Skip to content

Commit

Permalink
Add /stats
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Sachivka <juicy.igor@gmail.com>
  • Loading branch information
isachivka committed May 15, 2023
1 parent 7e770e4 commit eaf063f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/bot.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Telegraf } from "telegraf";
import { Ctx } from "./types";

console.log(process.env.BOT_KEY);

export const bot = new Telegraf(process.env.BOT_KEY);

export const send = (ctx: Ctx, text: string) => {
Expand Down
1 change: 1 addition & 0 deletions src/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ export const commands = {
reDrawMode,
start: "start",
newDialog: "new_dialog",
stats: "stats",
};
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ bot.command(commands.start, (ctx) => {
}
});

bot.command(commands.stats, (ctx) => {
return send(ctx, "Version: " + require("../package.json").version);
});

modesArray.forEach((mode) => {
bot.command(mode, (ctx) => {
usersStorage.get(ctx.from.id).changeMode(mode);
Expand Down

0 comments on commit eaf063f

Please sign in to comment.