kmfkpacks.blogg.se

How to check discord id
How to check discord id












We will be changing the check_Mod function for this. Here's an example of how your text file may look like: 394506589350002688įirst you need to read the file and check whether the author's id is in the file. In this case, I will use a text file since it's simpler, and also because my json isn't as fluent as others. To answer is there is a way to add user ids to the list via a command?, you may either use a json or text file. The above working is shown in the image below: If the author is in this list when the command 'test' is invoked, then the bot will send "You are a mod!", otherwise it will raise a check error. The function in the code below checks if the message author, ctx.author, is in the given list, modList. One way you could do it would be to use commands.check(). Return def AddUser(self, ctx, *, def ViewModList(self, ctx):Īwait ctx.send('User ids that have access:')Īwait ctx.send('Modlist def PermTest(self, ctx): The code below is the problematic code from a cog modlist = I added a command that i can use to to add their user id to a list, but when the user tries to use the command they receive a permission error. I've added a few commands that could be pretty disruptive if all users had access to them at all times and have been trying to add a method to enable and disable access to them without using discord roles but a python list instead.

how to check discord id

Im fairly new to python and have been writing a discord bot for a server with me and a few friends as practice.














How to check discord id