Пример #1
0
        public async Task MarriageCancel()
        {
            if (SQLiteHandler.Marriage.NoInMarriage(Context.Guild.Id, Context.User.Id))
            {
                SQLiteHandler.Marriage.NewPerson(Context.Guild.Id, Context.User.Id);
            }

            MarriageItem item = SQLiteHandler.Marriage.GetMarriage(Context.Guild.Id, Context.User.Id);

            if (item.user2id == 0)
            {
                await Context.Channel.SendMessageAsync("You are not married yet...");

                return;
            }

            if (Context.Guild.GetUser(item.user2id) != null)
            {
                var user = Context.Guild.GetUser(item.user2id);
                await Context.Channel.SendMessageAsync(Context.User.ToString() + " just broke marriage with " + user.Mention);

                SQLiteHandler.Marriage.BrokeMarriage(Context.Guild.Id, Context.User.Id, item.user2id);
            }
            else
            {
                await Context.Channel.SendMessageAsync("User, you was married with, is no more on this server... Use again this command.");

                SQLiteHandler.Marriage.BrokeMarriage(Context.Guild.Id, Context.User.Id, item.user2id);
                return;
            }
        }
Пример #2
0
        public async Task Marriage(IGuildUser user)
        {
            if (SQLiteHandler.Marriage.NoInMarriage(Context.Guild.Id, user.Id))
            {
                SQLiteHandler.Marriage.NewPerson(Context.Guild.Id, user.Id);
            }

            MarriageItem item = SQLiteHandler.Marriage.GetMarriage(Context.Guild.Id, user.Id);

            string status, marriedwith, marrieddate;

            if (item.user2id == 0)
            {
                status      = "Single";
                marriedwith = "None";
                marrieddate = "None";
            }
            else
            {
                status      = "Married";
                marrieddate = item.date;

                if (Context.Guild.GetUser(item.user2id) != null)
                {
                    marriedwith = Context.Guild.GetUser(item.user2id).ToString();
                }
                else
                {
                    await Context.Channel.SendMessageAsync("User, you was married with, is no more on this server... Use again this command.");

                    SQLiteHandler.Marriage.BrokeMarriage(Context.Guild.Id, Context.User.Id, item.user2id);
                    return;
                }
            }

            var embed = new EmbedBuilder();

            embed.WithTitle("Server Marriage - " + user.ToString())
            .AddField("­­ ", "Info:")
            .AddField("Status:", status, true)
            .AddField("Married with:", marriedwith, true)
            .AddField("Marriage date:", marrieddate, true)
            .AddField("­­­ ", "Marriage Commands:")
            .AddField("Request marriage", "marriage request", true)
            .AddField("Accept/denied marriage", "(wex) yes/no", true)
            .AddField("Cancel marriage", "cancel marriage", true)
            .WithColor(Color.Blue);

            await Context.Channel.SendMessageAsync("", false, embed.Build());
        }
Пример #3
0
        public async Task HowSimp(IGuildUser user = null)
        {
            if (user == null)
            {
                user = (IGuildUser)Context.User;
            }

            if (SQLiteHandler.Marriage.NoInMarriage(Context.Guild.Id, Context.User.Id))
            {
                SQLiteHandler.Marriage.NewPerson(Context.Guild.Id, Context.User.Id);
            }

            MarriageItem item = SQLiteHandler.Marriage.GetMarriage(Context.Guild.Id, user.Id);

            if (item.user2id != 0)
            {
                await Context.Channel.SendMessageAsync(user.Mention + " is simp in 0% because she/he is in marriage!");

                return;
            }

            var    plainTextBytes = Encoding.UTF8.GetBytes(user.ToString());
            string converted      = Convert.ToBase64String(plainTextBytes);

            byte[] LogoDataBy = Encoding.ASCII.GetBytes(converted);
            int    seed       = 0;

            foreach (byte byt in LogoDataBy)
            {
                seed += byt * 2;
            }

            Random x = new Random(seed);

            await Context.Channel.SendMessageAsync(user.Mention + " is simp in " + x.Next(1, 101) + "%");
        }
Пример #4
0
        public async Task MarriageRequest(IGuildUser user)
        {
            if (SQLiteHandler.Marriage.NoInMarriage(Context.Guild.Id, Context.User.Id))
            {
                SQLiteHandler.Marriage.NewPerson(Context.Guild.Id, Context.User.Id);
            }

            if (user.Id == Context.User.Id)
            {
                await ReplyAsync("You can't marry yourself...");

                return;
            }
            else if (user.Id == 665514955985911818)
            {
                await ReplyAsync("You can't marry me...");

                return;
            }
            else if (user.IsBot)
            {
                await ReplyAsync("You can't marry bot...");

                return;
            }

            MarriageItem marr = SQLiteHandler.Marriage.GetMarriage(Context.Guild.Id, Context.User.Id);

            if (marr.user2id != 0)
            {
                await ReplyAsync("You are already married...");

                return;
            }

            await ReplyAsync(user.Mention + ", You have 15 seconds from now to say 'wex yes' to accept marriage! *If you don't want to say 'wex no'...* Btw. nobody can't write in this time or It will be canceled");

            var response = await NextMessageAsync(false);

            if (response != null)
            {
                if (response.Author.Id == user.Id && response.Content.ToLower() == "wex yes")
                {
                    await ReplyAsync(user.Mention + " has accepted marriage! " + Context.User.Mention + " and " + user.Mention + " are now marriage! Congratulations!");

                    SQLiteHandler.Marriage.NewMarriage(Context.Guild.Id, Context.User.Id, response.Author.Id);
                }
                else if (response.Author.Id == user.Id && response.Content.ToLower() == "wex no")
                {
                    await ReplyAsync(user.Mention + " just refused marriage request...");
                }
                else if (response.Author.Id == user.Id)
                {
                    await ReplyAsync("Wrong message...");
                }
                else
                {
                    await ReplyAsync(response.Author.Mention + " just broke " + Context.User.Mention + " request...");
                }
            }
            else
            {
                await ReplyAsync("You did not reply before the timeout. Marriage canceled.");
            }
        }