link commands
This commit is contained in:
11
dist/index.js
vendored
11
dist/index.js
vendored
@@ -30,6 +30,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const discord_js_1 = require("discord.js");
|
const discord_js_1 = require("discord.js");
|
||||||
const fs = __importStar(require("fs"));
|
const fs = __importStar(require("fs"));
|
||||||
|
const api_1 = require("./api");
|
||||||
const discord_1 = require("./discord");
|
const discord_1 = require("./discord");
|
||||||
const queue_1 = require("./queue");
|
const queue_1 = require("./queue");
|
||||||
const CLIENT = new discord_js_1.Client({ intents: [discord_js_1.Intents.FLAGS.GUILDS] });
|
const CLIENT = new discord_js_1.Client({ intents: [discord_js_1.Intents.FLAGS.GUILDS] });
|
||||||
@@ -47,6 +48,14 @@ CLIENT.on('interactionCreate', (interaction) => __awaiter(void 0, void 0, void 0
|
|||||||
if (!interaction.isCommand())
|
if (!interaction.isCommand())
|
||||||
return;
|
return;
|
||||||
if (interaction.commandName === 'queue')
|
if (interaction.commandName === 'queue')
|
||||||
(0, queue_1.createQueue)(interaction);
|
yield (0, queue_1.createQueue)(interaction);
|
||||||
|
else if (interaction.commandName === 'join')
|
||||||
|
yield (0, queue_1.joinQueue)(interaction);
|
||||||
|
//else if (interaction.commandName === 'ready')
|
||||||
|
// await readyQueue(interaction);
|
||||||
|
else if (interaction.commandName === 'queueinfo')
|
||||||
|
yield (0, queue_1.queueInfo)(interaction);
|
||||||
|
else if (interaction.commandName === 'elo')
|
||||||
|
yield (0, api_1.getPlayerInteraction)(interaction);
|
||||||
}));
|
}));
|
||||||
CLIENT.login(TOKEN);
|
CLIENT.login(TOKEN);
|
||||||
|
|||||||
13
src/index.ts
13
src/index.ts
@@ -1,8 +1,9 @@
|
|||||||
|
|
||||||
import { Client, Intents } from 'discord.js';
|
import { Client, Intents } from 'discord.js';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
|
import { getPlayerInteraction } from './api';
|
||||||
import { registerCommands } from './discord';
|
import { registerCommands } from './discord';
|
||||||
import { createQueue } from './queue';
|
import { createQueue, joinQueue, queueInfo } from './queue';
|
||||||
const CLIENT = new Client({ intents: [Intents.FLAGS.GUILDS] });
|
const CLIENT = new Client({ intents: [Intents.FLAGS.GUILDS] });
|
||||||
|
|
||||||
if (!fs.existsSync('./token')) {
|
if (!fs.existsSync('./token')) {
|
||||||
@@ -22,7 +23,15 @@ CLIENT.on('interactionCreate', async interaction => {
|
|||||||
if (!interaction.isCommand()) return;
|
if (!interaction.isCommand()) return;
|
||||||
|
|
||||||
if (interaction.commandName === 'queue')
|
if (interaction.commandName === 'queue')
|
||||||
createQueue(interaction);
|
await createQueue(interaction);
|
||||||
|
else if (interaction.commandName === 'join')
|
||||||
|
await joinQueue(interaction);
|
||||||
|
//else if (interaction.commandName === 'ready')
|
||||||
|
// await readyQueue(interaction);
|
||||||
|
else if (interaction.commandName === 'queueinfo')
|
||||||
|
await queueInfo(interaction);
|
||||||
|
else if (interaction.commandName === 'elo')
|
||||||
|
await getPlayerInteraction(interaction);
|
||||||
});
|
});
|
||||||
|
|
||||||
CLIENT.login(TOKEN);
|
CLIENT.login(TOKEN);
|
||||||
Reference in New Issue
Block a user