aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord.js
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-31 13:46:27 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2021-07-31 13:46:27 -0400
commitedcc0dd0a9228192ff6c4f6d6797dd6238e98f92 (patch)
tree70c3f5436342d7f6b0e81222467d2773a3bb0b33 /src/lib/extensions/discord.js
parentb63a6b0cb61f0abf8a946a7f0f04a2a19a31e690 (diff)
downloadtanzanite-edcc0dd0a9228192ff6c4f6d6797dd6238e98f92.tar.gz
tanzanite-edcc0dd0a9228192ff6c4f6d6797dd6238e98f92.tar.bz2
tanzanite-edcc0dd0a9228192ff6c4f6d6797dd6238e98f92.zip
upgraded to typescript 4.3.5
The reason I had to use getters and setters for the db models is because in the newer version of typescript the properties would be defined at runtime and override the getter and setters that sequalize uses later, causing all the values to be undefined and not being able to save any information.
Diffstat (limited to 'src/lib/extensions/discord.js')
-rw-r--r--src/lib/extensions/discord.js/BushBaseGuildEmojiManager.d.ts9
-rw-r--r--src/lib/extensions/discord.js/BushChannel.d.ts23
-rw-r--r--src/lib/extensions/discord.js/BushChannelManager.d.ts9
-rw-r--r--src/lib/extensions/discord.js/BushClientUser.d.ts23
-rw-r--r--src/lib/extensions/discord.js/BushGuild.ts8
-rw-r--r--src/lib/extensions/discord.js/BushGuildManager.d.ts20
-rw-r--r--src/lib/extensions/discord.js/BushGuildMemberManager.d.ts15
-rw-r--r--src/lib/extensions/discord.js/BushMessage.ts2
-rw-r--r--src/lib/extensions/discord.js/BushUserManager.d.ts9
9 files changed, 109 insertions, 9 deletions
diff --git a/src/lib/extensions/discord.js/BushBaseGuildEmojiManager.d.ts b/src/lib/extensions/discord.js/BushBaseGuildEmojiManager.d.ts
new file mode 100644
index 0000000..165ea6e
--- /dev/null
+++ b/src/lib/extensions/discord.js/BushBaseGuildEmojiManager.d.ts
@@ -0,0 +1,9 @@
+import { Snowflake } from 'discord-api-types';
+import { CachedManager } from 'discord.js';
+import { BushClient, BushEmojiIdentifierResolvable, BushEmojiResolvable } from '../discord-akairo/BushClient';
+import { BushGuildEmoji } from './BushGuildEmoji';
+
+export class BushBaseGuildEmojiManager extends CachedManager<Snowflake, BushGuildEmoji, BushEmojiResolvable> {
+ public constructor(client: BushClient, iterable?: Iterable<unknown>);
+ public resolveIdentifier(emoji: BushEmojiIdentifierResolvable): string | null;
+}
diff --git a/src/lib/extensions/discord.js/BushChannel.d.ts b/src/lib/extensions/discord.js/BushChannel.d.ts
new file mode 100644
index 0000000..482dd9b
--- /dev/null
+++ b/src/lib/extensions/discord.js/BushChannel.d.ts
@@ -0,0 +1,23 @@
+import { Snowflake } from 'discord-api-types';
+import { Channel, ChannelMention } from 'discord.js';
+import { ChannelTypes } from 'discord.js/typings/enums';
+import { BushClient } from '../discord-akairo/BushClient';
+import { BushDMChannel } from './BushDMChannel';
+import { BushNewsChannel } from './BushNewsChannel';
+import { BushTextChannel } from './BushTextChannel';
+import { BushThreadChannel } from './BushThreadChannel';
+
+export class BushChannel extends Channel {
+ public constructor(client: BushClient, data?: unknown, immediatePatch?: boolean);
+ public readonly createdAt: Date;
+ public readonly createdTimestamp: number;
+ public deleted: boolean;
+ public id: Snowflake;
+ public readonly partial: false;
+ public type: keyof typeof ChannelTypes;
+ public delete(): Promise<BushChannel>;
+ public fetch(force?: boolean): Promise<BushChannel>;
+ public isText(): this is BushTextChannel | BushDMChannel | BushNewsChannel | BushThreadChannel;
+ public isThread(): this is BushThreadChannel;
+ public toString(): ChannelMention;
+}
diff --git a/src/lib/extensions/discord.js/BushChannelManager.d.ts b/src/lib/extensions/discord.js/BushChannelManager.d.ts
new file mode 100644
index 0000000..1aa19c5
--- /dev/null
+++ b/src/lib/extensions/discord.js/BushChannelManager.d.ts
@@ -0,0 +1,9 @@
+import { Snowflake } from 'discord-api-types';
+import { CachedManager, Client, FetchChannelOptions } from 'discord.js';
+import { BushChannelResolvable } from '../discord-akairo/BushClient';
+import { BushChannel } from './BushChannel';
+
+export class BushChannelManager extends CachedManager<Snowflake, BushChannel, BushChannelResolvable> {
+ public constructor(client: Client, iterable: Iterable<unknown>);
+ public fetch(id: Snowflake, options?: FetchChannelOptions): Promise<BushChannel | null>;
+}
diff --git a/src/lib/extensions/discord.js/BushClientUser.d.ts b/src/lib/extensions/discord.js/BushClientUser.d.ts
new file mode 100644
index 0000000..119f8ce
--- /dev/null
+++ b/src/lib/extensions/discord.js/BushClientUser.d.ts
@@ -0,0 +1,23 @@
+import {
+ ActivityOptions,
+ Base64Resolvable,
+ BufferResolvable,
+ ClientUserEditData,
+ Presence,
+ PresenceData,
+ PresenceStatusData
+} from 'discord.js';
+import { BushUser } from './BushUser';
+
+export class BushClientUser extends BushUser {
+ public mfaEnabled: boolean;
+ public verified: boolean;
+ public edit(data: ClientUserEditData): Promise<this>;
+ public setActivity(options?: ActivityOptions): Presence;
+ public setActivity(name: string, options?: ActivityOptions): Presence;
+ public setAFK(afk: boolean, shardId?: number | number[]): Presence;
+ public setAvatar(avatar: BufferResolvable | Base64Resolvable): Promise<this>;
+ public setPresence(data: PresenceData): Presence;
+ public setStatus(status: PresenceStatusData, shardId?: number | number[]): Presence;
+ public setUsername(username: string): Promise<this>;
+}
diff --git a/src/lib/extensions/discord.js/BushGuild.ts b/src/lib/extensions/discord.js/BushGuild.ts
index dd41dad..acfe5da 100644
--- a/src/lib/extensions/discord.js/BushGuild.ts
+++ b/src/lib/extensions/discord.js/BushGuild.ts
@@ -1,8 +1,10 @@
-import { Guild, User } from 'discord.js';
-import { BushGuildMember, ModLogType } from '../..';
+import { Guild } from 'discord.js';
import { Guild as GuildDB, GuildModel } from '../../models/Guild';
+import { ModLogType } from '../../models/ModLog';
import { BushClient, BushUserResolvable } from '../discord-akairo/BushClient';
+import { BushGuildMember } from './BushGuildMember';
import { BushGuildMemberManager } from './BushGuildMemberManager';
+import { BushUser } from './BushUser';
export class BushGuild extends Guild {
public declare readonly client: BushClient;
@@ -27,7 +29,7 @@ export class BushGuild extends Guild {
}
public async unban(options: {
- user: BushUserResolvable | User;
+ user: BushUserResolvable | BushUser;
reason?: string;
moderator?: BushUserResolvable;
}): Promise<
diff --git a/src/lib/extensions/discord.js/BushGuildManager.d.ts b/src/lib/extensions/discord.js/BushGuildManager.d.ts
new file mode 100644
index 0000000..5bfe706
--- /dev/null
+++ b/src/lib/extensions/discord.js/BushGuildManager.d.ts
@@ -0,0 +1,20 @@
+import { Snowflake } from 'discord-api-types';
+import {
+ CachedManager,
+ Collection,
+ FetchGuildOptions,
+ FetchGuildsOptions,
+ Guild,
+ GuildCreateOptions,
+ OAuth2Guild
+} from 'discord.js';
+import { BushClient } from '../discord-akairo/BushClient';
+import { BushGuildResolvable } from './BushCommandInteraction';
+import { BushGuild } from './BushGuild';
+
+export class BushGuildManager extends CachedManager<Snowflake, BushGuild, BushGuildResolvable> {
+ public constructor(client: BushClient, iterable?: Iterable<unknown>);
+ public create(name: string, options?: GuildCreateOptions): Promise<Guild>;
+ public fetch(options: Snowflake | FetchGuildOptions): Promise<BushGuild>;
+ public fetch(options?: FetchGuildsOptions): Promise<Collection<Snowflake, OAuth2Guild>>;
+}
diff --git a/src/lib/extensions/discord.js/BushGuildMemberManager.d.ts b/src/lib/extensions/discord.js/BushGuildMemberManager.d.ts
index 96b99e5..7bdad83 100644
--- a/src/lib/extensions/discord.js/BushGuildMemberManager.d.ts
+++ b/src/lib/extensions/discord.js/BushGuildMemberManager.d.ts
@@ -1,5 +1,6 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import {
+ AddGuildMemberOptions,
BanOptions,
CachedManager,
Collection,
@@ -10,8 +11,7 @@ import {
GuildPruneMembersOptions,
GuildSearchMembersOptions,
Snowflake,
- User,
- UserResolvable
+ User
} from 'discord.js';
import { BushClient, BushGuildMemberResolvable, BushUserResolvable } from '../discord-akairo/BushClient';
import { BushGuild } from './BushGuild';
@@ -21,15 +21,20 @@ export class BushGuildMemberManager extends CachedManager<Snowflake, BushGuildMe
public constructor(guild: BushGuild, iterable?: Iterable<unknown>);
public declare readonly client: BushClient;
public guild: BushGuild;
+ public add(
+ user: BushUserResolvable,
+ options: AddGuildMemberOptions & { fetchWhenExisting: false }
+ ): Promise<GuildMember | null>;
+ public add(user: BushUserResolvable, options: AddGuildMemberOptions): Promise<GuildMember>;
public ban(user: BushUserResolvable, options?: BanOptions): Promise<GuildMember | User | Snowflake>;
public edit(user: BushUserResolvable, data: GuildMemberEditData, reason?: string): Promise<void>;
public fetch(
- options: UserResolvable | FetchMemberOptions | (FetchMembersOptions & { user: UserResolvable })
+ options: BushUserResolvable | FetchMemberOptions | (FetchMembersOptions & { user: BushUserResolvable })
): Promise<GuildMember>;
public fetch(options?: FetchMembersOptions): Promise<Collection<Snowflake, GuildMember>>;
- public kick(user: UserResolvable, reason?: string): Promise<BushGuildMember | User | Snowflake>;
+ public kick(user: BushUserResolvable, reason?: string): Promise<BushGuildMember | User | Snowflake>;
public prune(options: GuildPruneMembersOptions & { dry?: false; count: false }): Promise<null>;
public prune(options?: GuildPruneMembersOptions): Promise<number>;
public search(options: GuildSearchMembersOptions): Promise<Collection<Snowflake, GuildMember>>;
- public unban(user: UserResolvable, reason?: string): Promise<User>;
+ public unban(user: BushUserResolvable, reason?: string): Promise<User>;
}
diff --git a/src/lib/extensions/discord.js/BushMessage.ts b/src/lib/extensions/discord.js/BushMessage.ts
index 7971a6d..5638801 100644
--- a/src/lib/extensions/discord.js/BushMessage.ts
+++ b/src/lib/extensions/discord.js/BushMessage.ts
@@ -26,7 +26,7 @@ export class BushMessage extends Message {
super(client, data, channel);
// this.util = new BushCommandUtil(client.commandHandler, this);
}
- public fetch(force?: boolean): Promise<BushMessage> {
+ public override fetch(force?: boolean): Promise<BushMessage> {
return super.fetch(force) as Promise<BushMessage>;
}
}
diff --git a/src/lib/extensions/discord.js/BushUserManager.d.ts b/src/lib/extensions/discord.js/BushUserManager.d.ts
new file mode 100644
index 0000000..176b449
--- /dev/null
+++ b/src/lib/extensions/discord.js/BushUserManager.d.ts
@@ -0,0 +1,9 @@
+import { Snowflake } from 'discord-api-types';
+import { BaseFetchOptions, CachedManager } from 'discord.js';
+import { BushClient, BushUserResolvable } from '../discord-akairo/BushClient';
+import { BushUser } from './BushUser';
+
+export class BushUserManager extends CachedManager<Snowflake, BushUser, BushUserResolvable> {
+ public constructor(client: BushClient, iterable?: Iterable<unknown>);
+ public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<BushUser>;
+}