앱 v1.1.0: 겜녹이 봇 기본 연결 + '다른 봇으로 진행하기'
- 설정 discord.botMode (builtin 기본 / custom). 겜녹이 봇은 토큰 입력 없이 연결 - 겜녹이 봇 토큰은 저장소에 두지 않고 빌드 때 GVR_BUILTIN_BOT_TOKEN 에서 읽어 감춘 값으로 박는다 - 마법사·디스코드 탭에 봇 선택 카드, 다른 봇일 때만 토큰 입력. 오가도 넣은 토큰 유지 - v1.0.0 에서 토큰을 넣어 쓰던 설치는 custom 으로 이어짐 - win-ci full 빌드가 서버 비밀 저장소에서 토큰을 넣고, smoke 에 기본 봇 로그인 결과 기록 - 테스트 6개 추가 (기본·다른 봇·전환·이전 설치·기본 봇 없는 빌드·개발 env) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -45,6 +45,8 @@ export interface AppState {
|
||||
dataDir: string;
|
||||
portable: boolean;
|
||||
settings: Settings;
|
||||
/** 이 빌드에 겜녹이 기본 봇 토큰이 들어 있는지 */
|
||||
builtinBot: boolean;
|
||||
secrets: { botToken: boolean; riotApiKey: boolean; deviceKey: boolean };
|
||||
secretCodec: string;
|
||||
bot: BotState;
|
||||
|
||||
@@ -19,6 +19,7 @@ export function buildState(core: Core, opts: { dataDir: string; portable: boolea
|
||||
dataDir: opts.dataDir,
|
||||
portable: opts.portable,
|
||||
settings: s,
|
||||
builtinBot: core.settings.hasBuiltinBot,
|
||||
secrets: { botToken: core.settings.hasSecret('botToken'), riotApiKey: core.settings.hasSecret('riotApiKey'), deviceKey: core.settings.hasSecret('deviceKey') },
|
||||
secretCodec: core.settings.codecName,
|
||||
bot: core.bot.state,
|
||||
@@ -46,8 +47,8 @@ export function registerIpc(core: Core, ft: Finetuner, ctx: { dataDir: string; p
|
||||
setSecret: (key, value) => core.settings.setSecret(key, value),
|
||||
|
||||
testBotToken: async (token?: string) => {
|
||||
const t = token || core.settings.getSecret('botToken');
|
||||
if (!t) return { ok: false, error: '봇 토큰을 입력해 주세요' };
|
||||
const t = token || core.settings.activeBotToken();
|
||||
if (!t) return { ok: false, error: core.settings.get().discord.botMode === 'builtin' ? '이 빌드에는 겜녹이 봇이 들어 있지 않습니다. 다른 봇으로 진행해 주세요' : '봇 토큰을 입력해 주세요' };
|
||||
const get = (p: string) => fetch(`https://discord.com/api/v10${p}`, { headers: { authorization: `Bot ${t}` } });
|
||||
try {
|
||||
const me = await get('/users/@me');
|
||||
|
||||
@@ -132,6 +132,9 @@ async function smoke(): Promise<void> {
|
||||
try {
|
||||
const c = await startCore({ dataDir, resourcesDir: resourcesDir(), worker: workerCommand(), version: app.getVersion(), codec: dpapiCodec() });
|
||||
out.codec = c.settings.codecName;
|
||||
out.builtinBot = c.settings.hasBuiltinBot;
|
||||
out.botMode = c.settings.get().discord.botMode;
|
||||
out.bot = { status: c.bot.state.status, user: c.bot.state.user?.name ?? null, error: c.bot.state.error };
|
||||
const ready = await new Promise<any>((res) => {
|
||||
if (c.worker.ready) return res(true);
|
||||
const t = setTimeout(() => res(false), 120000);
|
||||
|
||||
Reference in New Issue
Block a user