I’m making a say command for a discord bot and everything is working fine for the most part. What i want to make is a command that one person can use in any channel, and it sends the message delegated, in the channel that it is told to send it in. This all works, and here is my code:
async def say(self, ctx, channelname, *, message):
"""Make the bot say whatever you want it to say"""
channel = discord.utils.get(ctx.guild.channels, name=channelname)
await channel.send(message)
However, my problem is that every channel in the intended discord server has an emoji in front of the channel name, so its much easier to just use the discord feature where if you type a # you can click on the name of the channel. But whenever I do that and send it with the # still there it throws this error code:
AttributeError: NoneType object has no attribute “send”
Does anyone know how I might fix this?
Thanks in advance!