Classes

Embed

Embed

new


General

Creates an embed.


Usage

Embed.new((array) data)
Returns: <Embed> embed


Example

local Embed = Okwo.class.Embed

Embed.new({
  	title = "A test embed",
  	description = "This is a test embed! Yay",
	fields = {
		{
        	name = "Test Field",
          	value = "Test Value :D"
        }
    },
  	footer = {
    	text = "Some text"
    }
})

Embed

setTitle


General

Sets the embed's title


Usage

Embed:setTitle(<string> title)
Returns: <Embed> embed


Example

Embed.new():setTitle("Wow! I've set a title! :D")

Embed

setDescription


General

Sets the embed's description.


Usage

Embed:setDescription(<string> description)
Returns: <Embed> embed


Example

Embed.new():setTitle("TITLE"):setDescription("This is a test description :O"):setFooter("FOOTER")

Embed

setUrl


General

Sets the embed's url


Usage

Embed:setUrl(<string> url)
Returns: <Embed> embed


Example

Embed.new():setTitle("TITLE CONTAINING A LINK TO THE WIKI"):setUrl("https://wiki.0q0.eu")

Embed

setColor


General

Sets the embed's barcode color. 


Usage

Embed:setColor(<string> color)
Returns: <Embed> embed


Example

Embed.new():setColor("#FF0000")

setColor.png

Embed

setAuthor


General

Sets the embed's author.


Usage

Embed:setAuthor(<string> author, (string) icon, (string) url)
Returns: <Embed> embed


Examples

Embed.new():setAuthor("OutlookG", "https://yt3.ggpht.com/-rAmMcvHYT34/AAAAAAAAAAI/AAAAAAAAATY/2UhMUKebEPY/s288-mo-c-c0xffffffff-rj-k-no/photo.jpg", "https://twitter.com/OutlookG_")

setAuthor.png

Embed

setTimestamp


General

Sets the embed's timestamp.


Embed:setTimestamp(<number> timestamp)
Returns: <Embed> embed

Timestamp should be given in miliseconds.


Examples

Embed.new():setTimestamp(tick() * 1000)

setTimestamp.png

Embed

addField


General

Adds a field to the embed.


Usage

Embed:addField(<string> name, <string> value, (boolean) inline)
Returns: <Embed> embed


Limitations

Embeds may not exceed 25 fields.

Embed names must not exceed 256 characters.

Embed field values may not exceed 1024 characters.


Examples

Embed.new():addField("Titles are awesome!", "No! Values are better!", true)

addField.png

Embed

setThumbnail


General

Sets the embed's thumbnail.


Usage

Embed:setThumbnail(<string> thumbnail)
Returns: <Embed> embed


Examples

Embed.new():setThumbnail("https://yt3.ggpht.com/-rAmMcvHYT34/AAAAAAAAAAI/AAAAAAAAATY/2UhMUKebEPY/s288-mo-c-c0xffffffff-rj-k-no/photo.jpg")

setThumbnail.png

Embed

setImage


General

Sets the embed's image.


Usage

Embed:setImage(<string> image)
Returns: <Embed> embed


Examples

Embed.new():setImage("https://yt3.ggpht.com/-rAmMcvHYT34/AAAAAAAAAAI/AAAAAAAAATY/2UhMUKebEPY/s288-mo-c-c0xffffffff-rj-k-no/photo.jpg")

setImage.png

Embed

setFooter


General


Usage

Embed:setFooter(<string> footer, (string) icon)
Returns: <Embed> embed


Examples

Embed.new():setFooter("This footer is amazing!")

setFooter.png

Embed

attachFile


General


Usage

Embed:attachFile(<string / Attachment> file)
Returns: <Embed> embed


Examples

Embed.new():setTitle("Okwo Logo! :D"):attachFile(Attachment.new('https://0q0.eu/img/okwo.png', 'OkwoLogo.png'))

Embed

attachFiles


General


Usage

Embed:attachFiles(<array> files)
Returns: <Embed> embed

See attachFile.

Doesn't work when using webhook.


Examples

Embed.new():setTitle("Few Okwo's Brandings! :D"):attachFiles({
	'https://0q0.eu/img/okwoteam.png',
	'https://0q0.eu/img/okwo.png',
    'https://0q0.eu/img/okwodev.png'
})

Attachment

Attachment

new


General

Creates an attachment.


Usage

Attachment.new(<string> file, (string) name)
Returns: <Attachment> attachment


Example

local Attachment = Okwo.class.Attachment

Attachment.new('https://0q0.eu/img/okwo.png', 'OkwoLogoSource.txt')

Attachment

attachment


General

Returns the attached file.


Usage

Attachment:attachment()
Returns: <string> file


Example

local myAttachment = Attachment.new('https://0q0.eu/img/okwo.png', 'OkwoLogoSource.txt')
print(myAttachment:attachment())

Attachment

name


General

Returns the attached file's name.


Usage

Attachment:name()
Returns: <string> name


Example

local myAttachment = Attachment.new('https://0q0.eu/img/okwo.png', 'OkwoLogoSource.txt')
print(myAttachment:name())

Attachment

setAttachment


General

Attaches a file into the attachment and names it.


Usage

Attachment:setAttachment(<string> file, (string) name)
Returns: <Attachment> attachment


Example

Attachment.new():setAttachment('https://0q0.eu/img/okwo.png', 'TestName.json')

Attachment

setFile


General

Attaches a file into the attachment.


Usage

Attachment:setFile(<string> file)
Returns: <Attachment> attachment


Example

Attachment.new():setFile('https://0q0.eu/img/okwoteam.png')

Attachment

setName


General

Sets the attachment's name.


Usage

Attachment:setName(<string> name)
Returns: <Attachment> attachment


Example

Attachment.new():setFile('https://0q0.eu/img/okwoteam.png'):setName('Hello_guys.html')

HttpEvent

HttpEvent

new


General

Creates an event connection.


Usage

HttpEvent.new(<string> url, <array> headers, <number> interval, <function> handler)
Returns: <HttpEvent> httpEvent

 

HttpEvent

connect


General

Connects a connection to the event.


Usage

HttpEvent:connect(<function> callback)
Returns: <Connection> connection

 

HttpEvent

execute


General

Executes the event.


Usage

HttpEvent:execute(<ANY> data...)
Returns: -

 

HttpEvent

stop


General

Stops the event.


Usage

HttpEvent:stop()
Returns: <HttpEvent> httpEvent

 

HttpEvent

run


General

Runs the event.


Usage

HttpEvent:run(<string> url, <array> headers, <number> interval)
Returns: <HttpEvent> httpEvent

 

SectorRequest

SectorRequest

new


General

Creates a sector request.


Usage

SectorRequest.new(<string> url, <array> headers, <Client> client, <ANY> data)
Returns: <SectorRequest> sectorRequest

 

SectorRequest

send


General

Sends the sector request.


Usage

SectorRequest:send(<ANY> data)
Returns: <string> id

 

SectorRequest

getResult


General

Retreives the sector request's result.


Usage

SectorRequest:getResult(<number> interval, <number> timeout)
Returns: <ANY> result