Skip to content

Floppa Lua API

htmlcsjs edited this page Apr 2, 2022 · 7 revisions

This is the API for the discord related functions of the lua API

Structure

This API is contained in the floppa package in lua. The root object contains:

  • msg -> a message object that contains the information of the message that invoked the command.
  • get_message -> a function that returns a message object from message id and a channel object. The channel object is optional and if it is not provided it defaults to the sender channel.
  • get_channel -> a function that returns a channel object from a channel id.

Message Object

This is a table that holds information about a message:

  • author -> the author of the messages id, if applicable.
  • id -> the id of the message.
  • channel -> the id of the channel the message was sent in.
  • content -> a string representing the content of the message.
  • attachment -> an array of the urls for any attachments. not present if there is no attachments.

Channel Object

This is a table that holds the information about a channel depending on the type of channel:

  • id -> the id of the channel.
  • type -> the type of channel.
  • mention -> the mention for the channel.

GUILD_TEXT channels

  • rate_limit -> the rate limit on the channel. doesn't affect some users + bots
  • is_nsfw -> if the channel is nsfw.
  • last_messages -> return the latest 20 messages sent in the channel.
  • topic -> the topic of the channel if it present.
  • category -> the category the channel is in if it is in one.
  • name -> name of the channel.

GUILD_VOICE channels

  • bitrate -> the bitrate the channel is set too.
  • user_limit -> the limit of users in the channel at once.
  • video_quality_mode -> the video quality mode that is imposed on the channel.
  • region -> the region the channel is set too.
  • topic -> the topic of the channel if it present.
  • category -> the category the channel is in if it is in one.
  • name -> name of the channel.

Clone this wiki locally