Skip to content

Commit

Permalink
sleep timer
Browse files Browse the repository at this point in the history
  • Loading branch information
account0123 committed May 26, 2023
1 parent 84c50b0 commit c612e54
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "observer-bot",
"version": "1.0.0",
"description": "Discord bot written in Typescript and discord.js hosted on Heroku",
"description": "Discord bot written in Typescript and discord.js hosted",
"main": "index.js",
"scripts": {
"lint": "eslint . --ext .ts",
Expand Down
9 changes: 9 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import SnipeHandler from './snipeHandler';
import { Connections } from './config/connections';
import { RowDataPacket } from 'mysql2';
import { AddRoleCommand, BanCommand, CreateRoleCommand, DefineCommand, HelpCommand, RemoveRoleCommand, SayCommand } from './commands';
import { exit } from 'process';

const PORT = parseInt(process.argv[2]) || 5000;

Expand Down Expand Up @@ -34,6 +35,14 @@ app.use('/', (request: Request, response: Response) => {
const sniper = new SnipeHandler();
const handler = new CommandHandler();


// Sleep time
setTimeout(sleep, 12 * 60 * 60 * 1000)

function sleep(){
console.log("Hora de dormir (%d minutos completados)", performance.now() / 60000)
exit(0)
}
//////////////////////////////////////////////////////////////////
// DISCORD CLIENT LISTENERS //
//////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit c612e54

Please sign in to comment.