Last active
April 20, 2025 16:07
-
Star
(126)
You must be signed in to star a gist -
Fork
(9)
You must be signed in to fork a gist
-
-
Save Painezor/eb2519022cd2c907b56624105f94b190 to your computer and use it in GitHub Desktop.
Revisions
-
Painezor revised this gist
Dec 13, 2020 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ @commands.guild_only() # Command cannot be used in private messages. @commands.dm_only() # Command can only be used in private messages. @commands.is_owner() # Command can only be used by the bot owner. -
Painezor revised this gist
Apr 17, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,13 +13,13 @@ @commands.bot_has_role(11132312313213) # As above, but for the bot itself. (name can be replaced with id) @commands.has_any_role("role1","foo",11132312313213) # Check if user has any of the roles with the names "role1", "foo", or the role with id 11132312313213 @commands.bot_has_any_role(*roles) # As above, but for the bot itself @commands.has_permissions(ban_members=True, kick_members=True) # Check if user has all of the passed permissions # e.g. this command will require both kick and ban permissions -
Painezor revised this gist
Mar 12, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,13 +13,13 @@ @commands.bot_has_role(11132312313213) # As above, but for the bot itself. (name can be replaced with id) @commands.has_any_role(*["role1","foo",11132312313213]) # Check if user has any of the roles with the names "role1", "foo", or the role with id 11132312313213 @commands.bot_has_any_role(*roles) # As above, but for the bot itself @commands.has_permissions(**{ban_members:True, kick_members:True}) # Check if user has all of the passed permissions # e.g. this command will require both kick and ban permissions -
Painezor revised this gist
Mar 12, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,13 +13,13 @@ @commands.bot_has_role(11132312313213) # As above, but for the bot itself. (name can be replaced with id) @commands.has_any_role("role1","foo",11132312313213) # Check if user has any of the roles with the names "role1", "foo", or the role with id 11132312313213 @commands.bot_has_any_role(*roles) # As above, but for the bot itself @commands.has_permissions(ban_members=True, kick_members=True) # Check if user has all of the passed permissions # e.g. this command will require both kick and ban permissions -
Painezor revised this gist
Jan 25, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,7 @@ @commands.cooldown(rate,per,BucketType) # Limit how often a command can be used, (num per, seconds, BucketType) @commands.max_concurrency(number, per=BucketType.default, *, wait=False) # Limit how many instances of the command can be running at the same time. # Setting wait=True will queue up additional commands. False will raise MaxConcurrencyReached -
Painezor revised this gist
Jan 25, 2020 . 1 changed file with 13 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,24 +10,24 @@ @commands.has_role("name") # Check if member has a role with the name "name" @commands.bot_has_role(11132312313213) # As above, but for the bot itself. (name can be replaced with id) @commands.has_any_role(["role1","foo",11132312313213]) # Check if user has any of the roles with the names "role1", "foo", or the role with id 11132312313213 @commands.bot_has_any_role(*roles) # As above, but for the bot itself @commands.has_permissions([ban_members=True, kick_members=True]) # Check if user has all of the passed permissions # e.g. this command will require both kick and ban permissions @commands.bot_has_permissions(**perms) # As above, but for the bot itself. @commands.has_guild_permissions(**perms) @commands.bot_has_guild_permissions(**perms) # As for the two above, but for guild permissions rather than channel permissions. @commands.check(myfunction) @@ -43,4 +43,6 @@ @commands.max_concurrency(number, per=<BucketType.default: 0>, *, wait=False) # Limit how many instances of the command can be running at the same time. # Setting wait=True will queue up additional commands. False will raise MaxConcurrencyReached # Checks can be stacked, and will Raise a CheckFailure if any check fails. -
Painezor revised this gist
Jan 25, 2020 . 1 changed file with 22 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,11 @@ @commands.guild_only() # Command cannot be used in private messages. @commands.is_owner() # Command can only be used by the bot owner. @commands.is_nsfw() # Command can only be used in NSFW channels @commands.has_role("name") # Check if member has a role with the name "name" @@ -20,16 +26,21 @@ @commands.bot_has_permissions(**perms) # As above, but for the bot itself. @commands.has_guild_permissions() @commands.bot_has_guild_permissions() # As for the two above, but for guild permissions rather than channel permissions. @commands.check(myfunction) # Check against your own function that returns those able to use your command @commands.check_any(*myfunctions) # Command will be ran if the conditions of any of your own check functions are met from discord.ext.commands.cooldowns import BucketType # BucketType can be BucketType.default, member, user, guild, role, or channel @commands.cooldown(rate,per,BucketType) # Limit how often a command can be used, (num per, seconds, BucketType) @commands.max_concurrency(number, per=<BucketType.default: 0>, *, wait=False) # Limit how many instances of the command can be running at the same time. # Setting wait=True will queue up additional commands. False will raise MaxConcurrencyReached -
Painezor created this gist
Sep 13, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ @commands.check(myfunction) # Check against your own function that returns those able to use your command @commands.has_role("name") # Check if member has a role with the name "name" @commands.bot_has_role("name") # As above, but for the bot itself. @commands.has_any_role("role1","foo","bar") # Check if user has any of the roles with the names "role1", "foo", or "bar" @commands.bot_has_any_role("role1","foo","bar") # As above, but for the bot itself @commands.has_permissions(**perms) # Check if user has any of a list of passed permissions # e.g. ban_members=True @commands.bot_has_permissions(**perms) # As above, but for the bot itself. from discord.ext.commands.cooldowns import BucketType @commands.cooldown(rate,per,BucketType) # Limit how often a command can be used, (num per, seconds, BucketType) # BucketType can be BucketType.default, user, server, or channel @commands.guild_only() # Rewrite Only: Command cannot be used in private messages. (Replaces no_pm=True) @commands.is_owner() # Rewrite Only: Command can only be used by the bot owner. @commands.is_nsfw() # Rewrite Only: Command can only be used in NSFW channels