#How to create custom checks in SlashCommandGroup

1 messages · Page 1 of 1 (latest)

unkempt galleon
#

How to create custom checks in SlashCommandGroup

admin_main = SlashCommandGroup(
		"admin",
		"Admin",
		checks=[plugins.check_admin()],
		guild_ids=[993502625574162552]
	)

check_admin() returns True or False depends on the user status

#

ping if you have an answer, thanks!

cursive ermine
#

@unkempt galleon , if I'm understanding you correctly, this was the WHOLE purpose of permissions 2.0. You now control this within the integrations tab within discord, not by code.

#

You just need to be at pycord 2.0rc1

unkempt galleon
#

I have admin ids in an database listed. It can not be discord controlled @cursive ermine

#

I am stuck on making an Command slash check

cursive ermine
#

Much easier to code also.

unkempt galleon
cursive ermine
#

Someone else more knowledgeable can verify, but I dont think SlashCommandGroup support checks like commands do. But I could be wrong, so I'll defer. . .

#

Personally, if its only one or two, I wouldn't use a database for that. I'd just have a list with the ID's in place then something like:

interlist = []

append the list here to include your admin ID's

adminAccess = False
for adminCheck in iterList:
if adminCheck == ctx.author.id:
adminAccess = True
if adminAccess == False:
await ctx.respond('You do not have access to this function.')
return

unkempt galleon
summer surge
#

At the bottom @unkempt galleon

unkempt galleon
#

whats that @summer surge

summer surge
#

The checks