#๐ code not working
46 messages ยท Page 1 of 1 (latest)
@topaz lynx
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.
The error is telling you the token is None instead of an actual token.
where have you defined the TOKEN variable?
If it's defined using os.environ.get, make sure you've set an environment variable with the token
Oh, you have an .env file, so you're presumably reading that?
bot.command("name")
async def name(ctx):
are you trying to get the bot to send that
bot.command('commando')
async def commando(ctx,userinput):
await ctx.send(get_respone(userinput))
read the document
you need import discord
yes
bot = discord.Bot()
before the client
i can't help with the code, but you should put it all in a pastebin instead of images.
!paste
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
I believe it should be discord.Client, not discord.Bot
like in ur screenshot
name error
you used uppercase Bot for ur var name
check squiggly lines
those are helpful
Bot = discord.client
line 7
you always use lowercase bot after that
name and case gotta match
yeah thats better
i would refer to the discordpy documentation https://discordpy.readthedocs.io/en/stable/
so you can know what you're doing
well where are you getting the code you have
like where did you get slash_command
yea good idea
i would use discordpy tutorials to learn
if documentation is bad
they're very helpful to get started
you're kinda trying to walk a tightrope over a volcano, when you haven't learned to stand on solid ground yet.
discord bots are highly complex, and doing that without any python foundation will be difficult.
running the program turns the bot on
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.