봇 중계: 지켜보는 앱이 없는 서버의 슬래시 명령은 서버가 받지 않는다
봇 토큰을 직접 쓰는 v1.1.0 PC 가 아직 켜져 있으면 같은 명령을 서버와 PC 가 함께 받는다. 서버가 먼저 응답(defer)하면 PC 의 응답이 실패해 /녹음시작 이 동작하지 않으므로, 그 서버를 지켜보는 v1.2.1 앱이 있을 때만 받는다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,7 @@ class FakeSource extends EventEmitter implements BotSource {
|
||||
sent: { guildId: string; payload: any }[] = [];
|
||||
handlers = new Map<string, { server: (d: any) => void; state: (d: any) => void }>();
|
||||
commands: string[] = [];
|
||||
wants?: (guildId: string) => boolean;
|
||||
me() {
|
||||
return ME;
|
||||
}
|
||||
@@ -274,9 +275,13 @@ test('봇 중계: 슬래시 명령은 그 서버를 지켜보는 앱으로 가
|
||||
new Promise<string>((resolve) => s.source.emit('command', { name, guildId: G, user: m(user, user), voiceChannel: { id: VC1, name: '일반' } } satisfies BotCommand, resolve));
|
||||
try {
|
||||
assert.equal(await cmd('녹음시작', SUPER), '지금 이 서버에서 켜져 있는 겜녹이 앱이 없습니다.');
|
||||
// 지켜보는 앱이 없는 서버의 명령은 서버가 받지 않는다 (봇 토큰을 직접 쓰는 v1.1.0 PC 가 응답하게)
|
||||
assert.equal(s.source.wants?.(G), false);
|
||||
await a.gw.start();
|
||||
await b.gw.start();
|
||||
await a.gw.watch(G, { commands: false });
|
||||
assert.equal(s.source.wants?.(G), true);
|
||||
assert.equal(s.source.wants?.(OTHER_G), false);
|
||||
await b.gw.watch(G, { commands: false });
|
||||
const seenBy: string[] = [];
|
||||
a.gw.on('command', (c, respond) => (seenBy.push(`a:${c.name}`), respond(`A 가 ${c.name}`)));
|
||||
|
||||
Reference in New Issue
Block a user