diff --git a/.env.example b/.env.example index 8571e7b..0a5155d 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,4 @@ DISCORD_TOKEN="" -DISCORD_CHANNELS="id1,id2,id3" +DISCORD_CHANNEL="" SOURCE_CHANNEL="" REGEX_MATCH="^.*(K41|COVID).*$" -PING_ROLE="" diff --git a/README.md b/README.md index 0b92d07..47cbe8c 100644 --- a/README.md +++ b/README.md @@ -17,8 +17,7 @@ copy .env.example to .env and setup your user Token in .env .env file layout DISCORD_TOKEN="token_from_web" - DISCORD_CHANNELS="channel_1_id,channel_2_id" + DISCORD_CHANNELS="channel_1_id" SOURCE_CHANNEL="channel_id_to_listen_to" REGEX_MATCH="^.*(REGEX|TO|USE|TO|MATCH).*$" - PING_ROLE="id_of_role" diff --git a/bot.py b/bot.py index 19abd80..2f23067 100644 --- a/bot.py +++ b/bot.py @@ -12,13 +12,8 @@ class MyClient(discord.Client): async def on_message(self, message): if message.channel.id == int(os.getenv("SOURCE_CHANNEL")): if re.match(os.getenv("REGEX_MATCH"), message.content, re.IGNORECASE): - 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)) - ping_string = '' - if os.getenv("PING_ROLE") != '': - ping_string = '<@&' + os.getenv("PING_ROLE") + '>: ' - await channel.send(ping_string + message.content) + channel = client.get_channel(int(os.getenv("DISCORD_CHANNEL")) + await channel.send(message.content) load_dotenv() client = MyClient()