Tazgirl
Tazgirl

Reputation: 83

Discord.py random syntax error when loading bot.run

I was following a tutorial to learn some new discord.py techniques but when following a tutorial I came across this error which I can't fix, this is the code:

import discord
import asyncio
from discord.ext import commands
import os
from discord.utils import get
from dotenv import load_dotenv

load_dotenv()

DISCORD_TOKEN = os.getenv("Nzg4NjQxMTQzNDExNTcyNzk2.X9mdTA.3NrZ87u3cn8-i5icp7AQD1xdmbQ")

bot = commands.Bot(command_prefix="/"
bot.run('Nzg4NjQxMTQzNDExNTcyNzk2.X9mdTA.3NrZ87u3cn8-i5icp7AQD1xdmbQ')

My problem is that when I run the code I get a syntax error specifically on the "b" at the beginning of bot.run() any help is appreciated.

Upvotes: 0

Views: 77

Answers (1)

Ralubrusto
Ralubrusto

Reputation: 1501

If your code is exactly what you've posted, you're just missing a ) at the line before the last.

bot = commands.Bot(command_prefix="/" # <-- MISSING PARENTHESIS HERE
bot.run('Nzg4NjQxMTQzNDExNTcyNzk2.X9mdTA.3NrZ87u3cn8-i5icp7AQD1xdmbQ')

In cases like this Python throws an error at the line below because it can't understand the previous line has ended.

Upvotes: 1

Related Questions