Added help for commands
This commit is contained in:
@ -13,6 +13,7 @@ import (
|
|||||||
func setupCommands() {
|
func setupCommands() {
|
||||||
reboot := Command{
|
reboot := Command{
|
||||||
Name: "Reboot",
|
Name: "Reboot",
|
||||||
|
Help: "Reboot me, requires token from logs.",
|
||||||
Keywords: []string{"reboot", "re", "restart"},
|
Keywords: []string{"reboot", "re", "restart"},
|
||||||
Exec: Reboot,
|
Exec: Reboot,
|
||||||
}
|
}
|
||||||
@ -20,6 +21,7 @@ func setupCommands() {
|
|||||||
|
|
||||||
bumpset := Command{
|
bumpset := Command{
|
||||||
Name: "BumpSet",
|
Name: "BumpSet",
|
||||||
|
Help: "Set the bump timer (requires time in minutes until next bump).",
|
||||||
Keywords: []string{"bs", "bumpset", "bumps"},
|
Keywords: []string{"bs", "bumpset", "bumps"},
|
||||||
Exec: BumpSet,
|
Exec: BumpSet,
|
||||||
}
|
}
|
||||||
@ -27,6 +29,7 @@ func setupCommands() {
|
|||||||
|
|
||||||
retrieveVerification := Command{
|
retrieveVerification := Command{
|
||||||
Name: "Retrieve Verification",
|
Name: "Retrieve Verification",
|
||||||
|
Help: "Retrieve verification either by discord ID or by nickname",
|
||||||
Keywords: []string{"veri", "verification", "retrieve"},
|
Keywords: []string{"veri", "verification", "retrieve"},
|
||||||
Exec: RetrieveVerification,
|
Exec: RetrieveVerification,
|
||||||
}
|
}
|
||||||
@ -90,6 +93,7 @@ func RetrieveVerification(b BotCommand) bool {
|
|||||||
user, err := s.GuildMember(config.GuildID, discordId)
|
user, err := s.GuildMember(config.GuildID, discordId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.LogErrorType(err)
|
log.LogErrorType(err)
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
matches, err := filepath.Glob(fmt.Sprintf("./verifications/*%+v*", discordId))
|
matches, err := filepath.Glob(fmt.Sprintf("./verifications/*%+v*", discordId))
|
||||||
@ -128,6 +132,7 @@ func Snap(b BotCommand) bool {
|
|||||||
func Status(b BotCommand) bool {
|
func Status(b BotCommand) bool {
|
||||||
defer log.PanicSafe()
|
defer log.PanicSafe()
|
||||||
status := fmt.Sprintf("Uptime: %+v\n", time.Since(startupTime))
|
status := fmt.Sprintf("Uptime: %+v\n", time.Since(startupTime))
|
||||||
|
status += fmt.Sprintf("Last active time: %+v\n", time.Since(lastActiveTime))
|
||||||
status += fmt.Sprintf("Last bump: %+v\n", time.Since(config.BumpTime))
|
status += fmt.Sprintf("Last bump: %+v\n", time.Since(config.BumpTime))
|
||||||
status += fmt.Sprintf("Last bumper: <@%+v>\n", userFromID(config.LastBumper).Username)
|
status += fmt.Sprintf("Last bumper: <@%+v>\n", userFromID(config.LastBumper).Username)
|
||||||
status += fmt.Sprintf("Bump needed: %+v\n", bump)
|
status += fmt.Sprintf("Bump needed: %+v\n", bump)
|
||||||
@ -158,6 +163,8 @@ func Status(b BotCommand) bool {
|
|||||||
status += fmt.Sprintf("%+v for another %+v\n", probationUser.Username, time.Until(join.Add(2*time.Hour)))
|
status += fmt.Sprintf("%+v for another %+v\n", probationUser.Username, time.Until(join.Add(2*time.Hour)))
|
||||||
}
|
}
|
||||||
status += "```"
|
status += "```"
|
||||||
|
}else {
|
||||||
|
status += "There are no users on probation."
|
||||||
}
|
}
|
||||||
b.Session.ChannelMessageSend(config.AdminChannel, status)
|
b.Session.ChannelMessageSend(config.AdminChannel, status)
|
||||||
statistics := "```"
|
statistics := "```"
|
||||||
|
|||||||
@ -82,7 +82,7 @@ func bumpTimer(s *discordgo.Session) {
|
|||||||
bump = false
|
bump = false
|
||||||
config.BumpTime = time.Now()
|
config.BumpTime = time.Now()
|
||||||
time.Sleep(2 * time.Hour)
|
time.Sleep(2 * time.Hour)
|
||||||
if time.Since(lastActiveTime) < (5*time.Minute) && lastActiveChan != config.AdminChannel {
|
if time.Since(lastActiveTime) < (5*time.Minute) {
|
||||||
s.ChannelMessageSend(lastActiveChan, "!d bump is ready, please use it. (say \"!d bump\" without the quotes)")
|
s.ChannelMessageSend(lastActiveChan, "!d bump is ready, please use it. (say \"!d bump\" without the quotes)")
|
||||||
}
|
}
|
||||||
s.ChannelMessageSend(config.AdminChannel, "!d bump is ready.")
|
s.ChannelMessageSend(config.AdminChannel, "!d bump is ready.")
|
||||||
|
|||||||
Reference in New Issue
Block a user