v0.2.1 (#53)
* ios proxy app, tune vp8 tunnel * refactor go modules, move headless joiner android to a go captcha * restore emojis in vk bot keyboard * headless support in vk bot * remove telemost dc hooks, update cretor-app ui and bot * remove telemost support from go code, add fallback to video if mode == dc in joiners * fix headless creators in windows * update vk call creation autoclick * force desktop useragent for creator app * kick disconnected user in headless vk creator immediately when connection is lost * update README.md * update SETUP.md * update release version * add fallback for link creation in vk bot
This commit is contained in:
1 parent
9e1f2a98d9
commit
1b2d6bc5d3
89 files changed
+3503
-2158
No files matched your search
@@ -163,10 +163,9 @@ export class BotManager {
|
||||
if (payload?.cmd) {
|
||||
const handled = await this.handlePayloadCommand(payload, peerId);
|
||||
if (handled) return;
|
||||
if (payload.cmd === BotCommand.VK) {
|
||||
text = '/vk' + (payload.mode === 'video' ? ' video' : '');
|
||||
} else if (payload.cmd === BotCommand.TM) {
|
||||
text = '/tm' + (payload.mode === 'video' ? ' video' : '');
|
||||
const cmdPrefix = payload.cmd === BotCommand.VK ? '/vk' : payload.cmd === BotCommand.TM ? '/tm' : null;
|
||||
if (cmdPrefix && payload.mode) {
|
||||
text = `${cmdPrefix} ${payload.mode}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,19 +194,37 @@ export class BotManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
private parseTunnelMode(text: string, platform: Platform): TunnelMode {
|
||||
if (text.includes('headless')) {
|
||||
return platform === Platform.VK ? TunnelMode.HeadlessVK : TunnelMode.HeadlessTelemost;
|
||||
}
|
||||
if (text.includes('video')) return TunnelMode.PionVideo;
|
||||
return TunnelMode.DC;
|
||||
}
|
||||
|
||||
private tunnelModeLabel(mode: TunnelMode): string {
|
||||
switch (mode) {
|
||||
case TunnelMode.HeadlessVK:
|
||||
case TunnelMode.HeadlessTelemost:
|
||||
return 'Headless';
|
||||
case TunnelMode.PionVideo:
|
||||
return 'Video';
|
||||
default:
|
||||
return 'DC';
|
||||
}
|
||||
}
|
||||
|
||||
private async handleTextCommand(text: string, peerId: number): Promise<void> {
|
||||
if (text.startsWith('/vk')) {
|
||||
const mode = text.includes('video') ? TunnelMode.PionVideo : TunnelMode.DC;
|
||||
const mode = this.parseTunnelMode(text, Platform.VK);
|
||||
console.log('[BOT] Creating VK tab with mode:', mode);
|
||||
this.onCreateTab({ mode, peerId, platform: Platform.VK });
|
||||
const label = mode === TunnelMode.DC ? 'DC' : 'Video';
|
||||
await this.sendMessage(peerId, `Creating VK call (${label})`, createMainKeyboard());
|
||||
await this.sendMessage(peerId, `Creating VK call (${this.tunnelModeLabel(mode)})`, createMainKeyboard());
|
||||
} else if (text.startsWith('/tm')) {
|
||||
const mode = text.includes('video') ? TunnelMode.PionVideo : TunnelMode.DC;
|
||||
const mode = this.parseTunnelMode(text, Platform.Telemost);
|
||||
console.log('[BOT] Creating Telemost tab with mode:', mode);
|
||||
this.onCreateTab({ mode, peerId, platform: Platform.Telemost });
|
||||
const label = mode === TunnelMode.DC ? 'DC' : 'Video';
|
||||
await this.sendMessage(peerId, `Creating Telemost call (${label})`, createMainKeyboard());
|
||||
await this.sendMessage(peerId, `Creating Telemost call (${this.tunnelModeLabel(mode)})`, createMainKeyboard());
|
||||
} else if (text === '/list') {
|
||||
await this.showList(peerId);
|
||||
} else if (text.startsWith('/close ')) {
|
||||
|
||||
@@ -26,15 +26,16 @@ export function createMainKeyboard() {
|
||||
one_time: false,
|
||||
buttons: [
|
||||
[
|
||||
{ action: { type: 'text', label: 'VK DC', payload: JSON.stringify({ cmd: BotCommand.VK, mode: 'dc' }) } },
|
||||
{ action: { type: 'text', label: 'VK Video', payload: JSON.stringify({ cmd: BotCommand.VK, mode: 'video' }) } },
|
||||
{ action: { type: 'text', label: '📞 VK DC', payload: JSON.stringify({ cmd: BotCommand.VK, mode: 'dc' }) } },
|
||||
{ action: { type: 'text', label: '📹 VK Video', payload: JSON.stringify({ cmd: BotCommand.VK, mode: 'video' }) } },
|
||||
{ action: { type: 'text', label: '👻 VK Headless', payload: JSON.stringify({ cmd: BotCommand.VK, mode: 'headless' }) } },
|
||||
],
|
||||
[
|
||||
{ action: { type: 'text', label: 'TM DC', payload: JSON.stringify({ cmd: BotCommand.TM, mode: 'dc' }) } },
|
||||
{ action: { type: 'text', label: 'TM Video', payload: JSON.stringify({ cmd: BotCommand.TM, mode: 'video' }) } },
|
||||
{ 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: 'Active Tabs', payload: JSON.stringify({ cmd: BotCommand.List }) } },
|
||||
{ action: { type: 'text', label: '📋 Active Tabs', payload: JSON.stringify({ cmd: BotCommand.List }) } },
|
||||
],
|
||||
],
|
||||
};
|
||||
@@ -44,7 +45,7 @@ export function createListKeyboard(tabsList: TabListEntry[]) {
|
||||
const buttons = tabsList.map((entry) => {
|
||||
const shortId = padShortId(generateShortId(entry.id));
|
||||
const prefix = entry.isBot ? 'bot' : 'user';
|
||||
const status = entry.callStatus === CallStatus.Active ? '+' : '-';
|
||||
const status = entry.callStatus === CallStatus.Active ? '🟢' : '⚪';
|
||||
return [
|
||||
{
|
||||
action: {
|
||||
@@ -56,7 +57,7 @@ export function createListKeyboard(tabsList: TabListEntry[]) {
|
||||
];
|
||||
});
|
||||
buttons.push([
|
||||
{ action: { type: 'text', label: 'Back', payload: JSON.stringify({ cmd: BotCommand.Menu }) } },
|
||||
{ action: { type: 'text', label: '◀️ Back', payload: JSON.stringify({ cmd: BotCommand.Menu }) } },
|
||||
]);
|
||||
return { one_time: false, buttons };
|
||||
}
|
||||
Reference in new issue
Block a user