diff options
author | vin <git@vineetk.net> | 2024-01-14 23:16:41 -0500 |
---|---|---|
committer | vin <git@vineetk.net> | 2024-01-14 23:16:41 -0500 |
commit | a14104e3db81f5ef26a602487123279d33a0346e (patch) | |
tree | 7016f8a2298cd7d1ce2e5d46707e3c7f32d2d761 /main.py |
read messages from specified channels and print them
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +import os, discord + +intents = discord.Intents.default() +intents.message_content = True + +token = os.getenv("DISCORD_TOKEN") +client = discord.Client(intents=intents) + +channelids = [1196201613132574733] + +@client.event +async def on_ready(): + print(f"Logged in as {client.user}") + +@client.event +async def on_message(message): + if message.channel.id in channelids: + print(f"<{message.author.global_name}> {message.content}") + +client.run(token) |