private static string GetEventName(RpcChannelEvent rpcEvent) { switch (rpcEvent) { case RpcChannelEvent.VoiceStateCreate: return("VOICE_STATE_CREATE"); case RpcChannelEvent.VoiceStateUpdate: return("VOICE_STATE_UPDATE"); case RpcChannelEvent.VoiceStateDelete: return("VOICE_STATE_DELETE"); case RpcChannelEvent.SpeakingStart: return("SPEAKING_START"); case RpcChannelEvent.SpeakingStop: return("SPEAKING_STOP"); case RpcChannelEvent.MessageCreate: return("MESSAGE_CREATE"); case RpcChannelEvent.MessageUpdate: return("MESSAGE_UPDATE"); case RpcChannelEvent.MessageDelete: return("MESSAGE_DELETE"); default: throw new InvalidOperationException($"Unknown RPC Channel Event: {rpcEvent}"); } }
public async Task UnsubscribeChannel(ulong channelId, RpcChannelEvent evnt, RequestOptions options = null) { await ApiClient.SendChannelUnsubscribeAsync(GetEventName(evnt), channelId).ConfigureAwait(false); }
public async Task UnsubscribeGuild(ulong guildId, RpcChannelEvent evnt, RequestOptions options = null) { await ApiClient.SendGuildUnsubscribeAsync(GetEventName(evnt), guildId, options).ConfigureAwait(false); }