-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.py
More file actions
29 lines (21 loc) · 792 Bytes
/
bot.py
File metadata and controls
29 lines (21 loc) · 792 Bytes
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
import logging
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from handler import handle_bet, start
# 启用日志
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger(__name__)
def main():
# 用您的 token 替换
TOKEN = '7749410324:AAGYPwzvt2oPzTei3Ero_68jQb9NWZqk5eI'
updater = Updater(TOKEN, use_context=True)
dp = updater.dispatcher
# 处理 /start 命令
dp.add_handler(CommandHandler("start", start))
# 处理下注消息
dp.add_handler(MessageHandler(Filters.text & ~Filters.command, handle_bet))
# 启动 Bot
updater.start_polling()
updater.idle()
if __name__ == '__main__':
main()