Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError #11

Open
hemvg opened this issue Apr 26, 2022 · 1 comment
Open

TypeError #11

hemvg opened this issue Apr 26, 2022 · 1 comment

Comments

@hemvg
Copy link

hemvg commented Apr 26, 2022

I have an issue, which I am not sure how to fix
Traceback (most recent call last):
File "C:\Users\name\Desktop\EinsteinBot-master\bot.py", line 13, in
bot = commands.Bot(
TypeError: init() missing 1 required keyword-only argument: 'intents'

@hemvg
Copy link
Author

hemvg commented Apr 26, 2022

`# Creates Discord Bot
import discord
from discord.ext import commands
import json
import os

Load config

with open("config.json", "r") as f:
config = json.load(f)

Initialize

bot = commands.Bot(intents = discord.Intents.default(), command_prefix = config["prefix"])
bot.remove_command("help")
async def load_extensions():
for file in os.listdir("./cogs"):
if file.endswith(".py"):
name = file[:-3]
await bot.load_extension(f"cogs.{name}")
@bot.event
async def on_ready():
print(f"Bot is online")
await bot.change_presence(activity=discord.Game(name="big brain | =help"))
try:
bot.run(config["token"])
except Exception as err:
print(f"Error: {err}")`

Can someone vet my code? I modified it to discord.py 2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant