public static Command GetSetCCCommand(Bot bot) { return(new Command("!setcc {CC code}", "Set the clash caller code for the current war.", "!setcc abc01", Command.CommandType.ModsOnly, bot, (message) => { return message.text.ToUpper().StartsWith("!SETCC "); }, (message) => { var clashCallerCode = message.text.Substring(7); ClashCaller.SetClashCaller(clashCallerCode); bot.SendMessage("Clash caller code set to " + clashCallerCode); })); }
protected override void ApplicationStartup(ILifetimeScope container, IPipelines pipelines) { ClashCaller.Init(); Bots.Init(); GroupCommands.Init(); Mods.Init(); try { //The bot can live if the members consistency isn't verified. Members.UpdateMembersByGroup(ConfigurationManager.AppSettings["GROUPME_TOKEN"], ConfigurationManager.AppSettings["GENERALCHAT_ID"]); Members.UpdateMembersByGroup(ConfigurationManager.AppSettings["GROUPME_TOKEN"], ConfigurationManager.AppSettings["WARCHAT_ID"]); } catch (Exception ex) { Bots.TestChatBot.SendMessage("Error while saving members into the database"); Bots.TestChatBot.SendMessage(ex.ToString()); } base.ApplicationStartup(container, pipelines); }
public static void Destroy(this ClashCaller c) { c.BaseDestroyed = true; }
public static void ResetTime(this ClashCaller c) { c.TimeAdded = DateTime.UtcNow; }