I am developing a Discord Bot using Python. And getting the following error (AttributeError: 'NoneType' object has no attribute 'strip'). Here is my code.
import os
import discord
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('O.......')
GUILD = os.getenv('CodeUP')
client = discord.Client()
@client.event
async def on_ready():
for guild in client.guilds:
if guild.name == GUILD:
break
print(
f'{client.user} is connected to the following guild:\n'
f'{guild.name}(id: {guild.id})'
)
client.run(TOKEN)
TOKEN
variable, you'll see it'sNone
. TheODMyMTUxN..
key doesn't exist, I think that might be your actual token - Łukasz Kwieciński