#πŸ”’ Is this code right? I'm getting error messages and I'm not sure what the issue is.

30 messages Β· Page 1 of 1 (latest)

high loom
#

Code:
`import discord
import os
from dotenv import load_dotenv

load_dotenv()
TOKEN = os.getenv('TOKEN')

client = discord.Client(intents= discord.Intents.default())Output: [2024-10-21 11:28:26] [INFO ] discord.client: logging in using static token
[2024-10-21 11:28:28] [INFO ] discord.gateway: Shard ID None has connected to Gateway (Session ID: {redacted bc idk what this is}).
transient_frnd#4810 has connected to Discord.`

Also the code is still running?

tranquil egretBOT
#

@high loom

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

high loom
#

Yeah I don't know if my computer is just slower than a corpse or this is supposed to happen because it's still running

dark slate
high loom
dark slate
#

colors have nothing to do with error messages

high loom
#

Is it still running because it's slow or it's just going to stay this way?

high loom
dark slate
dark slate
high loom
dark slate
# high loom

yea thats not an error. You can (kinda) clearly see that the log line on each says INFO

dark slate
high loom
#

Oh I see. alright thanks, I'll just open a different file and keep working on it

#

appreciate it!

dark slate
#

np

high loom
#

I have a bit of a stupid question, does the bot need to be online to work on the server, or just while I'm working on it? Am i going to need to run this code every time I want to start working on the bot?

dark slate
#

yes you need the bot online so you can see it working. No, you don't need the bot to always be online while you're working on it.

high loom
#

hmm okay, so for the bot to be working on the discord server, interacting with members and such, it has to be online? Meaning this code has to be running on the machine indefinitely to be doing its job?

high loom
#

oh wow

#

thanks for explaining, appreciate it a lot!

#

ill get a server lol

high loom
dark slate
#

np

tranquil egretBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.