Restcord

Restcord is a Python wrapper for the Discord API, but without WebSockets. Original by JustMaffie.

View the Project on GitHub Doezer/Restcord

Restcord

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.

Breaking Changes

The Discord API is subject to breaking changes, so this wrapper is also subject to these changes.

Installing

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:

Quick Example (bot accounts)

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.

For user accounts:

Use at your own risk, Discord does not like at all selfbots.

client = restcord.Restcord(token="Your token here", selfbot=True)

Requirements

Usually pip will handle these for you.