コード例 #1
0
        /// <summary>
        /// Invoked when a Heartbeat Acknowledged event is fired from Discord's WebSocket server.
        /// </summary>
        /// <param name="response">JSON response.</param>
        public void HeartbeatAcknowledged(string response)
        {
            HeartbeatResponse           heartbeat = serializer.Deserialize <HeartbeatResponse>(response);
            DiscordOnHeartbeatEventArgs args      = new DiscordOnHeartbeatEventArgs()
            {
                Heartbeat = heartbeat
            };

            OnHeartbeatNotify(args);
        }
コード例 #2
0
        protected void OnHeartbeatNotify(DiscordOnHeartbeatEventArgs e)
        {
            EventHandler <DiscordOnHeartbeatEventArgs> handler = OnHeartbeat;

            handler?.Invoke(this, e);
        }