according to  greeter bot discord  customized Prefixes in Discord.py | Creating a discord bot Part: 9

Hi men it's me spoil like and iin this. video i'm gonna show you men how to. make a system. in which clients will be capable to change the. prefix of the bot. in their very own servers so in theory every. server could have its possess prefix. so let's start so before starting i would. want to say that i'll be changing the. call of the channel to sponsor pi. it is because most  of you guys stated i. should do it and iif you want to. perform those polls. or join giveaways you may join the. server the link will be within the . description under. so let's begin in case your bot is in a lot. of servers i'd say you don't do this. because. it is using json documents and a greater manner. to do this will be utilizing databases. and ii'll be making an updated video. approximately this besides later yet for now. i will be simply displaying you men with json. so in case your bot is in now not loads of.

broken image

 

auto role bot discord . and it's surely async dev difference prefix. ctx and prefix. we'll open the file it's again an analogous. we'll open the file. then we will say as opposed to setting it to. the default prefix we'll set it to. whatever the. difference prefix is and then we can dump. it lower back. and at last the on message inside of the. on message occasion we'll say that if the. bot receives pinged. we can inform the prefix so it's truely. if. message dot mentions so this can be a list. of mentions and we will get the 1st. mention. if that's we could also get the identity i. imagine perhaps. we can evaluate the ids or we can simply. say if the message dimensions is. client class sorry purchaser dot consumer. we can then say look forward to message. dot message.channel.send. dot ship my prefix is. my prefix for this server is. let's simply use a f string and let's have. a prefix. due to the fact we haven't really gotten it so.

 

Let's  discord scheduling bot  open the back it is the same as. this. we are going to clearly open this. paste it here and what we're doing is. beginning this. and then we set the prefix. equal to you don't have the guild it is. message.guild actually. message.guild.identification and this could deliver us. the prefix. so this is all the code and that's it. and iif you want the code actually whilst. the video hits 30 likes i am going to publish the. code in my server. so you could join there and also hit the. like button. so let's shop thiis now finally you desire. to have this. watch for client or strategy commands. and the message so this will be it for. the code. and this will let you get a prefix. means change the prefix for each server. so on when it joins it'll set the. default prefix and whilst while an admin. desires they are able to difference the prefix as well. and whilst the bot is pinged it is going to supply.

welcomer bot discord  going to say that my prefix for the. server is the prefix. so let's experiment it ok so we have to do. this. actually we need to placed this in an ordeal. try to  be given block due to the fact. if there are no mentions it's going to. actually simply under no circumstances. execute the code so try to  receive we. can pass. i assume and one more thing you need to. perhaps have it. send this asserting oh wait cdx.send. the prefix became changed too. the prefix was converted. to um the prefix so. prefix and there must be an f string. so now we will test it. i will just invite the bottom two servers. and we are going to see. so i invited the bot to two servers now. let's examine. i am going to ping the bot and as you will see that. the prefix is. the angular bracket let's attempt to alter. it to illustrate difference prefix to. whatever like this question mark and as. you can see the former the prefix become.