seyfert/tests/bot.js
Marcos Susaña 4bad71399a
[skip ci] bot up (#304)
* Add a bot startup (bro scared of circulars) (#303)

* fix(channels): correct return type of mixin functions

* feat: startup bot in test

* fix: build

* fix: ?

* fix: ??

* ci(bot-up): update conditional
2024-12-10 09:24:00 -04:00

30 lines
553 B
JavaScript

const { Client } = require('../lib')
const { GatewayIntentBits } = require('../lib/types');
const token = process.env.BOT_TOKEN;
if (!token) process.exit(0);
const client = new Client({
getRC: () => {
return {
intents: GatewayIntentBits.NonPrivilaged,
token,
locations: {
base: '',
output: '',
},
};
},
});
client.events.onFail = (event, err) => {
client.logger.error(`${event}: ${err}`);
process.exit(1);
};
client.start().then(() => {
setTimeout(() => {
process.exit(0);
}, 15_000 * client.gateway.totalShards)
});