diff --git a/bot.py b/bot.py index 1e32fa5..179086b 100644 --- a/bot.py +++ b/bot.py @@ -2,19 +2,19 @@ import asyncio import datetime from telegram import Update from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes +import bot_syms as _botsyms import main as _brsim -TOKEN = "7670066927:AAG8jI5n9NcyxPksYky7LPYqA08BThs07c4" +async def loop_game(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: + chat_id = update.effective_chat.id + if 'arena' in context.application.bot_data: + pass + else: + print('Arena non trovata') + await update.message.reply_text('Che e\' successo? un Guarino ha rubato l\'arena, avvia una nuova partita con /start') async def bot_start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: - txt="""Benvenuto nel crudele mondo di Battle Royal Simulator, -La tua avventura e quella dei tuoi compagni inizia qui. -Questo Bot simula Hunger Games, -Tu e i tuoi compagni, sarete catapultati in questo mondo, -ma solo 1 di voi riuscira' a salvarsi. -Uccidi o sarai tu ad essere ucciso -""" - await update.message.reply_text(txt) + await update.message.reply_text(_botsyms.START_MSG) print('Sto costruendo il mondo di gioco...') Arena= _brsim.init_arena() @@ -40,21 +40,9 @@ async def echo(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: testo_ricevuto = update.message.text await update.message.reply_text(f'Ehi, mio padre mi sta ancora finendo di creare, abbi pazienza, che fretta hai di entrare in questo mondo per morire?') -async def send_message(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: - testo_ricevuto = update.message.text - await update.message.reply_text(f'Ehi, mio padre mi sta ancora finendo di creare, abbi pazienza, che fretta hai di entrare in questo mondo per morire?') - -async def loop_game(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: - chat_id = update.effective_chat.id - if 'arena' in context.application.bot_data: - pass - else: - print('Arena non trovata') - await update.message.reply_text('Che e\' successo? un Guarino ha rubato l\'arena, avvia una nuova partita con /start') - def main(): # Crea l'applicazione e passagli il token del tuo bot. - application = Application.builder().token(TOKEN).build() + application = Application.builder().token(_botsyms.TOKEN).build() # Gestisce il comando /start application.add_handler(CommandHandler('start', bot_start)) diff --git a/bot_syms.py b/bot_syms.py new file mode 100644 index 0000000..211c9fe --- /dev/null +++ b/bot_syms.py @@ -0,0 +1,9 @@ +TOKEN = "7670066927:AAG8jI5n9NcyxPksYky7LPYqA08BThs07c4" + +START_MSG= """Benvenuto nel crudele mondo di Battle Royal Simulator, +La tua avventura e quella dei tuoi compagni inizia qui. +Questo Bot simula Hunger Games, +Tu e i tuoi compagni, sarete catapultati in questo mondo, +ma solo 1 di voi riuscira' a salvarsi. +Uccidi o sarai tu ad essere ucciso +"""