Exemplo n.º 1
0
        private void OnChannelDeleted(SocketFrame gatewayEvent)
        {
            GatewayEventArgs <Channel> eventArgs;

            if (IsChannelAGuildChannel(gatewayEvent))
            {
                eventArgs = new GatewayEventArgs <Channel>(gatewayEvent.GetData <GuildChannel>());
            }
            else
            {
                eventArgs = new GatewayEventArgs <Channel>(gatewayEvent.GetData <DirectMessageChannel>());
            }

            ChannelDeleted?.Invoke(this, eventArgs);
        }
Exemplo n.º 2
0
        private void FireEventOnDelegate <TEventData>(SocketFrame gatewayEvent, EventHandler <GatewayEventArgs <TEventData> > eventHandler)
        {
            var eventArgs = new GatewayEventArgs <TEventData>(gatewayEvent.GetData <TEventData>());

            eventHandler?.Invoke(this, eventArgs);
        }