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

44
bot/handlers/ext.go Normal file
View file

@ -0,0 +1,44 @@
package handlers
import (
extractors "govd/ext"
"strings"
"github.com/PaulSonOfLars/gotgbot/v2"
"github.com/PaulSonOfLars/gotgbot/v2/ext"
)
func ExtractorsHandler(bot *gotgbot.Bot, ctx *ext.Context) error {
ctx.CallbackQuery.Answer(bot, nil)
messageText := "available extractors:\n"
extractorNames := make([]string, 0, len(extractors.List))
for _, extractor := range extractors.List {
if extractor.IsRedirect {
continue
}
extractorNames = append(extractorNames, extractor.Name)
}
messageText += strings.Join(extractorNames, ", ")
ctx.EffectiveMessage.EditText(
bot,
messageText,
&gotgbot.EditMessageTextOpts{
LinkPreviewOptions: &gotgbot.LinkPreviewOptions{
IsDisabled: true,
},
ReplyMarkup: gotgbot.InlineKeyboardMarkup{
InlineKeyboard: [][]gotgbot.InlineKeyboardButton{
{
{
Text: "back",
CallbackData: "start",
},
},
},
},
},
)
return nil
}