コード例 #1
0
 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);
 }
コード例 #2
0
 public void ChannelParted(TwitchChannel channel)
 {
     storagePlugin = null;
     chan          = null;
 }