public HelpResult ToResult(TopicHelp help, Footer foot) { return(new HelpResult( help, foot.Format(this, help) )); }
public NyaaSpam(IIrcComm ircComm, IMeidoComm meidoComm) { meido = meidoComm; irc = ircComm; log = meido.CreateLogger(this); // Setting up configuration. var xmlConf = new XmlConfig2 <Config>( Config.DefaultConfig(), (xml) => new Config(xml), log, Configure ); meido.LoadAndWatchConfig("NyaaSpam.xml", xmlConf); var bangs = new TopicHelp[] { new TopicHelp("nyaa bangs", Bangs()) }; var nyaaHelp = new TriggerHelp( () => string.Format( "Commands to manipulate which patterns are periodically checked for at {0}", conf.Feed), new CommandHelp( "add", "<pattern...>", "Adds pattern(s), separated by commas (,). Unless enclosed in quotation marks (\"), in which case " + "the pattern is added verbatim.") { AlsoSee = bangs }, new CommandHelp( "del", "<index...> | <pattern...>", "Removes pattern(s) indicated by list of indices. Can also accept a list of patterns " + "(or parts thereof) to be deleted. Lists of indices/patterns are comma (,) separated and indices can " + "be specified as a number range (x-y). (Ex: nyaa del 4, 7, 0-2)"), new CommandHelp( "show", "Gives an overview of all patterns that are checked for.") ) { AlsoSee = bangs }; Triggers = new Trigger[] { new Trigger("nyaa", Nyaa, TriggerOption.ChannelOnly) { Help = nyaaHelp } }; }
public WebSearches(IIrcComm ircComm, IMeidoComm meido) { irc = ircComm; var sites = new TopicHelp[] { new TopicHelp( "searches", "Supported site specific searches are, with the trigger in parentheses: YouTube (yt), " + "Wikipedia EN (wiki), MyAnimeList (mal), AniDB (anidb), MangaUpdates (mu), Visual Novel DB (vndb), " + "Steam Store (steam).") }; var t = TriggerThreading.Threadpool; Triggers = Trigger.Group( new Trigger("g", GoogleSearch, t) { Help = new TriggerHelp( "<query>", "Returns the first 3 results of a Google Search on passed query. There are also a number of " + "triggers for site specific searches, see the 'searches' help subject for more information.") { AlsoSee = sites } }, new Trigger("yt", YtSearch, t), new Trigger("wiki", WikiSearch, t), new Trigger("mal", MalSearch, t), new Trigger("anidb", AnidbSearch, t), new Trigger("mu", MuSearch, t), new Trigger("vndb", VndbSearch, t), new Trigger("steam", SteamSearch, t) // maybe: urbandict, dict, animenewsnetwork ); }