-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rand_games_code
104 lines (77 loc) · 2.53 KB
/
Rand_games_code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import os
import telebot
import time
from telebot import TeleBot
API_KEY = "1920327941:AAGmZfhVeZ5rgbE8OzsVljnr378fQUKO8FM"
bot = telebot.TeleBot(API_KEY)
@bot.message_handler(commands=['start']) #starting bot
def start_message(message):
bot.send_message(
message.chat.id,
"Welcome to Random Games Bot. Use /join to a random group")
@bot.message_handler(commands=['help']) #help to tell users about the bot
def help_message(message):
bot.reply_to(
message,
"You will be matched to other users with similar game interest. Feel free to use these chats to make friends and have fun!!"
)
@bot.message_handler(commands=['join']) # list of games the bot provides
def join_message(message):
bot.send_message(
message.chat.id,
"Please select your game:\n/Avalon\n/Chat_Against_Humanity\n/Dreamers\n/Hangman\n/Poker\n/Quizzarium\n/Uno\n/Werewolf"
)
# the following are the links to the group to host the game
@bot.message_handler(commands=['Werewolf'])
def werewolf_message(message):
bot.send_message(
message.chat.id,
"Please click the link to join: https://t.me/joinchat/s2sgkdBnNnw4ZDE9"
)
@bot.message_handler(commands=['Dreamers'])
def dreamers_message(message):
bot.send_message(
message.chat.id,
"Please click the link to join: https://t.me/joinchat/K-BhYcsodKAxNjQ1"
)
@bot.message_handler(commands=['Avalon'])
def avalon_message(message):
bot.send_message(
message.chat.id,
"Please click the link to join: https://t.me/joinchat/hxWjOu_JS6UwOTA1"
)
@bot.message_handler(commands=['Uno'])
def Uno_message(message):
bot.send_message(
message.chat.id,
"Please click the link to join: https://t.me/joinchat/SyAMSugM5x5kNmVl"
)
@bot.message_handler(commands=['Poker'])
def poker_message(message):
bot.send_message(
message.chat.id,
"Please click the link to join: https://t.me/joinchat/BzCidJG1xL0yMGU1"
)
@bot.message_handler(commands=['Chat_Against_Humanity'])
def CAH_message(message):
bot.send_message(
message.chat.id,
"Please click the link to join: https://t.me/joinchat/mv7qyFEncakxNmJl"
)
@bot.message_handler(commands=['Hangman'])
def Hangman_message(message):
bot.send_message(
message.chat.id,
"Please click the link to join: https://t.me/joinchat/xKFkdS21wZ9jYjFl"
)
@bot.message_handler(commands=['Quizzarium'])
def quizzarium_message(message):
bot.send_message(
message.chat.id,
"Please click the link to join: https://t.me/joinchat/Z2NeEMryZ6wxYzll"
)
while True:
try:
bot.polling()
except Exception:
time.sleep(15)