Hardly.Library.Twitch.AboutCommands.ListCommands C# (CSharp) Method

ListCommands() public method

public ListCommands ( TwitchUser speaker, string additionalText ) : void
speaker TwitchUser
additionalText string
return void
        void ListCommands(TwitchUser speaker, string additionalText)
        {
            var commands = ChatCommand.ForRoom(room);

            string chatMessage = "";
            if(commands != null) {
                foreach(var command in commands) {
                    if(!command.modOnly && command.enabled) {
                        if(chatMessage.Length > 0) {
                            chatMessage += ", ";
                        }
                        chatMessage += command.commandName;
                    }
                }
            }

            room.SendWhisper(speaker, chatMessage);
        }