Example #1
0
        public async Task MarryUser(SocketUser user)
        {
            var    gp     = GuildProfiles.GetAccount(Context.Guild);
            string prefix = gp.CmdPrefix;

            if (user != Context.User)
            {
                if (UserProfiles.IsMarried(Context.User, user) == false)
                {
                    if (UserProfiles.HasMarriageSlots(Context.User))
                    {
                        UserProfiles.AddMarriageProposal(Context.User, user);

                        var embed = new EmbedBuilder()
                                    .WithColor(255, 73, 167)
                                    .AddField($"{Context.User.Username} has proposed to {user.Username}", $"A marriage is a voluntary and full commitment. It is made in the deepest sense to the exclusion of all others. Before you declare your vows to one another, I want to hear you confirm that it is your intention to be married today. **{user.Username}**, do you come here freely to give yourself to **{Context.User.Username}** in marriage?", false)
                                    .AddField(":white_check_mark: To accpet", $"{prefix}acceptmarriage @user", true)
                                    .AddField(":negative_squared_cross_mark: To decline", $"{prefix}declinemarriage @user", true)
                                    .WithFooter(footer =>
                        {
                            footer
                            .WithText($"Take your time though! This proposal won't disappear");
                        });

                        await Context.Channel.SendMessageAsync("", embed : embed.Build());
                    }
                    else
                    {
                        await ReplyAsync($"{Context.User.Mention}, don't have enough marriage slots available.");
                    }
                }
                else
                {
                    await ReplyAsync($"{Context.User.Mention}, you are already married to this user.");
                }
            }
            else
            {
                await ReplyAsync($"{Context.User.Mention}, you can't marry yourself.");
            }
        }