Skip to content

Commit

Permalink
trigger now recognizes message thread
Browse files Browse the repository at this point in the history
  • Loading branch information
orzklv committed May 23, 2023
1 parent f6df0cd commit 7e99f49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 4 additions & 9 deletions delta/trigger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const composer = new Composer();

composer.command("off", isReply, async (ctx: Context): Promise<void> => {
if (ctx?.message?.reply_to_message?.from?.id === ctx.me.id) {
await ctx.reply(`Ha-ha... yaxshi urinish!`);
await ctx.reply(`Ha-ha... yaxshi urinish!`, {
parse_mode: "HTML",
});
Expand Down Expand Up @@ -41,9 +42,7 @@ composer.command("off", isReply, async (ctx: Context): Promise<void> => {

composer.command("nometa", isReply, async (ctx: Context): Promise<void> => {
if (ctx?.message?.reply_to_message?.from?.id === ctx.me.id) {
await ctx.reply(`Ha-ha... yaxshi urinish!`, {
parse_mode: "HTML",
});
await ctx.reply(`Ha-ha... yaxshi urinish!`);
} else {
await ctx.api.deleteMessage(
ctx.message!.chat!.id,
Expand Down Expand Up @@ -77,9 +76,7 @@ composer.command("nometa", isReply, async (ctx: Context): Promise<void> => {

composer.command("nonoff", isReply, async (ctx: Context): Promise<void> => {
if (ctx?.message?.reply_to_message?.from?.id === ctx.me.id) {
await ctx.reply(`Ha-ha... yaxshi urinish!`, {
parse_mode: "HTML",
});
await ctx.reply(`Ha-ha... yaxshi urinish!`);
} else {
await ctx.api.deleteMessage(
ctx.message!.chat!.id,
Expand Down Expand Up @@ -113,9 +110,7 @@ composer.command("nonoff", isReply, async (ctx: Context): Promise<void> => {

composer.command("doc", isReply, async (ctx: Context): Promise<void> => {
if (ctx?.message?.reply_to_message?.from?.id === ctx.me.id) {
await ctx.reply(`Ha-ha... yaxshi urinish!`, {
parse_mode: "HTML",
});
await reply(ctx, `Ha-ha... yaxshi urinish!`);
} else {
const message =
`<b>Demak, <a href="tg://user?id=${ctx?.message?.reply_to_message?.from?.id}">${ctx?.message?.reply_to_message?.from?.first_name}</a>,</b>` +
Expand Down
2 changes: 1 addition & 1 deletion utils/sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const reply = async (
ctx: Context,
message: string,
buttons?: InlineKeyboard,
configs?: { [key: string]: any }
configs?: { [key: string]: any },
): Promise<any> => {
const config: { [key: string]: any } = {
parse_mode: "HTML",
Expand Down

0 comments on commit 7e99f49

Please sign in to comment.