From fc99769a29940a60729ae4fbd46f50bb4a716b65 Mon Sep 17 00:00:00 2001 From: Daniel Mason Date: Sat, 21 Mar 2020 14:19:53 +1300 Subject: [PATCH] Resolve int/str comps --- bot.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 5629d5c..3d1d8f8 100644 --- a/bot.py +++ b/bot.py @@ -10,10 +10,11 @@ class MyClient(discord.Client): print('Logged on as', self.user) async def on_message(self, message): - if message.channel.id == os.getenv("SOURCE_CHANNEL"): + if message.channel.id == int(os.getenv("SOURCE_CHANNEL")): if re.match(os.getenv("REGEX_MATCH"), message.content, re.IGNORECASE): - for channel_id in explode(os.getenv("DISCORD_CHANNELS")): - channel = client.get_channel(channel_id) + chan_list = [x.strip() for x in os.getenv("DISCORD_CHANNELS").split(',')] + for channel_id in chan_list: + channel = client.get_channel(int(channel_id)) await channel.send('*' + message.content + '*') load_dotenv()