diff --git a/src/gateway/handlers/channelUpdate.ts b/src/gateway/handlers/channelUpdate.ts index d6e633a..b19e99b 100644 --- a/src/gateway/handlers/channelUpdate.ts +++ b/src/gateway/handlers/channelUpdate.ts @@ -1,5 +1,5 @@ import { Channel } from '../../structures/channel.ts' -import { Guild } from "../../structures/guild.ts" +import { Guild } from '../../structures/guild.ts' import { ChannelPayload, GuildChannelPayload } from '../../types/channel.ts' import getChannelByType from '../../utils/getChannelByType.ts' import { Gateway, GatewayEventHandler } from '../index.ts' diff --git a/src/gateway/handlers/guildCreate.ts b/src/gateway/handlers/guildCreate.ts index a3aebfd..f35a047 100644 --- a/src/gateway/handlers/guildCreate.ts +++ b/src/gateway/handlers/guildCreate.ts @@ -1,10 +1,10 @@ import { Gateway, GatewayEventHandler } from '../index.ts' import { Guild } from '../../structures/guild.ts' -import { GuildPayload, MemberPayload } from "../../types/guild.ts" -import { MembersManager } from "../../managers/members.ts" -import { GuildChannelPayload } from "../../types/channel.ts" -import { RolePayload } from "../../types/role.ts" -import { RolesManager } from "../../managers/roles.ts" +import { GuildPayload, MemberPayload } from '../../types/guild.ts' +import { MembersManager } from '../../managers/members.ts' +import { GuildChannelPayload } from '../../types/channel.ts' +import { RolePayload } from '../../types/role.ts' +import { RolesManager } from '../../managers/roles.ts' export const guildCreate: GatewayEventHandler = async(gateway: Gateway, d: GuildPayload) => { let guild: Guild | undefined = await gateway.client.guilds.get(d.id) diff --git a/src/gateway/handlers/index.ts b/src/gateway/handlers/index.ts index 00527f4..0501dd5 100644 --- a/src/gateway/handlers/index.ts +++ b/src/gateway/handlers/index.ts @@ -10,8 +10,8 @@ import { guildUpdate } from './guildUpdate.ts' import { guildBanAdd } from './guildBanAdd.ts' import { ready } from './ready.ts' import { guildBanRemove } from './guildBanRemove.ts' -import { messageCreate } from "./messageCreate.ts" -import { resume } from "./resume.ts" +import { messageCreate } from './messageCreate.ts' +import { resume } from './resume.ts' import { reconnect } from './reconnect.ts' export const gatewayHandlers: { diff --git a/src/gateway/handlers/messageCreate.ts b/src/gateway/handlers/messageCreate.ts index 983ba3c..3f43aa5 100644 --- a/src/gateway/handlers/messageCreate.ts +++ b/src/gateway/handlers/messageCreate.ts @@ -31,9 +31,9 @@ export const messageCreate: GatewayEventHandler = async ( message.member = member if (guild !== undefined) message.guild = guild if (message.member !== undefined) { - if(message.member.user === undefined) { + if (message.member.user === undefined) { const user = await gateway.client.users.get(message.member.id) - if(user !== undefined) { + if (user !== undefined) { message.member.user = user } } diff --git a/src/gateway/handlers/reconnect.ts b/src/gateway/handlers/reconnect.ts index db3d070..1dbcbf6 100644 --- a/src/gateway/handlers/reconnect.ts +++ b/src/gateway/handlers/reconnect.ts @@ -1,4 +1,4 @@ -import { Gateway , GatewayEventHandler } from "../index.ts" +import { Gateway , GatewayEventHandler } from '../index.ts' export const reconnect: GatewayEventHandler = async (gateway: Gateway, d: any) => { gateway.reconnect() diff --git a/src/gateway/handlers/resume.ts b/src/gateway/handlers/resume.ts index 4fe58f1..4b2c7c9 100644 --- a/src/gateway/handlers/resume.ts +++ b/src/gateway/handlers/resume.ts @@ -1,5 +1,5 @@ -import { User } from "../../structures/user.ts" -import { CLIENT_USER } from "../../types/endpoint.ts" +import { User } from '../../structures/user.ts' +import { CLIENT_USER } from '../../types/endpoint.ts' import { Gateway, GatewayEventHandler } from '../index.ts' export const resume: GatewayEventHandler = async (gateway: Gateway, d: any) => { diff --git a/src/gateway/index.ts b/src/gateway/index.ts index 483eb11..005d5b4 100644 --- a/src/gateway/index.ts +++ b/src/gateway/index.ts @@ -12,8 +12,8 @@ import { } from '../types/gateway.ts' import { gatewayHandlers } from './handlers/index.ts' import { GATEWAY_BOT } from '../types/endpoint.ts' -import { GatewayCache } from "../managers/gatewayCache.ts" -import { ClientActivityPayload } from "../structures/presence.ts" +import { GatewayCache } from '../managers/gatewayCache.ts' +import { ClientActivityPayload } from '../structures/presence.ts' /** * Handles Discord gateway connection. diff --git a/src/managers/base.ts b/src/managers/base.ts index 8f8de74..2531d4d 100644 --- a/src/managers/base.ts +++ b/src/managers/base.ts @@ -1,5 +1,5 @@ -import { Client } from "../models/client.ts"; -import { Collection } from "../utils/collection.ts"; +import { Client } from '../models/client.ts' +import { Collection } from '../utils/collection.ts' export class BaseManager { client: Client diff --git a/src/managers/baseChild.ts b/src/managers/baseChild.ts index ae4a973..1f43d42 100644 --- a/src/managers/baseChild.ts +++ b/src/managers/baseChild.ts @@ -1,6 +1,6 @@ -import { Client } from "../models/client.ts"; -import { Collection } from "../utils/collection.ts"; -import { BaseManager } from "./base.ts"; +import { Client } from '../models/client.ts' +import { Collection } from '../utils/collection.ts' +import { BaseManager } from './base.ts' export class BaseChildManager { client: Client diff --git a/src/managers/channels.ts b/src/managers/channels.ts index a8a3261..c61be56 100644 --- a/src/managers/channels.ts +++ b/src/managers/channels.ts @@ -1,9 +1,9 @@ -import { Client } from "../models/client.ts"; -import { Channel } from "../structures/channel.ts"; -import { ChannelPayload } from "../types/channel.ts"; -import { CHANNEL } from "../types/endpoint.ts"; -import getChannelByType from "../utils/getChannelByType.ts"; -import { BaseManager } from "./base.ts"; +import { Client } from '../models/client.ts' +import { Channel } from '../structures/channel.ts' +import { ChannelPayload } from '../types/channel.ts' +import { CHANNEL } from '../types/endpoint.ts' +import getChannelByType from '../utils/getChannelByType.ts' +import { BaseManager } from './base.ts' export class ChannelsManager extends BaseManager { constructor(client: Client) { diff --git a/src/managers/guildChannels.ts b/src/managers/guildChannels.ts index 281379f..e596733 100644 --- a/src/managers/guildChannels.ts +++ b/src/managers/guildChannels.ts @@ -1,13 +1,13 @@ -import { Client } from "../models/client.ts"; -import { Channel } from "../structures/channel.ts"; -import { Guild } from "../structures/guild.ts"; -import { CategoryChannel } from "../structures/guildCategoryChannel.ts"; -import { GuildTextChannel } from "../structures/guildTextChannel.ts"; -import { VoiceChannel } from "../structures/guildVoiceChannel.ts"; -import { GuildChannelCategoryPayload, GuildTextChannelPayload, GuildVoiceChannelPayload } from "../types/channel.ts"; -import { CHANNEL } from "../types/endpoint.ts"; -import { BaseChildManager } from "./baseChild.ts"; -import { ChannelsManager } from "./channels.ts"; +import { Client } from '../models/client.ts' +import { Channel } from '../structures/channel.ts' +import { Guild } from '../structures/guild.ts' +import { CategoryChannel } from '../structures/guildCategoryChannel.ts' +import { GuildTextChannel } from '../structures/guildTextChannel.ts' +import { VoiceChannel } from '../structures/guildVoiceChannel.ts' +import { GuildChannelCategoryPayload, GuildTextChannelPayload, GuildVoiceChannelPayload } from '../types/channel.ts' +import { CHANNEL } from '../types/endpoint.ts' +import { BaseChildManager } from './baseChild.ts' +import { ChannelsManager } from './channels.ts' export type GuildChannelPayloads = GuildTextChannelPayload | GuildVoiceChannelPayload | GuildChannelCategoryPayload export type GuildChannel = GuildTextChannel | VoiceChannel | CategoryChannel diff --git a/src/managers/guilds.ts b/src/managers/guilds.ts index ac298e1..a53b605 100644 --- a/src/managers/guilds.ts +++ b/src/managers/guilds.ts @@ -1,9 +1,9 @@ -import { Client } from "../models/client.ts"; -import { Guild } from "../structures/guild.ts"; -import { GUILD } from "../types/endpoint.ts"; -import { GuildPayload, MemberPayload } from "../types/guild.ts"; -import { BaseManager } from "./base.ts"; -import { MembersManager } from "./members.ts"; +import { Client } from '../models/client.ts' +import { Guild } from '../structures/guild.ts' +import { GUILD } from '../types/endpoint.ts' +import { GuildPayload, MemberPayload } from '../types/guild.ts' +import { BaseManager } from './base.ts' +import { MembersManager } from './members.ts' export class GuildManager extends BaseManager { constructor (client: Client) { diff --git a/src/managers/members.ts b/src/managers/members.ts index 5e27bfb..acf6e2c 100644 --- a/src/managers/members.ts +++ b/src/managers/members.ts @@ -1,10 +1,10 @@ -import { User } from "../structures/user.ts"; -import { Client } from "../models/client.ts"; -import { Guild } from "../structures/guild.ts"; -import { Member } from "../structures/member.ts"; -import { GUILD_MEMBER } from "../types/endpoint.ts"; -import { MemberPayload } from "../types/guild.ts"; -import { BaseManager } from "./base.ts"; +import { User } from '../structures/user.ts' +import { Client } from '../models/client.ts' +import { Guild } from '../structures/guild.ts' +import { Member } from '../structures/member.ts' +import { GUILD_MEMBER } from '../types/endpoint.ts' +import { MemberPayload } from '../types/guild.ts' +import { BaseManager } from './base.ts' export class MembersManager extends BaseManager { guild: Guild @@ -21,7 +21,7 @@ export class MembersManager extends BaseManager { const res = new this.DataType(this.client, raw, user) for (const roleid of res.roleIDs as string[]) { const role = await this.guild.roles.get(roleid) - if(role !== undefined) res.roles.push(role) + if (role !== undefined) res.roles.push(role) } return res } @@ -34,7 +34,7 @@ export class MembersManager extends BaseManager { const res = new Member(this.client, data as MemberPayload, user) for (const roleid of res.roleIDs as string[]) { const role = await this.guild.roles.get(roleid) - if(role !== undefined) res.roles.push(role) + if (role !== undefined) res.roles.push(role) } resolve(res) }).catch(e => reject(e)) diff --git a/src/managers/messages.ts b/src/managers/messages.ts index 7364d91..b56384f 100644 --- a/src/managers/messages.ts +++ b/src/managers/messages.ts @@ -1,11 +1,11 @@ -import { Client } from "../models/client.ts"; -import { Message } from "../structures/message.ts"; -import { MessageMentions } from "../structures/messageMentions.ts"; -import { TextChannel } from "../structures/textChannel.ts"; -import { User } from "../structures/user.ts"; -import { MessagePayload } from "../types/channel.ts"; -import { CHANNEL_MESSAGE } from "../types/endpoint.ts"; -import { BaseManager } from "./base.ts"; +import { Client } from '../models/client.ts' +import { Message } from '../structures/message.ts' +import { MessageMentions } from '../structures/messageMentions.ts' +import { TextChannel } from '../structures/textChannel.ts' +import { User } from '../structures/user.ts' +import { MessagePayload } from '../types/channel.ts' +import { CHANNEL_MESSAGE } from '../types/endpoint.ts' +import { BaseManager } from './base.ts' export class MessagesManager extends BaseManager { constructor (client: Client) { diff --git a/src/models/client.ts b/src/models/client.ts index 1a136b6..748796c 100644 --- a/src/models/client.ts +++ b/src/models/client.ts @@ -3,13 +3,13 @@ import { GatewayIntents } from '../types/gateway.ts' import { Gateway } from '../gateway/index.ts' import { RESTManager } from './rest.ts' import EventEmitter from 'https://deno.land/std@0.74.0/node/events.ts' -import { DefaultCacheAdapter, ICacheAdapter } from "./cacheAdapter.ts" -import { UserManager } from "../managers/users.ts" -import { GuildManager } from "../managers/guilds.ts" -import { EmojisManager } from "../managers/emojis.ts" -import { ChannelsManager } from "../managers/channels.ts" -import { MessagesManager } from "../managers/messages.ts" -import { ActivityGame, ClientActivity, ClientPresence } from "../structures/presence.ts" +import { DefaultCacheAdapter, ICacheAdapter } from './cacheAdapter.ts' +import { UserManager } from '../managers/users.ts' +import { GuildManager } from '../managers/guilds.ts' +import { EmojisManager } from '../managers/emojis.ts' +import { ChannelsManager } from '../managers/channels.ts' +import { MessagesManager } from '../managers/messages.ts' +import { ActivityGame, ClientActivity, ClientPresence } from '../structures/presence.ts' /** Some Client Options to modify behaviour */ export interface ClientOptions { diff --git a/src/models/command.ts b/src/models/command.ts index 3e60a64..39c60e4 100644 --- a/src/models/command.ts +++ b/src/models/command.ts @@ -1,8 +1,8 @@ -import { Message } from "../structures/message.ts" -import { TextChannel } from "../structures/textChannel.ts" -import { User } from "../structures/user.ts" -import { Collection } from "../utils/collection.ts" -import { CommandClient } from "./commandClient.ts" +import { Message } from '../structures/message.ts' +import { TextChannel } from '../structures/textChannel.ts' +import { User } from '../structures/user.ts' +import { Collection } from '../utils/collection.ts' +import { CommandClient } from './commandClient.ts' export interface CommandContext { /** The Client object */ diff --git a/src/models/rest.ts b/src/models/rest.ts index 8245d9a..aabb9e0 100644 --- a/src/models/rest.ts +++ b/src/models/rest.ts @@ -1,7 +1,7 @@ import { delay } from '../utils/index.ts' import * as baseEndpoints from '../consts/urlsAndVersions.ts' import { Client } from './client.ts' -import { getBuildInfo } from "../utils/buildInfo.ts" +import { getBuildInfo } from '../utils/buildInfo.ts' export enum HttpResponseCode { Ok = 200, diff --git a/src/structures/guild.ts b/src/structures/guild.ts index c1df310..1fceec9 100644 --- a/src/structures/guild.ts +++ b/src/structures/guild.ts @@ -4,9 +4,9 @@ import { PresenceUpdatePayload } from '../types/gateway.ts' import { Base } from './base.ts' import { Emoji } from './emoji.ts' import { VoiceState } from './voiceState.ts' -import { RolesManager } from "../managers/roles.ts" -import { GuildChannelsManager } from "../managers/guildChannels.ts" -import { MembersManager } from "../managers/members.ts" +import { RolesManager } from '../managers/roles.ts' +import { GuildChannelsManager } from '../managers/guildChannels.ts' +import { MembersManager } from '../managers/members.ts' export class Guild extends Base { id: string diff --git a/src/structures/guildCategoryChannel.ts b/src/structures/guildCategoryChannel.ts index 741dccc..1da8d67 100644 --- a/src/structures/guildCategoryChannel.ts +++ b/src/structures/guildCategoryChannel.ts @@ -4,7 +4,7 @@ import { GuildChannelCategoryPayload, Overwrite } from '../types/channel.ts' -import { Guild } from "./guild.ts" +import { Guild } from './guild.ts' export class CategoryChannel extends Channel { guildID: string diff --git a/src/structures/guildNewsChannel.ts b/src/structures/guildNewsChannel.ts index 5dcc78d..0f05237 100644 --- a/src/structures/guildNewsChannel.ts +++ b/src/structures/guildNewsChannel.ts @@ -1,6 +1,6 @@ import { Client } from '../models/client.ts' import { GuildNewsChannelPayload, Overwrite } from '../types/channel.ts' -import { Guild } from "./guild.ts" +import { Guild } from './guild.ts' import { TextChannel } from './textChannel.ts' export class NewsChannel extends TextChannel { diff --git a/src/structures/guildTextChannel.ts b/src/structures/guildTextChannel.ts index bd25b21..385f220 100644 --- a/src/structures/guildTextChannel.ts +++ b/src/structures/guildTextChannel.ts @@ -1,7 +1,7 @@ import { Client } from '../models/client.ts' import { GuildTextChannelPayload, Overwrite } from '../types/channel.ts' import { TextChannel } from './textChannel.ts' -import { Guild } from "./guild.ts" +import { Guild } from './guild.ts' export class GuildTextChannel extends TextChannel { guildID: string diff --git a/src/structures/guildVoiceChannel.ts b/src/structures/guildVoiceChannel.ts index ed402ff..211c81c 100644 --- a/src/structures/guildVoiceChannel.ts +++ b/src/structures/guildVoiceChannel.ts @@ -1,7 +1,7 @@ import { Client } from '../models/client.ts' import { GuildVoiceChannelPayload, Overwrite } from '../types/channel.ts' import { Channel } from './channel.ts' -import { Guild } from "./guild.ts" +import { Guild } from './guild.ts' export class VoiceChannel extends Channel { bitrate: string diff --git a/src/structures/member.ts b/src/structures/member.ts index b134ad6..78783b2 100644 --- a/src/structures/member.ts +++ b/src/structures/member.ts @@ -1,7 +1,7 @@ import { Client } from '../models/client.ts' import { MemberPayload } from '../types/guild.ts' import { Base } from './base.ts' -import { Role } from "./role.ts" +import { Role } from './role.ts' import { User } from './user.ts' export class Member extends Base { diff --git a/src/structures/message.ts b/src/structures/message.ts index 0890e02..c1b29ab 100644 --- a/src/structures/message.ts +++ b/src/structures/message.ts @@ -14,10 +14,10 @@ import { User } from './user.ts' import { Member } from './member.ts' import { Embed } from './embed.ts' import { CHANNEL_MESSAGE } from '../types/endpoint.ts' -import { MessageMentions } from "./messageMentions.ts" -import { TextChannel } from "./textChannel.ts" -import { DMChannel } from "./dmChannel.ts" -import { Guild } from "./guild.ts" +import { MessageMentions } from './messageMentions.ts' +import { TextChannel } from './textChannel.ts' +import { DMChannel } from './dmChannel.ts' +import { Guild } from './guild.ts' export class Message extends Base { // eslint-disable-next-line @typescript-eslint/prefer-readonly diff --git a/src/structures/textChannel.ts b/src/structures/textChannel.ts index daa8685..d4e815c 100644 --- a/src/structures/textChannel.ts +++ b/src/structures/textChannel.ts @@ -2,7 +2,7 @@ import { Client } from '../models/client.ts' import { MessageOption, TextChannelPayload } from '../types/channel.ts' import { CHANNEL_MESSAGE, CHANNEL_MESSAGES } from '../types/endpoint.ts' import { Channel } from './channel.ts' -import { Embed } from "./embed.ts" +import { Embed } from './embed.ts' import { Message } from './message.ts' import { MessageMentions } from './messageMentions.ts' @@ -27,14 +27,14 @@ export class TextChannel extends Channel { } async send (text?: string | AllMessageOptions, option?: AllMessageOptions): Promise { - if(typeof text === "object") { + if (typeof text === "object") { option = text text = undefined } if (text === undefined && option === undefined) { throw new Error('Either text or option is necessary.') } - if(option instanceof Embed) option = { + if (option instanceof Embed) option = { embed: option } diff --git a/src/test/cmd.ts b/src/test/cmd.ts index 21edd9c..d87d21d 100644 --- a/src/test/cmd.ts +++ b/src/test/cmd.ts @@ -1,6 +1,6 @@ -import { CommandClient, Intents } from '../../mod.ts'; -import PingCommand from "./cmds/ping.ts"; -import UserinfoCommand from "./cmds/userinfo.ts"; +import { CommandClient, Intents } from '../../mod.ts' +import PingCommand from './cmds/ping.ts' +import UserinfoCommand from './cmds/userinfo.ts' import { TOKEN } from './config.ts' const client = new CommandClient({ diff --git a/src/test/cmds/ping.ts b/src/test/cmds/ping.ts index 123be1a..30b3f67 100644 --- a/src/test/cmds/ping.ts +++ b/src/test/cmds/ping.ts @@ -1,5 +1,5 @@ -import { Command } from "../../../mod.ts"; -import { CommandContext } from "../../models/command.ts"; +import { Command } from '../../../mod.ts' +import { CommandContext } from '../../models/command.ts' export default class PingCommand extends Command { name = "ping" diff --git a/src/test/cmds/userinfo.ts b/src/test/cmds/userinfo.ts index 6aee7e9..9b65e2f 100644 --- a/src/test/cmds/userinfo.ts +++ b/src/test/cmds/userinfo.ts @@ -1,4 +1,4 @@ -import { Command, Member, CommandContext, Embed } from "../../../mod.ts"; +import { Command, Member, CommandContext, Embed } from '../../../mod.ts' export default class UserinfoCommand extends Command { name = "userinfo" diff --git a/src/test/index.ts b/src/test/index.ts index 4082eaa..7b07a8b 100644 --- a/src/test/index.ts +++ b/src/test/index.ts @@ -1,4 +1,4 @@ -import { Client, Intents, GuildTextChannel, Message, ClientPresence, Member, Role, GuildChannel, Embed, Guild } from '../../mod.ts'; +import { Client, Intents, GuildTextChannel, Message, ClientPresence, Member, Role, GuildChannel, Embed, Guild } from '../../mod.ts' import { TOKEN } from './config.ts' const client = new Client({ diff --git a/src/types/gateway.ts b/src/types/gateway.ts index 224c3d1..9b6209b 100644 --- a/src/types/gateway.ts +++ b/src/types/gateway.ts @@ -1,6 +1,6 @@ // https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway // https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events -import { StatusType } from "../../mod.ts" +import { StatusType } from '../../mod.ts' import { EmojiPayload } from './emoji.ts' import { MemberPayload } from './guild.ts' import { ActivityPayload } from './presence.ts' diff --git a/src/utils/buildInfo.ts b/src/utils/buildInfo.ts index 7d37a5f..21f8d9d 100644 --- a/src/utils/buildInfo.ts +++ b/src/utils/buildInfo.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { Client } from "../models/client.ts"; +import { Client } from '../models/client.ts' export const getBuildInfo = (client: Client): { os: string diff --git a/src/utils/getChannelByType.ts b/src/utils/getChannelByType.ts index 9a8436d..b15d38b 100644 --- a/src/utils/getChannelByType.ts +++ b/src/utils/getChannelByType.ts @@ -14,9 +14,9 @@ import { GroupDMChannel } from '../structures/groupChannel.ts' import { CategoryChannel } from '../structures/guildCategoryChannel.ts' import { NewsChannel } from '../structures/guildNewsChannel.ts' import { VoiceChannel } from '../structures/guildVoiceChannel.ts' -import { Guild } from "../structures/guild.ts" -import { GuildTextChannel } from "../structures/guildTextChannel.ts" -import { TextChannel } from "../structures/textChannel.ts" +import { Guild } from '../structures/guild.ts' +import { GuildTextChannel } from '../structures/guildTextChannel.ts' +import { TextChannel } from '../structures/textChannel.ts' const getChannelByType = ( client: Client, diff --git a/src/utils/intents.ts b/src/utils/intents.ts index 09f980f..4af2252 100644 --- a/src/utils/intents.ts +++ b/src/utils/intents.ts @@ -1,4 +1,4 @@ -import { GatewayIntents } from "../types/gateway.ts"; +import { GatewayIntents } from '../types/gateway.ts' // eslint-disable-next-line @typescript-eslint/no-extraneous-class export class Intents {