forked from LagrangeDev/LagrangeV2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOperationExt.cs
More file actions
50 lines (35 loc) · 2.93 KB
/
Copy pathOperationExt.cs
File metadata and controls
50 lines (35 loc) · 2.93 KB
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
using Lagrange.Core.Common.Entity;
using Lagrange.Core.Common.Response;
using Lagrange.Core.Internal.Logic;
namespace Lagrange.Core.Common.Interface;
public static class OperationExt
{
public static Task<BotQrCodeInfo?> FetchQrCodeInfo(this BotContext context, byte[] k) =>
context.EventContext.GetLogic<WtExchangeLogic>().FetchQrCodeInfo(k);
public static Task<(bool Success, string Message)> CloseQrCode(this BotContext context, byte[] k, bool confirm) =>
context.EventContext.GetLogic<WtExchangeLogic>().CloseQrCode(k, confirm);
public static Task<Dictionary<string, string>> FetchCookies(this BotContext context, params List<string> domains) =>
context.EventContext.GetLogic<OperationLogic>().FetchCookies(domains);
public static Task<(string Key, uint Expiration)> FetchClientKey(this BotContext context) =>
context.EventContext.GetLogic<OperationLogic>().FetchClientKey();
public static Task<List<BotFriend>> FetchFriends(this BotContext context, bool refresh = false) =>
context.CacheContext.GetFriendList(refresh);
public static Task<List<BotGroup>> FetchGroups(this BotContext context, bool refresh = false) =>
context.CacheContext.GetGroupList(refresh);
public static Task<List<BotGroupMember>> FetchMembers(this BotContext context, long groupUin, bool refresh = false) =>
context.CacheContext.GetMemberList(groupUin, refresh);
public static Task<List<BotGroupNotificationBase>> FetchGroupNotifications(this BotContext context, ulong count, ulong start = 0) =>
context.EventContext.GetLogic<OperationLogic>().FetchGroupNotifications(count, start);
public static Task<List<BotGroupNotificationBase>> FetchFilteredGroupNotifications(this BotContext context, ulong count, ulong start = 0) =>
context.EventContext.GetLogic<OperationLogic>().FetchFilteredGroupNotifications(count, start);
public static Task<BotStranger> FetchStranger(this BotContext context, long uin) =>
context.EventContext.GetLogic<OperationLogic>().FetchStranger(uin);
public static Task SetGroupNotification(this BotContext context, long groupUin, ulong sequence, BotGroupNotificationType type, bool isFiltered, GroupNotificationOperate operate, string message = "") =>
context.EventContext.GetLogic<OperationLogic>().SetGroupNotification(groupUin, sequence, type, isFiltered, operate, message);
public static Task SetGroupReaction(this BotContext context, long groupUin, ulong sequence, string code, bool isAdd) =>
context.EventContext.GetLogic<OperationLogic>().SetGroupReaction(groupUin, sequence, code, isAdd);
public static Task<string> GetNTV2RichMediaUrl(this BotContext context, string fileUuid) =>
context.EventContext.GetLogic<OperationLogic>().GetNTV2RichMediaUrl(fileUuid);
public static Task<bool> SetBotAvatar(this BotContext context, Stream stream) =>
context.HighwayContext.UploadFile(stream, 90, Array.Empty<byte>());
}