-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathManageCommands.cs
65 lines (55 loc) · 1.51 KB
/
ManageCommands.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using EleCho.GoCqHttpSdk;
using EleCho.GoCqHttpSdk.Message;
using NullLib.CommandLine;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace MiraiGo_C
{
/// <summary>
/// 管理指令
/// </summary>
internal class ManageCommands
{
public ManageCommands(CqWsSession session)
{
Session = session;
}
public CqWsSession Session { get; }
[Command]
public void Help()
{
Console.WriteLine($"OriBot v.{Assembly.GetExecutingAssembly().GetName().Version}");
Console.WriteLine("114514!");
Console.WriteLine(
"""
OriBot 命令手册
退出:
Exit
发送群消息:
SendGroupMessage {群号} {消息内容}
发送私聊消息;
SendPrivateMessage {群号} {消息内容}
""");
}
[Command]
public void Exit()
{
Console.WriteLine("感谢使用!");
Environment.Exit(0);
}
[Command]
public void SendGroupMessage(long groupId, CqMessage message)
{
Session.SendGroupMessageAsync(groupId, message).Wait();
}
[Command]
public void SendPrivateMessage(long friendId, CqMessage message)
{
Session.SendPrivateMessageAsync(friendId, message);
}
}
}