diff --git a/bunnybot.go b/bunnybot.go index 755c3f3..a8d9521 100644 --- a/bunnybot.go +++ b/bunnybot.go @@ -79,6 +79,8 @@ func message_create (s *discordgo.Session, m *discordgo.MessageCreate) { s.ChannelMessageSend(m.ChannelID, coinflip(m.Author.ID)) } else if message == "roll" { // roll a number s.ChannelMessageSend(m.ChannelID, roll(m.Author.ID)) + } else if message == "source" { // print source code + s.ChannelMessageSend(m.ChannelID, source()) } else if len(message) > 0 { // as long as there is a message, try to find a picture // get url url := <-get_image(message) diff --git a/commands.go b/commands.go index 7630de4..461b669 100644 --- a/commands.go +++ b/commands.go @@ -29,4 +29,9 @@ func roll(author string) string{ max := 100 num := rand.Intn(max - min) + min return "<@" + author + "> rolls a number between 1 and 100. They roll **" + strconv.Itoa(num) + "**." +} + +// source code +func source() string { + return "BunnyBot is a Discord bot written in Go. You can view the source code here: https://git.dtam.pw/daniel/GoBunnyBot" } \ No newline at end of file