From 9acdc8bcc375878fb29729bda6e4e6c84daa5264 Mon Sep 17 00:00:00 2001 From: themrrobert <10122432+themrrobert@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:43:48 -0700 Subject: [PATCH 1/6] Fix a bug in migrate user script (disallow src = dst) (#5915) --- 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); From 8b655e172ca53a479cf84b368135935dd7a7438c Mon Sep 17 00:00:00 2001 From: themrrobert <10122432+themrrobert@users.noreply.github.com> Date: Mon, 10 Jun 2024 23:17:32 -0700 Subject: [PATCH 2/6] Add src != dest user check to the migrateUser function (#5916) --- src/lib/util/migrateUser.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/util/migrateUser.ts b/src/lib/util/migrateUser.ts index 58ad89de50..dbdeea7f12 100644 --- a/src/lib/util/migrateUser.ts +++ b/src/lib/util/migrateUser.ts @@ -8,6 +8,10 @@ export async function migrateUser(_source: string | MUser, _dest: string | MUser const sourceUser = typeof _source === 'string' ? await mUserFetch(_source) : _source; const destUser = typeof _dest === 'string' ? await mUserFetch(_dest) : _dest; + if (sourceUser.id === destUser.id) { + throw new UserError('Destination user cannot be the same as the source!'); + } + // First check for + cancel active GE Listings: await Promise.all([cancelUsersListings(sourceUser), cancelUsersListings(destUser)]); From f26e505ed5df825ff06f412f84bd2a0f07bae102 Mon Sep 17 00:00:00 2001 From: nwjgit <69014816+nwjgit@users.noreply.github.com> Date: Thu, 13 Jun 2024 08:50:11 -0500 Subject: [PATCH 3/6] Add minions inferno kc to cl (#5911) --- src/lib/data/Collections.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/data/Collections.ts b/src/lib/data/Collections.ts index e001fc577e..b72ed565e1 100644 --- a/src/lib/data/Collections.ts +++ b/src/lib/data/Collections.ts @@ -353,6 +353,10 @@ export const allCollectionLogs: ICollection = { fmtProg: kcProg(Monsters.Hespori) }, 'The Inferno': { + kcActivity: { + Default: async (_, minigameScores) => + minigameScores.find(i => i.minigame.column === 'inferno')!.score + }, alias: ['zuk', 'inferno'], items: theInfernoCL, fmtProg: ({ minigames }) => `${minigames.inferno} KC` From b8d04e1dbf9e1527d818094f79e3dd413601cdeb Mon Sep 17 00:00:00 2001 From: nwjgit <69014816+nwjgit@users.noreply.github.com> Date: Fri, 14 Jun 2024 04:33:35 -0500 Subject: [PATCH 4/6] A few osb cl fixes (#5909) --- src/lib/data/CollectionsExport.ts | 7 ++++--- tests/unit/snapshots/clsnapshots.test.ts.snap | 5 ++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/data/CollectionsExport.ts b/src/lib/data/CollectionsExport.ts index 2ac2ab37ee..a383c19525 100644 --- a/src/lib/data/CollectionsExport.ts +++ b/src/lib/data/CollectionsExport.ts @@ -343,13 +343,14 @@ export const grotesqueGuardiansCL = resolveItems([ 'Granite dust' ]); export const hesporiCL = resolveItems(['Bottomless compost bucket', 'Iasor seed', 'Kronos seed', 'Attas seed']); -export const theInfernoCL = resolveItems(['Jal-nib-rek', 'Infernal cape', 'Tokkul']); +export const theInfernoCL = resolveItems(['Jal-nib-rek', 'Infernal cape']); export const kalphiteQueenCL = resolveItems([ 'Kalphite princess', 'Kq head', 'Jar of sand', 'Dragon 2h sword', - 'Dragon chainbody' + 'Dragon chainbody', + 'Dragon pickaxe' ]); export const kingBlackDragonCL = resolveItems([ 'Prince black dragon', @@ -391,12 +392,12 @@ export const spiritAnglerOutfit = resolveItems([ export const temporossCL = resolveItems([ 'Tiny tempor', 'Big harpoonfish', + ...spiritAnglerOutfit, 'Tome of water (empty)', 'Soaked page', 'Tackle box', 'Fish barrel', 'Dragon harpoon', - ...spiritAnglerOutfit, 'Spirit flakes' ]); export const thermonuclearSmokeDevilCL = resolveItems([ diff --git a/tests/unit/snapshots/clsnapshots.test.ts.snap b/tests/unit/snapshots/clsnapshots.test.ts.snap index 28191f3d0b..328e187c4b 100644 --- a/tests/unit/snapshots/clsnapshots.test.ts.snap +++ b/tests/unit/snapshots/clsnapshots.test.ts.snap @@ -53,7 +53,7 @@ Hard Treasure Trails (134) Hespori (4) Implings (12) K'ril Tsutsaroth (8) -Kalphite Queen (5) +Kalphite Queen (6) King Black Dragon (4) Kraken (4) Kree'arra (8) @@ -94,7 +94,7 @@ Tempoross (12) The Fight Caves (2) The Forgotten Four (40) The Gauntlet (5) -The Inferno (3) +The Inferno (2) The Leviathan (10) The Nightmare (12) The Whisperer (10) @@ -1419,7 +1419,6 @@ The stuff Thieving bag Thread of elidinis Tiny tempor -Tokkul Toktz-ket-xil Toktz-mej-tal Toktz-xil-ak From e10c7eb3c6d07f54530ee827b63c30108dae1a86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 11:25:33 +1000 Subject: [PATCH 5/6] Bump braces from 3.0.2 to 3.0.3 (#5923) Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yarn.lock b/yarn.lock index 27e4ed785c..0ccda17eba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1479,11 +1479,11 @@ brace-expansion@^2.0.1: balanced-match "^1.0.0" braces@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: - fill-range "^7.0.1" + fill-range "^7.1.1" buffer@^5.5.0: version "5.7.1" @@ -2659,10 +2659,10 @@ filing-cabinet@^4.1.6: tsconfig-paths "^4.2.0" typescript "^5.0.4" -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1" From 627e68fdc20992a852dcd20622cd2a371296d5e7 Mon Sep 17 00:00:00 2001 From: nwjgit <69014816+nwjgit@users.noreply.github.com> Date: Sun, 16 Jun 2024 20:27:41 -0500 Subject: [PATCH 6/6] Add quantity owned to ge sell autocomplete (#5919) --- src/mahoji/commands/ge.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/mahoji/commands/ge.ts b/src/mahoji/commands/ge.ts index 1336716b9d..4467b00f3f 100644 --- a/src/mahoji/commands/ge.ts +++ b/src/mahoji/commands/ge.ts @@ -17,7 +17,7 @@ import { handleMahojiConfirmation } from '../../lib/util/handleMahojiConfirmatio import { deferInteraction } from '../../lib/util/interactionReply'; import itemIsTradeable from '../../lib/util/itemIsTradeable'; import { cancelGEListingCommand } from '../lib/abstracted_commands/cancelGEListingCommand'; -import { itemOption, ownedItemOption, tradeableItemArr } from '../lib/mahojiCommandOptions'; +import { itemOption, tradeableItemArr } from '../lib/mahojiCommandOptions'; import { OSBMahojiCommand } from '../lib/util'; export type GEListingWithTransactions = GEListing & { @@ -130,10 +130,19 @@ export const geCommand: OSBMahojiCommand = { description: 'Sell something on the grand exchange.', options: [ { - ...ownedItemOption(item => Boolean(item.tradeable_on_ge)), name: 'item', + type: ApplicationCommandOptionType.String, description: 'The item you want to sell.', - required: true + required: true, + autocomplete: async (value, { id }) => { + const user = await mUserFetch(id); + + return user.bank + .items() + .filter(i => i[0].tradeable_on_ge) + .filter(i => (!value ? true : i[0].name.toLowerCase().includes(value.toLowerCase()))) + .map(i => ({ name: `${i[0].name} (${i[1]}x Owned)`, value: i[0].name })); + } }, quantityOption, priceOption