add watchdog

pull/29/head
Matthew 2020-12-01 21:58:11 -05:00
parent e978289165
commit defa87a039
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
3 changed files with 9 additions and 0 deletions

View File

@ -49,6 +49,7 @@
"mongoose": "^5.9.13",
"nodemailer": "^6.4.8",
"pluris": "^0.2.5",
"sd-notify": "^2.8.0",
"signale": "^1.4.0",
"stripe": "^8.120.0",
"uuid": "^8.0.0",

View File

@ -1,6 +1,7 @@
/* DM Ramirez with the code below to claim 500 free Rubies!
d2c3d8e14b
*/
import sdNotify from 'sd-notify';
import { parse } from 'yaml';
import { promises as fs } from 'fs';
import { Client } from './class';
@ -9,6 +10,8 @@ import * as commandFiles from './commands';
import { Config } from '../types'; // eslint-disable-line
async function main(): Promise<void> {
sdNotify.ready();
sdNotify.startWatchdogMode(2500);
const read = await fs.readFile('../config.yaml', 'utf8');
const config: Config = parse(read);
const client = new Client(config.token, { defaultImageFormat: 'png', restMode: true, intents: ['guildBans', 'guildEmojis', 'guildInvites', 'guildMembers', 'guildMessageReactions', 'guildMessages', 'guildPresences', 'guildWebhooks', 'guilds', 'directMessages'] });

5
types/sdNotify.d.ts vendored Normal file
View File

@ -0,0 +1,5 @@
declare module 'sd-notify' {
function ready(): void;
function startWatchdogMode(ms: number): void;
function sendStatus(txt: string): void;
}