Skip to content Skip to sidebar Skip to footer

Message.channel.id Discord Py

I am attempting to make a logging bot however I am having issues with message.channel.id What is sent upon event being triggered; Message ID - Message ID | User - User ID | Their M

Solution 1:

You used twice the same variable channel

just rename ones of them


Here is an example of a change of the 2 lines:

@bot.eventasyncdefon_message(message):
    user = message.author
    user_id = message.author.id
    message_id = message.id
    content = message.content
    message_channel = message.channel.id
    guild = message.guild
    if user.bot:
        return
    channel = bot.get_channel(my private log channel)
    await channel.send(f"Message ID - {message_id} **|** {user} - {user_id} **|** {content} **|** #{message_channel} - {guild}")
    await bot.process_commands(message)

Post a Comment for "Message.channel.id Discord Py"