I am trying to code a discord bot but when I run the program it gives the error
Traceback (most recent call last): File "c:/Users/phara/Documents/GitHub/RayzeBot/bot.py", line 41, in intents = discord.Intents.default() AttributeError: module 'discord' has no attribute 'Intents'
import discord, asyncio, os, platform, sys
from discord.ext.commands import Bot
from discord.ext import commands
import time
import random
if not os.path.isfile("config.py"):
sys.exit("'config.py' not found! Please add it and try again.")
else:
import config
"""
Setup bot intents (events restrictions)
For more information about intents, please go to the following websites:
https://discordpy.readthedocs.io/en/latest/intents.html
https://discordpy.readthedocs.io/en/latest/intents.html#privileged-intents
Default Intents:
intents.messages = True
intents.reactions = True
intents.guilds = True
intents.emojis = True
intents.bans = True
intents.guild_typing = False
intents.typing = False
intents.dm_messages = False
intents.dm_reactions = False
intents.dm_typing = False
intents.guild_messages = True
intents.guild_reactions = True
intents.integrations = True
intents.invites = True
intents.voice_states = False
intents.webhooks = False
Privileged Intents (Needs to be enabled on dev page):
intents.presences = True
intents.members = True
"""
intents = discord.Intents.default()
I have the latest version of the discord API installed and am running python 3.8 What is causing the error and how do I fix it?