Skip to content

Commit

Permalink
Fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeyUsersREC committed Feb 25, 2024
1 parent ae0f63d commit b65c80b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cogs/Actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ async def action_execute(self, ctx: commands.Context, action: str):
if '--verbose' in action:
action = action.replace(' --verbose', '')
verbose = True
ctx.verbose = verbose

actions = [i async for i in self.bot.actions.db.find({'Guild': ctx.guild.id})] or []
action_obj = None
for item in actions:
Expand Down Expand Up @@ -243,7 +245,7 @@ async def send_erlc_command(bot, guild_id: int, context, command: str):
command = ':' + command

command_response = await bot.prc_api.run_command(guild_id, command)
return 0 if command_response[0] == 200 else 1
return 0 if command_response[0] == 200 else (1 and (await context.send(command_response[1]) if context.verbose else 'A'))


@staticmethod
Expand All @@ -254,15 +256,15 @@ async def send_erlc_message(bot, guild_id: int, context, message: str):
message = message[2:]

command_response = await bot.prc_api.run_command(guild_id, f':m {message}')
return 0 if command_response[0] == 200 else 1
return 0 if command_response[0] == 200 else (1 and (await context.send(command_response[1]) if context.verbose else 'A'))

@staticmethod
async def send_erlc_hint(bot, guild_id: int, context, hint: str):
if hint[:3] == ':h ':
hint = hint[3:]

command_response = await bot.prc_api.run_command(guild_id, f':h {hint}')
return 0 if command_response[0] == 200 else 1
return 0 if command_response[0] == 200 else (1 and (await context.send(command_response[1]) if context.verbose else 'A'))

@staticmethod
async def delay(bot, guild_id, context, timer: int):
Expand Down

0 comments on commit b65c80b

Please sign in to comment.