Added opcode 8
This commit is contained in:
@@ -125,6 +125,21 @@ namespace Discord.API
|
||||
//Get
|
||||
public sealed class GetMessagesResponse : List<MessageInfo> { }
|
||||
|
||||
//Commands
|
||||
internal sealed class GetUsersCommand : WebSocketMessage<GetUsersCommand.Data>
|
||||
{
|
||||
public GetUsersCommand() : base(8) { }
|
||||
public class Data
|
||||
{
|
||||
[JsonProperty("guild_id")]
|
||||
public string ServerId;
|
||||
[JsonProperty("query")]
|
||||
public string Query;
|
||||
[JsonProperty("limit")]
|
||||
public int Limit;
|
||||
}
|
||||
}
|
||||
|
||||
//Events
|
||||
internal sealed class MessageCreateEvent : MessageInfo { }
|
||||
internal sealed class MessageUpdateEvent : MessageInfo { }
|
||||
|
||||
@@ -182,6 +182,14 @@ namespace Discord
|
||||
return response.Pruned ?? 0;
|
||||
}
|
||||
|
||||
/// <summary>When Config.UseLargeThreshold is enabled, running this command will request the Discord server to provide you with all offline users for a particular server.</summary>
|
||||
public void RequestOfflineUsers(string serverId)
|
||||
{
|
||||
if (serverId == null) throw new ArgumentNullException(nameof(serverId));
|
||||
|
||||
_dataSocket.SendGetUsers(serverId);
|
||||
}
|
||||
|
||||
public Task EditProfile(string currentPassword = "",
|
||||
string username = null, string email = null, string password = null,
|
||||
ImageType avatarType = ImageType.Png, byte[] avatar = null)
|
||||
|
||||
@@ -141,5 +141,11 @@ namespace Discord.Net.WebSockets
|
||||
leaveVoice.Payload.ServerId = serverId;
|
||||
QueueMessage(leaveVoice);
|
||||
}
|
||||
public void SendGetUsers(string serverId, string query = "", int limit = 0)
|
||||
{
|
||||
var getOfflineUsers = new GetUsersCommand();
|
||||
getOfflineUsers.Payload.ServerId = serverId;
|
||||
QueueMessage(getOfflineUsers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user