0
votes

I'm trying to make a discord bot using the discord.py module. I have structured my code in so called Cogs and now want to make one for creating text channels. The Bot has the permissions it requires but is not doing anything when I call the command. I also don't get any error message, it just does nothing. Thanks for helping already!


from discord.ext import commands
import discord


class createchannel(commands.Cog):

    def __init__(self, client):
        self.client = client


    @commands.command()
    async def create(self, ctx, channel_name):
        guild = ctx.message.guild
        await guild.create_text_channel(channel_name)

def setup(client):
    client.add_cog(createchannel(client))
1
Can you see the command when you use the help command?Nurqm
@Nurqm Yes I can. I'm pretty sure the Cog is loaded correctly and it's not the things that's causing the problem.Celltox

1 Answers

0
votes

I found what was causing it not to work. The bot actually didn't have the permissions to edit the channel (which is weird because I authorized it with Amdin Rights) and I didn't get an error in the console because my cog that handles erros blocked it.