mirror of
https://github.com/oshima-studios/OshimaGameModule.git
synced 2025-12-05 08:09:04 +00:00
添加新指令
This commit is contained in:
parent
472d0cec79
commit
a9f0c7f6f1
@ -176,6 +176,7 @@ namespace Oshima.FunGame.WebAPI
|
|||||||
builder.Services.AddScoped<RainBOTService>();
|
builder.Services.AddScoped<RainBOTService>();
|
||||||
builder.Services.AddScoped<FunGameController>();
|
builder.Services.AddScoped<FunGameController>();
|
||||||
builder.Services.AddScoped<QQController>();
|
builder.Services.AddScoped<QQController>();
|
||||||
|
builder.Services.AddScoped<TestController>();
|
||||||
builder.Services.AddTransient(provider =>
|
builder.Services.AddTransient(provider =>
|
||||||
{
|
{
|
||||||
SQLHelper? sql = Factory.OpenFactory.GetSQLHelper();
|
SQLHelper? sql = Factory.OpenFactory.GetSQLHelper();
|
||||||
|
|||||||
@ -12,7 +12,7 @@ using Oshima.FunGame.WebAPI.Models;
|
|||||||
|
|
||||||
namespace Oshima.FunGame.WebAPI.Services
|
namespace Oshima.FunGame.WebAPI.Services
|
||||||
{
|
{
|
||||||
public class RainBOTService(FunGameController controller, QQController qqcontroller, QQBotService service, ILogger<RainBOTService> logger, IMemoryCache memoryCache)
|
public class RainBOTService(FunGameController controller, QQController qqcontroller, QQBotService service, ILogger<RainBOTService> logger, IMemoryCache memoryCache, TestController testController)
|
||||||
{
|
{
|
||||||
private static List<string> FunGameItemType { get; } = ["卡包", "武器", "防具", "鞋子", "饰品", "消耗品", "魔法卡", "收藏品", "特殊物品", "任务物品", "礼包", "其他"];
|
private static List<string> FunGameItemType { get; } = ["卡包", "武器", "防具", "鞋子", "饰品", "消耗品", "魔法卡", "收藏品", "特殊物品", "任务物品", "礼包", "其他"];
|
||||||
private bool FunGameSimulation { get; set; } = false;
|
private bool FunGameSimulation { get; set; } = false;
|
||||||
@ -21,6 +21,7 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
private QQBotService Service { get; } = service;
|
private QQBotService Service { get; } = service;
|
||||||
private ILogger<RainBOTService> Logger { get; } = logger;
|
private ILogger<RainBOTService> Logger { get; } = logger;
|
||||||
private IMemoryCache MemoryCache { get; set; } = memoryCache;
|
private IMemoryCache MemoryCache { get; set; } = memoryCache;
|
||||||
|
private TestController TestController { get; set; } = testController;
|
||||||
|
|
||||||
private async Task SendAsync(IBotMessage msg, string title, string content, int msgType = 0, object? media = null, int? msgSeq = null)
|
private async Task SendAsync(IBotMessage msg, string title, string content, int msgType = 0, object? media = null, int? msgSeq = null)
|
||||||
{
|
{
|
||||||
@ -105,6 +106,20 @@ namespace Oshima.FunGame.WebAPI.Services
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (e.Detail == "查询服务器启动时间")
|
||||||
|
{
|
||||||
|
string msg = NetworkUtility.JsonDeserialize<string>(TestController.GetLastLoginTime()) ?? "";
|
||||||
|
await SendAsync(e, "查询服务器启动时间", msg);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.Detail.StartsWith("查询任务计划"))
|
||||||
|
{
|
||||||
|
string msg = NetworkUtility.JsonDeserialize<string>(TestController.GetTaskScheduler(e.Detail.Replace("查询任务计划", ""))) ?? "";
|
||||||
|
await SendAsync(e, "查询任务计划", msg);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (e.Detail == "帮助" || e.Detail == "帮助1")
|
if (e.Detail == "帮助" || e.Detail == "帮助1")
|
||||||
{
|
{
|
||||||
await SendAsync(e, "饭给木", @"《饭给木》游戏指令列表(第 1 / 7 页)
|
await SendAsync(e, "饭给木", @"《饭给木》游戏指令列表(第 1 / 7 页)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user