add help command

This commit is contained in:
Watn3y 2023-03-19 23:02:35 +01:00
parent 6817ed5a9e
commit bde1d93369

View file

@ -29,6 +29,8 @@ func Commands(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
gaypoints.SetGP(update, bot)
case "remindme":
notify.Reminder(update, bot)
case "help":
help(update, bot)
}
}
@ -41,3 +43,22 @@ func shutup(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
botIO.SendMessage(msg, bot)
}
func help(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
const textHelp string = "<b>User commands:</b>" + "\n\n" +
"<code>/help </code><i>Sends this help message</i>" + "\n" +
"<code>/gp </code><i>List Gaypoints for user or group</i>" + "\n" +
"<code>/remindme 2m,5h,7d &lt;message&gt; </code> <i>Send a reminder message in 2 minutes, 5 hours, 7 days</i>" + "\n\n" +
"<b>Admin Commands:</b>" + "\n\n" +
"<code>/addgp &lt;amount&gt; </code> <i>Add Gaypoints to User</i>" + "\n" +
"<code>/subtractgp &lt;amount&gt; </code> <i>Add Gaypoints to User</i>" + "\n"
message := tgbotapi.MessageConfig{
BaseChat: tgbotapi.BaseChat{ChatID: update.Message.Chat.ID, ReplyToMessageID: update.Message.MessageID},
ParseMode: "html",
DisableWebPagePreview: false,
Text: textHelp,
}
botIO.SendMessage(message, bot)
}