mirror of
https://github.com/idanoo/discord-keyword-bot
synced 2025-07-01 21:52:16 +00:00
Resolve int/str comps
This commit is contained in:
parent
a480c2c898
commit
fc99769a29
1 changed files with 4 additions and 3 deletions
7
bot.py
7
bot.py
|
@ -10,10 +10,11 @@ class MyClient(discord.Client):
|
||||||
print('Logged on as', self.user)
|
print('Logged on as', self.user)
|
||||||
|
|
||||||
async def on_message(self, message):
|
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):
|
if re.match(os.getenv("REGEX_MATCH"), message.content, re.IGNORECASE):
|
||||||
for channel_id in explode(os.getenv("DISCORD_CHANNELS")):
|
chan_list = [x.strip() for x in os.getenv("DISCORD_CHANNELS").split(',')]
|
||||||
channel = client.get_channel(channel_id)
|
for channel_id in chan_list:
|
||||||
|
channel = client.get_channel(int(channel_id))
|
||||||
await channel.send('*' + message.content + '*')
|
await channel.send('*' + message.content + '*')
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue