Adjust some calls for bot accounts

This commit is contained in:
Tulir Asokan
2023-02-27 01:12:06 +02:00
parent ce4d05bb11
commit 71d1689776
3 changed files with 24 additions and 12 deletions

View File

@@ -79,7 +79,12 @@ func (thread *Thread) Join(user *User) {
return
}
user.log.Debugfln("Joining thread %s@%s", thread.ID, thread.ParentID)
err := user.Session.ThreadJoinWithLocation(thread.ID, discordgo.ThreadJoinLocationContextMenu)
var err error
if user.Session.IsUser {
err = user.Session.ThreadJoinWithLocation(thread.ID, discordgo.ThreadJoinLocationContextMenu)
} else {
err = user.Session.ThreadJoin(thread.ID)
}
if err != nil {
user.log.Errorfln("Error joining thread %s@%s: %v", thread.ID, thread.ParentID, err)
} else {