Пример #1
0
        private void Client_OnChatCommandReceived(object sender, OnChatCommandReceivedArgs e)
        {
            Console.WriteLine($"Chat Command - {e.Command.ChatMessage.Username}: {e.Command.ChatMessage.Message}");

            // TODO: We may want !stop to be a mod only command. Maybe?
            if (e.Command.CommandText.ToLower() == "stop")
            {
                Console.WriteLine("Stopping sounds");
                soundProcessor.CurrentlyPlaying.Dispose();
                soundProcessor.Dispose();
            }
            else if (SoundCommand.Exists(e.Command.CommandText))
            {
                soundProcessor.Queue(new SoundCommand(e.Command.CommandText));
            }
        }
Пример #2
0
        private void Client_OnUserJoined(object sender, OnUserJoinedArgs e)
        {
            Console.WriteLine($"{e.Username} joined the channel. Welcome!");
            // Check userSounds to see if the user has a sound file

            UserSound userSound = this.UserSounds.Find(s => s.Username.ToLower() == e.Username.ToLower());

            if (userSound != null)
            {
                // User was found, play the sound
                if (SoundCommand.Exists(userSound.Sound))
                {
                    soundProcessor.Queue(new SoundCommand(userSound.Sound));
                }
            }
        }