Fix lint...
This commit is contained in:
		
							parent
							
								
									70824135a7
								
							
						
					
					
						commit
						04f2912c3c
					
				
					 33 changed files with 100 additions and 100 deletions
				
			
		|  | @ -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' | ||||
|  |  | |||
|  | @ -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) | ||||
|  |  | |||
|  | @ -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: { | ||||
|  |  | |||
|  | @ -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 | ||||
|       } | ||||
|     } | ||||
|  |  | |||
|  | @ -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() | ||||
|  |  | |||
|  | @ -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) => { | ||||
|  |  | |||
|  | @ -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. | ||||
|  |  | |||
|  | @ -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<T, T2> { | ||||
|   client: Client | ||||
|  |  | |||
|  | @ -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<T, T2> { | ||||
|   client: Client | ||||
|  |  | |||
|  | @ -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<ChannelPayload, Channel> { | ||||
|   constructor(client: Client) { | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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<GuildPayload, Guild> { | ||||
|   constructor (client: Client) { | ||||
|  |  | |||
|  | @ -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<MemberPayload, Member> { | ||||
|   guild: Guild | ||||
|  | @ -21,7 +21,7 @@ export class MembersManager extends BaseManager<MemberPayload, Member> { | |||
|     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<MemberPayload, Member> { | |||
|         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)) | ||||
|  |  | |||
|  | @ -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<MessagePayload, Message> { | ||||
|   constructor (client: Client) { | ||||
|  |  | |||
|  | @ -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 { | ||||
|  |  | |||
|  | @ -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 */ | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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 { | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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 { | ||||
|  |  | |||
|  | @ -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
 | ||||
|  |  | |||
|  | @ -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<Message> { | ||||
|     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 | ||||
|     } | ||||
|      | ||||
|  |  | |||
|  | @ -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({ | ||||
|  |  | |||
|  | @ -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" | ||||
|  |  | |||
|  | @ -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" | ||||
|  |  | |||
|  | @ -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({ | ||||
|  |  | |||
|  | @ -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' | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
|  | @ -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, | ||||
|  |  | |||
|  | @ -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 { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue