So i am currently making a chat channel, where you can chat in the channel and the bot sends into an another server that has the channel named chat-chan,
here is my code:
async def on_message(message):
if message.channel.name == 'chat-chan' and message.author.bot == False:
await message.channel.send(f"{message.author.name}: {message}")
instead it sends the information of the message instead of the message itself
Mini: <Message id=12345678910 channel= type=<MessageType.default: 0> author=<Member id=12345678910 name=’Mini’ discriminator=’4140′ bot=False nick=None guild=> flags=>
>Solution :
You are sending the object of the message. To access message itself you need to replace it with message.content
async def on_message(message):
if message.channel.name == 'chat-chan' and message.author.bot == False:
await message.channel.send(f"{message.author.name}: {message.content}")