コード例 #1
0
 /// <summary>
 /// 异步撤回消息
 /// </summary>
 /// <param name="uri">API URI</param>
 /// <param name="sessionKey">Session Key</param>
 /// <param name="target">目标消息 ID</param>
 public static Task <string> RecallAsync(string uri, string sessionKey, int target) => ApiHttpUtilities.PostAsync($"{uri}recall", JsonConvert.SerializeObject(new { sessionKey, target }));
コード例 #2
0
 /// <summary>
 /// 异步移除群成员
 /// </summary>
 /// <param name="uri">API URI</param>
 /// <param name="sessionKey">Session Key</param>
 /// <param name="target">目标群号码</param>
 public static Task <string> QuitAsync(string uri, string sessionKey, long target) => ApiHttpUtilities.PostAsync($"{uri}quit", JsonConvert.SerializeObject(new { sessionKey, target }));
コード例 #3
0
 /// <summary>
 /// 异步发送好友消息
 /// </summary>
 /// <param name="uri">API URI</param>
 /// <param name="sessionKey">Session Key</param>
 /// <param name="target">目标号码</param>
 /// <param name="quote">引用的消息 ID</param>
 /// <param name="messageChain">消息链</param>
 public static Task <string> SendGroupMessageAsync(string uri, string sessionKey, long target, int?quote, MessageElement[] messageChain) => ApiHttpUtilities.PostAsync($"{uri}sendGroupMessage", JsonConvert.SerializeObject(new { sessionKey, target, quote, messageChain }));
コード例 #4
0
 /// <summary>
 /// 异步禁言群成员
 /// </summary>
 /// <param name="uri">API URI</param>
 /// <param name="sessionKey">Session Key</param>
 /// <param name="target">目标群号码</param>
 /// <param name="memberId">目标成员号码</param>
 public static Task <string> UnmuteAsync(string uri, string sessionKey, long target, long memberId) => ApiHttpUtilities.PostAsync($"{uri}unmute", JsonConvert.SerializeObject(new { sessionKey, target, memberId }));
コード例 #5
0
 /// <summary>
 /// 异步移除群成员
 /// </summary>
 /// <param name="uri">API URI</param>
 /// <param name="sessionKey">Session Key</param>
 /// <param name="target">目标群号码</param>
 /// <param name="memberId">目标成员号码</param>
 /// <param name="msg">移除消息</param>
 public static Task <string> KickAsync(string uri, string sessionKey, long target, long memberId, string msg = null) => ApiHttpUtilities.PostAsync($"{uri}kick", JsonConvert.SerializeObject(new { sessionKey, target, memberId, msg }));
コード例 #6
0
 /// <summary>
 /// 异步修改群成员信息
 /// </summary>
 /// <param name="uri">API URI</param>
 /// <param name="sessionKey">Session Key</param>
 /// <param name="target">目标群号码</param>
 /// <param name="memberId">目标成员号码</param>
 /// <param name="info">配置</param>
 public static Task <string> MemberInfoAsync(string uri, string sessionKey, long target, long memberId, object info) => ApiHttpUtilities.PostAsync($"{uri}memberInfo", JsonConvert.SerializeObject(new { sessionKey, target, memberId, info }));
コード例 #7
0
 /// <summary>
 /// 异步修改群设置
 /// </summary>
 /// <param name="uri">API URI</param>
 /// <param name="sessionKey">Session Key</param>
 /// <param name="target">目标群号码</param>
 /// <param name="config">配置</param>
 public static Task <string> GroupConfigAsync(string uri, string sessionKey, long target, object config) => ApiHttpUtilities.PostAsync($"{uri}groupConfig", JsonConvert.SerializeObject(new { sessionKey, target, config }));
コード例 #8
0
 /// <summary>
 /// 异步释放 Session
 /// </summary>
 /// <param name="uri">API URI</param>
 /// <param name="sessionKey">Session Key</param>
 /// <param name="qq">机器人号码</param>
 public static Task <string> ReleaseAsync(string uri, string sessionKey, long qq) => ApiHttpUtilities.PostAsync($"{uri}release", JsonConvert.SerializeObject(new { sessionKey, qq }));
コード例 #9
0
 /// <summary>
 /// 异步认证
 /// </summary>
 /// <param name="uri">API URI</param>
 /// <param name="authKey">AuthKey</param>
 public static Task <string> AuthAsync(string uri, string authKey) => ApiHttpUtilities.PostAsync($"{uri}auth", JsonConvert.SerializeObject(new { authKey }));
コード例 #10
0
 /// <summary>
 /// 异步配置 Session
 /// </summary>
 /// <param name="uri">API URI</param>
 /// <param name="sessionKey">Session Key</param>
 /// <param name="cacheSize">缓存大小</param>
 /// <param name="enableWebsocket">是否启用 Websocket</param>
 public static Task <string> ConfigAsync(string uri, string sessionKey, int cacheSize, bool enableWebsocket) => ApiHttpUtilities.PostAsync($"{uri}config", JsonConvert.SerializeObject(new { sessionKey, cacheSize, enableWebsocket }));