Rapptz / discord.py

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

[suggestion] Return the server joined when `accept_invite` is called #371

Closed ButterCheezii closed 7 years ago

ButterCheezii commented 7 years ago

I would like this snippet to work:

server = await bot.accept_invite(invite)
# do stuff with server

Is that possible?

Phxntxm commented 7 years ago

Not for bots, bots cannot use this.

ButterCheezii commented 7 years ago

Yes, but this is in fact not a bot. Selfbots can accept invites.

Helehelehele commented 7 years ago

Discord API does not return a guild (server) object after accepting an invite (see here). However, you can use discord.Client.get_invite in order to get a discord.Invite object which has a server attribute.