[Python] Discord.py read messages from channels

Discussão em 'Python' iniciado por Stack, Agosto 19, 2025.

  1. Stack

    Stack Membro Participativo

    I m trying to listen to all messages from specific channels inside guilds that i m not owner, i started to trying listen to all messages with the code below, without success. How can i do that if possible using the channel id?

    Thank you!

    import discord

    client = discord.Client()
    guild = discord.Guild
    messages = []


    print("Bot started")
    @client.event
    async def on_message(message):

    msg = message.content

    if msg != "" :

    messages.append(msg)

    while True:
    print(messages)

    client.run('TOKENHERE')

    Continue reading...

Compartilhe esta Página