Restcord is a Python wrapper for the Discord API, but without WebSockets. Original by JustMaffie.
Restcord is a Python wrapper for the Discord API, but without using WebSockets. This is for people who only want to make requests to the api without having a full-fledged bot.
It was originally developed by JustMaffie.
The Discord API is subject to breaking changes, so this wrapper is also subject to these changes.
To install this library, you should either clone it or download it. The version on PyPi is the original one, without any of the fixes here.
Please note that on Linux installing voice you must install the following packages via your favourite package manager (e.g. apt
, yum
, etc) before running the above command:
import restcord
import asyncio
loop = asyncio.get_event_loop() # Get current asyncio loop
client = restcord.Restcord(token="Your token here") # Start the REST API session
async def get_guild():
guild = await client.GuildCord.get_guild("Some guild id of a guild that ur bot/user account is in")
print(guild.__dict__)
loop.run_until_complete(test())
client.close()
Check the file example.py for an application used to upload an emote to the first guild with permissions OK & storage OK.
Use at your own risk, Discord does not like at all selfbots.
client = restcord.Restcord(token="Your token here", selfbot=True)
aiohttp
libraryUsually pip
will handle these for you.