Example #1
0
        public static string getWife(long user)
        {
            string result = "User's waifu not registered.";

            using (IDbConnection con = DataModules.DBConnection())
            {
                con.Open();
                List <string> temp = con.Query <string>("SELECT WAIFU FROM USERS WHERE DiscordId = " + user).ToList <string>();
                if (temp.Count > 0)
                {
                    result = temp.First();
                }
                con.Close();
            }
            return(result);
        }
Example #2
0
        public static string gush(long id, string name, string waifu, string type)
        {
            if (waifu == "User's waifu not registered.")
            {
                return("I don't know who your waifu is, baka.");
            }
            Random  random = new Random();
            string  output;
            UserObj user;

            using (IDbConnection con = DataModules.DBConnection())
            {
                con.Open();
                List <string> lines = con.Query <string>("SELECT Text FROM " + type).ToList <string>();
                user = con.Query <UserObj>("SELECT * FROM USERS WHERE DiscordId = " + id).ToList().First();
                con.Close();
                output = lines[random.Next(0, lines.Count)];
            }

            return(pronounFiller(output.Replace("user", name).Replace("waifu", waifu), user.Gender, user.WaifuGender));
        }
Example #3
0
        public static string Register(UserObj data)
        {
            using (IDbConnection con = DataModules.DBConnection())
            {
                con.Open();

                List <int> Id = con.Query <int>("SELECT Id FROM USERS WHERE DiscordId = " + data.DiscordId).ToList <int>();

                if (Id.Count == 0)
                {
                    con.Insert <UserObj>(data);
                }

                else
                {
                    data.Id = Id[0];
                    con.Update <UserObj>(data);
                }

                con.Close();
                return("Success!");
            }
        }