Category : command

so I have setup some code in my Discord bot that when a user tries to invoke a command, the bot checks the channel topic to see if that command is blacklisted in that channel. You can see my code below: @commands.Cog.listener() async def on_command(self, ctx): if f'[{ctx.command.name}]’ in ctx.channel.topic: await ctx.send(f'{x_mark} **{ctx.author.name}**, The bot ..

Read more

So, I want to write a function for all subcommands for my python bot but I’m not sure how they work in discord.py. For instance, I have this mute code here. @bot.command() async def mute(ctx,member : discord.Member, *, reason=None): with open("role.json", "r") as f: roles = json.load(f) muted_role = discord.utils.get(ctx.guild.roles, id=roles[f"{ctx.guild.id}"]["role_id"]) embed = discord.Embed(color=discord.Color(0xFF0000), title=f"{member} ..

Read more

i’m using chrome remote debugger for my work. Specific is i want to open a remote host with available user profile but it’s not work. i’m used command : chrome –remote-debugging-port=9222 –user-data-dir="C:UsersAdminAppDataLocalGoogleChromeUser DataDefault" then a chrome has been opened as guest user. Source: Python..

Read more

I am currently working on a kick command that does a double check with the user before carrying out action for my discord bot, and came up with this: @bot.command() @commands.has_permissions(manage_guild=True) async def kick(ctx, member: discord.Member = None, *, reason="No reason provided"): server_name = ctx.guild.name user = member if member == None: await ctx.send( f'{x_mark} ..

Read more