/marry proposes to a member with Accept and Decline buttons only they can press, /divorce ends it, and /partner shows who someone is married to and since when
A marriage system for your server where members can propose to each other, accept or decline proposals, check their partner status, and divorce.
Commands:
/marry @user โ Propose marriage to someone. They get Accept and Decline buttons (only they can press)./divorce โ End your current marriage./partner [@user] โ See who someone is married to and for how long. Leave empty to check yourself.Features:
Made by MEE6. Remix it to get a copy of your own and change anything you like.
๐ @Alex and @Sam are now married! Congratulations! ๐
@Alex is married to @Sam
September 14, 2026 (0 days)
You are already married! Use /divorce first.
That person is already married to someone else!
๐ You are no longer married to @Sam.
You are not married to anyone.
๐ @Alex declined the proposal.
// Marriage System
// Propose, accept/decline, divorce, and view partners
// Store structure (member store):
// - "married_to": userId (string) โ who they're married to
// - "married_since": timestamp (number) โ when the marriage started
/** Whether a call was refused because the member has left the server. */
function hasLeft(err: unknown): boolean {
return String(err).includes('is not in this server');
}
mee6.command(
'marry',
{
description: 'Propose marriage to someone',
options: [{ name: 'user', type: 'user', description: 'Who to propose to', required: true }],
},
async (ctx) => {
const targetId = ctx.option<string>('user');
// Can't marry yourself
if (targetId === ctx.author.id) {
await ctx.reply('You cannot marry yourself!');
return;
}
// Check if proposer is already married
const proposerStore = mee6.store.member(ctx.author.id);
const proposerMarriedTo = await proposerStore.get<string>('married_to');
if (proposerMarriedTo) {
await ctx.reply('You are already married! Use `/divorce` first.');
return;
}
// Check if target is already married
const targetStore = mee6.store.member(targetId);
const targetMarriedTo = await targetStore.get<string>('married_to');
if (targetMarriedTo) {
await ctx.reply('That person is already married to someone else!');
return;
}
// Check if target is a bot
const targetMember = await mee6.getMember(targetId);
if (!targetMember) {
await ctx.reply('That user is not in this server.');
return;
}
if (targetMember.bot) {
await ctx.reply('You cannot marry a bot!');
return;
}
// Send proposal with buttons
const sent = await ctx.reply({
content: `๐ ${ctx.author.mention} has proposed to <@${targetId}>!`,
buttons: [
{ label: 'Accept', customId: `accept_${ctx.author.id}_${targetId}`, style: 'success' },
{ label: 'Decline', customId: `decline_${ctx.author.id}_${targetId}`, style: 'danger' },
],
});
// Store proposal with 5 minute expiry
await mee6.store.set(`proposal_${sent.messageId}`, { proposer: ctx.author.id, target: targetId }, { ttl: 300 });
}
);
mee6.command(
'divorce',
{
description: 'End your marriage',
},
async (ctx) => {
const store = mee6.store.member(ctx.author.id);
const marriedTo = await store.get<string>('married_to');
if (!marriedTo) {
await ctx.reply('You are not married to anyone.');
return;
}
// Remove marriage from both members
await store.delete('married_to');
await store.delete('married_since');
const partnerStore = mee6.store.member(marriedTo);
await partnerStore.delete('married_to');
await partnerStore.delete('married_since');
await ctx.reply(`๐ You are no longer married to <@${marriedTo}>.`);
}
);
mee6.command(
'partner',
{
description: 'See who someone is married to',
options: [{ name: 'user', type: 'user', description: 'The user to check (leave empty for yourself)' }],
},
async (ctx) => {
const targetId = ctx.option<string>('user', ctx.author.id);
const targetMember = await mee6.getMember(targetId);
if (!targetMember) {
await ctx.reply('That user is not in this server.');
return;
}
const store = mee6.store.member(targetId);
const marriedTo = await store.get<string>('married_to');
if (!marriedTo) {
const name = targetId === ctx.author.id ? 'You are' : `${targetMember.displayName} is`;
await ctx.reply(`${name} not married to anyone.`);
return;
}
const marriedSince = await store.get<number>('married_since', Date.now());
const days = Math.floor((Date.now() - marriedSince) / 86400000);
await ctx.reply({
embed: {
title: '๐ Marriage',
description: `${targetMember.mention} is married to <@${marriedTo}>`,
fields: [
{
name: 'Married since',
value: `<t:${Math.floor(marriedSince / 1000)}:D> (${days} day${days === 1 ? '' : 's'})`,
},
],
color: '#ff69b4',
},
});
}
);
mee6.on('button', async (ctx) => {
// Handle marriage proposal responses
if (ctx.customId.startsWith('accept_') || ctx.customId.startsWith('decline_')) {
const proposal = await mee6.store.get<{ proposer: string; target: string }>(`proposal_${ctx.message.id}`);
if (!proposal) {
await ctx.reply({ content: 'This proposal has expired.', ephemeral: true });
return;
}
// Only the target can respond
if (ctx.author.id !== proposal.target) {
await ctx.reply({ content: 'This proposal is not for you!', ephemeral: true });
return;
}
if (ctx.customId.startsWith('decline_')) {
await ctx.editOriginal({
content: `๐ <@${proposal.target}> declined the proposal.`,
buttons: [],
});
await mee6.store.delete(`proposal_${ctx.message.id}`);
return;
}
// Accept โ check both are still unmarried
const proposerStore = mee6.store.member(proposal.proposer);
const targetStore = mee6.store.member(proposal.target);
const proposerMarriedTo = await proposerStore.get<string>('married_to');
const targetMarriedTo = await targetStore.get<string>('married_to');
if (proposerMarriedTo || targetMarriedTo) {
await ctx.editOriginal({
content: 'โ One of you is already married to someone else!',
buttons: [],
});
await mee6.store.delete(`proposal_${ctx.message.id}`);
return;
}
// Marry them! The proposer first: one who has left the server cannot be
// married, and the proposal goes with them.
const now = Date.now();
try {
await proposerStore.set('married_to', proposal.target);
} catch (err) {
if (!hasLeft(err)) throw err;
await mee6.store.delete(`proposal_${ctx.message.id}`);
await ctx.editOriginal({ content: `๐ <@${proposal.proposer}> has left the server.`, buttons: [] });
return;
}
await proposerStore.set('married_since', now);
await targetStore.set('married_to', proposal.proposer);
await targetStore.set('married_since', now);
await ctx.editOriginal({
content: `๐ <@${proposal.proposer}> and <@${proposal.target}> are now married! Congratulations! ๐`,
buttons: [],
});
await mee6.store.delete(`proposal_${ctx.message.id}`);
}
});