0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00
server/project/src/helpers/Dialogue/Commando/SptCommandoCommands.ts

39 lines
1.1 KiB
TypeScript
Raw Normal View History

import { ICommandoAction } from "@spt-aki/helpers/Dialogue/Commando/ICommandoAction";
import { ICommandoCommand } from "@spt-aki/helpers/Dialogue/Commando/ICommandoCommand";
import { ISptCommand } from "@spt-aki/helpers/Dialogue/Commando/SptCommands/ISptCommand";
import { ISendMessageRequest } from "@spt-aki/models/eft/dialog/ISendMessageRequest";
import { IUserDialogInfo } from "@spt-aki/models/eft/profile/IAkiProfile";
import { injectAll, injectable } from "tsyringe";
@injectable()
export class SptCommandoCommands implements ICommandoCommand
{
constructor(
@injectAll("SptCommand") protected sptCommands: ISptCommand[]
)
{
}
public getCommandHelp(command: string): string
{
return this.sptCommands.find(c => c.getCommand() === command)?.getCommandHelp();
}
public getCommandPrefix(): string
{
return "spt";
}
public getCommands(): Set<string>
{
return new Set(this.sptCommands.map(c => c.getCommand()));
}
public getCommandAction(command: string): ICommandoAction
{
return this.sptCommands.find(c => c.getCommand() === command);
}
}