discordgo
discordgo copied to clipboard
`UserUpdateStatus()`, unable to set idle.
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.
Same here
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.
same for me with:
_, err := discord.UserUpdateStatus(discordgo.StatusDoNotDisturb)
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"))
}
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),
})