[Python] What do I need to change? [closed]

Discussão em 'Python' iniciado por Stack, Junho 17, 2025.

  1. Stack

    Stack Membro Participativo

    I recently got into coding (less than a week ago) And am trying to learn the basics via YT. I followed a video from a month ago perfectly from what I can tell, but it doesn't seem to work and I'm unsure why.

    Link to the video I followed

    I had expected for the result of the code to be at the bottom, but all it says every time I try is "Process finished with exit code 0"

    There's no errors that I can find, so I can't figure out what's wrong. Here is my code so far. Any help is appreciated.

    import discord
    from discord.ext import commands
    import logging
    from dotenv import load_dotenv
    import os

    load_dotenv()
    token = os.getenv('DISCORD_TOKEN')

    handler = logging.FileHandler(filename='discord.log', encoding='utf-8', mode='w')
    intents = discord.Intents.default()
    intents.message_content = True
    intents.members = True

    bot = commands.Bot(command_prefix='!', intents=intents)
    @bot.event
    async def on_ready():
    print(f"{bot.user.name} is online!")

    bot.run(token, log_handler=handler, log_level=logging.DEBUG)

    Continue reading...

Compartilhe esta Página