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

3
.gitignore vendored
View File

@ -109,6 +109,7 @@ yarn.lock
# PRIVACY XDDDD
src/test/config.ts
test/config.ts
.vscode
# macOS is shit xD
@ -117,4 +118,4 @@ src/test/config.ts
# Webstorm dont forget this duude :)
.idea/
src/test/music.mp3
src/test/music.mp3

13
mod.ts
View File

@ -104,7 +104,15 @@ export type {
ClientStatus,
StatusType
} 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 { ImageFormats, ImageSize } from './src/types/cdn.ts'
export type {
@ -129,8 +137,7 @@ export type {
MessageStickerPayload,
MessageTypes,
OverwriteAsArg,
Overwrite,
OverwriteAsOptions
Overwrite
} from './src/types/channel.ts'
export type { EmojiPayload } from './src/types/emoji.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'
const client = new Client()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,4 @@
import { Command } from '../../../mod.ts'
import { CommandContext } from '../../models/command.ts'
import { Command, CommandContext } from '../../mod.ts'
export default class PingCommand extends Command {
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 {
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'
class MyClient extends Client {
constructor() {
super({
token: TOKEN,
intents: [],
intents: []
})
}
@ -17,7 +17,9 @@ class MyClient extends Client {
debug(title: string, msg: string): void {
console.log(`[${title}] ${msg}`)
if (title === 'Gateway' && msg === 'Initializing WebSocket...') {
try { throw new Error("Stack") } catch (e) {
try {
throw new Error('Stack')
} catch (e) {
console.log(e.stack)
}
}
@ -25,4 +27,4 @@ class MyClient extends Client {
}
const client = new MyClient()
client.connect()
client.connect()

View File

@ -5,7 +5,7 @@ import {
// PermissionFlags,
// ChannelTypes,
// GuildCreateOptions
} from '../../mod.ts'
} from '../mod.ts'
import { TOKEN } from './config.ts'
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'
const webhook = await Webhook.fromURL(WEBHOOK)

View File

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