#Help with making a command to create a role
1 messages · Page 1 of 1 (latest)
idk how i would be supposed to do it
@client.slash_command(name="makeadmin", description="makeadmin")
async def makeadmin(ctx):
await client.create_role(name='test')
await client.add_roles
something like this
idk
The docs explicitly say "discord.Guild.create_role"
You need a guild object
You don't use the client object (and doesn't make sense at all)
And the last line doesn't make sense either.
i have no idea how to do it bro
can you just make it for me
i can literaly pay you aswell
i just need this done
We don't spoonfeed here lol
alright so what do i do
idk wtf im supposed to do
.
.
@client.slash_command(name="makeadmin", description="makeadmin")
async def makeadmin(ctx):
await discord.Guild.create_role(name='test')
what something like this?
Yes and no
Do you know Object Orientated Programming?
no
Because the whole library is OOP
makes sense
Then you're welcome to learn OOP.
can you atleast tell me what the no is about
You need an actual discord.Guild instance
But you don't know what that is
Because you don't know OOP
how do i make one?
You don't.
If you cared to read the docs, at least, you would see context has an attribute called guild which refers to the guild the command is being run in
ok bro
Scrolling through the help sections, I think "Oh, this is an easy one I can help with." Then I see the way this guy is treating you, and I'm like, "pass"
cool
The problem is that you were told what needs to be changed and how to do it. We do not have the time/energy to teach people OOP especially with there being many online resources that would do a better job. We also will not give you the code as that does not promote learning. If we give you code you will need to come back with similar questions and in the end we will have pretty much written your bot for you through spoon feeding. I will link some resources below.
.tag lp
Resources For Learning Python
- Official Beginner's Guide
- Shortcut to guide for people new to programming and people with experience programming
- Official Tutorial
Other Resources To Learn Python
- Automate The Boring Stuff for complete beginners to programming
- Learn X In Y Minutes for people with experience programming
- Swaroopch is a useful book
- Code Abbey has practice for beginners
- W3Schools is a good resource for general use
This thread was archived by a staff member.
sorry to bother as i know this has been archived, I was wondering for buttons, if the interactions parameter also has a method to acheive this?
i.e
await interactions.discord.Guild.create_role(name='exemplar')
Interaction.guild where Interaction is your interaction object. This will allow you to do anything with guild. Also for future reference you can ask questions like this in #1132206148309749830 or your own help thread unless it directly relates to the original question being asked.
@crude mica ^
makes sense thanks