1
0
Fork 0
mirror of https://github.com/muerwre/vk-tg-bot.git synced 2025-04-24 22:46:41 +07:00

added silent message mode

This commit is contained in:
Fedor Katurov 2022-05-26 10:11:25 +07:00
parent 740cf4f5e7
commit 34fa8a38b2
4 changed files with 6 additions and 2 deletions

View file

@ -6,7 +6,9 @@ import { UsersUserFull } from "vk-io/lib/api/schemas/objects";
import { ConfigGroup } from "../types"; import { ConfigGroup } from "../types";
import { ExtraReplyMessage } from "telegraf/typings/telegram-types"; import { ExtraReplyMessage } from "telegraf/typings/telegram-types";
interface Fields {} interface Fields {
silent?: boolean
}
interface Values { interface Values {
user?: UsersUserFull; user?: UsersUserFull;
@ -43,6 +45,7 @@ export class JoinLeaveHandler extends VkEventHandler<Fields, Values> {
const extras: ExtraReplyMessage = { const extras: ExtraReplyMessage = {
disable_web_page_preview: true, disable_web_page_preview: true,
disable_notification: !!this.template.fields.silent,
}; };
await this.telegram.sendMessageToChan( await this.telegram.sendMessageToChan(

View file

@ -18,7 +18,6 @@ import Composer from "telegraf";
import CallbackQueryUpdate = Update.CallbackQueryUpdate; import CallbackQueryUpdate = Update.CallbackQueryUpdate;
import { Template } from "../../template"; import { Template } from "../../template";
import { getAttachment } from "../../../utils/attachment"; import { getAttachment } from "../../../utils/attachment";
import PhotoMessage = Message.PhotoMessage;
type Button = "links" | "likes" | "more"; type Button = "links" | "likes" | "more";
type UrlPrefix = string; type UrlPrefix = string;

View file

@ -1,4 +1,5 @@
--- ---
silent: true
--- ---
{{!-- {{!--
use handlebars template here use handlebars template here

View file

@ -1,4 +1,5 @@
--- ---
silent: true
--- ---
{{!-- {{!--
use handlebars template here use handlebars template here