move out src/test to test

This commit is contained in:
DjDeveloperr 2021-04-04 11:22:47 +05:30
parent f812e06d17
commit 46cbd66166
26 changed files with 51 additions and 45 deletions

1
.gitignore vendored
View file

@ -109,6 +109,7 @@ yarn.lock
# PRIVACY XDDDD # PRIVACY XDDDD
src/test/config.ts src/test/config.ts
test/config.ts
.vscode .vscode
# macOS is shit xD # macOS is shit xD

13
mod.ts
View file

@ -104,7 +104,15 @@ export type {
ClientStatus, ClientStatus,
StatusType StatusType
} from './src/types/presence.ts' } from './src/types/presence.ts'
export { ChannelTypes } from './src/types/channel.ts' export {
ChannelTypes,
OverwriteType,
OverrideType
} from './src/types/channel.ts'
export type {
OverwriteAsOptions,
OverwritePayload
} from './src/types/channel.ts'
export type { ApplicationPayload } from './src/types/application.ts' export type { ApplicationPayload } from './src/types/application.ts'
export type { ImageFormats, ImageSize } from './src/types/cdn.ts' export type { ImageFormats, ImageSize } from './src/types/cdn.ts'
export type { export type {
@ -129,8 +137,7 @@ export type {
MessageStickerPayload, MessageStickerPayload,
MessageTypes, MessageTypes,
OverwriteAsArg, OverwriteAsArg,
Overwrite, Overwrite
OverwriteAsOptions
} from './src/types/channel.ts' } from './src/types/channel.ts'
export type { EmojiPayload } from './src/types/emoji.ts' export type { EmojiPayload } from './src/types/emoji.ts'
export { Verification } from './src/types/guild.ts' export { Verification } from './src/types/guild.ts'

View file

@ -1,4 +1,4 @@
import { Client, Intents } from '../../mod.ts' import { Client, Intents } from '../mod.ts'
import { TOKEN } from './config.ts' import { TOKEN } from './config.ts'
const client = new Client() const client = new Client()

View file

@ -6,7 +6,7 @@ import {
CommandContext, CommandContext,
Extension, Extension,
CommandBuilder CommandBuilder
} from '../../mod.ts' } from '../mod.ts'
import { TOKEN } from './config.ts' import { TOKEN } from './config.ts'
class MyClient extends CommandClient { class MyClient extends CommandClient {

View file

@ -4,9 +4,9 @@ import {
Intents, Intents,
CommandContext, CommandContext,
Extension, Extension,
GuildChannels GuildChannels,
} from '../../mod.ts' Invite
import { Invite } from '../structures/invite.ts' } from '../mod.ts'
import { TOKEN } from './config.ts' import { TOKEN } from './config.ts'
const client = new CommandClient({ const client = new CommandClient({

View file

@ -1,5 +1,4 @@
import { Command } from '../../../mod.ts' import { Command, CommandContext } from '../../mod.ts'
import { CommandContext } from '../../models/command.ts'
export default class AddEmojiCommand extends Command { export default class AddEmojiCommand extends Command {
name = 'addemoji' name = 'addemoji'

View file

@ -1,5 +1,4 @@
import { Command } from '../../../mod.ts' import { Command, CommandContext } from '../../mod.ts'
import { CommandContext } from '../../models/command.ts'
export default class EvalCommand extends Command { export default class EvalCommand extends Command {
name = 'eval' name = 'eval'

View file

@ -1,5 +1,4 @@
import { Command } from '../../../mod.ts' import { Command, CommandContext } from '../../mod.ts'
import { CommandContext } from '../../models/command.ts'
export default class JoinCommand extends Command { export default class JoinCommand extends Command {
name = 'join' name = 'join'

View file

@ -1,6 +1,9 @@
import { Command, VoiceChannel } from '../../../mod.ts' import {
import { CommandContext } from '../../models/command.ts' Command,
import { ChannelTypes } from '../../types/channel.ts' CommandContext,
ChannelTypes,
VoiceChannel
} from '../../mod.ts'
export default class KickFromSpecificVoiceCommand extends Command { export default class KickFromSpecificVoiceCommand extends Command {
name = 'kickFromSpecificVoice' name = 'kickFromSpecificVoice'

View file

@ -1,5 +1,4 @@
import { Command } from '../../../mod.ts' import { Command, CommandContext } from '../../mod.ts'
import { CommandContext } from '../../models/command.ts'
export default class KickFromVoiceCommand extends Command { export default class KickFromVoiceCommand extends Command {
name = 'kickFromVoice' name = 'kickFromVoice'

View file

@ -1,5 +1,4 @@
import { Command } from '../../../mod.ts' import { Command, CommandContext } from '../../mod.ts'
import { CommandContext } from '../../models/command.ts'
export default class LeaveCommand extends Command { export default class LeaveCommand extends Command {
name = 'leave' name = 'leave'

View file

@ -1,5 +1,4 @@
import { Command, Embed } from '../../../mod.ts' import { Command, CommandContext, Embed } from '../../mod.ts'
import { CommandContext } from '../../models/command.ts'
export default class PingCommand extends Command { export default class PingCommand extends Command {
name = 'mentions' name = 'mentions'

View file

@ -1,5 +1,4 @@
import { Command } from '../../../mod.ts' import { Command, CommandContext } from '../../mod.ts'
import { CommandContext } from '../../models/command.ts'
export default class PingCommand extends Command { export default class PingCommand extends Command {
name = 'ping' name = 'ping'

View file

@ -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 { export default class UserinfoCommand extends Command {
name = 'userinfo' name = 'userinfo'

View file

@ -1,11 +1,11 @@
import { Client, event } from '../../mod.ts' import { Client, event } from '../mod.ts'
import { TOKEN } from './config.ts' import { TOKEN } from './config.ts'
class MyClient extends Client { class MyClient extends Client {
constructor() { constructor() {
super({ super({
token: TOKEN, token: TOKEN,
intents: [], intents: []
}) })
} }
@ -17,7 +17,9 @@ class MyClient extends Client {
debug(title: string, msg: string): void { debug(title: string, msg: string): void {
console.log(`[${title}] ${msg}`) console.log(`[${title}] ${msg}`)
if (title === 'Gateway' && msg === 'Initializing WebSocket...') { if (title === 'Gateway' && msg === 'Initializing WebSocket...') {
try { throw new Error("Stack") } catch (e) { try {
throw new Error('Stack')
} catch (e) {
console.log(e.stack) console.log(e.stack)
} }
} }

View file

@ -5,7 +5,7 @@ import {
// PermissionFlags, // PermissionFlags,
// ChannelTypes, // ChannelTypes,
// GuildCreateOptions // GuildCreateOptions
} from '../../mod.ts' } from '../mod.ts'
import { TOKEN } from './config.ts' import { TOKEN } from './config.ts'
const client = new Client() const client = new Client()

View file

@ -1,4 +1,4 @@
import { Webhook } from '../../mod.ts' import { Webhook } from '../mod.ts'
import { WEBHOOK } from './config.ts' import { WEBHOOK } from './config.ts'
const webhook = await Webhook.fromURL(WEBHOOK) const webhook = await Webhook.fromURL(WEBHOOK)

View file

@ -11,11 +11,11 @@ import {
ChannelTypes, ChannelTypes,
GuildTextChannel, GuildTextChannel,
checkGuildTextBasedChannel, checkGuildTextBasedChannel,
Permissions Permissions,
} from '../../mod.ts' Collector,
import { Collector } from '../models/collectors.ts' MessageAttachment,
import { MessageAttachment } from '../structures/message.ts' OverrideType
import { OverrideType } from '../types/channel.ts' } from '../mod.ts'
import { TOKEN } from './config.ts' import { TOKEN } from './config.ts'
const client = new Client({ const client = new Client({
@ -74,12 +74,12 @@ client.on('messageCreate', async (msg: Message) => {
const guilds = await msg.client.guilds.collection() const guilds = await msg.client.guilds.collection()
msg.channel.send( msg.channel.send(
'Guild List:\n' + 'Guild List:\n' +
(guilds (guilds
.array() .array()
.map((c: Guild, i: number) => { .map((c: Guild, i: number) => {
return `${i + 1}. ${c.name} - ${c.memberCount} members` return `${i + 1}. ${c.name} - ${c.memberCount} members`
}) })
.join('\n') as string) .join('\n') as string)
) )
} else if (msg.content === '!roles') { } else if (msg.content === '!roles') {
const col = await msg.guild?.roles.collection() const col = await msg.guild?.roles.collection()

View file

@ -1,4 +1,4 @@
import { Client, Intents } from '../../mod.ts' import { Client, Intents } from '../mod.ts'
import { TOKEN } from './config.ts' import { TOKEN } from './config.ts'
const client = new Client() const client = new Client()