Declare links_accounts and the account.link event, return the bot's deep link from LinkURL, and emit account.link when an allowed user sends /start with a code. Approval answers carry chat_id so the host can reply to an unlinked account.
15 lines
572 B
Go
15 lines
572 B
Go
// Command telegram is the Telegram connector: it delivers messages, with
|
|
// Approve and Deny buttons on an approval request, to the private chats of
|
|
// the users an operator allows, and listens for their taps. A tap becomes an
|
|
// approval.answer event, so an answer reaches Archie the way every event does.
|
|
// A /start code a user sends the bot becomes an account.link event.
|
|
package main
|
|
|
|
import "github.com/samcharles93/archipelago/sdk/connector"
|
|
|
|
func main() {
|
|
connector.Serve(func(cfg connector.Config) (connector.Connector, error) {
|
|
return newTelegram(cfg)
|
|
})
|
|
}
|