/// <summary>
        /// Creates a new VoiceNext client with specified settings.
        /// </summary>
        /// <param name="client">Discord client to create VoiceNext instance for.</param>
        /// <param name="config">Configuration for the VoiceNext client.</param>
        /// <returns>VoiceNext client instance.</returns>
        // Token: 0x06000012 RID: 18 RVA: 0x00002268 File Offset: 0x00000468
        public static VoiceNextExtension UseVoiceNext(this DiscordClient client, VoiceNextConfiguration config)
        {
            if (client.GetExtension <VoiceNextExtension>() != null)
            {
                throw new InvalidOperationException("VoiceNext is already enabled for that client.");
            }
            VoiceNextExtension voiceNextExtension = new VoiceNextExtension(config);

            client.AddExtension(voiceNextExtension);
            return(voiceNextExtension);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new VoiceNext client with specified settings.
 /// </summary>
 /// <param name="client">Discord client to create VoiceNext instance for.</param>
 /// <param name="config">Configuration for the VoiceNext client.</param>
 /// <returns>VoiceNext client instance.</returns>
 public static VoiceNextExtension UseVoiceNext(this DiscordClient client, VoiceNextConfiguration config)
 {
     ClientInstance = new VoiceNextExtension(config);
     client.AddModule(ClientInstance);
     return(ClientInstance);
 }