Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.7k stars 3.74k forks source link

Add a method for fetching a preview of a discoverable guild #9890

Open gingershaped opened 1 month ago

gingershaped commented 1 month ago

Summary

Discord has an API for fetching a preview of a discoverable guild, which is currently not used by this library.

What is the feature request for?

The core library

The Problem

Discord has an API endpoint for getting a preview of a discoverable guild. There is a type for the response in the library, but no way to actually perform the request at present. This means that bots can't see preview information of discoverable guilds.

The Ideal Solution

I would like a new method on Client called fetch_guild_preview(id: int) which returns a GuildPreview that exposes all the fields of the response.

The Current Solution

The request must be made manually and the response parsed by hand.

Additional Context

No response

MCausc78 commented 1 month ago

You can recreate this PR: https://github.com/Rapptz/discord.py/pull/2642