mirror of
https://github.com/tucnak/telebot
synced 2024-11-03 09:40:18 +00:00
Fixes a nil pointer dereference by checking a nil value for the
OnAddedToGroup handler.
This commit is contained in:
parent
a3451788c3
commit
6adfa4be13
6
bot.go
6
bot.go
@ -190,9 +190,9 @@ func (b *Bot) incomingUpdate(upd *Update) {
|
||||
return
|
||||
}
|
||||
|
||||
// OnAddedToGrop
|
||||
wasAdded := m.UserJoined.ID == b.Me.ID ||
|
||||
m.UsersJoined != nil && isUserInList(b.Me, m.UsersJoined)
|
||||
// OnAddedToGroup
|
||||
wasAdded := (m.UserJoined != nil && m.UserJoined.ID == b.Me.ID) ||
|
||||
(m.UsersJoined != nil && isUserInList(b.Me, m.UsersJoined))
|
||||
if m.GroupCreated || m.SuperGroupCreated || wasAdded {
|
||||
b.handle(OnAddedToGroup, m)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user