-
Notifications
You must be signed in to change notification settings - Fork 2
Floppa Lua API
htmlcsjs edited this page Jun 9, 2022
·
7 revisions
This is the API for the discord related functions of the lua API
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.
-
get_user
-> a function that returns a user object from a user id. -
get_role
-> a function that returns a role object from a role id. -
send_message
-> a function that sends a message, whith a limit of 5.
This is a table that holds information about a message:
-
author
-> (optional) an user object representing the author of the messages -
id
-> the id of the message. -
channel
-> a channel object of the channel the message was sent in. -
contents
-> a string representing the content of the message. -
attachments
-> a list of the urls for any attachments. not present if there is no attachments. -
flags
-> a list of any flags the message has. a list of flags can be found here.
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.
-
rate_limit
-> the rate limit on the channel. doesn't affect some users + bots -
is_nsfw
-> if the channel is nsfw. -
not in currently due to lag issues.last_messages
-> return the latest 20 messages sent in the channel. -
last_message
-> the id of the last message sent. -
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.
-
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.
This is a table that holds information about a user
-
accent_colour
-> (optional) the hex code for an users accent colour. -
animated_avatar
-> bool showing if the user has an animated avatar. -
animated_banner
-> bool showing if the user has an animated banner. -
animated_guild_avatar
-> bool showing if the user has an animated guild avatar. -
avatar_url
-> the url to the users avatar. -
banner_url
-> (optional) the url for the users banner. -
bot
-> bool if the user is a bot or not. -
colour
-> (optional) the colour used to represent this user in the discord client. -
discriminator
-> the discriminator of the users discord tag. e.g. the1234
bit offloppa#1234
. -
display_name
-> the display name of the user. It is their nick if they have one, or their username. -
default_avatar_url
-> the url of the default avatar for this user. e.g this is mine. -
flags
-> a list with whatever flags the user has, like hypesquad houses. a full list can be found here. -
guild_avatar
-> (optional) the url to the users guild avatar. -
nick
-> (optional) the users nickname. -
roles
-> a list of role ids for any roles the user might have. -
tag
-> the users tag. e.g.floppa#1234
-
username
-> the users username. e.g.floppa
fromfloppa#1234
.
This is a table containing information about a role.
-
name
-> the name of the role. -
id
-> the id of the role. -
colour
-> the colour of the role. -
permissions
-> the permissions the role has. see here for more info. -
nitro_role
-> whether the role is the role given to nitro boosters. -
bot_id
-> (optional) the id of the bot that the role represents. -
integration_id
-> (optional) the id of the integration that the role represents. -
is_everyone
-> does the role represent everyone. -
is_separated
-> is this role separated on the user list. -
is_mentionable
-> can this role be mentioned.
If the input object is a string, it is used as the message contents for the message, However, if the object is a table, it must be formatted like this:
-
content
-> the contents of the message. -
file
-> a table to describe an attachment sent along.-
data
-> the data of the file, being a string or aBuffer
object. -
name
-> name of the file, falls back tounknown.txt
if it is invalid.
-
-
embed
-> a table describing an embed to be sent.-
author
-> either a string for the author's name, or a table-
name
-> name of the author. -
url
-> url of the author. -
icon_url
-> url to be shown as an icon for the author.
-
-
colour
-> colour at the side of the embed. -
description
-> string to be used as a description. -
image
-> url to an image to be shown. -
thumbnail
-> url to a thumbnail image. -
title
-> string to be used as the title. -
url
-> url of the embed (makes the title clickable). -
timestamp
-> int representing a uinux timestamp -
footer
-> either a string for the footer's body, or a table:-
body
-> body of the footer. -
icon_url
-> url to be shown as an icon for the footer.
-
-
fields
-> an array of field object for the fields of the embed:-
name
-> the field name. -
body
-> the body of the field. -
inline
-> optional bool for weather the field is inline or not.
-
-
stay