#Exclusive Server Emojis
1 messages · Page 1 of 1 (latest)
On every message, check if it contains an emoji. If it does, check if the user has the role, if not, delete the message.
you can use the on_message event and you will need the message content intent
.rtfm on_message
?tag intents
https://docs.pycord.dev/en/master/intents.html
https://discord.com/developers/docs/topics/gateway#gateway-intents
import discord
from discord.ext import commands
# Get specific intents for fine control
intents = discord.Intents()
intents.emojis = True
intents.guilds = True
intents.messages = True # Required for prefix commands!
...
# Get all non-priveliged intents; this excludes presences, members and message_content
intents = discord.Intents.default()
# Set priveliged intents: these must be enabled on dev portal
intents.members = True
intents.presences = True
intents.message_content = True # Required for prefix commands >= 2.0.0b5
# Get all intents; all intents must be enabled on dev portal.
intents = discord.Intents.all()
# Apply intents when creating your bot
bot = commands.bot(prefix="?", intents=intents)
In version 1.5 comes the introduction of Intents. This is a radical change in how bots are written. An intent basically allows a bot to subscribe to specific buckets of events. The events that corr...
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
It is possible
.rtfm create_custom_emoji
It accepts a roles parameter
No need to use on_message event
I'm not sure if that feature is intentional, or why only bots can do it, but it has been there for a long time
@sharp helm hey. Any idea about this?
it's intentional that only bots can do that
There's actually another thing (I did it last on discord.py) where the emoji isn't even visible to the roles that aren't allowed and are visible to roles that are allowed
Ahh ty!
Btw can I apply that to preexisting emojis?
not sure, try
not really. Although you create a copy of existing emoji and delete the old one
Ah alrighty, ty!
Done with your help thread?
Please close your own help thread by using </close:1009144375709814897> with @untold torrent.
This thread was archived by the user that opened it.
Edit: I found out the solution lol
I switched back to discord.py
And used the edit.emoji property
This thread was archived by the user that opened it.