1.1.1 • Published 4 years ago

somewebhook v1.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

Some Webhook

Installation

npm install somewebhook

Usage

var { WebhooksClientManager } = require('somewebhook')

var Hooks = new WebhooksClientManager()

Hooks.createHookFromURL('https://discordapp.com/api/webhooks/ID/TOKEN')
Hooks.createHookFromURL('https://discordapp.com/api/webhooks/ID/TOKEN')
Hooks.createHookFromURL('https://discordapp.com/api/webhooks/ID/TOKEN')

Hooks.send('Hi !')

Create this : Image

API

(in dev)

Class

Webhooks WebhooksConsole extend Webhooks (Only use for error, warn and log in the script) WebhooksManager extend Webhooks WebhooksClientManager extend Webhooks

Functions of the class WebhooksClientManager

.changeAllHooks(hooks) => Change all hooks | hooks: (Hooks||Path)
.changeOneHook(hook) => Change one hook | hook: WebhookClient
.resetHooks() => Reset the WebhooksClientManager
.find(obj) => Return the first element | obj: (string||WebhooksID)
.webhookCreator(id, token, message?, options?) => Create a WebhookClient and stock it | id: WebhooksID, token: string, message: string?, options: object
.webhookDestructor(id, token)
.createHookFromURL(link, message?, options?)
.saveHooks(path?)
.addHooksFromGuild(guild)
.removeHooksFromGuild(guild)
.getHooksFromGuild(guild)
.addHooksFromTextChannel(channel)
.removeHooksFromChannel(channel)
.setPath(path)
.send(content, options?)
.delete(reason?)
.destroy()
.toString() is different

Properties of the class WebhooksClientManager

.getHooks
.getPath 
.client
.id
.options
.token
.url
.length
.toJSON
.createdTimestamp

Static function of Webhooks class

.formHookFromURL(link)
.getHooksFromTextChannel(channel)
.getHooksFromGuild(guild)

Typedef

WID => (string or number) - Simple id of the webhook

WebhooksID => {
  id : WID
} - Format of the Webhooks id

WebhookToken => {
  id : WID,
  token : string
} - Format of the Webhooks token

Path => (string) - Path in general

WebhooksHooks => {
  id : id,
  hooks : WebhookToken[]
} - Format of an Array of WebhookClient

Hooks => WebhookClient[] - Represent all webhooksClient
Webhooks => Webhook[] - Represent all webhooks

WebhooksToString => {
  path : Path,
  hooks : Hooks
} - Represent all hooks

Changelog

1.0.0 : Initialisation 1.0.1 : Little error on package.json 1.0.2 : Second big error on package.json 1.0.3 : AGAIN an error on package.json 1.0.4 : Upgraded the module somejson to 1.1.0 1.0.5 : Hooks.js to index.js 1.1.0 : Added Class => Webhooks, WebhooksManager; Rework statics class and place it in the class Webhooks; Upgrade discord.js to 12.2.0 1.1.1 : Little error on index.js

1.1.1

4 years ago

1.1.0

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago