Compare commits

..

No commits in common. "master" and "v0.0.2" have entirely different histories.

3 changed files with 13 additions and 24 deletions

View File

@ -37,8 +37,10 @@ func init() {
return
}
messageContent[0] = messageContent[0][len(prefix):]
var response string
if fun, ok := dotCommandHandlers[messageContent[0]]; ok {
response := fun(messageContent[1:])
response = fun(messageContent[1:])
}
_, err := s.ChannelMessageSendComplex(m.ChannelID, &discordgo.MessageSend{
Content: response,
Reference: m.Reference(),
@ -49,7 +51,6 @@ func init() {
if err != nil {
log.Printf("Error sending message: %v", err)
}
}
})
}

View File

@ -74,10 +74,6 @@ func roll(opts optionMap) string {
return ret
}
var ret strings.Builder
_, err = fmt.Fprintf(&ret, "Dice expression: `%s`\n", exp)
if err != nil {
return fmt.Sprintf("Error rolling dice: %s", err)
}
_, err = fmt.Fprint(&ret, "Rolled dice: `")
if err != nil {
return fmt.Sprintf("Error rolling dice: %s", err)
@ -104,5 +100,5 @@ func roll(opts optionMap) string {
if ret.Len() < 2000 {
return ret.String()
}
return fmt.Sprintf("Too many dice to display. Omitting.\nExpression: %s\nTotal: %v", exp, total)
return fmt.Sprintf("Too many dice to display. Omitting.\nTotal: %v", total)
}

View File

@ -1,8 +0,0 @@
version: '3'
services:
treerazer:
image: git.malmal200.xyz/malmal200/treerazer:test
environment:
COMMAND_PREFIX: "treereazer-test."
DISCORD_TOKEN: ""