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

Minor update 1.1.1 #76

Merged
merged 7 commits into from
Jan 8, 2025
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: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Pokéstar Changelog

### 1.1.1

- Increase spawned Pokemon duration 15 min -> 30 min
- Fix some performance issues
- Fix `/help` bug
- Add vote, events to tutorial
- Fix a weird voting bug

TODO:

- Stretch: New event
Expand Down
36 changes: 34 additions & 2 deletions src/config/questConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { emojis } = require("../enums/emojis");
const { pokemonIdEnum } = require("../enums/pokemonEnums");
const { checkNumPokemon, listPokemons } = require("../services/pokemon");
const { backpackCategories, backpackItems } = require("./backpackConfig");
const { SUPPORT_SERVER_INVITE } = require("./helpConfig");
const { SUPPORT_SERVER_INVITE, gameEventConfig } = require("./helpConfig");
const { locations } = require("./locationConfig");
const { difficulties } = require("./npcConfig");
const { shopItems } = require("./shopConfig");
Expand Down Expand Up @@ -112,6 +112,23 @@ const newTutorialConfigRaw = {
image:
"https://raw.githubusercontent.com/ewei068/pokestar/main/media/images/tutorial/backpack.png",
},
voting: {
name: "(Optional) Voting",
emoji: "🗳️",
description:
"Voting for Pokestar helps the bot grow! **Vote for Pokestar on top.gg [here](https://top.gg/bot/1093411444877439066/vote)**. Then, use `/vote` to claim your rewards.\n\n" +
`Voting gives you many rewards, and voting consistently gives you a streak. With a max streak, **you can get up to 15x ${emojis.POKEBALL} Pokeballs every 12 hours!**`,
requirementString: "Complete the previous stage",
proceedString:
"(Optional) Vote for Pokestar on top.gg, and complete the previous stage.",
checkRequirements: async (trainer) =>
trainer.tutorialData.completedTutorialStages.backpack,
rewards: {
money: 1000,
},
image:
"https://raw.githubusercontent.com/ewei068/pokestar/refs/heads/main/media/images/tutorial/vote.png",
},
catchSixPokemon: {
name: "Catch More Pokemon",
emoji: emojis.GREATBALL,
Expand Down Expand Up @@ -407,6 +424,21 @@ const newTutorialConfigRaw = {
image:
"https://raw.githubusercontent.com/ewei068/pokestar/main/media/images/pve.gif",
},
events: {
name: "Events",
emoji: "🎉",
description:
"Pokestar has events which provide **limited-time rewards, benefits, and custom Pokemon!** Use `/events` to view ongoing events.",
requirementString: "Complete the previous stage",
proceedString:
"Use `/events` to view ongoing events, and complete the previous stage.",
checkRequirements: async (trainer) =>
trainer.tutorialData.completedTutorialStages.winEasyDifficulty,
rewards: {
money: 1000,
},
image: gameEventConfig[0]?.image,
},
userSettings: {
name: "Settings",
emoji: "⚙️",
Expand All @@ -416,7 +448,7 @@ const newTutorialConfigRaw = {
proceedString:
"Use `/settings` to view and change your settings, and complete the previous stage.",
checkRequirements: async (trainer) =>
trainer.tutorialData.completedTutorialStages.winEasyDifficulty,
trainer.tutorialData.completedTutorialStages.events,
rewards: {
money: 1000,
},
Expand Down
18 changes: 14 additions & 4 deletions src/config/trainerConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,20 @@ const trainerFields = {
},
voting: {
type: "object",
default: {
lastVoted: new Date(0).getTime(),
streak: 0,
rewards: 0,
default: {},
config: {
lastVoted: {
type: "number",
default: new Date(0).getTime(),
},
streak: {
type: "number",
default: 0,
},
rewards: {
type: "number",
default: 0,
},
},
},
trade: {
Expand Down
3 changes: 3 additions & 0 deletions src/deact/interactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ const removeInteractionInstance = (interaction) => {
deleteInteraction(interaction.id);
};

const getInteractionCount = () => Object.keys(interactions).length;

module.exports = {
setInteractionInstance,
getInteractionInstance,
removeInteractionInstance,
getInteractionCount,
};
2 changes: 1 addition & 1 deletion src/elements/help/HelpCategoryList.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ module.exports = async (ref, { initialPage = 1, initialCommand = null }) => {
) {
return {
initialCategoryFound: category,
initialCommandFound: providedCommand,
initialCommandFound: commandData.aliases[0],
err: null,
};
}
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const { cleanupRaids } = require("./services/raid");
const {
initialize: initializeBattleData,
} = require("./battle/data/initialize");
const { getInteractionCount } = require("./deact/interactions");

console.log(`STAGE: ${process.env.STAGE}`);
const FFLAG_ENABLE_SPAWN = process.env.FFLAG_ENABLE_SPAWN === "1";
Expand Down Expand Up @@ -170,7 +171,10 @@ client.once(Events.ClientReady, (c) => {
poll(async () => {
try {
const stateSize = getStateCount();
logger.info(`STATE SIZE: ${stateSize}`);
const interactionCount = getInteractionCount();
logger.info(
`STATE SIZE: ${stateSize} | INTERACTION COUNT: ${interactionCount}`
);
} catch {
logger.warn("Error polling state size");
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const buildPokemonSpawnSend = (goodSpawn) => {
level,
goodSpawn,
},
15 * 60
30 * 60
);
const buttonConfigs = [
{
Expand Down
Loading