forked from Cryz/battle_royale_sim
show map with players on telegram bot
This commit is contained in:
@@ -61,6 +61,12 @@ async def cmd_get_ranking_players(context, update, chat_id):
|
||||
async def cmd_simulate_day(context, update, chat_id):
|
||||
return await _bot_simulation.simulate_day(context, chat_id)
|
||||
|
||||
async def cmd_show_game_map(context, update, chat_id):
|
||||
Arena= context.application.bot_data['arena']
|
||||
Gamemap= Arena.get_map()
|
||||
rendered_map= Gamemap.get_renderized_map()
|
||||
return await update.message.reply_text(rendered_map)
|
||||
|
||||
async def cmd_simulate_day_cron(context, update, chat_id):
|
||||
context.application.bot_data['ask_seconds'] = 1
|
||||
if 'ask_name' in context.application.bot_data:
|
||||
|
||||
@@ -5,7 +5,8 @@ from bot_libs import syms as _bot_syms
|
||||
async def add_player(update, context, chat_id, name):
|
||||
_log.log_info(f'add_player: {chat_id} - {name}')
|
||||
Arena= context.application.bot_data['arena']
|
||||
if len(Arena.get_players()) >= 70: return # prevent message too long error
|
||||
#if len(Arena.get_players()) >= 70: return # prevent message too long error
|
||||
if len(Arena.get_players()) >= 20: return # maybe this should depend on the map dimension
|
||||
Arena.add_player(name)
|
||||
|
||||
async def add_random_players(update, context, chat_id, colors_names= False):
|
||||
|
||||
Reference in New Issue
Block a user