mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-04 06:30:53 +00:00
feat(channels/telegram): add slash command support
- Local commands: /start (welcome), /help (dynamic list), /reset (clear session) - Non-local slash commands forwarded to ACP agent as prompts - AcpBridge captures available_commands_update to populate /help dynamically - SessionRouter gains hasSession/removeSession for /reset support
This commit is contained in:
parent
be838eea01
commit
2985201317
4 changed files with 88 additions and 2 deletions
|
|
@ -34,4 +34,17 @@ export class SessionRouter {
|
|||
getTarget(sessionId: string): SessionTarget | undefined {
|
||||
return this.toTarget.get(sessionId);
|
||||
}
|
||||
|
||||
hasSession(channelName: string, senderId: string): boolean {
|
||||
return this.toSession.has(`${channelName}:${senderId}`);
|
||||
}
|
||||
|
||||
removeSession(channelName: string, senderId: string): boolean {
|
||||
const key = `${channelName}:${senderId}`;
|
||||
const sessionId = this.toSession.get(key);
|
||||
if (!sessionId) return false;
|
||||
this.toSession.delete(key);
|
||||
this.toTarget.delete(sessionId);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue