From 8947d269392acc0f8fdf56c713eaf97713a9f904 Mon Sep 17 00:00:00 2001 From: Eric Matala de Mazza Date: Thu, 27 Apr 2023 04:41:26 +0200 Subject: [PATCH] feat: get own duty --- src/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 1817d4d..aad9b7a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,7 +14,15 @@ bot.command("start", (ctx) => `Hi ${ctx.chat.type === "private" ? ctx.chat.first_name : "stranger"}` ) ); -bot.command("get", (ctx) => {}); + +bot.command("get", (ctx) => { + const { duty, done } = mapping.find( + ({ roomie }) => roomie.id === ctx.chat.id + )!; + if (done) ctx.reply("Du bist für diese Woche fertig"); + else ctx.reply(`Du bist dran mit ${duty.title} (${duty.description})`); +}); + bot.command("getall", (ctx) => {}); bot.command("done", (ctx) => {}); bot.command("off", (ctx) => {});