Edit history

Earlier versions of Bots get 403 when creating a DM channel with POST /users/@me/channels, newest first.

Current version | Edited by Rex
Changes
DetailsBackend / APIRemoved: ### Pre-flight checksRemoved: Removed: - ☑ I searched for existing issues and didn't find a duplicate.Removed: - ☑ This is not a security vulnerability report (those go to https://fluxer.app/security).Removed: - ☑ I included enough information to reproduce the issue.Removed:
Show

Bots get 403 when creating a DM channel with POST /users/@me/channels

Observed behaviour

fails with a 403 Expected behaviour should return a dm channel

Reproduction steps

func (bot *client) startDM(user string) (*channel, error) {
	if dmChannel, ok := bot.dms.Get(user); ok {
		return dmChannel, nil
	}

	var dmChannel channel

	err := bot.do("POST", "/users/@me/channels", map[string]string{"recipient_id": user}, &dmChannel)
	if err != nil {
		return nil, err
	}

	bot.dms.Set(user, &dmChannel)
	bot.channels.Set(string(dmChannel.ID), &dmChannel)

	return &dmChannel, nil
}

Details

Summary

bots can't make DM channels seemingly

Area

Backend / API
Edited by Rex
Changes
Removed: POST /channels/@me/messages returns access denied for botsAdded: Bots get 403 when creating a DM channel with POST /users/@me/channels
Show

Bots get 403 when creating a DM channel with POST /users/@me/channels

Observed behaviour

fails with a 403 Expected behaviour should return a dm channel

Reproduction steps

func (bot *client) startDM(user string) (*channel, error) {
	if dmChannel, ok := bot.dms.Get(user); ok {
		return dmChannel, nil
	}

	var dmChannel channel

	err := bot.do("POST", "/users/@me/channels", map[string]string{"recipient_id": user}, &dmChannel)
	if err != nil {
		return nil, err
	}

	bot.dms.Set(user, &dmChannel)
	bot.channels.Set(string(dmChannel.ID), &dmChannel)

	return &dmChannel, nil
}

Details

Summary

bots can't make DM channels seemingly

Area

Backend / API

Pre-flight checks

  • ☑ I searched for existing issues and didn't find a duplicate.
  • ☑ This is not a security vulnerability report (those go to https://fluxer.app/security).
  • ☑ I included enough information to reproduce the issue.
Original by Rex
Show

POST /channels/@me/messages returns access denied for bots

Observed behaviour

fails with a 403 Expected behaviour should return a dm channel

Reproduction steps

func (bot *client) startDM(user string) (*channel, error) {
	if dmChannel, ok := bot.dms.Get(user); ok {
		return dmChannel, nil
	}

	var dmChannel channel

	err := bot.do("POST", "/users/@me/channels", map[string]string{"recipient_id": user}, &dmChannel)
	if err != nil {
		return nil, err
	}

	bot.dms.Set(user, &dmChannel)
	bot.channels.Set(string(dmChannel.ID), &dmChannel)

	return &dmChannel, nil
}

Details

Summary

bots can't make DM channels seemingly

Area

Backend / API

Pre-flight checks

  • ☑ I searched for existing issues and didn't find a duplicate.
  • ☑ This is not a security vulnerability report (those go to https://fluxer.app/security).
  • ☑ I included enough information to reproduce the issue.