From: jweigele Date: Wed, 9 Sep 2020 01:53:19 +0000 (-0700) Subject: Accept guild ids from the horn object passed by rabbitmq. X-Git-Url: http://git.hexthepla.net/?a=commitdiff_plain;h=0b588a8a8941d6b0663c628cd377f7b57124e52a;p=grahbot Accept guild ids from the horn object passed by rabbitmq. --- diff --git a/grahbot.py b/grahbot.py index e02188c..340d1de 100755 --- a/grahbot.py +++ b/grahbot.py @@ -138,7 +138,7 @@ class GrahDiscordBot(discord.Client, HornClient): if 'output_type' in obj and obj['output_type'] == 'discord': print('Received a horn for us! {}'.format(msg.body)) - asyncio.ensure_future(self.horn(dict(sample_name=obj['sample_name']), properties=None)) + asyncio.ensure_future(self.horn(obj, properties=None)) else: print('Received a horn not for us: {}'.format(msg.body)) @@ -189,7 +189,7 @@ class GrahDiscordBot(discord.Client, HornClient): if obj['sample_name'] == 'random': sample_name = self.get_sample_name() elif obj['sample_name'] == 'terminate': - self.terminate_all() + self.terminate_all(guild=discord.utils.get(self.guilds, id=obj['guild'])) return None else: sample_name = '{}/{}'.format(self.config['airhorn_directory'], obj['sample_name']) @@ -197,7 +197,7 @@ class GrahDiscordBot(discord.Client, HornClient): traceback.print_exc() print('Error object was: {}'.format(obj)) else: - await self.msg_play_filename(sample_name, guild_id=336396117791211522, exclusive=exclusive) + await self.msg_play_filename(sample_name, guild_id=obj['guild'], exclusive=exclusive)