Compare commits
No commits in common. "a1924e411c5cb2a73fc13528c50cccfb1e826b06" and "136fe81b5094d128fa3de153ec9e4451bae75c12" have entirely different histories.
a1924e411c
...
136fe81b50
7 changed files with 106 additions and 921 deletions
|
@ -1,16 +1,13 @@
|
|||
{
|
||||
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"extends": "eslint:recommended",
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"project": ["./tsconfig.json"]
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"ecmaVersion": 2021,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"arrow-spacing": ["warn", { "before": true, "after": true }],
|
||||
"brace-style": ["error"],
|
||||
|
|
969
package-lock.json
generated
969
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -5,8 +5,7 @@
|
|||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
"main": "tsc && node ./dist/src/index.js",
|
||||
"debug": "tsnd --respawn ./src/index.ts",
|
||||
"lint": "npx eslint src"
|
||||
"debug": "tsnd --respawn ./src/index.ts"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -20,10 +19,8 @@
|
|||
"discord.js": "^13.8.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
||||
"@typescript-eslint/parser": "^5.30.7",
|
||||
"dotenv": "^16.0.1",
|
||||
"eslint": "^8.20.0",
|
||||
"eslint": "^8.13.0",
|
||||
"ts-node-dev": "^2.0.0",
|
||||
"typescript": "^4.7.4"
|
||||
},
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Client } from 'discord.js';
|
|||
import { readdir } from 'fs/promises';
|
||||
|
||||
export default async (client: Client) => {
|
||||
const rest = new REST({ version: '9' }).setToken(client.token ?? '');
|
||||
const rest = new REST({ version: '9' }).setToken(client.token!);
|
||||
|
||||
const command_categories = (await readdir('./src/commands'))
|
||||
.filter(element => !element.endsWith('.js'));
|
||||
|
@ -32,7 +32,7 @@ export default async (client: Client) => {
|
|||
)
|
||||
).flat(2);
|
||||
|
||||
return await rest.put(Routes.applicationCommands(client.user?.id ?? ''), {
|
||||
return await rest.put(Routes.applicationCommands(client.user!.id), {
|
||||
body: commands,
|
||||
});
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@ export default async (client: Client) => {
|
|||
);
|
||||
|
||||
// Remove .js
|
||||
const event_type_ext = event_file.split('.');
|
||||
let event_type_ext = event_file.split('.');
|
||||
if (event_type_ext.pop() !== 'js') {
|
||||
throw `Unknown file in ${event_category}: ${event_file}`;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ const run = async () => {
|
|||
.then(async client => {
|
||||
console.log('Client ✅');
|
||||
await loadEvents(client)
|
||||
.then(() => console.log('Events ✅'))
|
||||
.then(_ => console.log('Events ✅'))
|
||||
.catch(() => {
|
||||
throw 'Events ❌';
|
||||
});
|
||||
|
@ -23,14 +23,14 @@ const run = async () => {
|
|||
await client.login(client.config.token_discord);
|
||||
|
||||
await loadCommands(client)
|
||||
.then(() => console.log('Commands ✅'))
|
||||
.then(_ => console.log('Commands ✅'))
|
||||
.catch(() => {
|
||||
throw 'Commands ❌';
|
||||
});
|
||||
|
||||
console.log(`Botanique "${client.user?.username}" ${client.config.version} started!`);
|
||||
console.log(`Botanique "${client.user!.username}" ${client.config.version} started!`);
|
||||
})
|
||||
.catch(() => {
|
||||
.catch(_ => {
|
||||
throw 'Client ❌';
|
||||
});
|
||||
};
|
||||
|
|
|
@ -4,20 +4,16 @@ import { SlashCommandBuilder } from '@discordjs/builders';
|
|||
|
||||
const { version } = JSON.parse(readFileSync('./package.json').toString());
|
||||
|
||||
declare module 'discord.js' {
|
||||
// eslint-disable-next-line no-shadow
|
||||
declare module "discord.js" {
|
||||
export interface Client {
|
||||
config: {
|
||||
version: string,
|
||||
token_discord: string | undefined
|
||||
version: any,
|
||||
token_discord: any
|
||||
},
|
||||
commands: Collection<
|
||||
string,
|
||||
{
|
||||
data: SlashCommandBuilder,
|
||||
interaction: (interaction: CommandInteraction, client: Client) => unknown
|
||||
}
|
||||
>
|
||||
commands: Collection<string, {
|
||||
data: SlashCommandBuilder,
|
||||
interaction: (interaction: CommandInteraction, client: Client) => any
|
||||
}>
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue