mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 21:44:21 +00:00
More fixes? Or bugs?
This commit is contained in:
parent
da3063421f
commit
844b1dddfc
1 changed files with 10 additions and 2 deletions
|
@ -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!")
|
||||||
u.start_polling()
|
while True:
|
||||||
u.idle()
|
try:
|
||||||
|
u.start_polling()
|
||||||
|
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)
|
Loading…
Reference in a new issue