File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,21 @@ func (b *Bot) ProcessUpdate(upd Update) {
349349			return 
350350		}
351351
352+ 		if  m .GroupCreated  {
353+ 			b .handle (OnGroupCreated , c )
354+ 			return 
355+ 		}
356+ 
357+ 		if  m .SuperGroupCreated  {
358+ 			b .handle (OnSuperGroupCreated , c )
359+ 			return 
360+ 		}
361+ 
362+ 		if  m .ChannelCreated  {
363+ 			b .handle (OnChannelCreated , c )
364+ 			return 
365+ 		}
366+ 
352367		if  m .MigrateTo  !=  0  {
353368			m .MigrateFrom  =  m .Chat .ID 
354369			b .handle (OnMigration , c )
@@ -507,6 +522,8 @@ func (b *Bot) handleMedia(c Context) bool {
507522		b .handle (OnLocation , c )
508523	case  m .Venue  !=  nil :
509524		b .handle (OnVenue , c )
525+ 	case  m .Game  !=  nil :
526+ 		b .handle (OnGame , c )
510527	case  m .Dice  !=  nil :
511528		b .handle (OnDice , c )
512529	default :
Original file line number Diff line number Diff line change @@ -117,6 +117,9 @@ type Message struct {
117117	// For a poll, information the native poll. 
118118	Poll  * Poll  `json:"poll"` 
119119
120+ 	// For a game, information about it. 
121+ 	Game  * Game  `json:"game"` 
122+ 
120123	// For a dice, information about it. 
121124	Dice  * Dice  `json:"dice"` 
122125
@@ -216,9 +219,6 @@ type Message struct {
216219	// The domain name of the website on which the user has logged in. 
217220	ConnectedWebsite  string  `json:"connected_website,omitempty"` 
218221
219- 	// Inline keyboard attached to the message. 
220- 	ReplyMarkup  InlineKeyboardMarkup  `json:"reply_markup"` 
221- 
222222	// For a service message, a voice chat started in the chat. 
223223	VoiceChatStarted  * VoiceChatStarted  `json:"voice_chat_started,omitempty"` 
224224
@@ -237,6 +237,9 @@ type Message struct {
237237
238238	// For a service message, represents about a change in auto-delete timer settings. 
239239	AutoDeleteTimer  * AutoDeleteTimer  `json:"message_auto_delete_timer_changed,omitempty"` 
240+ 
241+ 	// Inline keyboard attached to the message. 
242+ 	ReplyMarkup  InlineKeyboardMarkup  `json:"reply_markup"` 
240243}
241244
242245// MessageEntity object represents "special" parts of text messages, 
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ const (
6363	OnDice        =  "\a dice" 
6464	OnInvoice     =  "\a invoice" 
6565	OnPayment     =  "\a payment" 
66+ 	OnGame        =  "\a game" 
6667	OnPoll        =  "\a poll" 
6768	OnPollAnswer  =  "\a poll_answer" 
6869
@@ -73,12 +74,15 @@ const (
7374	// Will fire when bot is added to a group. 
7475	OnAddedToGroup  =  "\a added_to_group" 
7576
76- 	// Group  events: 
77+ 	// Service  events: 
7778	OnUserJoined         =  "\a user_joined" 
7879	OnUserLeft           =  "\a user_left" 
7980	OnNewGroupTitle      =  "\a new_chat_title" 
8081	OnNewGroupPhoto      =  "\a new_chat_photo" 
8182	OnGroupPhotoDeleted  =  "\a chat_photo_deleted" 
83+ 	OnGroupCreated       =  "\a group_created" 
84+ 	OnSuperGroupCreated  =  "\a supergroup_created" 
85+ 	OnChannelCreated     =  "\a channel_created" 
8286
8387	// Migration happens when group switches to 
8488	// a supergroup. You might want to update 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments