npm.io
1.3.7-1 • Published 4 years ago

webhookmgr

Licence
ISC
Version
1.3.7-1
Deps
1
Size
4 kB
Vulns
1
Weekly
0

WebHook-Manager, create y gestiona tu propio webhook
  • Instalación: npm i webhookmgr
  • Ejemplos:

    Ejemplo 1:
    let { webhook: wh, sendWebhook: sw } = require("webhookmgr")
    /*
    message: message
    message.author.username: String
    message.author.displayAvatarURL(): (opcional) URL
    */
    new wh(message, message.author.username, message.author.displayAvatarURL()).then(async webhook => {
      /*
      "Hola": String
      webhook: webhook
      true: Boolean (autodelete webhook)
      */
      await sw(webhook, "Hola", true)
    })

    Ejemplo 2
    let whmgr = require("webhookmgr")
    /*
    message: message
    message.author.username: String
    message.author.displayAvatarURL(): (opcional) URL
    */
    new whmgr.webhook(message, message.author.username, message.author.displayAvatarURL()).then(async webhook => {
      /*
      "Hola": string
      webhook: webhook
      false: Boolean (autodelete webhook)
      */
      await whmgr.sendWebhook(webhook, "Hola", false)
    })
  • Clases:

    webhook(message, username, avatar)
    /*
    message: message
    username: String
    avatar: URL
    */
    new webhook(message, username, avatar)

    sendWebhook(webhook, message, true)
    /*
    webhook: Webhook
    message: MessageToSay<String>
    true: AutoDelete<Boolean>
    */
    await sendWebhook(webhook, message, true)

    fetchWebhookBy()
    // Via ID
    /*
    guild: Guild
    id: WebhookID<Integer>
    */
    await fetchWebhookBy(guild, {id: id})
    
    // Via Name
    /*
    guild: Guild
    name: WebhookName<String>
    */
    await fetchWebhookBy(guild, {name: name})
    
    // Via URL
    /*
    guild: Guild
    url: WebhookURL<Link>
    */
    await fetchWebhookBy(guild, {url: url})
    
    // Via token
    /*
    guild: Guild
    token: WebhookToken
    */
    await fetchWebhookBy(guild, {token: token})
  • Discord:
    require("webhookmgr").discord