44 lines
894 B
Go
44 lines
894 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"common"
|
|
|
|
"github.com/go-telegram/bot"
|
|
"github.com/go-telegram/bot/models"
|
|
)
|
|
|
|
type InlineVoice struct {}
|
|
|
|
func (I *InlineVoice) Init() error {
|
|
fmt.Println("InlineVoice initialized.")
|
|
return nil
|
|
}
|
|
|
|
func (c *InlineVoice) TextHandler(opts *common.SubHandlerOpts) error {
|
|
return fmt.Errorf("no Setup")
|
|
}
|
|
|
|
func (c *InlineVoice) InlineCommandKeyword() string {
|
|
return "v"
|
|
}
|
|
|
|
func (c *InlineVoice) InlineHandler(opts *common.SubHandlerOpts) error {
|
|
opts.Thebot.AnswerInlineQuery(opts.Context, &bot.AnswerInlineQueryParams{
|
|
InlineQueryID: opts.Update.InlineQuery.ID,
|
|
Results: []models.InlineQueryResult{&models.InlineQueryResultArticle{
|
|
ID: "test",
|
|
Title: "success?",
|
|
Description: "running in plugin",
|
|
InputMessageContent: &models.InputTextMessageContent{
|
|
MessageText: "dwadsw",
|
|
},
|
|
}},
|
|
})
|
|
|
|
return nil
|
|
}
|
|
|
|
var Module InlineVoice
|