1
0
forked from noxious/server

Inline checking for less written code; removed unused import

This commit is contained in:
Dennis Postma 2025-01-24 23:52:56 +01:00
parent 7f4a784915
commit a0584c2bb9
2 changed files with 4 additions and 16 deletions

View File

@ -1,6 +1,5 @@
import { BaseEvent } from '#application/base/baseEvent'
import WeatherManager from '#managers/weatherManager'
import CharacterRepository from '#repositories/characterRepository'
import ChatService from '#services/chatService'
type TypePayload = {
@ -22,13 +21,8 @@ export default class ToggleFogCommand extends BaseEvent {
const args = ChatService.getArgs('fog', data.message)
if (args![0]) {
await WeatherManager.setFogValue(Number(args![0]))
}
else {
await WeatherManager.setFogValue(null)
}
await WeatherManager.setFogValue(args![0] ? Number(args![0]) : null);
callback(true)
} catch (error: any) {
this.logger.error('command error', error.message)
callback(false)

View File

@ -1,6 +1,5 @@
import { BaseEvent } from '#application/base/baseEvent'
import WeatherManager from '#managers/weatherManager'
import CharacterRepository from '#repositories/characterRepository'
import ChatService from '#services/chatService'
type TypePayload = {
@ -22,13 +21,8 @@ export default class ToggleRainCommand extends BaseEvent {
let args = ChatService.getArgs('rain', data.message)
if (args![0]) {
await WeatherManager.setRainValue(Number(args![0]))
}
else {
await WeatherManager.setRainValue(null)
}
await WeatherManager.setRainValue(args![0] ? Number(args![0]) : null);
callback(true)
} catch (error: any) {
this.logger.error('command error', error.message)
callback(false)