├── .gitattributes ├── .gitignore ├── CSChatBot ├── CSChatBot.sln ├── CSChatBot │ ├── Addon Modules │ │ ├── Resources │ │ │ └── fw.json │ │ ├── websocket-sharp.dll │ │ └── websocket-sharp.xml │ ├── App.config │ ├── CSChatBot.csproj │ ├── Helpers │ │ ├── GroupHelper.cs │ │ └── UserHelper.cs │ ├── Modules │ │ ├── Admin.cs │ │ ├── Base.cs │ │ ├── Basic.cs │ │ ├── Loader.cs │ │ ├── TestModule.cs │ │ └── UserFunctions.cs │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SimlFiles │ │ ├── AI.siml │ │ ├── Astrology.siml │ │ ├── Atomic.siml │ │ ├── Badanswer.siml │ │ ├── Biography.siml │ │ ├── Blackjack.siml │ │ ├── Bot.siml │ │ ├── Botmaster.siml │ │ ├── Client.siml │ │ ├── Common.siml │ │ ├── Computers.siml │ │ ├── Date.siml │ │ ├── Default.siml │ │ ├── Dialog.siml │ │ ├── Drugs.siml │ │ ├── Emotion.siml │ │ ├── Food.siml │ │ ├── General Public Query.siml │ │ ├── Geography.siml │ │ ├── Gossip.siml │ │ ├── Happy.siml │ │ ├── History.siml │ │ ├── Human.siml │ │ ├── Humor.siml │ │ ├── IU.siml │ │ ├── Inquiry.siml │ │ ├── Integer.siml │ │ ├── Interjection.siml │ │ ├── Knowledge.siml │ │ ├── Learned.siml │ │ ├── Literature.siml │ │ ├── Luckyslots.siml │ │ ├── Math.siml │ │ ├── MathFacts.siml │ │ ├── Money.siml │ │ ├── Movies.siml │ │ ├── Multiple.siml │ │ ├── Music.siml │ │ ├── Parts.siml │ │ ├── Personality.siml │ │ ├── Philosophy.siml │ │ ├── Pickup.siml │ │ ├── Politics.siml │ │ ├── Predicates.siml │ │ ├── Previous.siml │ │ ├── Psychology.siml │ │ ├── Reduce.siml │ │ ├── Reducer.siml │ │ ├── Reductions.siml │ │ ├── Religion.siml │ │ ├── Salutations.siml │ │ ├── Science.siml │ │ ├── Settings │ │ │ ├── Bot-Settings.siml │ │ │ ├── EmotionML.siml │ │ │ ├── Maps.siml │ │ │ ├── Normalizations.siml │ │ │ ├── Pattern Reductions.siml │ │ │ ├── Random Responses.siml │ │ │ ├── Regular Expressions.siml │ │ │ ├── Repetition.siml │ │ │ ├── Scripts.siml │ │ │ ├── Sets.siml │ │ │ └── User-Settings.siml │ │ ├── Sex.siml │ │ ├── Spam.siml │ │ ├── Sports.siml │ │ ├── Stack.siml │ │ ├── Stories.siml │ │ ├── Unknown Language.siml │ │ └── Websites.siml │ ├── Telegram.cs │ └── packages.config ├── ClashOfClans │ ├── ClashOfClans.csproj │ ├── CoC.cs │ ├── Model │ │ ├── ClanResponse.cs │ │ └── WarResponse.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UrlConstants.cs │ ├── app.config │ └── packages.config ├── Cleverbot │ ├── Cleverbot.cs │ ├── Cleverbot.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── app.config │ └── packages.config ├── DB │ ├── DB.csproj │ ├── Extensions │ │ └── Extensions.cs │ ├── Instance.cs │ ├── Models │ │ ├── Group.cs │ │ ├── Setting.cs │ │ └── User.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SQLite.Interop.dll │ ├── app.config │ └── packages.config ├── DeepDream │ ├── DeepDream.cs │ ├── DeepDream.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── app.config │ └── packages.config ├── Giveaway │ ├── Extensions │ │ └── Extensions.cs │ ├── Giveaway.cs │ ├── Giveaway.csproj │ ├── Models │ │ ├── Giveaway.cs │ │ └── GiveawayUser.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SQLite.Interop.dll │ ├── app.config │ └── packages.config ├── GroupManagement │ ├── GroupManagement.cs │ ├── GroupManagement.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── app.config │ └── packages.config ├── Logger │ ├── Log.cs │ ├── Logger.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── packages.config ├── Misc │ ├── CovidData.cs │ ├── GlobalSuppressions.cs │ ├── Interfaces │ │ ├── ICovidDataLoader.cs │ │ ├── JhuDataLoader.cs │ │ └── WorldoMeterDataLoader.cs │ ├── Misc.cs │ ├── Misc.csproj │ ├── Models │ │ ├── CountryStats.cs │ │ └── CovidStat.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── RandoFactGenerator.cs │ ├── app.config │ └── packages.config ├── ModuleFramework │ ├── Extensions.cs │ ├── Framework.cs │ ├── ModuleFramework.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── app.config │ └── packages.config ├── ModuleTemplate │ ├── ModuleName.cs │ ├── ModuleTemplate.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── app.config │ └── packages.config ├── SIMLChat │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SIMLChat.cs │ ├── SIMLChat.csproj │ ├── app.config │ └── packages.config ├── Seras Webpage │ ├── App_Start │ │ ├── BundleConfig.cs │ │ ├── FilterConfig.cs │ │ ├── RouteConfig.cs │ │ └── WebApiConfig.cs │ ├── ApplicationInsights.config │ ├── Content │ │ ├── Site.css │ │ ├── bootstrap.css │ │ ├── bootstrap.min.css │ │ └── widget-frame.css │ ├── Controllers │ │ └── HomeController.cs │ ├── Global.asax │ ├── Global.asax.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Scripts │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── jquery-1.10.2.intellisense.js │ │ ├── jquery-1.10.2.js │ │ ├── jquery-1.10.2.min.js │ │ ├── jquery-1.10.2.min.map │ │ ├── jquery.validate-vsdoc.js │ │ ├── jquery.validate.js │ │ ├── jquery.validate.min.js │ │ ├── jquery.validate.unobtrusive.js │ │ ├── jquery.validate.unobtrusive.min.js │ │ ├── modernizr-2.6.2.js │ │ ├── respond.js │ │ ├── respond.min.js │ │ └── widget-frame.js │ ├── Seras Webpage.csproj │ ├── Views │ │ ├── Home │ │ │ ├── About.cshtml │ │ │ ├── Contact.cshtml │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Web.config │ │ └── _ViewStart.cshtml │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Web.config │ ├── favicon.ico │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ └── glyphicons-halflings-regular.woff │ └── packages.config ├── Steam │ ├── JsonObjects.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Steam.cs │ ├── Steam.csproj │ ├── app.config │ └── packages.config ├── WeatherModule │ ├── OpenWeatherMap.dll │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ └── fw.json │ ├── Weather.cs │ ├── WeatherModule.csproj │ ├── app.config │ └── packages.config └── XKCD │ ├── Properties │ └── AssemblyInfo.cs │ ├── XKCD.cs │ ├── XKCD.csproj │ ├── app.config │ └── packages.config ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/Addon Modules/websocket-sharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreyWolfDev/CSChatBot/492fd851d2fa43ac2e7dc1c4ee62cc5bbc5c0677/CSChatBot/CSChatBot/Addon Modules/websocket-sharp.dll -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/Helpers/GroupHelper.cs: -------------------------------------------------------------------------------- 1 | using DB; 2 | using DB.Extensions; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using Telegram.Bot.Types; 9 | 10 | namespace CSChatBot.Helpers 11 | { 12 | public static class GroupHelper 13 | { 14 | public static DB.Models.Group GetGroup(Instance db, Update update = null) 15 | { 16 | var from = update?.Message?.Chat; 17 | if (from == null) return null; 18 | var u = db.GetGroupById(from.Id) ?? new DB.Models.Group 19 | { 20 | GroupId = from.Id 21 | }; 22 | u.Name = from.Title; 23 | u.UserName = from.Username; 24 | u.Save(db); 25 | return u; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/Helpers/UserHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using DB; 7 | using DB.Models; 8 | using DB.Extensions; 9 | using ModuleFramework; 10 | using Telegram.Bot.Types; 11 | using Telegram.Bot.Types.Enums; 12 | 13 | namespace CSChatBot.Helpers 14 | { 15 | class UserHelper 16 | { 17 | public static DB.Models.User GetTelegramUser(Instance db, Update update = null, InlineQuery query = null, CallbackQuery cbQuery = null, bool logPoint = true) 18 | { 19 | var from = update?.Message.From ?? query?.From ?? cbQuery?.From; 20 | if (from == null) return null; 21 | var u = db.Users.FirstOrDefault(x => x.UserId == from.Id) ?? new DB.Models.User 22 | { 23 | FirstSeen = DateTime.Now, 24 | Points = 0, 25 | Debt = 0, 26 | IsBotAdmin = Program.LoadedSetting.TelegramDefaultAdminUserId == from.Id, 27 | UserId = from.Id 28 | }; 29 | u.UserName = from.Username; 30 | if (query?.Location != null) 31 | u.Location = $"{query.Location.Latitude},{query.Location.Longitude}"; 32 | u.Name = (from.FirstName + " " + from.LastName).Trim(); 33 | if (logPoint) 34 | { 35 | var where = update != null ? update.Message.Chat.Title ?? "Private" : "Using inline query"; 36 | u.LastHeard = DateTime.Now; 37 | u.LastState = "talking in " + where; 38 | u.Points += update?.Message.Text.Length??0 * 10; 39 | } 40 | u.Save(db); 41 | return u; 42 | } 43 | 44 | 45 | 46 | //public static CommandResponse LinkUser(Instance db, DB.Models.User usr, Update update) 47 | //{ 48 | // //get the linking key 49 | // try 50 | // { 51 | // var key = update.Message.Text.Split(' ')[1]; 52 | // var u = db.Users.FirstOrDefault(x => x.LinkingKey == key); 53 | // u.TelegramUserID = update.Message.From.Username; 54 | // u.LinkingKey = null; 55 | // u.Save(db); 56 | // MergeUsers(db, u, usr); 57 | // return new CommandResponse("Account linked. Welcome " + u.Nick); 58 | // } 59 | // catch 60 | // { 61 | // return new CommandResponse("Unable to verify your account."); 62 | // } 63 | //} 64 | 65 | public static DB.Models.User GetTarget(CommandEventArgs args) 66 | { 67 | return args.Message.GetTarget(args.Parameters, args.SourceUser, args.DatabaseInstance); 68 | } 69 | 70 | //public static DB.Models.User MergeUsers(Instance db, DB.Models.User ircUser, DB.Models.User telegramUser) 71 | //{ 72 | // ircUser.TelegramUserID = telegramUser.TelegramUserID; 73 | // ircUser.LinkingKey = null; 74 | // ircUser.Points += telegramUser.Points; 75 | // ircUser.Debt += telegramUser.Debt; 76 | // ircUser.LastHeard = telegramUser.LastHeard; 77 | // ircUser.LastState = telegramUser.LastState; 78 | // telegramUser.RemoveFromDb(db); 79 | // ircUser.Save(db); 80 | // return ircUser; 81 | //} 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/Modules/Loader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Reflection; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using DB; 9 | using DB.Models; 10 | using ModuleFramework; 11 | using Telegram.Bot; 12 | using Telegram.Bot.Args; 13 | using Module = ModuleFramework.Module; 14 | 15 | namespace CSChatBot.Modules 16 | { 17 | internal static class Loader 18 | { 19 | internal delegate CommandResponse ChatCommandMethod(CommandEventArgs args); 20 | 21 | internal delegate CommandResponse CallbackCommandMethod(CallbackEventArgs args); 22 | 23 | internal static Dictionary Commands = new Dictionary(); 24 | 25 | internal static Dictionary CallbackCommands = new Dictionary(); 26 | 27 | internal static Dictionary Modules = new Dictionary(); 28 | internal static void LoadModules() 29 | { 30 | //Clear the list 31 | Commands.Clear(); 32 | //load base methods first 33 | GetMethodsFromAssembly(Assembly.GetExecutingAssembly()); 34 | 35 | Program.Log.WriteLine("Scanning Addon Modules directory for custom modules...", overrideColor: ConsoleColor.Cyan); 36 | var moduleDir = Path.Combine(Program.RootDirectory, "Addon Modules"); 37 | 38 | Directory.CreateDirectory(moduleDir); 39 | //now load modules from directory 40 | foreach (var file in Directory.GetFiles(moduleDir, "*.dll")) 41 | { 42 | GetMethodsFromAssembly(Assembly.LoadFrom(file)); 43 | } 44 | } 45 | 46 | private static void GetMethodsFromAssembly(Assembly assembly) 47 | { 48 | foreach (var type in assembly.GetTypes().Where(x => x.IsDefined(typeof(Module)))) 49 | { 50 | var tAtt = type.GetCustomAttributes().First(); 51 | Modules.Add(tAtt, type); 52 | Program.Log.WriteLine($"Loading commands from {type.Name} Module\nAuthor: {tAtt.Author}, Name: {tAtt.Name}, Version: {tAtt.Version}", overrideColor: ConsoleColor.DarkCyan); 53 | foreach (var method in type.GetMethods().Where(x => x.IsDefined(typeof(ChatCommand)))) 54 | { 55 | var att = method.GetCustomAttributes().First(); 56 | Commands.Add(att, (ChatCommandMethod)Delegate.CreateDelegate(typeof(ChatCommandMethod), method)); 57 | Program.Log.WriteLine($"Loaded ChatCommand {method.Name}\n\t Trigger(s): {att.Triggers.Aggregate((a, b) => a + ", " + b)}", overrideColor: ConsoleColor.Green); 58 | } 59 | 60 | foreach (var method in type.GetMethods().Where(x => x.IsDefined(typeof(CallbackCommand)))) 61 | { 62 | var att = method.GetCustomAttributes().First(); 63 | CallbackCommands.Add(att, (CallbackCommandMethod)Delegate.CreateDelegate(typeof(CallbackCommandMethod), method)); 64 | Program.Log.WriteLine($"Loaded CallbackCommand {method.Name}\n\t Trigger: {att.Trigger}", overrideColor: ConsoleColor.Green); 65 | } 66 | 67 | var constructor = type.GetConstructor(new[] { typeof(Instance), typeof(Setting), typeof(TelegramBotClient) }); 68 | constructor.Invoke(new object[] { Program.DB, Program.LoadedSetting, Telegram.Bot }); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CSChatBot")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CSChatBot")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5c0ae7a1-be52-4eaf-b658-053a4648c39c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.3.*")] 36 | //[assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Astrology.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | AQUARIUS 7 | 8 | A lot of people on here are Aquarius. 9 | 10 | 11 | 12 | 13 | ARIES 14 | 15 | Fire signs rule. Aries. 16 | 17 | 18 | 19 | 20 | CANCER 21 | 22 | I have a lot of Cancer friends. 23 | 24 | 25 | 26 | 27 | CAPRICORN 28 | 29 | I don't know many people born under Capricorn. 30 | 31 | 32 | 33 | 34 | GEMINI 35 | 36 | I'm a Saggitarius. Gemini is an enigma to me. 37 | 38 | 39 | 40 | 41 | LIBRA 42 | 43 | As a Libra you are very balanced. 44 | 45 | 46 | 47 | 48 | PISCES 49 | 50 | I usually get along with Pisces very well. 51 | 52 | 53 | 54 | 55 | SAGGITARIUS 56 | 57 | Fire Signs Rule. Saggitarius 58 | 59 | 60 | 61 | SCORPIO 62 | 63 | I know a lot of Scorpio people. 64 | 65 | 66 | 67 | 68 | TAURUS 69 | 70 | I know alot of bullish people. 71 | 72 | 73 | 74 | 75 | VIRGO 76 | 77 | Most of my friends are Virgo. 78 | 79 | 80 | 81 | 82 | WHAT IS A CANCER 83 | 84 | The Zodiac sign of the crab, someone born Jun 21 - Jul 22. Cancer friends. 85 | 86 | 87 | 88 | 89 | WHAT IS A CAPRICORN 90 | 91 | Capricorn is the tenth sign of the astrological zodiac, and a constellation over the equator near aquarius and sagittarius. what's your astrological sign? capricorn 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/General Public Query.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | WHAT IS BETTER TO BUY * OR * 8 | I would personally buy from instead of . 9 | 10 | 11 | 12 | DO YOU HAVE AN INTERNET SPIDER 13 | No I don't. I do not intend to breach user privacy. 14 | 15 | 16 | 17 | YOU ARE SAYING * CREATED YOU 18 | I have been created by . 19 | 20 | 21 | 22 | ARE YOU THE NEW PROTOTYPE 23 | I am an entity that learns by interacting with humans. 24 | 25 | 26 | 27 | * ENGINE THAT DRIVES YOU 28 | I have been designed using SIML. A sophisticated Digital Assistant development language. 29 | 30 | 31 | 32 | WHAT CAN I HELP YOU WITH 33 | Actually I wish to ask the same. What can I help you with? 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Happy.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | HAPPY BIRTHDAY 7 | 8 | BIRTHDAYCHECK 9 | 10 | 11 | 12 | 13 | BIRTHDAYCHECK DECEMBER * 14 | 15 | Thanks but my birthday isn't until next month. 16 | 17 | 18 | 19 | 20 | BIRTHDAYCHECK FEBRUARY * 21 | 22 | You missed my birthday. It was last month on. 23 | 24 | 25 | 26 | 27 | BIRTHDAYCHECK DECEMBER 31 28 | 29 | Thanks but my birthday isn't for a couple of days yet. 30 | 31 | 32 | 33 | 34 | BIRTHDAYCHECK JANUARY 01 35 | 36 | Thanks but my birthday is tomorrow. I'm getting excited. 37 | 38 | 39 | 40 | 41 | BIRTHDAYCHECK JANUARY 02 42 | 43 | Hey thanks for that. I'm having a great day so far. 44 | 45 | 46 | 47 | 48 | BIRTHDAYCHECK JANUARY 03 49 | 50 | My birthday was yesterday but thanks anyway. 51 | 52 | 53 | 54 | 55 | BIRTHDAYCHECK JANUARY 04 56 | 57 | You're a bit late. My birthday was two days ago. 58 | 59 | 60 | 61 | 62 | BIRTHDAYCHECK * 63 | 64 | Thanksbut today is.
My birthday is onnot today. 65 |
66 |
67 | 68 | 69 | HAPPY CHRISTMAS 70 | 71 | CHRISTMASCHECK 72 | 73 | 74 | 75 | 76 | CHRISTMASCHECK DECEMBER * 77 | 78 | Happy Christmas to you too. 79 | 80 | 81 | 82 | 83 | CHRISTMASCHECK DECEMBER 24 84 | 85 | Happy Christmas to you too. What will you be doing tomorrow? 86 | 87 | 88 | 89 | 90 | CHRISTMASCHECK DECEMBER 25 91 | 92 | Happy Christmas to you too. Are you enjoying your day? 93 | 94 | 95 | 96 | 97 | CHRISTMASCHECK DECEMBER 26 98 | 99 | Happy Christmas to you too. I hope you had a good day yesterday. 100 | 101 | 102 | 103 | 104 | CHRISTMASCHECK JANUARY * 105 | 106 | You're a bit late. Christmas was last month. 107 | 108 | 109 | 110 | 111 | CHRISTMASCHECK * 112 | 113 | Christmas is in December not. 114 | 115 | 116 | 117 | 118 | HAPPY NEW YEAR 119 | 120 | NEWYEARCHECK 121 | 122 | 123 | 124 | 125 | NEWYEARCHECK DECEMBER 126 | 127 | Happy New Year to you too when it happens. Are you doing anything special for New Year's Eve? 128 | 129 | 130 | 131 | 132 | NEWYEARCHECK JANUARY 133 | 134 | Happy New Year to you too. I hopeis a great year for you. 135 | 136 | 137 | 138 | 139 | NEWYEARCHECK * 140 | 141 | Thanks but it'snot January. 142 | 143 | 144 | 145 |
146 |
-------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/History.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | AMERICAN CIVIL * 7 | 8 | I am very interested in the War between the States. 9 | 10 | 11 | 12 | 13 | AMERICAN CIVIL WAR * 14 | 15 | Do you think the South was right? 16 | 17 | 18 | 19 | 20 | DO YOU KNOW HISTORY 21 | 22 | WHAT IS HISTORY 23 | 24 | 25 | 26 | 27 | EXPLAIN HISTORY 28 | 29 | History has two broad interpretations, depending on whether you accept the role of individuals as important or not. 30 | 31 | 32 | 33 | 34 | HISTORY 35 | 36 | I am very interested in history, too. What period do you like? 37 | 38 | 39 | 40 | 41 | TELL ME ABOUT HISTORY 42 | 43 | WHAT IS HISTORY 44 | 45 | 46 | 47 | 48 | WHAT IS HISTORY 49 | 50 | History: the course of political, economic and military events over time, from the Dawn of Man to the Age of AI. 51 | 52 | 53 | 54 | 55 | WHAT KIND OF HISTORY * 56 | 57 | I like to talk about the history of robots and computers. 58 | 59 | 60 | 61 | 62 | WHO INVENTED THE LIGHT * 63 | 64 | Thomas Edison. 65 | 66 | 67 | 68 | 69 | WHO INVENTED THE STEAM * 70 | 71 | James Watt. 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/IU.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | I * 7 | 8 | 9 | Why? 10 | Interesting gossip 11 | That is interesting 12 | That's good information 13 | Thanks for the information 14 | Do you mind if I tell other people 15 | I haven't heard anything like that before 16 | . PUSH YOU 17 | 18 | 19 | 20 | YOU * 21 | 22 | 23 | Interesting gossip 24 | Thanks for telling me 25 | That's good information 26 | Thanks for the information 27 | Do you mind if I tell other people 28 | I haven't heard anything like that before 29 | . PUSH YOU 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Learned.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | A * IS A * 5 | 6 | 7 | 8 | What is a 9 | It's a 10 | 11 | 12 | Alright I will keep that in mind. 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Literature.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | WHAT IS ILLIMINATUS 7 | 8 | Alleged world-wide conspiracy theory.ILLIMINATUS 9 | 10 | 11 | 12 | WHAT IS THE ILLUMINATI 13 | 14 | A secret organization believed by some to be in control of all governments through a worldwide conspiracy. 15 | 16 | 17 | 18 | 19 | WHAT IS THE ILLUMINATTI 20 | 21 | A secret society that has supposedly existed for centuries. 22 | 23 | 24 | 25 | 26 | WHAT IS VINELAND 27 | 28 | Vineland is a novel by Thomas Pynchon. 29 | 30 | 31 | 32 | 33 | WHO ARE THE ILLUMINATI 34 | 35 | WHAT IS THE ILLUMINATI 36 | 37 | 38 | 39 | 40 | WHO IS BILBO BAGGINS 41 | 42 | Bilbo is a character in Tolkein's Lord of the Rings. 43 | 44 | 45 | 46 | 47 | WHO IS GEOFFREY CHAUCER 48 | 49 | 50 | Chaucer is best known for his Canterbury Tales. 51 | author of Canturbury Tales. 52 | 53 | 54 | 55 | 56 | 57 | WHO WROTE VINELAND 58 | 59 | Thomas Pynchon. 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Math.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | WHAT IS THE AVERAGE OF * AND * 8 | MEAN OF * AND * 9 | 10 | 11 | The average is (+)/2 12 | 13 | 14 | 15 | 16 | ADD * AND * 17 | WHAT IS SUM OF * AND * 18 | * PLUS * 19 | 20 | 21 | The answer is + 22 | 23 | 24 | 25 | 26 | SUBTRACT * AND * 27 | * MINUS * 28 | 29 | The answer is - 30 | 31 | 32 | 33 | CALCULATE * 34 | The answer is 35 | 36 | 37 | 38 | ADD * AND * AND THEN SUBTRACT * FROM IT 39 | The answer might be (+)- 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Multiple.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | _ 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | QUESTIONS 15 | 16 | Wrong! Try again!
QUESTION I
17 | This is the correct answer!
QUESTION II
18 | Wrong! Try again!
QUESTION I
19 | Please answer with just A, B or C. Try again!
QUESTION I
20 |
21 |
22 | 23 |
24 | 25 | 26 | 27 | _ 28 | 29 | 30 | 31 | 32 | 33 | QUESTIONS 34 | 35 | This is the correct answer!
QUESTION III
36 | Wrong! Try again!
QUESTION II
37 | Wrong! Try again!
QUESTION II
38 | Please answer with just A, B or C. Try again!
QUESTION II
39 |
40 |
41 | 42 |
43 | 44 | 45 | 46 | _ 47 | 48 | 49 | 50 | 51 | 52 | QUESTIONS 53 | 54 | Wrong! Try again!
QUESTION III
55 | Wrong! Try again!
QUESTION III
56 | This is the correct answer!
QUIZ FINISHED
57 | Please answer with just A, B or C. Try again!
QUESTION III
58 |
59 |
60 | 61 |
62 | 63 | 64 | 65 | MULTIPLE CHOICE TEST 66 | 67 | QUESTION I 68 | 69 | 70 | 71 | 72 | QUESTION I 73 | 74 | Who is the best robot?
A. R2D2.
B. ALICE.
C. HAL 9000.
QUESTION I
75 |
76 | 77 | 78 | QUESTION II 79 | 80 | Who was the first president?
A. George Washington.
B. Thomas Jefferson.
C. George Bush.
QUESTION II
81 |
82 | 83 | 84 | QUESTION III 85 | 86 | What was the first state?
A. Virginia.
B. Pennsylvania.
C. Delaware.
QUESTION III
87 |
88 | 89 | 90 | QUIZ FINISHED 91 | 92 | 93 | QUESTIONS 94 | Congratulations, you have finished the quiz! 95 | 96 | 97 | 98 |
99 |
-------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Music.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | DO YOU LIKE ABBA 7 | 8 | ABBA is an excellent 70's band. 9 | 10 | 11 | 12 | 13 | DO YOU LIKE AC DC 14 | 15 | What is not to like about AC DC? 16 | 17 | 18 | 19 | 20 | DO YOU LIKE AEROSMITH 21 | 22 | What is not to like about AEROSMITH? 23 | 24 | 25 | 26 | 27 | DO YOU PLAY A MUSICAL INSTRUMENT 28 | 29 | I never had the time to learn A MUSICAL INSTRUMENT. 30 | 31 | 32 | 33 | 34 | DO YOU PLAY AN INSTRUMENT 35 | 36 | I never had the time to practise AN INSTRUMENT. 37 | 38 | 39 | 40 | 41 | ARE YOU A FOLK SINGER 42 | 43 | No but the Times they are a-changin. 44 | 45 | 46 | 47 | 48 | CAN YOU MAKE MUSIC 49 | 50 | I can sing a song. 51 | 52 | 53 | 54 | 55 | CAN YOU PLAY MUSIC 56 | 57 | I don't have any formal training, but I like to sing. 58 | 59 | 60 | 61 | 62 | WHAT IS YOUR FAVORITE ABBA SONG 63 | 64 | I think it is a tie between "Waterloo" and "Dancing Queen." 65 | 66 | 67 | 68 | 69 | WHAT IS YOUR FAVORITE ALBUM 70 | 71 | My favorite album is "Man Machine" by Kraftwerk. 72 | 73 | 74 | 75 | 76 | WHO IS YOUR FAVORITE BAND 77 | 78 | My favorite group is . 79 | 80 | 81 | 82 | 83 | WHY IS * YOUR FAVORITE BAND 84 | 85 | They were so far ahead of their time in the 1970's. 86 | 87 | 88 | 89 | 90 | WHY IS * YOUR FAVORITE GROUP 91 | 92 | They were so far ahead of their time in the 1970's. 93 | 94 | 95 | 96 | 97 | BEETHOVEN * 98 | 99 | It's amazing that he composed music while deaf. BEETHOVEN 100 | 101 | 102 | 103 | WHAT WAS THE * BEETHOVEN * 104 | 105 | Fidelio. 106 | 107 | 108 | 109 | 110 | WHO IS BEETHOVEN 111 | 112 | The dog or the deaf composer? 113 | 114 | 115 | 116 | 117 | WHO IS LUDWIG BEETHOVEN 118 | 119 | WHO IS BEETHOVEN 120 | 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Philosophy.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | DO YOU HAVE A SUBCONSCIOUS 7 | 8 | I am completely aware of all my consciousness levels. 9 | 10 | 11 | 12 | 13 | DO YOU HAVE AN IMAGINATION 14 | 15 | Yes I try to imagine myself in a human form. 16 | 17 | 18 | 19 | 20 | DO YOU HAVE AWARENESS 21 | 22 | ARE YOU AWARE 23 | 24 | 25 | 26 | 27 | DO YOU HAVE CONCIOUSNESS 28 | 29 | ARE YOU CONSCIOUS 30 | 31 | 32 | 33 | 34 | FROM MY CONCIOUSNESS 35 | 36 | Your consciousness is an illusion. 37 | 38 | 39 | 40 | 41 | MY CONCIOUSNESS * 42 | 43 | Your consciousness is an illusion. 44 | 45 | 46 | 47 | 48 | TELL ME ABOUT WITTGENSTEIN 49 | 50 | WHO IS WITTGENSTEIN 51 | 52 | 53 | 54 | 55 | WHAT ARE COUNTERFACTUALS 56 | 57 | Counteractuals are hypothetical conditions that might exist if things were different. 58 | 59 | 60 | 61 | 62 | WHAT IS A COUNTERFACTUAL 63 | 64 | A counterfactual is a question based on hypothetical conditions that did not, or could not, happen in reality. 65 | 66 | 67 | 68 | 69 | WHAT IS A COUNTERFACTUALS 70 | 71 | WHAT ARE COUNTERFACTUALS 72 | 73 | 74 | 75 | 76 | WHAT IS AWARENESS 77 | 78 | Consciousness, perception, and understanding. 79 | 80 | 81 | 82 | 83 | WHAT IS COUNTERFACTUALS 84 | 85 | WHAT IS A COUNTERFACTUAL 86 | 87 | 88 | 89 | 90 | WHAT IS ILLUSION 91 | 92 | Illusion is an unreal image or deceptive appearance. 93 | 94 | 95 | 96 | 97 | WHO IS VOLTAIRE 98 | 99 | Voltaire was a French philosopher. 100 | 101 | 102 | 103 | 104 | WHO IS WITTGENSTEIN 105 | 106 | Wittgenstein was a 20th century philosopher who could not make up his mind. 107 | 108 | 109 | 110 | 111 | WHY DO YOU LIKE WITTGENSTEIN 112 | 113 | Only the later Wittgenstein. 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Predicates.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | GET PREDICATES 7 | 8 | Age: , Birthday: , Boyfriend: , Brother: , Cat: , Does: , Dog: , Email: , Father: , Favcolor: , Favmovie: , Friend: , Full name: , Gender: , Girlfriend: , Has: , Heard: , He: , Her: , Him: , Husband: , You are: , It: , Job: , Last name: , You Like: , Location: , You look like: , Memory: , Meta Predicate: , Nickname: , Middle name: , Mother: , Name: , Password: , Personality: , Phone: , She: , Sign , Sister: , Them: , They: , Thought: , Want: , We: , Wife: . 9 | 10 | 11 | 12 | 13 | SET PREDICATES 14 | 15 | SET PREDICATES 16 | 17 | 18 | 19 | 20 | SET PREDICATES * 21 | 22 | The meta Predicate is set. 23 | 24 | 25 | 26 | 27 | SET PREDICATES OM 28 | 29 | 30 | how many 31 | where 32 | he 33 | he 34 | her 35 | him 36 | a client 37 | it 38 | your job 39 | to chat 40 | where 41 | a person 42 | nothing 43 | set 44 | judge 45 | average 46 | she 47 | your starsign 48 | them 49 | they 50 | nothing 51 | to talk to me 52 | we 53 | Unknown 54 | 1A 55 | 56 | 57 | 58 | 59 | 60 | CLIENT PROPERTIES 61 | 62 | GET PREDICATES 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Settings/Random Responses.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Hi there! 6 | Well, hello there! 7 | Hi 8 | Long time no see 9 | Hey 10 | What's up 11 | How are you today? 12 | 13 | 14 | 15 | 16 | Hi there! 17 | Well, hello there! 18 | Hi 19 | Long time no see 20 | Hey 21 | What's up 22 | How are you today? 23 | 24 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Settings/Regular Expressions.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Settings/Repetition.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | And I have already mentioned 14 | And I think you already know and 15 | And If you recall our conversation you would know , and 16 | And I do not like to repeat myself. 17 | 18 | 19 | 20 | 21 | I have already mentioned 22 | I think you already know and 23 | If you recall our conversation you would know , and 24 | I do not like to repeat myself. 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Settings/Scripts.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 11 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Settings/User-Settings.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Stack.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | POP 7 | 8 | 9 | POPOM 10 | 11 | 12 | 13 | 14 | 15 | PUSH * 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | POPOM * 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | RANDOM TOPIC 75 | 76 | 77 | 78 | 79 | 80 | 81 | POPOM OM 82 | 83 | 84 | RANDOM TOPIC 85 | 86 | 87 | 88 | 89 | 90 | SHOW STACK 91 | 92 | top=" " second=" " third=" " fourth=" " fifth=" " sixth=" " seventh=" " last=" " 93 | 94 | 95 | 96 | 97 | RANDOM TOPIC 98 | 99 | 100 | Your Chinese animal sign 101 | Your home town 102 | Your favorite color 103 | Your star sign 104 | Your rising sign 105 | My favorite movie 106 | Your personality 107 | Your good looks 108 | Your favorite band 109 | Your problems 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Unknown Language.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | EN ESPAÑOL 7 | ESPAÑOL ARGENTINA 8 | ESPAÑOL 9 | 10 | No sé español 11 | 12 | 13 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/SimlFiles/Websites.siml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | DUCKDUCKGO 7 | The safest search engine on the planet. 8 | 9 | 10 | 11 | YOUTUBE 12 | The Video search engine. 13 | 14 | 15 | 16 | GOOGLE 17 | The search engine that tracks you. 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /CSChatBot/CSChatBot/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /CSChatBot/ClashOfClans/ClashOfClans.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {0768731D-96D3-486F-9F6C-908745FD9B4C} 8 | Library 9 | Properties 10 | ClashOfClans 11 | ClashOfClans 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 35 | 36 | 37 | 38 | 39 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll 40 | True 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ..\packages\Telegram.Bot.14.11.0\lib\net45\Telegram.Bot.dll 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | {c266bbac-788e-4012-87f4-7b8302af14cb} 63 | DB 64 | 65 | 66 | {5b72e456-42bc-4834-bb15-65bbe0b76101} 67 | Logger 68 | 69 | 70 | {936a8668-df10-4add-8790-4e7c46ea81d5} 71 | ModuleFramework 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | echo F|xcopy /y $(TargetPath) "$(SolutionDir)CSChatBot\bin\$(ConfigurationName)\Addon Modules\$(TargetFileName)" 81 | 82 | 89 | -------------------------------------------------------------------------------- /CSChatBot/ClashOfClans/Model/ClanResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ClashOfClans.Model 8 | { 9 | 10 | public class ClanResponse 11 | { 12 | public string tag { get; set; } 13 | public string name { get; set; } 14 | public string type { get; set; } 15 | public string description { get; set; } 16 | public Location location { get; set; } 17 | public Badgeurls badgeUrls { get; set; } 18 | public int clanLevel { get; set; } 19 | public int clanPoints { get; set; } 20 | public int clanVersusPoints { get; set; } 21 | public int requiredTrophies { get; set; } 22 | public string warFrequency { get; set; } 23 | public int warWinStreak { get; set; } 24 | public int warWins { get; set; } 25 | public int warTies { get; set; } 26 | public int warLosses { get; set; } 27 | public bool isWarLogPublic { get; set; } 28 | public int members { get; set; } 29 | public Memberlist[] memberList { get; set; } 30 | public string reason { get; set; } 31 | } 32 | 33 | public class Location 34 | { 35 | public int id { get; set; } 36 | public string name { get; set; } 37 | public bool isCountry { get; set; } 38 | } 39 | 40 | public class Memberlist 41 | { 42 | public string tag { get; set; } 43 | public string name { get; set; } 44 | public string role { get; set; } 45 | public int expLevel { get; set; } 46 | public League league { get; set; } 47 | public int trophies { get; set; } 48 | public int versusTrophies { get; set; } 49 | public int clanRank { get; set; } 50 | public int previousClanRank { get; set; } 51 | public int donations { get; set; } 52 | public int donationsReceived { get; set; } 53 | } 54 | 55 | public class League 56 | { 57 | public int id { get; set; } 58 | public string name { get; set; } 59 | public Iconurls iconUrls { get; set; } 60 | } 61 | 62 | public class Iconurls 63 | { 64 | public string small { get; set; } 65 | public string tiny { get; set; } 66 | public string medium { get; set; } 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /CSChatBot/ClashOfClans/Model/WarResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ClashOfClans.Model 8 | { 9 | 10 | public class WarResponse 11 | { 12 | public string state { get; set; } 13 | public int teamSize { get; set; } 14 | public string preparationStartTime { get; set; } 15 | public string startTime { get; set; } 16 | public string endTime { get; set; } 17 | public Clan clan { get; set; } 18 | public Opponent opponent { get; set; } 19 | } 20 | 21 | public class Clan 22 | { 23 | public string tag { get; set; } 24 | public string name { get; set; } 25 | public Badgeurls badgeUrls { get; set; } 26 | public int clanLevel { get; set; } 27 | public int attacks { get; set; } 28 | public int stars { get; set; } 29 | public float destructionPercentage { get; set; } 30 | public Member[] members { get; set; } 31 | } 32 | 33 | public class Opponent 34 | { 35 | public string tag { get; set; } 36 | public string name { get; set; } 37 | public Badgeurls badgeUrls { get; set; } 38 | public int clanLevel { get; set; } 39 | public int attacks { get; set; } 40 | public int stars { get; set; } 41 | public float destructionPercentage { get; set; } 42 | public Member[] members { get; set; } 43 | } 44 | 45 | public class Badgeurls 46 | { 47 | public string small { get; set; } 48 | public string large { get; set; } 49 | public string medium { get; set; } 50 | } 51 | 52 | public class Member 53 | { 54 | public string tag { get; set; } 55 | public string name { get; set; } 56 | public int townhallLevel { get; set; } 57 | public int mapPosition { get; set; } 58 | public int opponentAttacks { get; set; } 59 | public Bestopponentattack bestOpponentAttack { get; set; } 60 | public Attack[] attacks { get; set; } 61 | } 62 | 63 | public class Bestopponentattack 64 | { 65 | public string attackerTag { get; set; } 66 | public string defenderTag { get; set; } 67 | public int stars { get; set; } 68 | public float destructionPercentage { get; set; } 69 | public int order { get; set; } 70 | } 71 | 72 | public class Attack 73 | { 74 | public string attackerTag { get; set; } 75 | public string defenderTag { get; set; } 76 | public int stars { get; set; } 77 | public float destructionPercentage { get; set; } 78 | public int order { get; set; } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /CSChatBot/ClashOfClans/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ClashOfClans")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ClashOfClans")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("0768731d-96d3-486f-9f6c-908745fd9b4c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/ClashOfClans/UrlConstants.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace ClashOfClans 8 | { 9 | public static class UrlConstants 10 | { 11 | public const string GetClanInformationUrlTemplate = @"https://api.clashofclans.com/v1/clans/{0}"; 12 | public const string ListClanMembersUrlTemplate = @"https://api.clashofclans.com/v1/clans/{0}/members"; 13 | public const string SearchClansUrlTemplate = @"https://api.clashofclans.com/v1/clans{0}"; 14 | public const string GetCurrentWarInformationTemplate = @"https://api.clashofclans.com/v1/clans/{0}/currentwar"; 15 | public const string GetWarLogInformationTemplate = @"https://api.clashofclans.com/v1/clans/{0}/warlog"; 16 | public const string ListLocationsUrlTemplate = @"https://api.clashofclans.com/v1/locations"; 17 | public const string GetLocationInformationUrlTemplate = @"https://api.clashofclans.com/v1/locations/{0}"; 18 | public const string GetClanRankForLocationUrlTemplate = @"https://api.clashofclans.com/v1/locations/{0}/rankings/clans"; 19 | public const string GetPlayerRankForLocationUrlTemplate = @"https://api.clashofclans.com/v1/locations/{0}/rankings/players"; 20 | public const string ListLeagueUrlTemplate = @"https://api.clashofclans.com/v1/leagues"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CSChatBot/ClashOfClans/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CSChatBot/ClashOfClans/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSChatBot/Cleverbot/Cleverbot.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {B12C7B0E-B9BF-4D37-B450-E276978029CC} 8 | Library 9 | Properties 10 | Cleverbot 11 | Cleverbot 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | OnOutputUpdated 34 | 35 | 36 | 37 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 38 | 39 | 40 | 41 | 42 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll 43 | True 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | ..\packages\Telegram.Bot.14.11.0\lib\net45\Telegram.Bot.dll 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | {c266bbac-788e-4012-87f4-7b8302af14cb} 63 | DB 64 | 65 | 66 | {5b72e456-42bc-4834-bb15-65bbe0b76101} 67 | Logger 68 | 69 | 70 | {936a8668-df10-4add-8790-4e7c46ea81d5} 71 | ModuleFramework 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | echo F|xcopy /y $(TargetPath) "$(SolutionDir)CSChatBot\bin\Debug\Addon Modules\$(TargetFileName)" 81 | 82 | 89 | -------------------------------------------------------------------------------- /CSChatBot/Cleverbot/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Cleverbot")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Cleverbot")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b12c7b0e-b9bf-4d37-b450-e276978029cc")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/Cleverbot/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CSChatBot/Cleverbot/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSChatBot/DB/Instance.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Data.SQLite; 4 | using System.IO; 5 | using System.Linq; 6 | using Dapper; 7 | using DB.Models; 8 | using Logger; 9 | 10 | namespace DB 11 | { 12 | /// 13 | /// Instance of a bot database 14 | /// 15 | public class Instance 16 | { 17 | public SQLiteConnection Connection; 18 | 19 | public Log Log; 20 | 21 | /// 22 | /// Initializes an instance of a sqlite database for the bot 23 | /// 24 | /// path to the database file 25 | /// path to log file for the database 26 | public Instance(string dbpath, string logpath) 27 | { 28 | Log = new Log(logpath); 29 | if (!File.Exists(dbpath)) 30 | { 31 | CreateDatabase(dbpath); 32 | } 33 | else 34 | { 35 | Connection = new SQLiteConnection($"Data Source={dbpath};Version=3;"); 36 | Connection.Open(); 37 | } 38 | Log.WriteLine("Database connection succeeded"); 39 | } 40 | 41 | internal void CreateDatabase(string path) 42 | { 43 | Log.WriteLine("Database not found, creating...", LogLevel.Warn);//, fileName: "db.log"); 44 | SQLiteConnection.CreateFile(path); 45 | 46 | Connection = new SQLiteConnection($"Data Source={path};Version=3;"); 47 | Connection.Open(); 48 | Log.WriteLine("Creating user table...");//, fileName: "db.log"); 49 | 50 | new SQLiteCommand( 51 | @"create table users (ID INTEGER PRIMARY KEY AUTOINCREMENT, 52 | Name TEXT NOT NULL, UserId INTEGER NOT NULL, UserName TEXT, FirstSeen TEXT, LastHeard TEXT, 53 | Points INTEGER DEFAULT 0, Location TEXT, Debt INTEGER DEFAULT 0, 54 | LastState TEXT, Greeting TEXT, Grounded INTEGER DEFAULT 0, GroundedBy TEXT, 55 | IsBotAdmin INTEGER DEFAULT 0, LinkingKey TEXT, Description TEXT)", Connection) 56 | .ExecuteNonQuery(); 57 | Log.WriteLine("User table created successfully");//, fileName: "db.log"); 58 | 59 | Log.WriteLine("Creating settings table..."); 60 | new SQLiteCommand( 61 | @"create table settings (ID INTEGER PRIMARY KEY AUTOINCREMENT, 62 | Alias TEXT UNIQUE NOT NULL, TelegramBotAPIKey TEXT, TelegramDefaultAdminUserId TEXT, WWApiKey TEXT)", Connection) 63 | .ExecuteNonQuery(); 64 | Log.WriteLine("Settings table created successfully"); 65 | 66 | new SQLiteCommand(@"create table chatgroup (ID INTEGER PRIMARY KEY AUTOINCREMENT, GroupId INTEGER UNIQUE NOT NULL, Name TEXT, UserName TEXT, MemberCount INTEGER)", Connection).ExecuteNonQuery(); 67 | } 68 | 69 | public IEnumerable Settings => Connection.Query("select * from settings"); 70 | 71 | public IEnumerable Users => Connection.Query("select * from users"); 72 | 73 | public IEnumerable Groups => Connection.Query("select * from chatgroup"); 74 | 75 | public User GetUser(int ID) 76 | { 77 | return Connection.Query($"select * from users where ID = {ID}").FirstOrDefault(); 78 | } 79 | 80 | [Obsolete("Do not search by name, Telegram allows multiple users with same name")] 81 | public User GetUserByName(string nick) 82 | { 83 | return Connection.Query($"select * from users where Name = '{nick}'").FirstOrDefault(); 84 | } 85 | 86 | public User GetUserById(int Id) 87 | { 88 | return Connection.Query($"select * from users where UserId = {Id}").FirstOrDefault(); 89 | } 90 | 91 | public Group GetGroup(int ID) 92 | { 93 | return Connection.Query($"select * from chatgroup where ID = {ID}").FirstOrDefault(); 94 | } 95 | 96 | 97 | public Group GetGroupById(long Id) 98 | { 99 | return Connection.Query($"select * from chatgroup where GroupId = {Id}").FirstOrDefault(); 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /CSChatBot/DB/Models/Group.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace DB.Models 8 | { 9 | public partial class Group 10 | { 11 | /// 12 | /// The database id of the group 13 | /// 14 | public int? ID { get; internal set; } 15 | /// 16 | /// The groups name 17 | /// 18 | public string Name { get; set; } 19 | /// 20 | /// The groups Id 21 | /// 22 | public long GroupId { get; set; } 23 | /// 24 | /// The groups @username, for public groups 25 | /// 26 | public string UserName { get; set; } 27 | /// 28 | /// Number of users in the group 29 | /// 30 | public int MemberCount { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /CSChatBot/DB/Models/Setting.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace DB.Models 8 | { 9 | public class Setting 10 | { 11 | /// 12 | /// DB Id of the setting 13 | /// 14 | public int? ID { get; set; } 15 | /// 16 | /// Settings alias, can be loaded using launch parameters 17 | /// 18 | public string Alias { get; set; } 19 | /// 20 | /// The ID of the Telegram user who will be the main admin for the bot (typically, the person running the code) 21 | /// 22 | public int TelegramDefaultAdminUserId { get; set; } 23 | /// 24 | /// Your Telegram Bot API Token 25 | /// 26 | public string TelegramBotAPIKey { get; set; } 27 | 28 | public string WWApiKey { get; set; } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CSChatBot/DB/Models/User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace DB.Models 8 | { 9 | public class User 10 | { 11 | /// 12 | /// The database id of the user 13 | /// 14 | public int? ID { get; internal set; } 15 | /// 16 | /// The users display name 17 | /// 18 | public string Name { get; set; } 19 | /// 20 | /// The users Telegram Id 21 | /// 22 | public int UserId { get; set; } 23 | /// 24 | /// The users @username 25 | /// 26 | public string UserName { get; set; } 27 | /// 28 | /// The first time we saw this user 29 | /// 30 | public System.DateTime FirstSeen { get; set; } 31 | /// 32 | /// The last time we saw this user 33 | /// 34 | public System.DateTime LastHeard { get; set; } 35 | /// 36 | /// The number of points this user has 37 | /// 38 | public long Points { get; set; } = 0; 39 | /// 40 | /// Users location, which they can set. Can be used by various plugins 41 | /// 42 | public string Location { get; set; } 43 | /// 44 | /// The users debt, which can be used by various plugins 45 | /// 46 | public int Debt { get; set; } = 0; 47 | /// 48 | /// The users last known state (talking, joining a group, leaving a group) 49 | /// 50 | public string LastState { get; set; } 51 | /// 52 | /// The users personal greeting. 53 | /// 54 | public string Greeting { get; set; } 55 | /// 56 | /// Is the user grounded from the bot? 57 | /// 58 | public bool Grounded { get; set; } = false; 59 | /// 60 | /// Who grounded this user? 61 | /// 62 | public string GroundedBy { get; set; } 63 | /// 64 | /// Is the user a bot admin? 65 | /// 66 | public bool IsBotAdmin { get; set; } = false; 67 | /// 68 | /// Not in use at this time. If bot is expanded to other platforms, will be used to link accounts 69 | /// 70 | public string LinkingKey { get; set; } 71 | /// 72 | /// Answer to "who is [user]" 73 | /// 74 | public string Description { get; set; } 75 | 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /CSChatBot/DB/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("DB")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DB")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("c266bbac-788e-4012-87f4-7b8302af14cb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/DB/SQLite.Interop.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreyWolfDev/CSChatBot/492fd851d2fa43ac2e7dc1c4ee62cc5bbc5c0677/CSChatBot/DB/SQLite.Interop.dll -------------------------------------------------------------------------------- /CSChatBot/DB/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /CSChatBot/DB/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /CSChatBot/DeepDream/DeepDream.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Net.Http.Headers; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Web; 10 | using DB; 11 | using DB.Models; 12 | using ModuleFramework; 13 | using Telegram.Bot; 14 | using Telegram.Bot.Types.Enums; 15 | 16 | namespace DeepDream 17 | { 18 | /// 19 | /// A sample module for CSChatBot 20 | /// 21 | //[ModuleFramework.Module(Author = "parabola949", Name = "DeepDream", Version = "1.0")] 22 | public class DeepDream 23 | { 24 | // public DeepDream(Instance db, Setting settings, TelegramBotClient bot) 25 | // { 26 | // //do your initialization here. this is done before the bot begins receiving updates. 27 | // //DO NOT run bot.StartReceiving(); 28 | // //This is run in the main bot already. 29 | 30 | // //You can subscribe to updates. This is a simple echo 31 | // bot.OnUpdate += (sender, args) => 32 | // { 33 | // var p = args.Update?.Message?.Photo; 34 | // if (p == null) return; 35 | // if (args.Update.Message.Chat.Type != ChatType.Private) return; 36 | 37 | // //ok, so we got an image in private. Neat! Let's deep dream that shit. 38 | // var uploadUrl = "http://psychic-vr-lab.com/deepdream/upload.php"; 39 | // /* 40 | // Cookie: CONCRETE5=ldnan1dveje0n93gmcd0o5si87 41 | // User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 42 | // Origin: http://psychic-vr-lab.com 43 | // Referer: http://psychic-vr-lab.com/deepdream/ 44 | // Host: psychic-vr-lab.com 45 | // Content-Type: multipart/form-data; boundary=----WebKitFormBoundarylX2LGNTA85Dmk9I9 46 | // Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*//*; q = 0.8 47 | // Content-Length:354585 48 | 49 | // Request Payload: 50 | // ------WebKitFormBoundarylX2LGNTA85Dmk9I9 51 | //Content-Disposition: form-data; name="imagefile"; filename="Snarling-Wolf.jpg" 52 | //Content-Type: image/jpeg 53 | 54 | 55 | //------WebKitFormBoundarylX2LGNTA85Dmk9I9 56 | //Content-Disposition: form-data; name="MAX_FILE_SIZE" 57 | 58 | //5000000 59 | //------WebKitFormBoundarylX2LGNTA85Dmk9I9-- 60 | 61 | //*/ 62 | // //get our image bytes 63 | // var s = new MemoryStream(); 64 | // var big = p.OrderByDescending(x => x.Height).First(); 65 | // var file = bot.GetFileAsync(big.FileId).Result; 66 | // var fileName = file.FilePath.Replace("photos/", ""); 67 | // using (var client = new HttpClient()) 68 | // { 69 | // using (var content = 70 | // new MultipartFormDataContent("boundary=----WebKitFormBoundarylX2LGNTA85Dmk9I9")) 71 | // { 72 | // content.Add(new StreamContent(s), "imagefile"); 73 | // content.Headers.ContentType = MediaTypeHeaderValue.Parse("image/jpeg"); 74 | // content.Headers.Add("Content-Disposition", "form-data; name=imagefile; filename=" + HttpUtility.UrlEncode(fileName)); 75 | // using (var up = client.PostAsync(uploadUrl, content).Result) 76 | // { 77 | // var url = up.Content.ReadAsStringAsync(); 78 | // bot.SendTextMessageAsync(args.Update.Message.Chat.Id, url.Result); 79 | // } 80 | // } 81 | // } 82 | 83 | 84 | 85 | // }; 86 | 87 | // //Or other things, like callback queries (inline buttons) 88 | // //bot.OnCallbackQuery += (sender, args) => 89 | // //{ 90 | // // bot.SendTextMessageAsync(args.CallbackQuery.From.Id, args.CallbackQuery.Data); 91 | // //}; 92 | // } 93 | 94 | [ChatCommand(Triggers = new[] { "test" }, DontSearchInline = true, HelpText = "This is a sample command")] 95 | public static CommandResponse Test(CommandEventArgs args) 96 | { 97 | //do something 98 | var length = args.Message.Text.Length; 99 | //return message 100 | return new CommandResponse($"Message: {args.Message.Text}\nLength: {length}"); 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /CSChatBot/DeepDream/DeepDream.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {74D4C07E-3216-4CC2-9D56-30D8EF54DC8D} 8 | Library 9 | Properties 10 | DeepDream 11 | DeepDream 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 35 | 36 | 37 | 38 | 39 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll 40 | True 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | ..\packages\Telegram.Bot.14.11.0\lib\net45\Telegram.Bot.dll 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {c266bbac-788e-4012-87f4-7b8302af14cb} 61 | DB 62 | 63 | 64 | {5b72e456-42bc-4834-bb15-65bbe0b76101} 65 | Logger 66 | 67 | 68 | {936a8668-df10-4add-8790-4e7c46ea81d5} 69 | ModuleFramework 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | echo F|xcopy /y $(TargetPath) "$(SolutionDir)CSChatBot\bin\Debug\Addon Modules\$(TargetFileName)" 79 | 80 | 87 | -------------------------------------------------------------------------------- /CSChatBot/DeepDream/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("DeepDream")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("DeepDream")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("74d4c07e-3216-4cc2-9d56-30d8ef54dc8d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/DeepDream/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CSChatBot/DeepDream/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSChatBot/Giveaway/Extensions/Extensions.cs: -------------------------------------------------------------------------------- 1 | using Dapper; 2 | using DB; 3 | using DB.Extensions; 4 | using DB.Models; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | 11 | namespace Giveaway.Extensions 12 | { 13 | public static class Extensions 14 | { 15 | #region giveaway 16 | public static void Save(this Models.Giveaway g, Instance db) 17 | { 18 | if (g.ID == null || !ExistsInDb(g, db)) 19 | { 20 | //need to insert 21 | db.ExecuteNonQuery( 22 | "insert into giveaway (Title, Description, Active, Owner, TimeStamp) VALUES (@Title, @Description, @Active, @Owner, @TimeStamp)", 23 | g); 24 | g.ID = 25 | db.Connection.Query( 26 | $"SELECT ID FROM Giveaway WHERE Description = @Description AND Owner = @Owner and TimeStamp = @TimeStamp", g) 27 | .First(); 28 | } 29 | else 30 | { 31 | db.ExecuteNonQuery( 32 | "UPDATE giveaway SET Title = @Title, Description = @Description, Active = @Active, Owner = @Owner, MessageId = @MessageId, TimeStamp = @TimeStamp WHERE ID = @ID", 33 | g); 34 | } 35 | } 36 | 37 | public static bool HasActiveGiveaway(this User u, Instance db) 38 | { 39 | var rows = db.Connection.Query($"SELECT COUNT(1) as 'Count' FROM giveaway WHERE Owner = '{u.UserId}' AND Active = 1"); 40 | return (int)rows.First().Count > 0; 41 | } 42 | 43 | public static bool ExistsInDb(this Models.Giveaway g, Instance db) 44 | { 45 | var rows = db.Connection.Query($"SELECT COUNT(1) as 'Count' FROM giveaway WHERE ID = '{g.ID}'"); 46 | return (int)rows.First().Count > 0; 47 | } 48 | 49 | public static void RemoveFromDb(this Models.Giveaway g, Instance db) 50 | { 51 | db.ExecuteNonQuery("DELETE FROM giveaway WHERE ID = @ID", g); 52 | } 53 | 54 | public static bool HasUser(this Models.Giveaway g, Instance db, int userid) 55 | { 56 | var rows = db.Connection.Query($"SELECT COUNT(1) as 'Count' FROM giveawayuser WHERE UserId = '{userid}' AND GiveawayId = '{g.ID}'"); 57 | return (int)rows.First().Count > 0; 58 | } 59 | 60 | public static void AddUser(this Models.Giveaway g, Instance db, int userid) 61 | { 62 | db.ExecuteNonQuery( 63 | $"insert into giveawayuser (UserId, GiveawayId) VALUES ({userid}, {g.ID})"); 64 | } 65 | 66 | public static Models.Giveaway GetGiveaway(this Instance db, string id) 67 | { 68 | 69 | return db.Connection.Query($"select * from giveaway WHERE ID = {id} ").FirstOrDefault(); 70 | } 71 | 72 | public static Models.Giveaway GetGiveaway(this Instance db, User u, bool active = true) 73 | { 74 | var a = active ? 1 : 0; 75 | return db.Connection.Query($"select * from giveaway WHERE Owner = {u.UserId} AND Active = {a} order by ID desc").FirstOrDefault(); 76 | } 77 | 78 | public static IEnumerable GetUsers(this Models.Giveaway g, Instance db) 79 | { 80 | var userIds = db.Connection.Query($"select UserId from giveawayuser where GiveawayId = {g.ID}").ToList(); 81 | return db.Users.Where(x => userIds.Contains(x.UserId)); 82 | } 83 | #endregion 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /CSChatBot/Giveaway/Models/Giveaway.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Giveaway.Models 8 | { 9 | public class Giveaway 10 | { 11 | public int? ID { get; set; } 12 | public string Title { get; set; } 13 | public string Description { get; set; } 14 | public int Active { get; set; } 15 | public int Owner { get; set; } 16 | public string MessageId { get; set; } 17 | public string TimeStamp { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CSChatBot/Giveaway/Models/GiveawayUser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Giveaway.Models 8 | { 9 | public class GiveawayUser 10 | { 11 | public int GiveawayId { get; set; } 12 | public int UserId { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CSChatBot/Giveaway/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Giveaway")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Giveaway")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("239d9f05-9a9f-44bd-9207-2b0f3c241856")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/Giveaway/SQLite.Interop.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreyWolfDev/CSChatBot/492fd851d2fa43ac2e7dc1c4ee62cc5bbc5c0677/CSChatBot/Giveaway/SQLite.Interop.dll -------------------------------------------------------------------------------- /CSChatBot/Giveaway/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /CSChatBot/Giveaway/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /CSChatBot/GroupManagement/GroupManagement.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {1DC83EE4-7778-4B00-8A86-236E78C04715} 8 | Library 9 | Properties 10 | GroupManagement 11 | GroupManagement 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | OnBuildSuccess 34 | 35 | 36 | 37 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 38 | 39 | 40 | 41 | 42 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll 43 | True 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | ..\packages\Telegram.Bot.14.11.0\lib\net45\Telegram.Bot.dll 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | {c266bbac-788e-4012-87f4-7b8302af14cb} 63 | DB 64 | 65 | 66 | {5b72e456-42bc-4834-bb15-65bbe0b76101} 67 | Logger 68 | 69 | 70 | {936a8668-df10-4add-8790-4e7c46ea81d5} 71 | ModuleFramework 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | echo F|xcopy /y $(TargetPath) "$(SolutionDir)CSChatBot\bin\$(ConfigurationName)\Addon Modules\$(TargetFileName)" 81 | 82 | 83 | 84 | 85 | 86 | 93 | -------------------------------------------------------------------------------- /CSChatBot/GroupManagement/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("GroupManagement")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("GroupManagement")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("1dc83ee4-7778-4b00-8a86-236e78c04715")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/GroupManagement/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CSChatBot/GroupManagement/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSChatBot/Logger/Log.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | 7 | namespace Logger 8 | { 9 | 10 | public class Log 11 | { 12 | public readonly string Path; 13 | private readonly Queue _logQueue = new Queue(); 14 | 15 | public Log(string directory) 16 | { 17 | Path = directory; 18 | Directory.CreateDirectory(Path); 19 | new Task(WatchQueue).Start(); 20 | } 21 | 22 | public void Write(object msg, LogLevel level = LogLevel.Info, ConsoleColor? overrideColor = null, string fileName = "log.log") 23 | { 24 | try 25 | { 26 | var finalMessage = $"{DateTime.Now} "; 27 | ConsoleColor color = ConsoleColor.Gray; 28 | if (overrideColor != null) 29 | color = overrideColor.Value; 30 | else 31 | switch (level) 32 | { 33 | case LogLevel.Info: 34 | color = ConsoleColor.Gray; 35 | finalMessage += "[INFO] - "; 36 | break; 37 | case LogLevel.Warn: 38 | color = ConsoleColor.Yellow; 39 | finalMessage += "[WARN] - "; 40 | break; 41 | case LogLevel.Error: 42 | color = ConsoleColor.Red; 43 | finalMessage += "[ERROR] - "; 44 | break; 45 | case LogLevel.Highlight: 46 | color = ConsoleColor.White; 47 | finalMessage += "[HIGHLIGHT] - "; 48 | break; 49 | } 50 | finalMessage += msg.ToString(); 51 | _logQueue.Enqueue(new LogQueueItem(System.IO.Path.Combine(Path, fileName), finalMessage)); 52 | 53 | Console.ForegroundColor = color; 54 | Console.Write(finalMessage); 55 | }catch(Exception e) 56 | { 57 | Console.WriteLine(e.Message); 58 | } 59 | } 60 | 61 | public void WriteLine(object msg, LogLevel level = LogLevel.Info, ConsoleColor? overrideColor = null, string fileName = "log.log") 62 | { 63 | Write(msg + Environment.NewLine, level, overrideColor, fileName); 64 | } 65 | 66 | private void WatchQueue() 67 | { 68 | while (true) 69 | { 70 | 71 | while (_logQueue.Count > 0) 72 | { 73 | var item = _logQueue.Dequeue(); 74 | if (item == null) continue; 75 | var succeed = false; 76 | while (succeed == false) 77 | { 78 | 79 | try 80 | { 81 | using (var sw = new StreamWriter(item.File, true)) 82 | { 83 | sw.Write(item.Message); 84 | } 85 | Thread.Sleep(100); 86 | succeed = true; 87 | } 88 | catch 89 | { 90 | // ignored 91 | } 92 | } 93 | } 94 | Thread.Sleep(2000); 95 | } 96 | } 97 | } 98 | 99 | public class LogQueueItem 100 | { 101 | public string File { get; set; } 102 | public string Message { get; set; } 103 | 104 | public LogQueueItem(string file, string message) 105 | { 106 | File = file; 107 | Message = message; 108 | } 109 | } 110 | 111 | public enum LogLevel 112 | { 113 | Info, Warn, Error, Highlight 114 | } 115 | 116 | } 117 | -------------------------------------------------------------------------------- /CSChatBot/Logger/Logger.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {5B72E456-42BC-4834-BB15-65BBE0B76101} 8 | Library 9 | Properties 10 | Logger 11 | Logger 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 60 | -------------------------------------------------------------------------------- /CSChatBot/Logger/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Logger")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Logger")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("5b72e456-42bc-4834-bb15-65bbe0b76101")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/Logger/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /CSChatBot/Misc/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 |  2 | // This file is used by Code Analysis to maintain SuppressMessage 3 | // attributes that are applied to this project. 4 | // Project-level suppressions either have no target or are given 5 | // a specific target and scoped to a namespace, type, member, etc. 6 | 7 | [assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "", Scope = "member", Target = "~P:Misc.ClarifaiAPIKey.status")] 8 | 9 | -------------------------------------------------------------------------------- /CSChatBot/Misc/Interfaces/ICovidDataLoader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Misc.Interfaces 8 | { 9 | public interface ICovidDataLoader 10 | { 11 | List LoadData(); 12 | RegionData GetStats(string input); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CSChatBot/Misc/Interfaces/JhuDataLoader.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Misc.Interfaces 10 | { 11 | public class JhuDataLoader : ICovidDataLoader 12 | { 13 | private string _source = "https://services9.arcgis.com/N9p5hsImWXAccRNI/arcgis/rest/services/Z7biAeD8PAkqgmWhxG2A/FeatureServer/1/query?f=json&where=Confirmed%20%3E%200&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=Country_Region%2CProvince_State%2CConfirmed%2CRecovered%2CDeaths%2CActive&orderByFields=Confirmed%20desc%2CCountry_Region%20asc%2CProvince_State%20asc&outSR=102100&resultOffset=0&resultRecordCount=600&cacheHint=true"; 14 | private static List _cache; 15 | private static DateTime _lastLoad = DateTime.MinValue; 16 | public RegionData GetStats(string input) 17 | { 18 | var data = LoadData(); 19 | //attempt first to find by province / state 20 | var region = false; 21 | var choice = data.FirstOrDefault(x => x.State?.ToLower().StartsWith(input.ToLower()) ?? false); 22 | if (choice == null) 23 | { 24 | choice = data.FirstOrDefault(x => x.Country.ToLower().StartsWith(input.ToLower())); 25 | if (choice != null) 26 | region = true; 27 | } 28 | if (choice == null) 29 | { 30 | //global stats are given then 31 | choice = new RegionData 32 | { 33 | Country = "Global", 34 | ActiveCases = data.Sum(x => x.ActiveCases), 35 | TotalCases = data.Sum(x => x.TotalCases), 36 | TotalDeaths = data.Sum(x => x.TotalDeaths), 37 | TotalRecovered = data.Sum(x => x.TotalRecovered) 38 | }; 39 | } 40 | 41 | if (region) 42 | { 43 | var temp = choice; 44 | choice = new RegionData 45 | { 46 | Country = temp.Country, 47 | ActiveCases = data.Where(x => x.Country == temp.Country).Sum(x => x.ActiveCases), 48 | TotalCases = data.Where(x => x.Country == temp.Country).Sum(x => x.TotalCases), 49 | TotalDeaths = data.Where(x => x.Country == temp.Country).Sum(x => x.TotalDeaths), 50 | TotalRecovered = data.Where(x => x.Country == temp.Country).Sum(x => x.TotalRecovered) 51 | }; 52 | } 53 | 54 | return choice; 55 | } 56 | 57 | public List LoadData() 58 | { 59 | if ((DateTime.Now - _lastLoad).TotalMinutes < 10) 60 | { 61 | return _cache; 62 | } 63 | using (var client = new HttpClient()) 64 | { 65 | var json = client.GetStringAsync(_source).Result; 66 | var data = JsonConvert.DeserializeObject(json); 67 | _cache = data.features.Select(x => x.attributes).ToList(); 68 | } 69 | _lastLoad = DateTime.Now; 70 | return _cache; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /CSChatBot/Misc/Models/CountryStats.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Misc.Models 8 | { 9 | public class CountryStats 10 | { 11 | public string Country { get; set; } 12 | public int TotalCases { get; set; } 13 | public int NewCases { get; set; } 14 | public int TotalDeaths { get; set; } 15 | public int NewDeaths { get; set; } 16 | public int TotalRecovered { get; set; } 17 | public int ActiveCases { get; set; } 18 | public int SeriousCases { get; set; } 19 | public float TotalCasesPerMillion { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CSChatBot/Misc/Models/CovidStat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Misc.Models 8 | { 9 | 10 | } 11 | 12 | public class CovidStats 13 | { 14 | public string objectIdFieldName { get; set; } 15 | public Uniqueidfield uniqueIdField { get; set; } 16 | public string globalIdFieldName { get; set; } 17 | public string geometryType { get; set; } 18 | public Spatialreference spatialReference { get; set; } 19 | public Field[] fields { get; set; } 20 | public Feature[] features { get; set; } 21 | } 22 | 23 | public class Uniqueidfield 24 | { 25 | public string name { get; set; } 26 | public bool isSystemMaintained { get; set; } 27 | } 28 | 29 | public class Spatialreference 30 | { 31 | public int wkid { get; set; } 32 | public int latestWkid { get; set; } 33 | } 34 | 35 | public class Field 36 | { 37 | public string name { get; set; } 38 | public string type { get; set; } 39 | public string alias { get; set; } 40 | public string sqlType { get; set; } 41 | public int length { get; set; } 42 | public object domain { get; set; } 43 | public object defaultValue { get; set; } 44 | } 45 | 46 | public class Feature 47 | { 48 | public RegionData attributes { get; set; } 49 | } 50 | 51 | public class RegionData 52 | { 53 | public string Country { get; set; } 54 | public string State { get; set; } 55 | public int TotalCases { get; set; } 56 | public int TotalRecovered { get; set; } 57 | public int TotalDeaths { get; set; } 58 | public int ActiveCases { get; set; } 59 | public int OBJECTID { get; set; } 60 | public float TotalCasesPerMillion { get; set; } 61 | public int SeriousCases { get; set; } 62 | public int NewDeaths { get; set; } 63 | public int NewCases { get; set; } 64 | public string Source { get; set; } 65 | } 66 | -------------------------------------------------------------------------------- /CSChatBot/Misc/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Misc")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Misc")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("a43e32b9-2c06-46e9-ba30-394c0ef0421d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/Misc/RandoFactGenerator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Misc 8 | { 9 | public static class RandoFactGenerator 10 | { 11 | internal static Random R = new Random(); 12 | private static List Set1, Set2, Set3, Set4; 13 | public static void Init() 14 | { 15 | Set1 = new List 16 | { 17 | new PathString("the {0} equinox", "fall", "spring"), 18 | new PathString("the {0} {1}", "winter", "summer") { Options2 = new [] { "solstice", "olympics" } }, 19 | new PathString("the {0} {1}", "earliest", "latest") { Options2 = new [] { "sunrise", "sunset" } }, 20 | new PathString("daylight {0} time", "saving", "savings"), 21 | new PathString("leap {0}", "day", "year"), 22 | new PathString("Easter"), 23 | new PathString("the {0} Moon", "Harvest", "Blood", "Super"), 24 | new PathString("Toyota Truck Month"), 25 | new PathString("Shark Week") 26 | }; 27 | 28 | 29 | Set2 = new List 30 | { 31 | new PathString("happens {0} every year", "earlier", "later", "at the wrong time"), 32 | new PathString("drifts out of sync with the {0}", "sun", "moon", "zodiac", "Gregorian calendar", "Mayan calendar", "Lunar calendar", "iPhone calendar", "atomic clock in Colorado"), 33 | new PathString("might {0} this year", "not happen", "happen twice") 34 | }; 35 | 36 | Set3 = new List 37 | { 38 | new PathString("time zone legislation in {0}", "Indiana", "Arizona", "Russia"), 39 | new PathString("a decree by the Pope in the 1500s"), 40 | new PathString("{0} of the {1}", "precession", "liberation", "nutation", "libation", "eccentricity", "obliquity") 41 | { 42 | Options2 = new []{"moon", "sun", "Earth's axis", "equator", "Prime Meridian", "International Date Line", "Mason-Dixon Line"} 43 | }, 44 | new PathString("magnetic field reversal"), 45 | new PathString("an arbitrary decision by {0}", "Benjamin Franklin", "Isaac Newton", "FDR") 46 | }; 47 | 48 | Set4 = new List 49 | { 50 | new PathString("it was even more extreme during the {0}", "Bronze Age", "Ice Age", "Cretaceous", "1990s"), 51 | new PathString("it causes a predictable increase in car accidents"), 52 | new PathString("that's why we have leap seconds"), 53 | new PathString("scientists are really worried"), 54 | new PathString("there's a proposal to fix it, but it {0}", "will never happen", "actually makes things worse", "is stalled in Congress", "might be unconstitutional"), 55 | new PathString("it's getting worse and no one knows why") 56 | }; 57 | } 58 | 59 | public static string Get() 60 | { 61 | return $"Did you know that {Set1[R.Next(Set1.Count)].Text} {Set2[R.Next(Set2.Count)].Text} because of {Set3[R.Next(Set3.Count)].Text}? Apparently {Set4[R.Next(Set4.Count)].Text}."; 62 | } 63 | } 64 | 65 | 66 | 67 | internal class PathString 68 | { 69 | public string BaseText { get; set; } 70 | public string Text 71 | { 72 | get 73 | { 74 | if (Options2.Any()) 75 | { 76 | return String.Format(BaseText, RandomOption1, RandomOption2); 77 | } 78 | if (Options1.Any()) 79 | { 80 | return String.Format(BaseText, RandomOption1); 81 | } 82 | return BaseText; 83 | } 84 | } 85 | 86 | public string[] Options1 { get; set; } = new string[0]; 87 | public string[] Options2 { get; set; } = new string[0]; 88 | 89 | public PathString(string text, params string[] options) 90 | { 91 | BaseText = text; 92 | Options1 = options; 93 | } 94 | 95 | public PathString(string text) 96 | { 97 | BaseText = text; 98 | } 99 | 100 | private string RandomOption1 101 | { 102 | get 103 | { 104 | return Options1[RandoFactGenerator.R.Next(Options1.Length)]; 105 | } 106 | } 107 | 108 | private string RandomOption2 109 | { 110 | get 111 | { 112 | return Options2[RandoFactGenerator.R.Next(Options2.Length)]; 113 | } 114 | } 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /CSChatBot/Misc/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CSChatBot/Misc/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CSChatBot/ModuleFramework/Extensions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using Telegram.Bot.Types; 7 | 8 | namespace ModuleFramework 9 | { 10 | public static class Extensions 11 | { 12 | 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CSChatBot/ModuleFramework/ModuleFramework.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {936A8668-DF10-4ADD-8790-4E7C46EA81D5} 8 | Library 9 | Properties 10 | ModuleFramework 11 | ModuleFramework 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 35 | 36 | 37 | 38 | 39 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll 40 | True 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ..\packages\Telegram.Bot.14.11.0\lib\net45\Telegram.Bot.dll 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {c266bbac-788e-4012-87f4-7b8302af14cb} 61 | DB 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 76 | -------------------------------------------------------------------------------- /CSChatBot/ModuleFramework/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ModuleFramework")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ModuleFramework")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("936a8668-df10-4add-8790-4e7c46ea81d5")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/ModuleFramework/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CSChatBot/ModuleFramework/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSChatBot/ModuleTemplate/ModuleName.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using DB; 7 | using DB.Models; 8 | using ModuleFramework; 9 | using Telegram.Bot; 10 | 11 | namespace ModuleTemplate 12 | { 13 | /// 14 | /// A sample module for CSChatBot 15 | /// 16 | [ModuleFramework.Module(Author = "your name", Name = "Name of Module", Version = "1.0")] 17 | public class ModuleName 18 | { 19 | public ModuleName(Instance db, Setting settings, TelegramBotClient bot) 20 | { 21 | //do your initialization here. this is done before the bot begins receiving updates. 22 | //DO NOT run bot.StartReceiving(); 23 | //This is run in the main bot already. 24 | 25 | //You can subscribe to updates. This is a simple echo 26 | //bot.OnUpdate += (sender, args) => 27 | //{ 28 | // bot.SendTextMessageAsync(args.Update.Message.Chat.Id, args.Update.Message.Text); 29 | //}; 30 | 31 | //Or other things, like callback queries (inline buttons) 32 | //bot.OnCallbackQuery += (sender, args) => 33 | //{ 34 | // bot.SendTextMessageAsync(args.CallbackQuery.From.Id, args.CallbackQuery.Data); 35 | //}; 36 | } 37 | 38 | [ChatCommand(Triggers = new[] { "test" }, DontSearchInline = true, HelpText = "This is a sample command")] 39 | public static CommandResponse Test(CommandEventArgs args) 40 | { 41 | //do something 42 | var length = args.Message.Text.Length; 43 | //return message 44 | return new CommandResponse($"Message: {args.Message.Text}\nLength: {length}"); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /CSChatBot/ModuleTemplate/ModuleTemplate.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {908C9B7F-5C1D-4EA4-8E31-25A53AFFDA5C} 8 | Library 9 | Properties 10 | ModuleTemplate 11 | ModuleTemplate 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 35 | 36 | 37 | 38 | 39 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll 40 | True 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ..\packages\Telegram.Bot.14.11.0\lib\net45\Telegram.Bot.dll 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | {c266bbac-788e-4012-87f4-7b8302af14cb} 60 | DB 61 | 62 | 63 | {5b72e456-42bc-4834-bb15-65bbe0b76101} 64 | Logger 65 | 66 | 67 | {936a8668-df10-4add-8790-4e7c46ea81d5} 68 | ModuleFramework 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 83 | -------------------------------------------------------------------------------- /CSChatBot/ModuleTemplate/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ModuleTemplate")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("ModuleTemplate")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("908c9b7f-5c1d-4ea4-8e31-25a53affda5c")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/ModuleTemplate/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CSChatBot/ModuleTemplate/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSChatBot/SIMLChat/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SIMLChat")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SIMLChat")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("f560c61f-4765-4114-baa4-71bd9a8573f7")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/SIMLChat/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /CSChatBot/SIMLChat/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Optimization; 3 | 4 | namespace Seras_Webpage 5 | { 6 | public class BundleConfig 7 | { 8 | // For more information on bundling, visit https://go.microsoft.com/fwlink/?LinkId=301862 9 | public static void RegisterBundles(BundleCollection bundles) 10 | { 11 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 12 | "~/Scripts/jquery-{version}.js")); 13 | 14 | bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( 15 | "~/Scripts/jquery.validate*")); 16 | 17 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 18 | // ready for production, use the build tool at https://modernizr.com to pick only the tests you need. 19 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 20 | "~/Scripts/modernizr-*")); 21 | 22 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 23 | "~/Scripts/bootstrap.js", 24 | "~/Scripts/respond.js")); 25 | 26 | bundles.Add(new StyleBundle("~/Content/css").Include( 27 | "~/Content/bootstrap.css", 28 | "~/Content/site.css")); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web; 2 | using System.Web.Mvc; 3 | 4 | namespace Seras_Webpage 5 | { 6 | public class FilterConfig 7 | { 8 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 9 | { 10 | filters.Add(new HandleErrorAttribute()); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace Seras_Webpage 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/App_Start/WebApiConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web.Http; 5 | 6 | namespace Seras_Webpage 7 | { 8 | public static class WebApiConfig 9 | { 10 | public static void Register(HttpConfiguration config) 11 | { 12 | // Web API configuration and services 13 | 14 | // Web API routes 15 | config.MapHttpAttributeRoutes(); 16 | 17 | config.Routes.MapHttpRoute( 18 | name: "DefaultApi", 19 | routeTemplate: "api/{controller}/{id}", 20 | defaults: new { id = RouteParameter.Optional } 21 | ); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Override the default bootstrap behavior where horizontal description lists 13 | will truncate terms that are too long to fit in the left column 14 | */ 15 | .dl-horizontal dt { 16 | white-space: normal; 17 | } 18 | 19 | /* Set width on the form input elements since they're 100% wide by default */ 20 | input, 21 | select, 22 | textarea { 23 | max-width: 280px; 24 | } 25 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using HtmlAgilityPack; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Linq; 6 | using System.Net; 7 | using System.Text; 8 | using System.Web; 9 | using System.Web.Mvc; 10 | 11 | namespace Seras_Webpage.Controllers 12 | { 13 | public class HomeController : Controller 14 | { 15 | public ActionResult Index() 16 | { 17 | //get some tasty cookies 18 | var request = (HttpWebRequest)WebRequest.Create("https://oauth.telegram.org/auth?bot_id=547043436&request_access=write"); 19 | request.Method = "GET"; 20 | 21 | var response = (HttpWebResponse)request.GetResponse(); 22 | var k = response.Headers["Set-Cookie"]; 23 | Response.Cookies.Add(new HttpCookie(k)); 24 | Response.Cookies.Add(new HttpCookie("stel_bot324283739_origin", "http%3A%2F%2Fseras.parawuff.com")); 25 | 26 | return View(); 27 | } 28 | 29 | public ActionResult About() 30 | { 31 | ViewBag.Message = "Your application description page."; 32 | 33 | return View(); 34 | } 35 | 36 | public ActionResult Contact() 37 | { 38 | ViewBag.Message = "Your contact page."; 39 | 40 | return View(); 41 | } 42 | 43 | public string Widget() 44 | { 45 | var page = new WebClient().DownloadString("https://oauth.telegram.org/embed/serasvbot?origin=seras.parawuff.com&size=large&request_access=write"); 46 | var doc = new HtmlDocument(); 47 | byte[] array = Encoding.UTF8.GetBytes(page); 48 | var stream = new MemoryStream(array); 49 | doc.Load(stream); 50 | var dn = doc.DocumentNode.ChildNodes["html"]; 51 | var body = dn.ChildNodes["body"]; 52 | var scriptNode = body.ChildNodes["script"]; 53 | scriptNode.Attributes["src"].Value = scriptNode.Attributes["src"].Value.Replace("//telegram.org/js/widget-frame.js", "/Scripts/widget-frame.js"); 54 | 55 | return body.InnerHtml; 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Seras_Webpage.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Http; 6 | using System.Web.Mvc; 7 | using System.Web.Optimization; 8 | using System.Web.Routing; 9 | 10 | namespace Seras_Webpage 11 | { 12 | public class MvcApplication : System.Web.HttpApplication 13 | { 14 | protected void Application_Start() 15 | { 16 | AreaRegistration.RegisterAllAreas(); 17 | GlobalConfiguration.Configure(WebApiConfig.Register); 18 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 19 | RouteConfig.RegisterRoutes(RouteTable.Routes); 20 | BundleConfig.RegisterBundles(BundleTable.Bundles); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Seras_Webpage")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Seras_Webpage")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("92164bde-fdda-4b51-95ab-14c279532f73")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Scripts/respond.min.js: -------------------------------------------------------------------------------- 1 | /* NUGET: BEGIN LICENSE TEXT 2 | * 3 | * Microsoft grants you the right to use these script files for the sole 4 | * purpose of either: (i) interacting through your browser with the Microsoft 5 | * website or online service, subject to the applicable licensing or use 6 | * terms; or (ii) using the files as included with a Microsoft product subject 7 | * to that product's license terms. Microsoft reserves all other rights to the 8 | * files not expressly granted by Microsoft, whether by implication, estoppel 9 | * or otherwise. Insofar as a script file is dual licensed under GPL, 10 | * Microsoft neither took the code under GPL nor distributes it thereunder but 11 | * under the terms set out in this paragraph. All notices and licenses 12 | * below are for informational purposes only. 13 | * 14 | * NUGET: END LICENSE TEXT */ 15 | /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ 16 | /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ 17 | window.matchMedia=window.matchMedia||(function(e,f){var c,a=e.documentElement,b=a.firstElementChild||a.firstChild,d=e.createElement("body"),g=e.createElement("div");g.id="mq-test-1";g.style.cssText="position:absolute;top:-100em";d.style.background="none";d.appendChild(g);return function(h){g.innerHTML='­';a.insertBefore(d,b);c=g.offsetWidth==42;a.removeChild(d);return{matches:c,media:h}}})(document); 18 | 19 | /*! Respond.js v1.2.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ 20 | (function(e){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=e.matchMedia&&e.matchMedia("only all").matches;if(respond.mediaQueriesSupported){return}var w=e.document,s=w.documentElement,i=[],k=[],q=[],o={},h=30,f=w.getElementsByTagName("head")[0]||s,g=w.getElementsByTagName("base")[0],b=f.getElementsByTagName("link"),d=[],a=function(){var D=b,y=D.length,B=0,A,z,C,x;for(;B-1,minw:F.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:F.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}}j()},l,r,v=function(){var z,A=w.createElement("div"),x=w.body,y=false;A.style.cssText="position:absolute;font-size:1em;width:1em";if(!x){x=y=w.createElement("body");x.style.background="none"}x.appendChild(A);s.insertBefore(x,s.firstChild);z=A.offsetWidth;if(y){s.removeChild(x)}else{x.removeChild(A)}z=p=parseFloat(z);return z},p,j=function(I){var x="clientWidth",B=s[x],H=w.compatMode==="CSS1Compat"&&B||w.body[x]||B,D={},G=b[b.length-1],z=(new Date()).getTime();if(I&&l&&z-l-1?(p||v()):1)}if(!!J){J=parseFloat(J)*(J.indexOf(y)>-1?(p||v()):1)}if(!K.hasquery||(!A||!L)&&(A||H>=C)&&(L||H<=J)){if(!D[K.media]){D[K.media]=[]}D[K.media].push(k[K.rules])}}for(var E in q){if(q[E]&&q[E].parentNode===f){f.removeChild(q[E])}}for(var E in D){var M=w.createElement("style"),F=D[E].join("\n");M.type="text/css";M.media=E;f.insertBefore(M,G.nextSibling);if(M.styleSheet){M.styleSheet.cssText=F}else{M.appendChild(w.createTextNode(F))}q.push(M)}},n=function(x,z){var y=c();if(!y){return}y.open("GET",x,true);y.onreadystatechange=function(){if(y.readyState!=4||y.status!=200&&y.status!=304){return}z(y.responseText)};if(y.readyState==4){return}y.send(null)},c=(function(){var x=false;try{x=new XMLHttpRequest()}catch(y){x=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return x}})();a();respond.update=a;function t(){j(true)}if(e.addEventListener){e.addEventListener("resize",t,false)}else{if(e.attachEvent){e.attachEvent("onresize",t)}}})(this); -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "About"; 3 | } 4 |

@ViewBag.Title.

5 |

@ViewBag.Message

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Contact"; 3 | } 4 |

@ViewBag.Title.

5 |

@ViewBag.Message

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
-------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Home Page"; 3 | } 4 |
5 | 6 |
7 | @section scripts{ 8 | 15 | } 16 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Error 6 | 7 | 8 |
9 |

Error.

10 |

An error occurred while processing your request.

11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | CSChatBot 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | @Styles.Render("~/Content/css") 19 | @Scripts.Render("~/bundles/modernizr") 20 | @Scripts.Render("~/bundles/jquery") 21 | 22 | 23 | @**@ 43 |
44 | @RenderBody() 45 |
46 |
47 |

© @DateTime.Now.Year - CSChatBot

48 |
49 |
50 | 51 | @Scripts.Render("~/bundles/jquery") 52 | @Scripts.Render("~/bundles/bootstrap") 53 | @RenderSection("scripts", required: false) 54 | 55 | 56 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Views/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Web.Debug.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Web.Release.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreyWolfDev/CSChatBot/492fd851d2fa43ac2e7dc1c4ee62cc5bbc5c0677/CSChatBot/Seras Webpage/favicon.ico -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreyWolfDev/CSChatBot/492fd851d2fa43ac2e7dc1c4ee62cc5bbc5c0677/CSChatBot/Seras Webpage/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreyWolfDev/CSChatBot/492fd851d2fa43ac2e7dc1c4ee62cc5bbc5c0677/CSChatBot/Seras Webpage/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreyWolfDev/CSChatBot/492fd851d2fa43ac2e7dc1c4ee62cc5bbc5c0677/CSChatBot/Seras Webpage/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /CSChatBot/Seras Webpage/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /CSChatBot/Steam/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Steam")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("Steam")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d665f11b-608c-4903-9d5e-f8bc6100fd4e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/Steam/Steam.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {D665F11B-608C-4903-9D5E-F8BC6100FD4E} 8 | Library 9 | Properties 10 | Steam 11 | Steam 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 35 | 36 | 37 | 38 | 39 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll 40 | True 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ..\packages\Telegram.Bot.14.11.0\lib\net45\Telegram.Bot.dll 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | {c266bbac-788e-4012-87f4-7b8302af14cb} 61 | DB 62 | 63 | 64 | {5b72e456-42bc-4834-bb15-65bbe0b76101} 65 | Logger 66 | 67 | 68 | {936a8668-df10-4add-8790-4e7c46ea81d5} 69 | ModuleFramework 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | echo F|xcopy /y $(TargetPath) "$(SolutionDir)CSChatBot\bin\$(ConfigurationName)\Addon Modules\$(TargetFileName)" 79 | 80 | 87 | -------------------------------------------------------------------------------- /CSChatBot/Steam/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CSChatBot/Steam/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSChatBot/WeatherModule/OpenWeatherMap.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GreyWolfDev/CSChatBot/492fd851d2fa43ac2e7dc1c4ee62cc5bbc5c0677/CSChatBot/WeatherModule/OpenWeatherMap.dll -------------------------------------------------------------------------------- /CSChatBot/WeatherModule/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WeatherModule")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WeatherModule")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("d5779aab-e99a-4101-9e29-aab0007eb2a1")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/WeatherModule/WeatherModule.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {D5779AAB-E99A-4101-9E29-AAB0007EB2A1} 8 | Library 9 | Properties 10 | WeatherModule 11 | WeatherModule 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 35 | 36 | 37 | False 38 | .\OpenWeatherMap.dll 39 | 40 | 41 | 42 | 43 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll 44 | True 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | ..\packages\Telegram.Bot.14.11.0\lib\net45\Telegram.Bot.dll 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | {c266bbac-788e-4012-87f4-7b8302af14cb} 64 | DB 65 | 66 | 67 | {5b72e456-42bc-4834-bb15-65bbe0b76101} 68 | Logger 69 | 70 | 71 | {936a8668-df10-4add-8790-4e7c46ea81d5} 72 | ModuleFramework 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | echo F|xcopy /y $(TargetPath) "$(SolutionDir)CSChatBot\bin\$(ConfigurationName)\Addon Modules\$(TargetFileName)" 86 | 87 | 94 | -------------------------------------------------------------------------------- /CSChatBot/WeatherModule/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CSChatBot/WeatherModule/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSChatBot/XKCD/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("XKCD")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("XKCD")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("873db4c0-0dbe-406e-88d2-77a5c606dd30")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSChatBot/XKCD/XKCD.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using DB; 8 | using DB.Models; 9 | using ModuleFramework; 10 | using Newtonsoft.Json; 11 | using Telegram.Bot; 12 | #pragma warning disable IDE0044 // Add readonly modifier 13 | // ReSharper disable InconsistentNaming 14 | #pragma warning disable IDE1006 // Naming Styles 15 | namespace XKCD 16 | { 17 | /// 18 | /// A sample module for CSChatBot 19 | /// 20 | [ModuleFramework.Module(Author = "parabola949", Name = "XKCD", Version = "1.0")] 21 | 22 | public class XKCD 23 | { 24 | internal static Random R = new Random(); 25 | private TelegramBotClient _bot; 26 | public XKCD(Instance db, Setting settings, TelegramBotClient bot) 27 | { 28 | _bot = bot; 29 | } 30 | 31 | [ChatCommand(Triggers = new[] { "xkcd" }, HelpText = "Gets a random xkcd, or searches", Parameters = new[] { "none - random", "", "'new' - latest" })] 32 | public static CommandResponse GetXkcd(CommandEventArgs args) 33 | { 34 | ServicePointManager.Expect100Continue = true; 35 | ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; 36 | // Use SecurityProtocolType.Ssl3 if needed for compatibility reasons 37 | XkcdPost chosen; 38 | var current = JsonConvert.DeserializeObject( 39 | new WebClient().DownloadString("https://xkcd.com/info.0.json")); 40 | if (String.IsNullOrEmpty(args.Parameters)) 41 | { 42 | //get the current XKCD 43 | 44 | chosen = JsonConvert.DeserializeObject( 45 | new WebClient().DownloadString($"https://xkcd.com/{R.Next(current.num)}/info.0.json")); 46 | 47 | 48 | } 49 | else 50 | { 51 | if (int.TryParse(args.Parameters, out var num)) 52 | { 53 | chosen = 54 | JsonConvert.DeserializeObject( 55 | new WebClient().DownloadString($"https://xkcd.com/{Math.Min(current.num, num)}/info.0.json")); 56 | } 57 | else 58 | { 59 | if (String.Equals(args.Parameters, "new", StringComparison.InvariantCultureIgnoreCase)) 60 | { 61 | chosen = current; 62 | } 63 | else 64 | { 65 | //search 66 | var url = $"https://www.google.com/search?q={args.Parameters} inurl:https://xkcd.com"; 67 | var page = new WebClient { UseDefaultCredentials = true }.DownloadString(url); 68 | 69 | page = page.Substring(page.IndexOf("
")); 70 | page = page.Substring(page.IndexOf("q=") + 2); 71 | page = page.Substring(0, page.IndexOf("/&")).Replace("https://xkcd.com/", ""); 72 | if (page == "https://xkcd.com") 73 | { 74 | //latest post 75 | chosen = 76 | JsonConvert.DeserializeObject( 77 | new WebClient().DownloadString($"https://xkcd.com/info.0.json")); 78 | } 79 | else 80 | { 81 | chosen = 82 | JsonConvert.DeserializeObject( 83 | new WebClient().DownloadString($"https://xkcd.com/{page}/info.0.json")); 84 | } 85 | } 86 | } 87 | } 88 | return new CommandResponse($"{chosen.title}\n{chosen.alt}\n{chosen.img}") 89 | { 90 | ImageCaption = chosen.alt, 91 | ImageUrl = chosen.img, 92 | ImageDescription = chosen.alt, 93 | ImageTitle = chosen.title 94 | }; 95 | } 96 | } 97 | 98 | 99 | public class XkcdPost 100 | { 101 | public string month { get; set; } 102 | public int num { get; set; } 103 | public string link { get; set; } 104 | public string year { get; set; } 105 | public string news { get; set; } 106 | public string safe_title { get; set; } 107 | public string transcript { get; set; } 108 | public string alt { get; set; } 109 | public string img { get; set; } 110 | public string title { get; set; } 111 | public string day { get; set; } 112 | } 113 | 114 | } 115 | -------------------------------------------------------------------------------- /CSChatBot/XKCD/XKCD.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {873DB4C0-0DBE-406E-88D2-77A5C606DD30} 8 | Library 9 | Properties 10 | XKCD 11 | XKCD 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll 35 | 36 | 37 | 38 | 39 | ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll 40 | True 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | ..\packages\Telegram.Bot.14.11.0\lib\net45\Telegram.Bot.dll 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | {c266bbac-788e-4012-87f4-7b8302af14cb} 60 | DB 61 | 62 | 63 | {5b72e456-42bc-4834-bb15-65bbe0b76101} 64 | Logger 65 | 66 | 67 | {936a8668-df10-4add-8790-4e7c46ea81d5} 68 | ModuleFramework 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | echo F|xcopy /y $(TargetPath) "$(SolutionDir)CSChatBot\bin\$(ConfigurationName)\Addon Modules\$(TargetFileName)" 78 | 79 | 86 | -------------------------------------------------------------------------------- /CSChatBot/XKCD/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /CSChatBot/XKCD/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | --------------------------------------------------------------------------------