Exemplo n.º 1
0
        private static string GetEventName(RpcGlobalEvent rpcEvent)
        {
            switch (rpcEvent)
            {
            case RpcGlobalEvent.ChannelCreated: return("CHANNEL_CREATE");

            case RpcGlobalEvent.GuildCreated: return("GUILD_CREATE");

            case RpcGlobalEvent.VoiceSettingsUpdated: return("VOICE_SETTINGS_UPDATE");

            default:
                throw new InvalidOperationException($"Unknown RPC Global Event: {rpcEvent}");
            }
        }
Exemplo n.º 2
0
 public async Task UnsubscribeGlobal(RpcGlobalEvent evnt, RequestOptions options = null)
 {
     await ApiClient.SendGlobalUnsubscribeAsync(GetEventName(evnt), options).ConfigureAwait(false);
 }