#๐ dc-bot help
28 messages ยท Page 1 of 1 (latest)
"file" or folder?
a virtual environment is a folder containing an isolated Python installation and its dependencies - they are created to separate your project's dependencies from your global environment
PyCharm creates it automatically for you and manages it, but regardless of which IDE or package manager you are using it's recommended to use a venv to prevent version conflicts
you should just let it create then ignore it and let PyCharm manage it for you
regardless, you should post the actual errors - odds are the problems is either in your script or the versions you're using of things you depend on
folder
import os
import discord
intents = discord.Intents.default()
intents.members = True
intents.messages = True
client = discord.Client()
@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('!hello'):
await message.channel.send('Hello!')
client.run(os.getenv('TOKEN'))```
whats wrong here?
fixed what problem. TY!
!pip python-dotenv
dc-bot help
what does that mean im new
read the summary in the embed
ohh ty
it says this now: Traceback (most recent call last):
File "C:\Users\juli2\PycharmProjects\PythonProject\main.py", line 11, in <module>
client = discord.Client(intents)
TypeError: Client.init() takes 1 positional argument but 2 were given
!d discord.Client
class discord.Client(*, intents, **options)```
Represents a client connection that connects to Discord. This class is used to interact with the Discord WebSocket and API.
async with x
: Asynchronously initialises the client and automatically cleans up.
New in version 2.0...
intents = intents
ty it works now
You helped me much thank you very much!!!
i'd probably recommend learning python before jumping head first into a discord bot
I very strongly recommended you looking into slash commands (app commands). There is no point to learn message based commands first at this point in time
You can close it with !close (funnily enough this server has not updated to use slash commands yet)
This help channel has been closed. 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.