Feature: Post Startup Message
Closed this issue · 0 comments
We currently determine Tony's operational status by observing if the bot user appears online upon startup. However, enhancing user feedback would be beneficial by implementing a feature where Tony announces its startup within a designated Discord channel. This can be accomplished by integrating a message posting function within the func(s *discordgo.Session, event *discordgo.Ready)
event handler, ideally situated in the main.go
file. Below is a proposed syntax for initiating this feature:
func main() {
db := database.NewDatabase("tony.db")
// Instantiate a new bot
bot, err := framework.NewBot(token, serverId, db)
if err != nil {
log.Fatalf("Error while creating bot: %s", err)
return
}
bot.OnStartup(startupCb)
}
func startupCb(s *discordgo.Session, event *discordgo.Ready) {
// Implementation details here
}
For improved flexibility and to adhere to best practices, the channel in which Tony posts the startup message should be configurable via an environment variable named DISCORD_STARTUP_CHANNEL
, with the default channel being tony-dev
.
Furthermore, enhancing this startup message to include the bot's current version and a changelog for that version would greatly benefit our users by keeping them informed about new features and fixes.