diff --git a/src/commands/getName.ts b/src/commands/getName.ts new file mode 100644 index 0000000..b9492de --- /dev/null +++ b/src/commands/getName.ts @@ -0,0 +1,15 @@ +import { author, homepage, name, version } from "../../package.json"; + +const debug = require("debug")("bot:about_command"); + +const getName = () => (ctx: any) => { + + const name= ctx.from.last_name ? `${ctx.from.first_name} ${ctx.from.last_name}` : ctx.from.first_name; + + const message = `*${name}`; + debug(`Triggered "about" command with message \n${message}`); + + ctx.reply(message); +}; + +export { getName }; diff --git a/src/commands/index.ts b/src/commands/index.ts index c94a2c4..f701cfc 100644 --- a/src/commands/index.ts +++ b/src/commands/index.ts @@ -1,2 +1,5 @@ export * from "./about"; export * from "./sendkey"; + +export * from "./getName"; +