forked from Southclaws/cj
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot_cmd_verify.go
32 lines (27 loc) · 897 Bytes
/
bot_cmd_verify.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"github.com/bwmarrin/discordgo"
)
func commandVerify(cm CommandManager, args string, message discordgo.Message, contextual bool) (bool, bool, error) {
verified, err := cm.App.IsUserVerified(message.Author.ID)
if err != nil {
return false, false, err
}
if verified {
_, err = cm.App.discordClient.ChannelMessageSend(message.ChannelID, "You are already verified! If you are experiencing problems with the bot or verification, please contact an admin.")
return true, false, err
}
switch message.Content {
case "verify":
err = cm.App.UserStartsVerification(message)
case "done":
err = cm.App.UserConfirmsProfile(message)
return true, false, err
case "cancel":
err = cm.App.UserCancelsVerification(message)
return true, false, err
default:
err = cm.App.UserProvidesProfileURL(message)
}
return true, true, err
}