Skip to content

Latest commit

 

History

History
92 lines (80 loc) · 2.37 KB

API.md

File metadata and controls

92 lines (80 loc) · 2.37 KB

yay

Fenixv5 API

Fenix uses websockets, and the current endpoint is wss://bloblet.com:3300.

All methods will accept an id parameter, which will be returned without changes. This is optional, but it's nicely useful to make sure you are handling the same request you made.

General Template

{
    'id': optional,
    'type': str,
    ...
}

Message related

sendMessage

{
    'type': 'sendMessage',
    'channelID': int, 
    'contents': str
}
  • If you dont have access to channelID, then a PermissionsError is raised.
  • If contents is over 1000 characters, then a ContentTooLong error is raised.

editMessage

{
    'type': 'editMessage',
    'messageID': int,
    'contents': str
}
  • If you aren't the owner of messageID, then a PermissionsError is raised.
  • If contents is over 1000 characters, then a ContentTooLong error is raised.

deleteMessage

{
    'type': 'deleteMessage',
    'messageID': int
}

addReaction

{
    'type': 'addReaction',
    'messageID': int,
    'reaction': str
}

removeReaction

{
    'type': 'removeReaction',
    'messageID': int,
    'reaction': int
}
  • reaction is the position of the emoji in the array of emojis
  • If you don't have the DeleteMessages permission, and you didn't send the message, a PermissionsError is raised.

Channel related

channelHistory

{
    'type': 'channelHistory',
    'channelID': int,
    'lastMessage': int
}
  • lastMessage is the last message you recieved in channelID
  • You will recive the most recent 50 (or less) new messages in channelID in array format.
  • If you can't read channelID or can't read its history, a PermissionsError is raised.