{"id":19302801,"url":"https://github.com/kisakay/guilded-webhook-node","last_synced_at":"2025-02-24T01:44:22.501Z","repository":{"id":102344798,"uuid":"609169779","full_name":"Kisakay/guilded-webhook-node","owner":"Kisakay","description":"This package is based on discord-webhook-node, ported on Guilded's API","archived":false,"fork":false,"pushed_at":"2023-03-03T16:26:44.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-29T09:43:04.256Z","etag":null,"topics":["guilded","webhook"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/guilded-webhook-node","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kisakay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-03T14:22:50.000Z","updated_at":"2024-07-29T21:39:34.949Z","dependencies_parsed_at":"2023-05-29T19:30:31.827Z","dependency_job_id":null,"html_url":"https://github.com/Kisakay/guilded-webhook-node","commit_stats":null,"previous_names":["peacefultrees/guilded-webhook-node"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kisakay%2Fguilded-webhook-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kisakay%2Fguilded-webhook-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kisakay%2Fguilded-webhook-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kisakay%2Fguilded-webhook-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kisakay","download_url":"https://codeload.github.com/Kisakay/guilded-webhook-node/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240404681,"owners_count":19796062,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["guilded","webhook"],"created_at":"2024-11-09T23:23:50.463Z","updated_at":"2025-02-24T01:44:22.471Z","avatar_url":"https://github.com/Kisakay.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Guilded Webhook Sender \n![version](https://img.shields.io/npm/v/guilded-webhook-node \"Version\")\n\n- [Installation](#installation)\n- [Examples](#examples)\n    - [Basic use](#basic-use)\n    - [Custom embeds](#custom-embeds)\n    - [Preset messages](#preset-messages)\n    - [Custom settings](#custom-settings)\n- [Notes](#notes)\n- [API](#api)\n    - [Webhook](#webhook---class)\n    - [MessageBuilder](#messagebuilder---class)\n- [License](#license)\n\n# Origin\nThe original source code is from here :\nwww.npmjs.com/package/discord-webhook-node\n\nThis modules is just \"Discord Webhook Node\" for Guilded version.\n\n# Installation\n```npm install guilded-webhook-node```\n\n# Examples\n\n## Basic use\n```js\nconst { Webhook } = require('guilded-webhook-node');\nconst hook = new Webhook(\"YOUR WEBHOOK URL\");\n\nconst IMAGE_URL = 'https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Unofficial_JavaScript_logo_2.svg/1200px-Unofficial_JavaScript_logo_2.svg.png';\nhook.setUsername('Guilded Webhook Name');\nhook.setAvatar(IMAGE_URL);\n\nhook.send(\"Hello world!\");\n```\n\n## Custom embeds\n```js\nconst { Webhook, MessageBuilder } = require('guilded-webhook-node');\nconst hook = new Webhook(\"YOUR WEBHOOK URL\");\n\nconst embed = new MessageBuilder()\n.setTitle('My title here')\n.setAuthor('Author here', 'https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Unofficial_JavaScript_logo_2.svg/1200px-Unofficial_JavaScript_logo_2.svg.png', 'https://www.google.com')\n.setURL('https://www.google.com')\n.addField('First field', 'this is inline', true)\n.addField('Second field', 'this is not inline')\n.setColor('#00b0f4')\n.setThumbnail('https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Unofficial_JavaScript_logo_2.svg/1200px-Unofficial_JavaScript_logo_2.svg.png')\n.setDescription('Oh look a description :)')\n.setImage('https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Unofficial_JavaScript_logo_2.svg/1200px-Unofficial_JavaScript_logo_2.svg.png')\n.setFooter('Hey its a footer', 'https://upload.wikimedia.org/wikipedia/commons/thumb/9/99/Unofficial_JavaScript_logo_2.svg/1200px-Unofficial_JavaScript_logo_2.svg.png')\n.setTimestamp();\n\nhook.send(embed);\n```\n\nKeep in mind that the custom embed method `setColor` takes in a decimal color/a hex color (pure black and white hex colors will be innacurate). You can convert hex colors to decimal using this website here: [https://convertingcolors.com](https://convertingcolors.com)\n\n## Preset messages\n```js\nconst { Webhook } = require('guilded-webhook-node');\nconst hook = new Webhook('YOUR WEBHOOK URL');\n\n//Sends an information message\nhook.info('**Information hook**', 'Information field title here', 'Information field value here');\n\n//Sends a success message\nhook.success('**Success hook**', 'Success field title here', 'Success field value here');\n\n//Sends an warning message\nhook.warning('**Warning hook**', 'Warning field title here', 'Warning field value here');\n\n//Sends an error message\nhook.error('**Error hook**', 'Error field title here', 'Error field value here');\n```\n\n## Custom settings\n```js\nconst { Webhook } = require('guilded-webhook-node');\nconst hook = new Webhook({\n    url: \"YOUR WEBHOOK URL\",\n    //If throwErrors is set to false, no errors will be thrown if there is an error sending\n    throwErrors: false,\n    //retryOnLimit gives you the option to not attempt to send the message again if rate limited\n    retryOnLimit: false\n});\n\nhook.setUsername('Username'); //Overrides the default webhook username\nhook.setAvatar('YOUR_AVATAR_URL'); //Overrides the default webhook avatar\n```\n\n# Notes\nguilded-webhook-node is a promise based library, which means you can use `.catch`, `.then`, and `await`, although if successful will not return any values. For example:\n\n```js\nconst { Webhook } = require('guilded-webhook-node');\nconst hook = new Webhook(\"YOUR WEBHOOK URL\");\n\nhook.send(\"Hello there!\")\n.then(() =\u003e console.log('Sent webhook successfully!'))\n.catch(err =\u003e console.log(err.message));\n```\n\nor using async:\n```js\nconst { Webhook } = require('guilded-webhook-node');\nconst hook = new Webhook(\"YOUR WEBHOOK URL\");\n\n(async () =\u003e {\n    try {\n        await hook.send('Hello there!');\n        console.log('Successfully sent webhook!');\n    }\n    catch(e){\n        console.log(e.message);\n    };\n})();\n```\n\nBy default, it will handle guilded's rate limiting, and if there is an error sending the message (other than rate limiting), an error will be thrown. You can change these options with the custom settings options below.\n\n# API\n## Webhook - class\nConstructor\n- options (optional) : object\n    - throwErrors (optional) : boolean\n    - retryOnLimit (optional) : boolean\n\nMethods\n- setUsername(username : string) returns this\n- setAvatar(avatarURL : string (image url)) returns this\n- async send(payload : string/MessageBuilder)\n- async info(title : string, fieldName (optional) : string, fieldValue (optional) : string, inline (optional) : boolean)\n- async success(title : string, fieldName (optional) : string, fieldValue (optional) : string, inline (optional) : boolean)\n- async warning(title : string, fieldName (optional) : string, fieldValue (optional) : string, inline (optional) : boolean)\n- async error(title : string, fieldName (optional) : string, fieldValue (optional) : string, inline (optional) : boolean)\n- \n## MessageBuilder - class\nMethods\n- setText(text: string)\n- setAuthor(author: string (text), authorImage (optional) : string (image url), authorUrl (optional) : string (link))\n- setTitle(title: string)\n- setURL(url: string)\n- setThumbnail(thumbnail : string (image url))\n- setImage(image : string (image url))\n- setTimestamp(date (optional) number/date object)\n- setColor(color : string/number (hex or decimal color))\n- setDescription(description : string)\n- addField(fieldName : string, fieldValue: string, inline (optional) : boolean)\n- setFooter(footer : string, footerImage (optional) : string (image url))\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkisakay%2Fguilded-webhook-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkisakay%2Fguilded-webhook-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkisakay%2Fguilded-webhook-node/lists"}