1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-24 03:54:20 +00:00

More fixes? Or bugs?

This commit is contained in:
Steffo 2018-04-09 23:02:24 +02:00
parent da3063421f
commit 844b1dddfc

View file

@ -6,9 +6,11 @@ import errors
import stagismo import stagismo
from telegram import Bot, Update, InlineKeyboardMarkup, InlineKeyboardButton from telegram import Bot, Update, InlineKeyboardMarkup, InlineKeyboardButton
from telegram.ext import Updater, CommandHandler, CallbackQueryHandler from telegram.ext import Updater, CommandHandler, CallbackQueryHandler
import telegram.error
from discord import Status as DiscordStatus from discord import Status as DiscordStatus
import subprocess import subprocess
import os import os
import time
# Init the config reader # Init the config reader
import configparser import configparser
@ -371,8 +373,14 @@ def process(arg_discord_connection):
u.dispatcher.add_handler(CommandHandler("ban", cmd_ban)) u.dispatcher.add_handler(CommandHandler("ban", cmd_ban))
u.dispatcher.add_handler(CallbackQueryHandler(on_callback_query)) u.dispatcher.add_handler(CallbackQueryHandler(on_callback_query))
u.bot.send_message(config["Telegram"]["main_group"], f" Royal Bot {version} avviato e pronto a ricevere comandi!") u.bot.send_message(config["Telegram"]["main_group"], f" Royal Bot {version} avviato e pronto a ricevere comandi!")
while True:
try:
u.start_polling() u.start_polling()
u.idle() u.idle()
except telegram.error.TimedOut:
print("Telegrambot timed out.")
time.sleep(60)
print("Telegrambot restarting...")
if __name__ == "__main__": if __name__ == "__main__":
process(None) process(None)