From 9c740d20c394af38f3ddeeea924bd7b94c79f63e Mon Sep 17 00:00:00 2001 From: Norberto A Date: Mon, 2 Nov 2020 13:41:50 +0000 Subject: [PATCH] Added documentation --- src/Classes/Message.lua | 8 ++++++++ src/Classes/RichEmbed.lua | 18 ++++++++++++++++++ src/RoHook.lua | 12 ++++++++++++ 3 files changed, 38 insertions(+) diff --git a/src/Classes/Message.lua b/src/Classes/Message.lua index c961867..f1e6a57 100644 --- a/src/Classes/Message.lua +++ b/src/Classes/Message.lua @@ -1,3 +1,11 @@ +-- Norbunny +-- November 1, 2020 + +--[[ + Message.new(content: string) - Creates a new message + Message.addEmbed(embed: RichEmbed) - Attaches a RichEmbed to the message +]] + local Message = {} Message.ClassName = "Message" Message.__index = Message diff --git a/src/Classes/RichEmbed.lua b/src/Classes/RichEmbed.lua index 5a89046..49481fd 100644 --- a/src/Classes/RichEmbed.lua +++ b/src/Classes/RichEmbed.lua @@ -1,3 +1,21 @@ +--[[ + RichEmbed.new(title: string, description: string) - Creates a new RichEmbed + + RichEmbed:setTimestamp() - Sets the RichEmbed's timestamp + + RichEmbed:setColor(color: RGB) - Sets the RichEmbed's color + + RichEmbed:setFooter(text: string, iconUrl: string) - Sets the RichEmbed footer's text & icon + + RichEmbed:setImage(url: string, height: int, width: int) - Sets the RichEmbed's image & its resolution + + RichEmbed:setThumbnail(url: string, height: int, width: int) - Sets the RichEmbed's thumbnail & its resolution + + RichEmbed:setAuthor(name: string, url: string, iconUrl: string) - Sets the RichEmbed's author name, url & icon + + RichEmbed:addField(name: string, value: string, inline: boolean) - Adds a field to the RichEmbed with the arguments passed +]] + local RichEmbed = {} RichEmbed.ClassName = "RichEmbed" RichEmbed.__index = RichEmbed diff --git a/src/RoHook.lua b/src/RoHook.lua index ce8c5e2..55fab92 100644 --- a/src/RoHook.lua +++ b/src/RoHook.lua @@ -1,6 +1,18 @@ -- Norbunny -- November 1, 2020 +--[[ + RoHook.new(url: string, username: string, avatar: string) - Creates a new RoHook instance + + RoHook:setUsername(username: string) - Sets the webhook's username + + RoHook:setAvatar(url: string) - Sets the webhook's avatar + + RoHook:send(data: RichEmbed) - Sends a RichEmbed + + RoHook:send(data: Message) - Sends a Message +]] + local httpService = game:GetService("HttpService") local RoHook = {}