feat(Webhook): add type property and created* getters (#3585)

* feat(Webhook): add created* getters

* feat(Webhook): add type property

* typings(WebhookFields): use primitive string for url getter

Co-Authored-By: Gryffon Bellish <owenbellish@gmail.com>

* fix(Webhook): token can be null

Co-authored-by: Gryffon Bellish <owenbellish@gmail.com>
This commit is contained in:
SpaceEEC
2019-12-27 19:27:34 +01:00
committed by GitHub
parent fc27ce1a15
commit ea76a56639
3 changed files with 51 additions and 4 deletions

10
typings/index.d.ts vendored
View File

@@ -1636,11 +1636,13 @@ declare module 'discord.js' {
public guildID: Snowflake;
public name: string;
public owner: User | object | null;
public readonly url: string;
public token: string | null;
public type: WebhookTypes;
}
export class WebhookClient extends WebhookMixin(BaseClient) {
constructor(id: string, token: string, options?: ClientOptions);
public token: string;
}
export class WebSocketManager extends EventEmitter {
@@ -1909,7 +1911,9 @@ declare module 'discord.js' {
interface WebhookFields {
readonly client: Client;
id: Snowflake;
token: string;
readonly createdAt: Date;
readonly createdTimestamp: number;
readonly url: string;
delete(reason?: string): Promise<void>;
edit(options: WebhookEditData): Promise<Webhook>;
send(content?: StringResolvable, options?: WebhookMessageOptions & { split?: false } | MessageAdditions): Promise<Message>;
@@ -2654,6 +2658,8 @@ declare module 'discord.js' {
split?: boolean | SplitOptions;
}
type WebhookTypes = 'Incoming' | 'Channel Follower';
interface WebSocketOptions {
large_threshold?: number;
compress?: boolean;