property roles```
A [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.11)") of [`Role`](https://docs.disnake.dev/page/api.html#disnake.Role "disnake.Role") that the member belongs to. Note that the first element of this list is always the default [‘@everyone](mailto:'%40everyone)’ role.
These roles are sorted by their position in the role hierarchy.
#Making Variables Types Dependent On Roles
1 messages · Page 1 of 1 (latest)
https://docs.disnake.dev/en/stable/api.html#disnake.Member.guild_permissions
Alternatively if you want it to be role agnostic
you'll want to collect your args and check them, if it looks like its a moderator level command you check their permissions/roles and either deny them or execute as normal.
discord does not give us a convenient way to list what automod violations a member has incurred. So you're either gonna have to monitor the event and log it internally when it happens, or cross reference the audit log. A combination of the two most likely.
IE when you start up the bot you peruse the audit logs to see if the bot missed anything, adding whatever is new. then starts listening for automod events and logging it to your database.
poor wording then x) However, if you're capable of implementing your own robust automod than making a simple prefix command should be easy in comparison.
yes, you want 1 command. >warnings that all can use.
but if args is numerical you only want moderators to use it. thats like 1 if statement
you could use the new match() function to decide
lets you write sort of RE cases, and getting it to react on numbers only is simple enough.
otherwise you have this
https://www.w3schools.com/python/ref_string_isnumeric.asp
you basically need to getch it from disnake, if its a user you get something usable returned, otherwise its None
but you want a Member, not a User in this case, so you need to refference the guild's members
Member is the guild specific version of a User.
Have you considered slash commands instead? x)
def warnings(ctx, *args):
match(args):
case []:
#Normal warnings
print("Normal Warning")
return
case ['--a']:
#Automod warnings
print("Automod Warning")
return
if args[0].isnumeric():
print("Some number: ",int(args[0]))
warnings(1,"--a")
warnings(None)
warnings(None,"1234")
Automod Warning
Normal Warning
Some number: 1234
Don't really remember the syntax for prefix commands as they're more or less dying. so just made it a normal function.
Couldn't find a way to match if a string was numeric
might be possible, no idea
Short answer is ofc yes x) But you're gonna have to do some fancy searching on the text. Why do you want to know?
https://carpedm20.github.io/emoji/docs/#extracting-emoji
can use this to check for unicode emojis atleast
custom emojis you're probably going to need to use RE
Regular Expressions yea, or Regex for short
something something find all pairs of : : containing some characters inbetween
yes

+source #1081676706449997874 message
+help
Missing required argument: command
Usage: +help <command>
+help source
+source
View the message source of the specified message id
Basic usage: !source 534722219696455701
https://zeppelin.nothing.party/docs/plugins/utility/usage#command-source
+source 1081708933133107260
Unknown message
Wai
{
"id": "1081709605467467816",
"content": "  :no_data:",
"attachments": [],
"embeds": [],
"stickers": [],
"components": []
}
there we go
so you're sort of screwed.
so you're gonna have to check for both. and theres no way to make it abuse proof
but any abuse would just lead to warnings so who cares