@@ -269,14 +269,14 @@ namespace Discord.API
options = RequestOptions.CreateOrClone(options);
options = RequestOptions.CreateOrClone(options);
return await SendRpcAsync<GetGuildsResponse>("GET_GUILDS", null, options: options).ConfigureAwait(false);
return await SendRpcAsync<GetGuildsResponse>("GET_GUILDS", null, options: options).ConfigureAwait(false);
}
}
public async Task<RpcGuild> SendGetGuildAsync(ulong guildId, RequestOptions options = null)
public async Task<Rpc.Rpc Guild> SendGetGuildAsync(ulong guildId, RequestOptions options = null)
{
{
options = RequestOptions.CreateOrClone(options);
options = RequestOptions.CreateOrClone(options);
var msg = new GetGuildParams
var msg = new GetGuildParams
{
{
GuildId = guildId
GuildId = guildId
};
};
return await SendRpcAsync<RpcGuild>("GET_GUILD", msg, options: options).ConfigureAwait(false);
return await SendRpcAsync<Rpc.Rpc Guild>("GET_GUILD", msg, options: options).ConfigureAwait(false);
}
}
public async Task<GetChannelsResponse> SendGetChannelsAsync(ulong guildId, RequestOptions options = null)
public async Task<GetChannelsResponse> SendGetChannelsAsync(ulong guildId, RequestOptions options = null)
{
{
@@ -287,14 +287,14 @@ namespace Discord.API
};
};
return await SendRpcAsync<GetChannelsResponse>("GET_CHANNELS", msg, options: options).ConfigureAwait(false);
return await SendRpcAsync<GetChannelsResponse>("GET_CHANNELS", msg, options: options).ConfigureAwait(false);
}
}
public async Task<RpcChannel> SendGetChannelAsync(ulong channelId, RequestOptions options = null)
public async Task<Rpc.Rpc Channel> SendGetChannelAsync(ulong channelId, RequestOptions options = null)
{
{
options = RequestOptions.CreateOrClone(options);
options = RequestOptions.CreateOrClone(options);
var msg = new GetChannelParams
var msg = new GetChannelParams
{
{
ChannelId = channelId
ChannelId = channelId
};
};
return await SendRpcAsync<RpcChannel>("GET_CHANNEL", msg, options: options).ConfigureAwait(false);
return await SendRpcAsync<Rpc.Rpc Channel>("GET_CHANNEL", msg, options: options).ConfigureAwait(false);
}
}
public async Task<SetLocalVolumeResponse> SendSetLocalVolumeAsync(int volume, RequestOptions options = null)
public async Task<SetLocalVolumeResponse> SendSetLocalVolumeAsync(int volume, RequestOptions options = null)
@@ -306,59 +306,63 @@ namespace Discord.API
};
};
return await SendRpcAsync<SetLocalVolumeResponse>("SET_LOCAL_VOLUME", msg, options: options).ConfigureAwait(false);
return await SendRpcAsync<SetLocalVolumeResponse>("SET_LOCAL_VOLUME", msg, options: options).ConfigureAwait(false);
}
}
public async Task<RpcChannel> SendSelectVoiceChannelAsync(ulong channelId, RequestOptions options = null)
public async Task<Rpc.Rpc Channel> SendSelectVoiceChannelAsync(ulong channelId, RequestOptions options = null)
{
{
options = RequestOptions.CreateOrClone(options);
options = RequestOptions.CreateOrClone(options);
var msg = new SelectVoiceChannelParams
var msg = new SelectVoiceChannelParams
{
{
ChannelId = channelId
ChannelId = channelId
};
};
return await SendRpcAsync<RpcChannel>("SELECT_VOICE_CHANNEL", msg, options: options).ConfigureAwait(false);
return await SendRpcAsync<Rpc.Rpc Channel>("SELECT_VOICE_CHANNEL", msg, options: options).ConfigureAwait(false);
}
}
public async Task<SubscriptionResponse> SendChannelSubscribeAsync(string evt, ulong channelId , RequestOptions options = null)
public async Task<SubscriptionResponse> SendGlobalSubscribeAsync(string evt , RequestOptions options = null)
{
{
options = RequestOptions.CreateOrClone(options);
options = RequestOptions.CreateOrClone(options);
var msg = new ChannelSubscriptionParams
{
ChannelId = channelId
};
var msg = new object();
return await SendRpcAsync<SubscriptionResponse>("SUBSCRIBE", msg, evt: evt, options: options).ConfigureAwait(false);
return await SendRpcAsync<SubscriptionResponse>("SUBSCRIBE", msg, evt: evt, options: options).ConfigureAwait(false);
}
}
public async Task<SubscriptionResponse> SendChannelUnsubscribeAsync(string evt, ulong channelId , RequestOptions options = null)
public async Task<SubscriptionResponse> SendGlobalUnsubscribeAsync(string evt, RequestOptions options = null)
{
{
options = RequestOptions.CreateOrClone(options);
options = RequestOptions.CreateOrClone(options);
var msg = new ChannelSubscriptionParams
{
ChannelId = channelId
};
var msg = new object();
return await SendRpcAsync<SubscriptionResponse>("UNSUBSCRIBE", msg, evt: evt, options: options).ConfigureAwait(false);
return await SendRpcAsync<SubscriptionResponse>("UNSUBSCRIBE", msg, evt: evt, options: options).ConfigureAwait(false);
}
}
public async Task<SubscriptionResponse> SendGlobalSubscribeAsync(string evt , RequestOptions options = null)
public async Task<SubscriptionResponse> SendGuildSubscribeAsync(string evt, ulong guildId , RequestOptions options = null)
{
{
options = RequestOptions.CreateOrClone(options);
options = RequestOptions.CreateOrClone(options);
var msg = new Channel SubscriptionParams
var msg = new Guild SubscriptionParams
{
{
GuildId = guildId
};
};
return await SendRpcAsync<SubscriptionResponse>("SUBSCRIBE", msg, evt: evt, options: options).ConfigureAwait(false);
return await SendRpcAsync<SubscriptionResponse>("SUBSCRIBE", msg, evt: evt, options: options).ConfigureAwait(false);
}
}
public async Task<SubscriptionResponse> SendGuildSubscribeAsync(string evt, ulong guildId, RequestOptions options = null)
public async Task<SubscriptionResponse> SendGuildUnsubscribeAsync(string evt, ulong guildId, RequestOptions options = null)
{
{
options = RequestOptions.CreateOrClone(options);
options = RequestOptions.CreateOrClone(options);
var msg = new GuildSubscriptionParams
var msg = new GuildSubscriptionParams
{
{
GuildId = guildId
GuildId = guildId
};
};
return await SendRpcAsync<SubscriptionResponse>("UNSUBSCRIBE", msg, evt: evt, options: options).ConfigureAwait(false);
}
public async Task<SubscriptionResponse> SendChannelSubscribeAsync(string evt, ulong channelId, RequestOptions options = null)
{
options = RequestOptions.CreateOrClone(options);
var msg = new ChannelSubscriptionParams
{
ChannelId = channelId
};
return await SendRpcAsync<SubscriptionResponse>("SUBSCRIBE", msg, evt: evt, options: options).ConfigureAwait(false);
return await SendRpcAsync<SubscriptionResponse>("SUBSCRIBE", msg, evt: evt, options: options).ConfigureAwait(false);
}
}
public async Task<SubscriptionResponse> SendGuildUnsubscribeAsync(string evt, ulong guildId, RequestOptions options = null)
public async Task<SubscriptionResponse> SendChannelUnsubscribeAsync(string evt, ulong channel Id, RequestOptions options = null)
{
{
options = RequestOptions.CreateOrClone(options);
options = RequestOptions.CreateOrClone(options);
var msg = new GuildSubscriptionParams
var msg = new Channel SubscriptionParams
{
{
GuildId = guildId
ChannelId = channel Id
};
};
return await SendRpcAsync<SubscriptionResponse>("UNSUBSCRIBE", msg, evt: evt, options: options).ConfigureAwait(false);
return await SendRpcAsync<SubscriptionResponse>("UNSUBSCRIBE", msg, evt: evt, options: options).ConfigureAwait(false);
}
}