0
votes

st recent call last): File "randomgg.py", line 1271, in \u003cmodule\u003e client.run(token) File "/usr/local/lib/python3.8/site-packages/discord/client.py", line 708, in run return future.result() File "/usr/local/lib/python3.8/site-packages/discord/client.py", line 687, in runner await self.start(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/discord/client.py", line 651, in start await self.connect(reconnect=reconnect) File "/usr/local/lib/python3.8/site-packages/discord/client.py", line 586, in connect raise PrivilegedIntentsRequired(exc.shard_id) from None discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.

my code was

import aiohttp
import discord
import asyncio
from collections import Counter
import typing
from discord.ext import commands
import os
from discord.ext.commands import has_permissions
import random
import json
from discord import Status
from asyncio import gather
from discord.utils import get
import datetime
from discord.utils import get
intents = discord.Intents.default()
intents.members = True
client = commands.Bot(command_prefix='.', intents=intents)
client.remove_command('help')

def check_if_it_is_me(ctx):
    return ctx.message.author.id == 465946367622381578

@client.event
async def status_task():
    while True:
        await client.change_presence(status=discord.Status.idle, activity=discord.Game('status1'))
        await asyncio.sleep(4)
        await client.change_presence(status=discord.Status.idle, activity=discord.Game('status2'))
        await asyncio.sleep(4)
        await client.change_presence(status=discord.Status.idle, activity=discord.Game('status3'))
        await asyncio.sleep(4)

@client.event
async def on_ready():
    print(f'{client.user.name} is ready')
    client.loop.create_task(status_task())

@client.event
async def on_member_join(member):
    mem_join = member.joined_at
    guild_create = member.created_at
    join_days = (mem_join - guild_create).days
    role = discord.utils.get(member.guild.roles, id=714805001918349344)
    channel = discord.utils.get(member.guild.channels, id=771081754038501376)
    if join_days < 10:
        await channel.send(f'{role.mention} {member} is suspicious of being an alt, he joined {join_days} after creating his account. Pls keep an eye on him')

@client.event
async def on_member_remove(member):
    pass

hope u can help me i alr tried everything

1
intents = discord.Intents.default() AttributeError: module 'discord' has no attribute 'Intents' thats the error i get nowuser13897264
also my discord.py version is the 1.5.1user13897264
nvm no wait i wasnt wtf thx for the helpuser13897264

1 Answers

2
votes

The error tells you exactly what to do.

  1. Go to https://discord.com/developers/applications
  2. Navigate to your application
  3. Go to the Bot section
  4. Scroll down and enable SERVER MEMBER INTENT