1
0
Fork 0
mirror of https://github.com/muerwre/vk-tg-bot.git synced 2025-04-25 06:56:40 +07:00

added plaintext fallback for markdown

This commit is contained in:
Fedor Katurov 2021-05-27 12:27:13 +07:00
parent 1b0a1f20d5
commit ef4794a33f
8 changed files with 161 additions and 68 deletions

View file

@ -29,20 +29,27 @@ export class JoinLeaveHandler extends VkEventHandler<Fields, Values> {
`vk, group ${this.group.name}: ${user.first_name} ${user.last_name} ${dir} the group`
);
const parsed = this.template.theme({
user,
group: this.group,
isJoined: context.isJoin,
isLeave: context.isLeave,
count,
});
const parsed = this.template.theme(
{
user,
group: this.group,
isJoined: context.isJoin,
isLeave: context.isLeave,
count,
},
!!this.channel.markdown
);
const extras: ExtraReplyMessage = {
parse_mode: "Markdown",
disable_web_page_preview: true,
};
await this.telegram.sendMessageToChan(this.channel.id, parsed, extras);
await this.telegram.sendMessageToChan(
this.channel.id,
parsed,
!!this.channel.markdown,
extras
);
await next();
};