Ejemplo n.º 1
0
 /// <summary>
 ///     Creates a new LavalinkNode instance without a Cluster
 /// </summary>
 /// <param name="options">The options of this Node</param>
 /// <param name="discordSendFunction">The DiscordSendFunction for the OP4 Packets</param>
 /// <param name="client">Optional, the HttpClient to use for Rest Requests</param>
 public LavalinkNode(LavalinkNodeOptions options, Func <long, UpdateVoiceStateDispatch, Task> discordSendFunction,
                     HttpClient client = null)
 {
     Options              = options;
     ResumeKey            = options.ResumeKey;
     Players              = new PlayerStore(this);
     _discordSendFunction = discordSendFunction;
     _http = client ?? new HttpClient();
 }
Ejemplo n.º 2
0
        /// <summary>
        ///     Creates a new LavalinkNode instance from a Cluster
        /// </summary>
        /// <param name="cluster">The LavalinkCluster which this Node is a part of</param>
        /// <param name="options">The options of this Node</param>
        public LavalinkNode(LavalinkCluster cluster, LavalinkNodeOptions options)
        {
            Cluster = cluster;
            Event  += (sender, data) => Cluster.EmitEvent(EventType.EVENT, data);
            Stats  += (sender, data) => Cluster.EmitEvent(EventType.STATS, data);
            Logs   += (sender, data) => Cluster.EmitEvent(EventType.LOGS, data);

            Players   = new PlayerStore(this);
            Options   = options;
            ResumeKey = options.ResumeKey;
        }