mirror of
https://github.com/RYGhub/royal-mifia.git
synced 2024-11-22 13:54:19 +00:00
Un if __debug__ in più fa sempre bene
This commit is contained in:
parent
b7fa715852
commit
fbb74a4acb
1 changed files with 14 additions and 13 deletions
27
main.py
27
main.py
|
@ -660,21 +660,22 @@ def role(bot, update):
|
||||||
|
|
||||||
def kill(bot, update):
|
def kill(bot, update):
|
||||||
"""Uccidi un giocatore in partita."""
|
"""Uccidi un giocatore in partita."""
|
||||||
game = findgamebyid(update.message.chat['id'])
|
if __debug__:
|
||||||
if game is not None and game.phase is 'Voting':
|
game = findgamebyid(update.message.chat['id'])
|
||||||
if update.message.from_user['id'] == game.adminid:
|
if game is not None and game.phase is 'Voting':
|
||||||
target = game.findplayerbyusername(update.message.text.split(' ')[1])
|
if update.message.from_user['id'] == game.adminid:
|
||||||
if target is not None:
|
target = game.findplayerbyusername(update.message.text.split(' ')[1])
|
||||||
target.kill()
|
if target is not None:
|
||||||
game.message(bot, s.admin_killed.format(name=target.tusername,
|
target.kill()
|
||||||
icon=target.role.icon,
|
game.message(bot, s.admin_killed.format(name=target.tusername,
|
||||||
role=target.role.name))
|
icon=target.role.icon,
|
||||||
|
role=target.role.name))
|
||||||
|
else:
|
||||||
|
game.message(bot, s.error_username)
|
||||||
else:
|
else:
|
||||||
game.message(bot, s.error_username)
|
game.message(bot, s.error_not_admin)
|
||||||
else:
|
else:
|
||||||
game.message(bot, s.error_not_admin)
|
bot.sendMessage(update.message.chat['id'], s.error_no_games_found, parse_mode=ParseMode.MARKDOWN)
|
||||||
else:
|
|
||||||
bot.sendMessage(update.message.chat['id'], s.error_no_games_found, parse_mode=ParseMode.MARKDOWN)
|
|
||||||
|
|
||||||
|
|
||||||
def delete(bot, update):
|
def delete(bot, update):
|
||||||
|
|
Loading…
Reference in a new issue