Closed TG-BOTSNETWORK closed 5 months ago
here is the example to how to use this
package main
import (
"log"
"github.com/veerpratap6870/gotgbot"
"github.com/veerpratap6870/gotgbot/filters"
)
func main() {
bot, err := gotgbot.NewBot("BOT_TOKEN", &gotgbot.BotOpts{})
if err != nil {
log.Fatal(err)
}
// Example of MessageEntityPre filter
offset := 0
length := 10
language := "python"
filter := filters.MessageEntityPre(offset, length, language)
bot.Dispatcher.AddHandler(filter, func(ctx *gotgbot.CallbackContext) {
// You can access the message that matched the filter using ctx.EffectiveMessage
ctx.Reply("Message matches the criteria.")
})
err = bot.StartPolling()
if err != nil {
log.Fatal(err)
}
}
@TG-BOTSNETWORK While I appreciate the example, CI is still failing on this PR, which makes me doubt that any of it has been tested
Closing because filter is too niche to make sense in the library
which is used to filter preformatted code entities based on their programming language. The filter will return true if it finds a preformatted code entity with the specified language, otherwise false.