From c9f47ab722b42824417ec7b4585e1801d2ba0eb4 Mon Sep 17 00:00:00 2001 From: themrrobert <10122432+themrrobert@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:40:38 -0700 Subject: [PATCH] Don't clobber accounts during migration by src==dest --- src/mahoji/commands/rp.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mahoji/commands/rp.ts b/src/mahoji/commands/rp.ts index c840f4fb57..8eefaf486f 100644 --- a/src/mahoji/commands/rp.ts +++ b/src/mahoji/commands/rp.ts @@ -52,7 +52,8 @@ const itemFilters = [ ]; function isProtectedAccount(user: MUser) { - if ([...ADMIN_IDS, ...OWNER_IDS].includes(user.id)) return true; + const botAccounts = ['303730326692429825', '729244028989603850', '969542224058654790']; + if ([...ADMIN_IDS, ...OWNER_IDS, ...botAccounts].includes(user.id)) return true; if ([BitField.isModerator, BitField.isContributor].some(bf => user.bitfield.includes(bf))) return true; return false; } @@ -809,7 +810,12 @@ ORDER BY item_id ASC;`); if (!isOwner && !isAdmin) { return randArrItem(gifs); } + const { source, dest, reason } = options.player.migrate_user; + + if (source.user.id === dest.user.id) { + return 'Destination cannot be the same as the source!'; + } const sourceUser = await mUserFetch(source.user.id); const destUser = await mUserFetch(dest.user.id);