wbstream support

This commit is contained in:
kulikov0 committed 2026-05-08 23:57:30 +02:00
1 parent b48b0cb927
commit 3b3ffed0b3
49 files changed
+3060 -151

No files matched your search

+11 -1
View File
@@ -163,7 +163,10 @@ export class BotManager {
if (payload?.cmd) {
const handled = await this.handlePayloadCommand(payload, peerId);
if (handled) return;
const cmdPrefix = payload.cmd === BotCommand.VK ? '/vk' : payload.cmd === BotCommand.TM ? '/tm' : null;
let cmdPrefix: string | null = null;
if (payload.cmd === BotCommand.VK) cmdPrefix = '/vk';
else if (payload.cmd === BotCommand.TM) cmdPrefix = '/tm';
else if (payload.cmd === BotCommand.WB) cmdPrefix = '/wb';
if (cmdPrefix && payload.mode) {
text = `${cmdPrefix} ${payload.mode}`;
}
@@ -195,6 +198,7 @@ export class BotManager {
}
private parseTunnelMode(text: string, platform: Platform): TunnelMode {
if (platform === Platform.WBStream) return TunnelMode.HeadlessWBStream;
if (text.includes('headless')) {
return platform === Platform.VK ? TunnelMode.HeadlessVK : TunnelMode.HeadlessTelemost;
}
@@ -206,6 +210,7 @@ export class BotManager {
switch (mode) {
case TunnelMode.HeadlessVK:
case TunnelMode.HeadlessTelemost:
case TunnelMode.HeadlessWBStream:
return 'Headless';
case TunnelMode.PionVideo:
return 'Video';
@@ -225,6 +230,11 @@ export class BotManager {
console.log('[BOT] Creating Telemost tab with mode:', mode);
this.onCreateTab({ mode, peerId, platform: Platform.Telemost });
await this.sendMessage(peerId, `Creating Telemost call (${this.tunnelModeLabel(mode)})`, createMainKeyboard());
} else if (text.startsWith('/wb')) {
const mode = this.parseTunnelMode(text, Platform.WBStream);
console.log('[BOT] Creating WB Stream tab with mode:', mode);
this.onCreateTab({ mode, peerId, platform: Platform.WBStream });
await this.sendMessage(peerId, `Creating WB Stream room (${this.tunnelModeLabel(mode)})`, createMainKeyboard());
} else if (text === '/list') {
await this.showList(peerId);
} else if (text.startsWith('/close ')) {
+3
View File
@@ -34,6 +34,9 @@ export function createMainKeyboard() {
{ action: { type: 'text', label: '📹 TM Video', payload: JSON.stringify({ cmd: BotCommand.TM, mode: 'video' }) } },
{ action: { type: 'text', label: '👻 TM Headless', payload: JSON.stringify({ cmd: BotCommand.TM, mode: 'headless' }) } },
],
[
{ action: { type: 'text', label: '👻 WB Headless', payload: JSON.stringify({ cmd: BotCommand.WB, mode: 'headless' }) } },
],
[
{ action: { type: 'text', label: '📋 Active Tabs', payload: JSON.stringify({ cmd: BotCommand.List }) } },
],