Created
June 25, 2021 19:05
-
-
Save abiriadev/2023d8ef96863328d597b79674cd3f13 to your computer and use it in GitHub Desktop.
discord.py reactions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord, asyncio, os | |
from discord.guild import Guild | |
from dotenv import load_dotenv | |
load_dotenv() | |
client = discord.Client( | |
intents=discord.Intents( | |
dm_reactions=True, | |
guild_reactions=True, | |
guilds=True, | |
members=True, | |
messages=True, | |
) | |
) | |
@client.event | |
async def on_ready(): | |
print("I'm Ready!") | |
print(client.intents) | |
print(f"intents.members: {client.intents.members}") | |
print(f"intents.reactions: {client.intents.reactions}") | |
print(f"intents.dm_reactions: {client.intents.dm_reactions}") | |
@client.event | |
async def on_message(msg): | |
args = msg.content.split(" ") | |
if args[0] == "echo": | |
await msg.channel.send(args[1]) | |
@client.event | |
async def on_reaction_add(reaction, user): | |
await reaction.message.channel.send( | |
f"hey {user}, thanks to reaction! {reaction.emoji}" | |
) | |
client.run(os.environ["TOKEN"]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment