Esempio n. 1
0
        private void RemoveIntent()
        {
            string targetToken = $"{lbKnownIntents.SelectedItem}";

            TwitchBot.Commands.CustomMap.Remove(targetToken);
            lbKnownIntents.DataSource = Wit.ListIntents().Select(i => TwitchBot.Commands.Map.Keys.Contains(i) ? $"*{i}" : i).ToList <string>();
            TwitchBot.Commands.SaveCustomCommands();
            Wit.DeleteIntent(targetToken);
        }
Esempio n. 2
0
 private string[] RemoveCommand(TwitchMessage message)
 {
     if (message.HasModPrivileges && !string.IsNullOrEmpty(message.ArgsString))
     {
         string targetToken = message.ArgsString;
         if (TwitchBot.Commands.CustomMap.Keys.Contains(targetToken))
         {
             TwitchBot.Commands.CustomMap.Remove(targetToken);
             TwitchBot.Commands.SaveCustomCommands();
             Wit.DeleteIntent(targetToken);
             return(new string[] { $"Removed command: {targetToken}" });
         }
     }
     return(null);
 }