#Exclusive Server Emojis

1 messages · Page 1 of 1 (latest)

cinder meadow
#

Heyo, I was wondering is there was any way to approach about making server emojis exclusive to people with a particular role? I've seen it done before and I have too (Mind you a loooong time ago)... I was wondering how I should approach that? Tysm for the help in advance!

mystic flame
#

On every message, check if it contains an emoji. If it does, check if the user has the role, if not, delete the message.

fluid dome
#

you can use the on_message event and you will need the message content intent

#

.rtfm on_message

fluid dome
#

?tag intents

sonic forgeBOT
#

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)
Discord Developer Portal

Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.

opaque valley
#

.rtfm create_custom_emoji

mental dawnBOT
opaque valley
#

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

opaque valley
sharp helm
#

it's intentional that only bots can do that

cinder meadow
cinder meadow
#

Btw can I apply that to preexisting emojis?

sharp helm
#

not sure, try

opaque valley
cinder meadow
#

Ah alrighty, ty!

opaque valley
#

👍

#

.close

mental dawnBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @untold torrent.

untold torrentBOT
#

This thread was archived by the user that opened it.

cinder meadow
#

Edit: I found out the solution lol

#

And used the edit.emoji property

untold torrentBOT
#

This thread was archived by the user that opened it.