Add status

Signed-off-by: Etzelia <etzelia@hotmail.com>
main latest
Etzelia 2021-07-12 16:56:12 -05:00
parent 9c65a4956e
commit 94d4c3ac72
No known key found for this signature in database
GPG Key ID: 708511AE7ABC5314
1 changed files with 8 additions and 0 deletions

View File

@ -19,6 +19,7 @@ func New(token, prefix string, db *database.Database) (*discordgo.Session, error
}
bot.Identify.Intents = discordgo.IntentsAllWithoutPrivileged
bot.AddHandler(Ready)
bot.AddHandler(CommandHandler(prefix, db))
bot.AddHandler(MessageHandler(prefix, db))
@ -86,3 +87,10 @@ func MessageHandler(prefix string, db *database.Database) func(session *discordg
}
}
}
func Ready(session *discordgo.Session, ready *discordgo.Ready) {
beaver.Infof("https://discord.com/api/oauth2/authorize?client_id=%s&permissions=0&redirect_uri=https://stone.land&scope=bot", ready.User.ID)
if err := session.UpdateGameStatus(0, "with ROCKS"); err != nil {
beaver.Errorf("could not update status: %v", err)
}
}