discordgo icon indicating copy to clipboard operation
discordgo copied to clipboard

`UserUpdateStatus()`, unable to set idle.

Open colecrouter opened this issue 3 years ago • 5 comments

When running

_, err = s.UserUpdateStatus("online")
log.Println(err)

I get:

HTTP 403 Forbidden, {"message": "Bots cannot use this endpoint", "code": 20001}

If I run

err = s.UpdateGameStatus(1, "status")
log.Println(err)

it sets "status" properly, but bot does not go idle. err is also nil this time.

EDIT: I'm running the latest release btw.

colecrouter avatar Apr 27 '21 21:04 colecrouter

Same here

ErrorNoInternet avatar Jul 29 '21 06:07 ErrorNoInternet

On the latest update 0.23, still seems to happen with the new system:

var act []*discordgo.Activity
act = append(act, &discordgo.Activity{Name: "game", Type: discordgo.ActivityTypeGame})
idle := 10
s.UpdateStatusComplex(discordgo.UpdateStatusData{IdleSince: &idle, Activities: act, AFK: true})

doesn't seem to work. Also, the program seems to crash(?) if I remove act from the function call.

colecrouter avatar Jul 30 '21 02:07 colecrouter

same for me with:

_, err := discord.UserUpdateStatus(discordgo.StatusDoNotDisturb)

zeroidentidad avatar Aug 24 '21 19:08 zeroidentidad

If you want to set bot's status, I found this way:

	discordClient.Identify.Presence.Status = string(discordgo.StatusOnline)
	if err = discordClient.Open(); err != nil {
		log.Fatal(errors.Annotate(err, "opening websocket connection failed"))
	}

lbyte00 avatar Sep 04 '21 18:09 lbyte00

UpdateStatusComplex seems to work for me, but I am ahead of the v0.23.2 tag (I'm on 0fad116). I also have not tried to set activities, so ymmv there.

session, _  := discordgo.New(...)
err = session.UpdateStatusComplex(discordgo.UpdateStatusData{
    AFK:    false,
    Status: string(discordgo.StatusOnline),
})

Kardbord avatar Oct 14 '21 06:10 Kardbord