From e45ad9322945e2c084f79c36aa5707a32fd6b299 Mon Sep 17 00:00:00 2001 From: Akiru Date: Sun, 28 Jan 2024 11:55:18 +0000 Subject: [PATCH] =?UTF-8?q?bot/helpCommand.ts=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New function to send the bot description as help text. --- bot/helpCommand.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 bot/helpCommand.ts diff --git a/bot/helpCommand.ts b/bot/helpCommand.ts new file mode 100644 index 0000000..3d759c5 --- /dev/null +++ b/bot/helpCommand.ts @@ -0,0 +1,15 @@ +import { ErisContext } from "./mod.ts"; +import { omitUndef } from "../utils/omitUndef.ts"; +import { botDescription } from "./mod.ts"; // Import the description + +export async function helpCommand(ctx: ErisContext) { + await ctx.reply( + botDescription, // Send the stored description + omitUndef({ + reply_to_message_id: ctx.message?.message_id, + allow_sending_without_reply: true, + disable_web_page_preview: true, // Disable link previews + parse_mode: "Markdown" + }), + ); +} \ No newline at end of file