telegraf-broadcast
Advanced tools
Comparing version 2.2.0 to 2.2.1
{ | ||
"name": "telegraf-broadcast", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Library for broadcast message to all users for telegraf.js", | ||
@@ -5,0 +5,0 @@ "author": "Stas Kardash real.peha@gmail.com", |
@@ -20,3 +20,2 @@ # Telegraf Broadcast | ||
const bot = new Telegraf(process.env.BOT_TOKEN) | ||
const broadcaster = new Broadcaster(bot) | ||
@@ -27,3 +26,3 @@ | ||
bot.start((ctx) => { | ||
broadcaster.broadcast(userIds, 'Hello everyone') | ||
broadcaster.sendMessage(userIds, 'Hello everyone') | ||
}) | ||
@@ -30,0 +29,0 @@ |
@@ -41,2 +41,4 @@ import { Job, EventCallback, CompletedEventCallback, FailedEventCallback, Queue, QueueOptions } from 'bull' | ||
static queueName: string | ||
constructor(bot: Telegraf<any> | Telegram, bullQueueOptions?: QueueOptions) | ||
@@ -65,3 +67,3 @@ | ||
public failed(formatJob?: boolean): Job<any> | Promise<FormatterFailedJob<any>> | ||
public failed(formatJob?: boolean): Promise<Job<any>> | Promise<FormatterFailedJob<any>> | ||
@@ -68,0 +70,0 @@ public status(): Promise<BroadcasterStatus> |
@@ -17,2 +17,4 @@ const { Telegraf, Telegram } = require('telegraf') | ||
class Broadcaster { | ||
static queueName = 'tg-broadcast' | ||
constructor(bot, bullQueueOptions) { | ||
@@ -24,3 +26,3 @@ const telegramApi = getTelegramApi(bot) | ||
this.queue = new Queue('broadcast', bullQueueOptions) | ||
this.queue = new Queue(Broadcaster.queueName, bullQueueOptions) | ||
this.queue.process((job, done) => { | ||
@@ -27,0 +29,0 @@ const { chatId, fromChatId, messageId, messageText, extra } = job.data |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8374
202
30