feat(Webhook): add ability to change channel and specify reason to edit (#3587)

* feat(Webhook): add ability to change channel and specify reason to edit

* fix(RESTMethods): update channelID of the webhook too
This commit is contained in:
SpaceEEC
2020-01-05 18:34:00 +01:00
committed by GitHub
parent d1d0d75d4a
commit fbe9bc499b
3 changed files with 58 additions and 14 deletions

9
typings/index.d.ts vendored
View File

@@ -1579,7 +1579,8 @@ declare module 'discord.js' {
public owner: User | object;
public token: string;
public delete(reason?: string): Promise<void>;
public edit(name: string, avatar: BufferResolvable): Promise<Webhook>;
public edit(name?: string, avatar?: BufferResolvable): Promise<Webhook>;
public edit(options?: WebhookEditOptions, reason?: string): Promise<Webhook>;
public send(content?: StringResolvable, options?: WebhookMessageOptions | RichEmbed | Attachment): Promise<Message | Message[]>;
public send(options?: WebhookMessageOptions | RichEmbed | Attachment): Promise<Message | Message[]>;
public sendCode(lang: string, content: StringResolvable, options?: WebhookMessageOptions): Promise<Message | Message[]>;
@@ -2201,6 +2202,12 @@ declare module 'discord.js' {
type VoiceStatus = number;
type WebhookEditOptions = {
name?: string;
avatar?: BufferResolvable;
channel?: ChannelResolvable;
};
type WebhookMessageOptions = {
username?: string;
avatarURL?: string;