I am trying to run my bot currently and I keep running into the error “module 'discord' has no attribute 'bot'” and will not let me start my bot.
Here is my code:
import os
os.system("pip install py-cord")
import discord
import time
import requests
import datetime
from discord.ext import commands
from discord.utils import get from discord.ext import tasks
from discord.ext.commands import Bot
bot = discord.Bot()
@bot.event
async def on_ready():
print(f"WORKING AS {client.user}"
# commands were removed due to it not letting me post the question but the code shouldn’t be a issue with the bot. It is slash commands. I will leave the beginning of the code below.
@bot.slash_command(description="Unlock the chat.")
@commands.has_permissions(manage_channels = True)
# code was here
bot.run(mytoken)
I’ve already tried changing it from bot to client with no luck. I also already tried the specific version being 2b1. I want to use slash commands with the bot and client says there is no attribute slash commands.I do not think it’s something to do with the lower portion of the code, it’s something to do with the top of the code if you can help, please and thank you.