telebot: add missed events

pull/447/head
Demian 3 years ago
parent 1b1c30eeb2
commit cb12b170d3

@ -349,6 +349,21 @@ func (b *Bot) ProcessUpdate(upd Update) {
return
}
if m.GroupCreated {
b.handle(OnGroupCreated, c)
return
}
if m.SuperGroupCreated {
b.handle(OnSuperGroupCreated, c)
return
}
if m.ChannelCreated {
b.handle(OnChannelCreated, c)
return
}
if m.MigrateTo != 0 {
m.MigrateFrom = m.Chat.ID
b.handle(OnMigration, c)
@ -507,6 +522,8 @@ func (b *Bot) handleMedia(c Context) bool {
b.handle(OnLocation, c)
case m.Venue != nil:
b.handle(OnVenue, c)
case m.Game != nil:
b.handle(OnGame, c)
case m.Dice != nil:
b.handle(OnDice, c)
default:

@ -117,6 +117,9 @@ type Message struct {
// For a poll, information the native poll.
Poll *Poll `json:"poll"`
// For a game, information about it.
Game *Game `json:"game"`
// For a dice, information about it.
Dice *Dice `json:"dice"`
@ -216,9 +219,6 @@ type Message struct {
// The domain name of the website on which the user has logged in.
ConnectedWebsite string `json:"connected_website,omitempty"`
// Inline keyboard attached to the message.
ReplyMarkup InlineKeyboardMarkup `json:"reply_markup"`
// For a service message, a voice chat started in the chat.
VoiceChatStarted *VoiceChatStarted `json:"voice_chat_started,omitempty"`
@ -237,6 +237,9 @@ type Message struct {
// For a service message, represents about a change in auto-delete timer settings.
AutoDeleteTimer *AutoDeleteTimer `json:"message_auto_delete_timer_changed,omitempty"`
// Inline keyboard attached to the message.
ReplyMarkup InlineKeyboardMarkup `json:"reply_markup"`
}
// MessageEntity object represents "special" parts of text messages,

@ -63,6 +63,7 @@ const (
OnDice = "\adice"
OnInvoice = "\ainvoice"
OnPayment = "\apayment"
OnGame = "\agame"
OnPoll = "\apoll"
OnPollAnswer = "\apoll_answer"
@ -73,12 +74,15 @@ const (
// Will fire when bot is added to a group.
OnAddedToGroup = "\aadded_to_group"
// Group events:
// Service events:
OnUserJoined = "\auser_joined"
OnUserLeft = "\auser_left"
OnNewGroupTitle = "\anew_chat_title"
OnNewGroupPhoto = "\anew_chat_photo"
OnGroupPhotoDeleted = "\achat_photo_deleted"
OnGroupCreated = "\agroup_created"
OnSuperGroupCreated = "\asupergroup_created"
OnChannelCreated = "\achannel_created"
// Migration happens when group switches to
// a supergroup. You might want to update

Loading…
Cancel
Save