Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
besoeasy authored Nov 6, 2024
1 parent 8c72046 commit a092eab
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,6 @@ const handleIpData = async (ctx) => {
bot.on("message", async (ctx) => {
if (ctx.message.text) {
try {
// maintainance jobs
if (Math.random() < 0.05) {
deleteOldFiles(process.env.PURGEINTERVAL || 7);
ctx.reply(".. .. ... ..");
}

// text classification
const { text } = ctx.message;
const [command, ...args] = text.split(" ");
Expand All @@ -216,6 +210,11 @@ bot.on("message", async (ctx) => {
// handle commands

switch (lowerCaseCommand) {
case "/clean":
deleteOldFiles(process.env.PURGEINTERVAL || 7);
ctx.reply("-- Cleaned --");
break;

case "/about":
handleAbout(ctx);
break;
Expand Down

0 comments on commit a092eab

Please sign in to comment.