mirror of
https://github.com/kirameki-cafe/Yumi.git
synced 2026-09-13 10:49:20 +00:00
Handle osu! command when the module is not initialized
This commit is contained in:
@@ -39,6 +39,10 @@ class App {
|
||||
}
|
||||
|
||||
public load_osu(): void {
|
||||
if (!Environment.get().OSU_API_KEY) {
|
||||
Logger.log('warn', 'OSU_API_KEY is not defined in .env, osu! features will be disabled');
|
||||
return;
|
||||
}
|
||||
Logger.log('info', 'Loading osu! Client');
|
||||
osu.init();
|
||||
}
|
||||
|
||||
@@ -2,14 +2,10 @@ import { Api } from 'node-osu';
|
||||
import Environment from './Environment';
|
||||
|
||||
class osuAPI {
|
||||
public client: Api;
|
||||
public client: Api | null;
|
||||
|
||||
constructor() {
|
||||
this.client = new Api(Environment.get().OSU_API_KEY, {
|
||||
notFoundAsError: false,
|
||||
completeScores: true,
|
||||
parseNumeric: true
|
||||
});
|
||||
this.client = null;
|
||||
}
|
||||
|
||||
public init(): void {
|
||||
|
||||
Reference in New Issue
Block a user