Ejemplo n.º 1
0
        /// <summary>
        /// Sets up Discord Events.
        /// </summary>
        private void SetUpEvents()
        {
            this._client.DebugLogger.Log("Setting up events.");

            this._client.Heartbeated += _client_HeartBeated;

            this._client.SocketOpened += _client_SocketOpened;


            this._client.Ready += async(e) =>
            {
                this._client.DebugLogger.Log("Ready");
                this._client.DebugLogger.Log($"Current user is '{_client.CurrentUser.Username}' which is connected to {_client.Guilds.Count} Guild(s).");

                SetupMusicModule();

                // Lets set the Status to something.
                await _client.UpdateStatusAsync(new DiscordGame("Emotions are Prohibited"));
            };


            this._client.MessageCreated += async(e) =>
            {
                if (e.Message.Content.ToLower() == $"{BotConfig.Instance.Prefix}restart mm" && e.Author.IsDeveloper())
                {
                    await e.Message.RespondAsync("Restarting Music Module now.");

                    _musMod.EmergencyDisconnect();
                    await Task.Delay(5000);

                    _musMod = null;
                    _musMod = new MusicModule();
                    _musMod.StartMusicModule();
                    await e.Message.RespondAsync("Restart Complete.");
                }
            };
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Setup the MusicModule
 /// </summary>
 private void SetupMusicModule()
 {
     _musMod = new MusicModule();
     _musMod.StartMusicModule();
 }