add /start and /ping commands
This commit is contained in:
		
							parent
							
								
									76ef16445b
								
							
						
					
					
						commit
						a43b031016
					
				| @ -4,5 +4,6 @@ type Command string | |||||||
| 
 | 
 | ||||||
| const ( | const ( | ||||||
| 	Start = Command("/start") | 	Start = Command("/start") | ||||||
|  | 	Help  = Command("/help") | ||||||
| 	Ping  = Command("/ping") | 	Ping  = Command("/ping") | ||||||
| ) | ) | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								main.go
									
									
									
									
									
								
							| @ -66,6 +66,8 @@ func run() { | |||||||
| 		switch command { | 		switch command { | ||||||
| 		case commands.Start: | 		case commands.Start: | ||||||
| 			_, _ = bot.Send(tgbot.NewMessage(chatID, "Здравствуйте, я ваш дворецкий.")) | 			_, _ = bot.Send(tgbot.NewMessage(chatID, "Здравствуйте, я ваш дворецкий.")) | ||||||
|  | 		case commands.Help: | ||||||
|  | 			_, _ = bot.Send(tgbot.NewMessage(chatID, "Вот что я умею:\n\n1) Позвать всех")) | ||||||
| 		case commands.Ping: | 		case commands.Ping: | ||||||
| 			_, _ = bot.Send(tgbot.NewMessage(chatID, "pong")) | 			_, _ = bot.Send(tgbot.NewMessage(chatID, "pong")) | ||||||
| 		} | 		} | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user