This commit is contained in:
stefanodvx 2025-04-14 13:05:43 +02:00
parent 264c97183e
commit 3faede7b1c
74 changed files with 6228 additions and 1 deletions

45
bot/handlers/help.go Normal file
View file

@ -0,0 +1,45 @@
package handlers
import (
"github.com/PaulSonOfLars/gotgbot/v2"
"github.com/PaulSonOfLars/gotgbot/v2/ext"
)
var helpMessage = "usage:\n" +
"- you can add the bot to a group " +
"to start catching sent links\n" +
"- you can send a link to the bot privately " +
"to download the media too\n\n" +
"group commands:\n" +
"- /settings = show current settings\n" +
"- /captions (true|false) = enable/disable descriptions\n" +
"- /nsfw (true|false) = enable/disable nsfw content\n" +
"- /limit (int) = set max items in media groups\n\n" +
"note: the bot is still in beta, " +
"so expect some bugs and missing features.\n"
var helpKeyboard = gotgbot.InlineKeyboardMarkup{
InlineKeyboard: [][]gotgbot.InlineKeyboardButton{
{
{
Text: "back",
CallbackData: "start",
},
},
},
}
func HelpHandler(bot *gotgbot.Bot, ctx *ext.Context) error {
ctx.CallbackQuery.Answer(bot, nil)
ctx.EffectiveMessage.EditText(
bot,
helpMessage,
&gotgbot.EditMessageTextOpts{
LinkPreviewOptions: &gotgbot.LinkPreviewOptions{
IsDisabled: true,
},
ReplyMarkup: helpKeyboard,
},
)
return nil
}