feat(commands|Network): add iplocalise command

This commit is contained in:
Romain J 2020-05-31 22:49:04 +02:00
commit 2e76379c87
9 changed files with 217 additions and 31 deletions
utils/functions

View file

@ -43,7 +43,8 @@ class ContextPlus(commands.Context):
ast.literal_eval(embed)
)
if self.command.deletable:
if (hasattr(self.command, 'deletable') and self.command.deletable) \
and kwargs.pop('deletable', True):
message = await super().send(content, *args, **kwargs)
await message.add_reaction('🗑')
@ -55,13 +56,14 @@ class ContextPlus(commands.Context):
try:
await self.bot.wait_for(
'reaction_add',
timeout=120.0,
timeout=60.0,
check=check
)
except asyncio.TimeoutError:
await message.remove_reaction('🗑', self.bot.user)
else:
await message.delete()
return message
else:
return await super().send(content, *args, **kwargs)