public void ChannelJoined(TwitchChannel channel) { chan = channel; // Get storage plugin storagePlugin = chan.GetModuleInterfaceHandler <IConcreteChatCommandStorage>(); if (storagePlugin != null) { // get the commands out of the plugin IEnumerable <SharedInformationalChatCommand> storageresult = storagePlugin.GetConcreteChatCommandsByChannelName(channel.Channel); if (storageresult != null) { // if not null, convert ienumerable to list. concreteCommands = storageresult.ToList(); } } if (concreteCommands != null) { LoadConcreteCommands(concreteCommands); } CommandServer.AddCommand(channel.Channel, CommandPermissions.Mod, "General", false, "!addcommand", "!addcommand !command cooldown \"some new response\"", "Adds a concrete 1 to 1 command response", RegisterChatCommand); CommandServer.AddCommand(channel.Channel, CommandPermissions.Mod, "General", false, "!remcommand", "!remcommand !command", "Adds a concrete 1 to 1 command response", UnRegisterChatCommand); }
public void ChannelParted(TwitchChannel channel) { storagePlugin = null; chan = null; }