mirror of
https://gitlab.durp.info/durfy/apps/durpot.git
synced 2026-05-10 01:01:31 -05:00
updates
This commit is contained in:
parent
b719dbd9fc
commit
618b4e290a
6 changed files with 127 additions and 156 deletions
30
handlers/messages.go
Normal file
30
handlers/messages.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package handlers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
"gitlab.com/DeveloperDurp/durpot/model"
|
||||
)
|
||||
|
||||
var (
|
||||
BotPrefix = model.BotPrefix
|
||||
)
|
||||
|
||||
func MessageHandler(s *discordgo.Session, m *discordgo.MessageCreate) {
|
||||
if m.Author.ID == s.State.User.ID {
|
||||
return
|
||||
}
|
||||
|
||||
switch m.Content {
|
||||
case BotPrefix + "ping":
|
||||
_, err := s.ChannelMessageSend(m.ChannelID, "pong")
|
||||
if err != nil {
|
||||
fmt.Println("Failed to send Message")
|
||||
}
|
||||
case BotPrefix + "unraid":
|
||||
GetUnraidUsage(s, m)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue