Giter Site home page Giter Site logo

lua-mod-for-discord-webhook's Introduction

Lua Module for Discord webhook via Powershell

Documentation

-- Require module
webhookMod = require "webhookMod"
discord = webhookMod

discord.setURL("str") -- Initiate standart URL webhooks
discord.setAvatar("str") -- Initiate standart avatar

local embed = discord.createEmbed(<tableEmbed>) -- Initiate and assign return <tableEmbed> to embed
<tableEmbed>{
    title = "str",
    description = "str",
    color = int,
    timestamp = discord.timestamp(int) -- Initiate and assign return value from discord timestamp

    -- Assosiated Method for embed
    embed.setImage("link") -- Initiate image link
    embed.setThumbnail("link") -- Initiate thumbnail link
    embed.setFooter(<tableFooter>) -- Initiate data for footer
    embed.setAuthor(<tableAuthor>) -- Initiate data for Author
    embed.addFields(<tableFields>) -- Initiate data for fields

    <tableFooter>{
        text = "str",
        icon_url = "str"
    }

    <tableAuthor>{
        name = "str",
        icon_url = "link",
        url = "link"
    }

    <tableFields>{
        {name = "str1", value = "str1", inline = true},
        {name = "str2", value = "str2", inline = false}
    }
}

local payload = discord.createBody(<tableBody>) -- Initiate and assign return <tableBody> to payload
<tableBody>{
    username = "str",
    content = "str",
    embed = embed
}

discord.send([url][, payload][, method<bool>]) -- Example discord.send("webhookURL/messages_id", payload, true)
    -- method = true => send method Patch
    or
discord.send("messages") -- Or sent via standard discord webhook link

TODO

  • add compatible for file attachment

lua-mod-for-discord-webhook's People

Contributors

marinesx avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.