Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle for wilderness high peak time warning #5411

Merged
merged 4 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

export const Channel = {
General: DISCORD_SETTINGS.Channels?.General ?? '342983479501389826',
Notifications: production ? '469523207691436042' : '1042760447830536212',

Check warning on line 27 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected any value in conditional. An explicit comparison or type cast is required
GrandExchange: DISCORD_SETTINGS.Channels?.GrandExchange ?? '682996313209831435',
Developers: DISCORD_SETTINGS.Channels?.Developers ?? '648196527294251020',
BlacklistLogs: DISCORD_SETTINGS.Channels?.BlacklistLogs ?? '782459317218967602',
Expand All @@ -34,13 +34,13 @@
TestingMain: TestingMainChannelID,
BarbarianAssault: DISCORD_SETTINGS.Channels?.BarbarianAssault ?? '789717054902763520',
ChambersOfXeric: DISCORD_SETTINGS.Channels?.ChambersOfXeric ?? '835876917252587581',
BotLogs: production ? '1051725977320964197' : TestingMainChannelID,

Check warning on line 37 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected any value in conditional. An explicit comparison or type cast is required
GeneralChannel:
BOT_TYPE === 'OSB'
? production

Check warning on line 40 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected any value in conditional. An explicit comparison or type cast is required
? '346304390858145792'
: '1154056119019393035'
: production

Check warning on line 43 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

Unexpected any value in conditional. An explicit comparison or type cast is required
? '792691343284764693'
: '1154056119019393035'
};
Expand Down Expand Up @@ -68,7 +68,7 @@
TopGlobalCL: '1072426869028294747'
};

export const enum Emoji {

Check warning on line 71 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

'Emoji' is already declared in the upper scope on line 71 column 19
MoneyBag = '<:MoneyBag:493286312854683654>',
OSBot = '<:OSBot:601768469905801226>',
Joy = '😂',
Expand Down Expand Up @@ -170,14 +170,14 @@
BronzeTrophy = '<:BronzeTrophy:1152881057788592188>'
}

export enum ActivityGroup {

Check warning on line 173 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

'ActivityGroup' is already declared in the upper scope on line 173 column 13
Skilling = 'Skilling',
Clue = 'Clue',
Monster = 'Monster',
Minigame = 'Minigame'
}

export const enum Events {

Check warning on line 180 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

'Events' is already declared in the upper scope on line 180 column 19
Error = 'error',
Log = 'log',
Verbose = 'verbose',
Expand All @@ -190,7 +190,7 @@

export const COINS_ID = 995;

export const enum PerkTier {

Check warning on line 193 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

'PerkTier' is already declared in the upper scope on line 193 column 19
/**
* Boosters
*/
Expand Down Expand Up @@ -221,7 +221,7 @@
Seven = 7
}

export enum BitField {

Check warning on line 224 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

'BitField' is already declared in the upper scope on line 224 column 13
IsPatronTier1 = 2,
IsPatronTier2 = 3,
IsPatronTier3 = 4,
Expand Down Expand Up @@ -260,7 +260,8 @@
SelfGamblingLocked = 36,
DisabledFarmingReminders = 37,
DisableClueButtons = 38,
DisableAutoSlayButton = 39
DisableAutoSlayButton = 39,
DisableHighPeakTimeWarning = 40
}

interface BitFieldData {
Expand Down Expand Up @@ -350,10 +351,15 @@
name: 'Disable Auto Slay Button',
protected: false,
userConfigurable: true
},
[BitField.DisableHighPeakTimeWarning]: {
name: 'Disable Wilderness High Peak Time Warning',
protected: false,
userConfigurable: true
}
} as const;

export const enum PatronTierID {

Check warning on line 362 in src/lib/constants.ts

View workflow job for this annotation

GitHub Actions / ESLint

'PatronTierID' is already declared in the upper scope on line 362 column 19
One = '4608201',
Two = '4608226',
Three = '4720356',
Expand Down
4 changes: 4 additions & 0 deletions src/mahoji/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ const toggles: UserConfigToggle[] = [
{
name: 'Disable Clue Buttons',
bit: BitField.DisableClueButtons
},
{
name: 'Disable wilderness high peak time warning',
bit: BitField.DisableHighPeakTimeWarning
}
];

Expand Down
4 changes: 2 additions & 2 deletions src/mahoji/lib/abstracted_commands/minionKill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Bank, Monsters } from 'oldschooljs';
import { MonsterAttribute } from 'oldschooljs/dist/meta/monsterData';
import { itemID } from 'oldschooljs/dist/util';

import { PeakTier, PvMMethod } from '../../../lib/constants';
import { BitField, PeakTier, PvMMethod } from '../../../lib/constants';
import { Eatables } from '../../../lib/data/eatables';
import { getSimilarItems } from '../../../lib/data/similarItems';
import { checkUserCanUseDegradeableItem, degradeablePvmBoostItems, degradeItem } from '../../../lib/degradeableItems';
Expand Down Expand Up @@ -689,7 +689,7 @@ export async function minionKillCommand(
break;
}
}
if (wildyPeak?.peakTier === PeakTier.High) {
if (wildyPeak?.peakTier === PeakTier.High && !user.bitfield.includes(BitField.DisableHighPeakTimeWarning)) {
if (interaction) {
await handleMahojiConfirmation(
interaction,
Expand Down
Loading