forked from Cryz/battle_royale_sim
bot syms
This commit is contained in:
32
bot.py
32
bot.py
@@ -2,19 +2,19 @@ import asyncio
|
|||||||
import datetime
|
import datetime
|
||||||
from telegram import Update
|
from telegram import Update
|
||||||
from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes
|
from telegram.ext import Application, CommandHandler, MessageHandler, filters, ContextTypes
|
||||||
|
import bot_syms as _botsyms
|
||||||
import main as _brsim
|
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:
|
async def bot_start(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
||||||
txt="""Benvenuto nel crudele mondo di Battle Royal Simulator,
|
await update.message.reply_text(_botsyms.START_MSG)
|
||||||
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)
|
|
||||||
|
|
||||||
print('Sto costruendo il mondo di gioco...')
|
print('Sto costruendo il mondo di gioco...')
|
||||||
Arena= _brsim.init_arena()
|
Arena= _brsim.init_arena()
|
||||||
@@ -40,21 +40,9 @@ async def echo(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
|
|||||||
testo_ricevuto = update.message.text
|
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?')
|
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():
|
def main():
|
||||||
# Crea l'applicazione e passagli il token del tuo bot.
|
# 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
|
# Gestisce il comando /start
|
||||||
application.add_handler(CommandHandler('start', bot_start))
|
application.add_handler(CommandHandler('start', bot_start))
|
||||||
|
|||||||
9
bot_syms.py
Normal file
9
bot_syms.py
Normal file
@@ -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
|
||||||
|
"""
|
||||||
Reference in New Issue
Block a user