Fix bug in broadcast
This commit is contained in:
parent
bbf454aabc
commit
3b77ba41bb
@ -601,6 +601,7 @@ class Rcon(commands.Cog):
|
|||||||
# noinspection PyShadowingNames
|
# noinspection PyShadowingNames
|
||||||
|
|
||||||
futures = []
|
futures = []
|
||||||
|
error = False
|
||||||
if server_name == 'all':
|
if server_name == 'all':
|
||||||
message = ''.join(i for i in f'{ctx.author.display_name}: {message}' if ord(i) < 128)
|
message = ''.join(i for i in f'{ctx.author.display_name}: {message}' if ord(i) < 128)
|
||||||
msg = await ctx.send(f'Broadcasting "{message}" to all servers.')
|
msg = await ctx.send(f'Broadcasting "{message}" to all servers.')
|
||||||
@ -618,8 +619,10 @@ class Rcon(commands.Cog):
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
await ctx.send('That server is not configured in this guild.')
|
await ctx.send('That server is not configured in this guild.')
|
||||||
self.bot.loop.create_task(asyncio.gather(*futures))
|
error = True
|
||||||
await ctx.message.add_reaction('✅')
|
if not error:
|
||||||
|
await asyncio.gather(*futures, loop=self.bot.loop)
|
||||||
|
await ctx.message.add_reaction('✅')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
await ctx.send('You must include a message with this command.')
|
await ctx.send('You must include a message with this command.')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user