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` 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/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)]); 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 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); 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 diff --git a/yarn.lock b/yarn.lock index 53c52a88db..09a2d20d5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1486,11 +1486,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" @@ -2681,10 +2681,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"