Skip to content

Commit 6b10fc8

Browse files
committed
修改管理 host
1 parent bc33011 commit 6b10fc8

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

packages/botcore/src/modules/admin/client.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
export default class AdminClient {
2-
constructor(private readonly secret: string) {
2+
constructor(private readonly secret: string, baseUrl?: string) {
3+
if (baseUrl) {
4+
this.BASE_URL = baseUrl;
5+
}
36
}
47

5-
private readonly BASE_URL = 'https://aquadx.net/aqua/api/v2/bot';
8+
private readonly BASE_URL: string = 'https://aquadx.net/aqua/api/v2/bot';
69

710
private async baseRequest(method: string, params: Record<string, string> = {}) {
811
const url = new URL(`${this.BASE_URL}/${method}`);

packages/botcore/src/modules/admin/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { BuilderEnv } from '../../botBuilder';
55
import UserContext from '../../UserContext';
66

77
export default <T extends BotTypes>({ bot, env, getContext, musicToFile }: BuilderEnv<T>) => {
8-
const client = new AdminClient(env.ADMIN_SECRET);
8+
const client = new AdminClient(env.ADMIN_SECRET, env.ADMIN_BASE);
99
const admins = env.ADMIN_UIDS.split(',');
1010

1111
const checkAdminUser = (fromId: T['ChatId']) => {

packages/types/src/types.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ export interface Env {
260260
export interface BotEnv extends Env {
261261
ADMIN_UIDS: string;
262262
ADMIN_SECRET: string;
263+
ADMIN_BASE?: string;
263264
GENIUS_SECRET: string;
264265
TELEGRAPH_SECRET: string;
265266
DEEPL_AUTH_KEY: string;

0 commit comments

Comments
 (0)