Add mod example 23

This commit is contained in:
CWX
2025-02-10 21:53:14 +00:00
parent 08ec102f99
commit e8f110f488
7 changed files with 200 additions and 2 deletions
@@ -0,0 +1,49 @@
using Core.Helpers.Dialog.Commando;
using Core.Models.Eft.Dialog;
using Core.Models.Eft.Profile;
using Core.Services;
namespace _23CustomAbstractChatBot.Commands;
public class AnotherCoolCommand : IChatCommand
{
private readonly MailSendService _mailSendService;
public AnotherCoolCommand(
MailSendService mailSendService
)
{
_mailSendService = mailSendService;
}
public string GetCommandPrefix()
{
return "anotherExample";
}
public string? GetCommandHelp(string command)
{
if (command == "test")
{
return "Usage: anotherExample test";
}
return null;
}
public List<string> GetCommands()
{
return ["test"];
}
public string? Handle(string command, UserDialogInfo commandHandler, string sessionId, SendMessageRequest request)
{
if (command == "test")
{
_mailSendService.SendUserMessageToPlayer(sessionId, commandHandler, $"This is another test message shown as a different example!");
return request.DialogId;
}
return null;
}
}
@@ -0,0 +1,49 @@
using Core.Helpers.Dialog.Commando;
using Core.Models.Eft.Dialog;
using Core.Models.Eft.Profile;
using Core.Services;
namespace _23CustomAbstractChatBot.Commands;
public class MyCoolCommand : IChatCommand
{
private readonly MailSendService _mailSendService;
public MyCoolCommand(
MailSendService mailSendService
)
{
_mailSendService = mailSendService;
}
public string GetCommandPrefix()
{
return "example";
}
public string? GetCommandHelp(string command)
{
if (command == "test")
{
return "Usage: example test";
}
return null;
}
public List<string> GetCommands()
{
return ["test"];
}
public string? Handle(string command, UserDialogInfo commandHandler, string sessionId, SendMessageRequest request)
{
if (command == "test")
{
_mailSendService.SendUserMessageToPlayer(sessionId, commandHandler, $"This is a test message shown as an example!");
return request.DialogId;
}
return null;
}
}