dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
684 stars 162 forks source link

Invites related results on 429: Too many requests error (Cloudflare blocked) #197

Closed Velka-DEV closed 2 years ago

Velka-DEV commented 2 years ago

Summary

Fetch_invite / join_guild not working as normal

Reproduction Steps

Using these functions result in being blocked by cloudflare for too many requests and as well server never joined.

Tried with and without fetching invite instance before joining, tried with invite Id without URL. Both don't work

Code

from discord.ext import tasks
import discord

class MyClient(discord.Client):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

    async def on_ready(self):
        print('Logged in as')
        print(self.user.name)
        print(self.user.id)
        print('------')
        invite =  await self.fetch_invite("https://discord.com/invite/BVCz8udSaM", with_counts=False, with_expiration=False)
        await self.join_guild(invite)

client = MyClient()
client.run('token')

Expected Results

Fetched invite & server correctly joined

Actual Results

Cloudflare blocked (429) Too many requests

System Information

Checklist

Additional Information

No response