Discord api wrapper
Project description
ANTICORD (anticordpy)
REMEMBER , THIS LIBRARY WAS MADE BY AN ANTI-FURRY 🐺🚫
THIS PROJECT IS STILL IN DEVELOPMENT , AND IT LACKS SOME FEATURES , FEEL FREE TO SUPPORT THIS PROJECT AND CONTRIBUTE , WE WILL GREATLY APPRECIATE THIS
ABOUT
anticord is a discord python library meant for:
- Another aproach at the discord api
- A lower level attachment to the discord api
this is not specifically meant for beginers
- you may need to have a bit of knowlege on how the discord api works
- you may need to have a tab with the discord api docs open while writing code in this library
check demos folder (in the github page) for examples
To install the library using pip , please do:
pip install anticord
DOCUMENTATION
Some information:
-
Most functions have errors and will return errors if they failed to do a set action
-
Most function will return the json body from the request but some other won't
-
The library is split into two importable files with functions in them
-
One of them is used for plain simple http requests and the other is used for gateway events and such
Errors:
- Will usually return the message from discord api along with the code
- There may be exceptions
AntiCordPlainHttpRequest:
- Plain HTTPS requests to the discord api
- Specific functions for your requests
CLASSES:
- Every class will usually have a
BOTParentToken(THE TOKEN OF BOT WHO OWNS THE OBJECT) and a specific id like:channelid,guildid,useridand so on - BOT class is an exception to this
- Most classes will have a get attribute function and maybe a change attribute one (stuff like
changechannelattribute(chg_data:dict)) - Most classes will have a header object that will be used to send requests (contains token)
Channel:
- A discord guild channel
Functions (self explanatory):
SendMessage(content:str):
DeleteMessage(messageid:int):
DeleteGuildChannel()
CreateInivte():
GetChannelAttribute(attribute):
User:
- A discord user/bot/member
Functions (self explanatory):
CreateUserDm():
GetUserAttribute(attribute):
Guild:
- A discord guild
Functions (self explanatory):
GetGuildAttribute(attribute):
CreateGuildChannelText(name:str,topic:str = ""):
ChangeGuildAttribute(chg_data:dict):
LeaveGuild()
DoesGuildMemberHaveRole(role_id:int,user:User):
TimeoutUser(user:User,timestamp_ISO8601_until):
KickUser(self,user:User):
BanUser(user:User,delete_message_seconds:int = 0):
UnBanUser(user:User):
GetGuildChannels():
GetGuildWebhooks():
GetGuildMembers(limit:int):
GetGuildMember():
GetGuildRoles()
BOT:
- A discord bot
Functions:
GetChannelByID(id):
GetGuildByID(id):
GetUserByID(id):
GetBotGuilds():
GetBotAttribute(attribute):
ChangeBotAttribute(chg_data:dict):
Get bot attribute
AntiCordGateway:
-
Handles the stuff related to the discord gateway (events)
-
Has abstractions
CLASSES:
GatewayWebsocket:
- a gateway websocket
Atributes:
WebSocket - its websocket object (uses the websocket library)
Token - the bot token (str)
Functions:
CreateGatewayObj(Token:str):
- Returns a GatewayWebsocket object with the token
CreateConnection():
- Will make a connection (adds a websocket object and makes a hearthbeat thread)
'SendIntents(Intents:int):'
-
Will send the given intents (read discord api and use a intent calculator)
-
Will return 0 if it recived a ready opcode , if not , it will return 1
ReciveEvent():
- Will recive an event from discord , it ignores the 11 opcode (ack opcode)
SOME INSTRUCTIONS TO USE:
-
first you have to create the gateway object
-
then you will need to create a connection with the gateway objectx
-
after that you can send your intents and listen for events
-
you can also look in the demos if you dont know how to do this
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file anticord-0.4.tar.gz.
File metadata
- Download URL: anticord-0.4.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e7e370bbf52235ad3d06005c462f2fbb7721b6ef5cdf8ba44fbddd2155882d1
|
|
| MD5 |
4af9bc2124217b61c7dc84fd8119ab9b
|
|
| BLAKE2b-256 |
315c9691eb8957f65775054218dd459247cc9a57cf43417a8abecc0840175812
|
File details
Details for the file Anticord-0.4-py3-none-any.whl.
File metadata
- Download URL: Anticord-0.4-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53a01d08dafb16eb9c1b3fb9327c44d6527f96cf51e3bec8d0e9fae29316f3fb
|
|
| MD5 |
0d7d0414ddacc40d68d69356020380f2
|
|
| BLAKE2b-256 |
597be4b38cf207284162f721ba7c209e4eddfeff1ba70f408d31532118b01e0e
|