Skip to main content

Discord api wrapper

Project description

ANTICORD (anticordpy)

anticord logo

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,userid and 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

anticord-0.4.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Anticord-0.4-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

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

Hashes for anticord-0.4.tar.gz
Algorithm Hash digest
SHA256 5e7e370bbf52235ad3d06005c462f2fbb7721b6ef5cdf8ba44fbddd2155882d1
MD5 4af9bc2124217b61c7dc84fd8119ab9b
BLAKE2b-256 315c9691eb8957f65775054218dd459247cc9a57cf43417a8abecc0840175812

See more details on using hashes here.

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

Hashes for Anticord-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 53a01d08dafb16eb9c1b3fb9327c44d6527f96cf51e3bec8d0e9fae29316f3fb
MD5 0d7d0414ddacc40d68d69356020380f2
BLAKE2b-256 597be4b38cf207284162f721ba7c209e4eddfeff1ba70f408d31532118b01e0e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page