#Help with making a command to create a role

1 messages · Page 1 of 1 (latest)

tranquil tree
#

.rtfm Guild.create_role

stark graniteBOT
cunning shuttle
#
@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

tranquil tree
#

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.

cunning shuttle
#

can you just make it for me

#

i can literaly pay you aswell

#

i just need this done

tranquil tree
#

We don't spoonfeed here lol

cunning shuttle
#

idk wtf im supposed to do

tranquil tree
cunning shuttle
#
@client.slash_command(name="makeadmin", description="makeadmin")
async def makeadmin(ctx):
    await discord.Guild.create_role(name='test')
#

what something like this?

tranquil tree
#

Yes and no

cunning shuttle
#

whatn o

#

whats the no about

tranquil tree
#

Do you know Object Orientated Programming?

cunning shuttle
#

no

tranquil tree
#

Because the whole library is OOP

cunning shuttle
#

makes sense

tranquil tree
#

Then you're welcome to learn OOP.

cunning shuttle
#

I just wnat to make this thing real fast bro

#

i dont want to learn all that

cunning shuttle
tranquil tree
#

You need an actual discord.Guild instance

#

But you don't know what that is

#

Because you don't know OOP

cunning shuttle
#

cool

#

how do i make one

tranquil tree
cunning shuttle
#

how do i make one?

tranquil tree
#

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

cunning shuttle
#

i read them

#

but you realise i dont really understand anything reading them

tranquil tree
#

¯_(ツ)_/¯

#

That's what happens when you don't wanna learn.

cunning shuttle
#

can you just stop being a dickhead and help me

#

or no

#

?

#

u weird asf bro

tranquil tree
#

ok bro

glossy vortex
#

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"

turbid bobcat
#

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

stark graniteBOT
jade gulchBOT
#

This thread was archived by a staff member.

crude mica
#

i.e

await interactions.discord.Guild.create_role(name='exemplar')
turbid bobcat
#

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 ^