Compare commits

...

5 commits

Author SHA1 Message Date
0747c3ebe4 disable ok-lines
All checks were successful
Lint and Format Check / lint-and-format (pull_request) Successful in 16s
2024-09-04 13:12:43 +02:00
e43234f790 comments 2024-09-04 13:12:43 +02:00
12f57e9195 add basic sharding 2024-09-04 13:12:43 +02:00
110142c2e7
feat: use internal sharding (#157)
All checks were successful
Publish latest version / build (push) Successful in 1m35s
ref: #148

better than #154 since botanique is a small bot

Reviewed-on: #157
Co-authored-by: Mylloon <kennel.anri@tutanota.com>
Co-committed-by: Mylloon <kennel.anri@tutanota.com>
2024-09-04 13:12:35 +02:00
8071bc8226
chore: vscode rule (#150)
All checks were successful
Publish latest version / build (push) Successful in 2m0s
Reviewed-on: #150
Co-authored-by: Mylloon <kennel.anri@tutanota.com>
Co-committed-by: Mylloon <kennel.anri@tutanota.com>
2024-09-04 13:02:13 +02:00
4 changed files with 18 additions and 7 deletions

View file

@ -1,6 +1,7 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": false,
"editor.rulers": [100],
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,

6
src/bot.ts Normal file
View file

@ -0,0 +1,6 @@
/** Load the app */
const start_app = () => {
import("./load").then((l) => l.run().catch((error) => console.error(error)));
};
start_app();

View file

@ -1,17 +1,20 @@
/** Load the app. */
const start_app = () => {
import("./load").then((l) => l.run().catch((error) => console.error(error)));
import { ShardingManager } from "discord.js";
const start_manager = () => {
const manager = new ShardingManager("./dist/bot.js", { token: process.env.TOKEN_DISCORD });
manager.on("shardCreate", (shard) => console.log(`Launched shard ${shard.id}`));
manager.spawn();
};
// Load .env if not in prod
if (process.env.NODE_ENV !== "production") {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import("dotenv").then((c) => {
c.config({ path: "./config/.env" });
start_app();
start_manager();
});
} else {
start_app();
start_manager();
}

View file

@ -9,6 +9,7 @@ import { YoutubeiExtractor } from "discord-player-youtubei";
/** Creation of the client and definition of its properties */
export default async () => {
const client: Client = new Client({
shards: "auto",
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,