guilded.ts
Advanced tools
Comparing version 0.16.0 to 0.17.0
# guilded.ts | ||
## 0.17.0 | ||
### Minor Changes | ||
- 88420fe: feat: webhook `username` and `avatar_url` support | ||
### Patch Changes | ||
- Updated dependencies [88420fe] | ||
- Updated dependencies [cbcedfb] | ||
- Updated dependencies [837ebfc] | ||
- guilded-api-typings@0.12.0 | ||
- @guildedts/rest@0.13.0 | ||
- @guildedts/ws@0.5.0 | ||
- @guildedts/builders@0.2.8 | ||
## 0.16.0 | ||
@@ -4,0 +20,0 @@ |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Webhook = void 0; | ||
const node_fetch_1 = __importDefault(require("node-fetch")); | ||
const Base_1 = require("./Base"); | ||
@@ -106,12 +102,4 @@ /** | ||
*/ | ||
async send(payload) { | ||
await (0, node_fetch_1.default)(`https://media.guilded.gg/webhooks/${this.id}/${this.token}`, { | ||
method: 'POST', | ||
headers: { 'Content-Type': 'application/json' }, | ||
body: JSON.stringify(typeof payload === 'string' | ||
? { content: payload } | ||
: Array.isArray(payload) | ||
? { embeds: payload } | ||
: payload), | ||
}); | ||
send(payload) { | ||
return this.client.api.webhooks.send(this.id, this.token, payload); | ||
} | ||
@@ -118,0 +106,0 @@ /** |
{ | ||
"name": "guilded.ts", | ||
"version": "0.16.0", | ||
"version": "0.17.0", | ||
"description": "A powerful NPM module that allows you to easily interact with the Guilded API.", | ||
@@ -31,9 +31,7 @@ "repository": { | ||
"@guildedts/builders": "^0.2.8", | ||
"@guildedts/rest": "^0.12.0", | ||
"@guildedts/ws": "^0.4.4", | ||
"guilded-api-typings": "^0.11.0", | ||
"node-fetch": "^2.6.7" | ||
"@guildedts/rest": "^0.13.0", | ||
"@guildedts/ws": "^0.5.0", | ||
"guilded-api-typings": "^0.12.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node-fetch": "^2.6.2", | ||
"rimraf": "^3.0.2", | ||
@@ -40,0 +38,0 @@ "typescript": "^4.7.4" |
@@ -5,2 +5,4 @@ import { BaseManager, FetchManyOptions, FetchOptions } from '../BaseManager'; | ||
import { Collection } from '@discordjs/collection'; | ||
import { APIEmbed, APIWebhookMessagePayload } from 'guilded-api-typings'; | ||
import { Embed } from '@guildedts/builders'; | ||
/** | ||
@@ -56,2 +58,9 @@ * The manager of webhooks that belong to a channel. | ||
} | ||
/** The payload for creating a webhook message. */ | ||
export interface WebhookMessagePayload extends Omit<APIWebhookMessagePayload, 'embeds'> { | ||
/** The embeds of the message. */ | ||
embeds?: (Embed | APIEmbed)[]; | ||
} | ||
/** The resolvable payload for creating a webhook message. */ | ||
export declare type WebhookMessagePayloadResolvable = string | (Embed | APIEmbed)[] | WebhookMessagePayload; | ||
//# sourceMappingURL=ChannelWebhookManager.d.ts.map |
@@ -1,6 +0,6 @@ | ||
import { APIEmbed, APIWebhook } from 'guilded-api-typings'; | ||
import { Embed } from '@guildedts/builders'; | ||
import { APIWebhook } from 'guilded-api-typings'; | ||
import { Base } from './Base'; | ||
import { FetchOptions } from '../managers/BaseManager'; | ||
import { Channel } from './channel/Channel'; | ||
import { WebhookMessagePayloadResolvable } from '../managers/channel/ChannelWebhookManager'; | ||
/** | ||
@@ -71,6 +71,3 @@ * Represents a webhook on Guilded. | ||
*/ | ||
send(payload: string | (Embed | APIEmbed)[] | { | ||
content?: string; | ||
embeds?: (Embed | APIEmbed)[]; | ||
}): Promise<void>; | ||
send(payload: WebhookMessagePayloadResolvable): Promise<void>; | ||
/** | ||
@@ -77,0 +74,0 @@ * Edit the webhook. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
507626
5
2
7758
+ Added@guildedts/rest@0.13.0(transitive)
+ Added@guildedts/ws@0.5.0(transitive)
+ Addedguilded-api-typings@0.12.1(transitive)
- Removednode-fetch@^2.6.7
- Removed@guildedts/rest@0.12.0(transitive)
- Removed@guildedts/ws@0.4.4(transitive)
- Removedguilded-api-typings@0.11.0(transitive)
Updated@guildedts/rest@^0.13.0
Updated@guildedts/ws@^0.5.0
Updatedguilded-api-typings@^0.12.0