From 8e7bfa29c14fdacea8f726c626cdafe36422e284 Mon Sep 17 00:00:00 2001 From: Elvis Wei Date: Mon, 6 Jan 2025 12:42:37 -0600 Subject: [PATCH 1/7] changelog --- changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog.md b/changelog.md index cd8aaba..b33d7d0 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Pokéstar Changelog +### 1.1.1 + +- Increase spawned Pokemon duration 15 min -> 30 min +- Fix some performance issues +- Fix `/help` bug + TODO: - Stretch: New event From 10b59818c4aac96ec2be76b5bda93fa34ba18fd6 Mon Sep 17 00:00:00 2001 From: Elvis Wei Date: Mon, 6 Jan 2025 12:43:16 -0600 Subject: [PATCH 2/7] changelog 2 --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index b33d7d0..3378cc1 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ - Increase spawned Pokemon duration 15 min -> 30 min - Fix some performance issues - Fix `/help` bug +- Add vote, events to tutorial? TODO: From 1c4cdb7eee7e76ccf45f14319dce14698a0a0902 Mon Sep 17 00:00:00 2001 From: Elvis Wei Date: Mon, 6 Jan 2025 12:44:37 -0600 Subject: [PATCH 3/7] increase spawn duration --- src/services/spawn.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/spawn.js b/src/services/spawn.js index 89cb142..0fa4e1f 100644 --- a/src/services/spawn.js +++ b/src/services/spawn.js @@ -118,7 +118,7 @@ const buildPokemonSpawnSend = (goodSpawn) => { level, goodSpawn, }, - 15 * 60 + 30 * 60 ); const buttonConfigs = [ { From f5fc934c2216239c950fbfcdebe7fe37e263e885 Mon Sep 17 00:00:00 2001 From: Elvis Wei Date: Mon, 6 Jan 2025 12:51:59 -0600 Subject: [PATCH 4/7] interaction count --- src/deact/interactions.js | 3 +++ src/index.js | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/deact/interactions.js b/src/deact/interactions.js index b24dc23..98b79d4 100644 --- a/src/deact/interactions.js +++ b/src/deact/interactions.js @@ -47,8 +47,11 @@ const removeInteractionInstance = (interaction) => { deleteInteraction(interaction.id); }; +const getInteractionCount = () => Object.keys(interactions).length; + module.exports = { setInteractionInstance, getInteractionInstance, removeInteractionInstance, + getInteractionCount, }; diff --git a/src/index.js b/src/index.js index ea7fffb..f336caf 100644 --- a/src/index.js +++ b/src/index.js @@ -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"; @@ -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"); } From c0d09568b35b0808f202bc44a694d77a81fa74bc Mon Sep 17 00:00:00 2001 From: Elvis Wei Date: Mon, 6 Jan 2025 13:39:13 -0600 Subject: [PATCH 5/7] fix help command --- src/elements/help/HelpCategoryList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elements/help/HelpCategoryList.js b/src/elements/help/HelpCategoryList.js index 21dae8f..67e3e02 100644 --- a/src/elements/help/HelpCategoryList.js +++ b/src/elements/help/HelpCategoryList.js @@ -46,7 +46,7 @@ module.exports = async (ref, { initialPage = 1, initialCommand = null }) => { ) { return { initialCategoryFound: category, - initialCommandFound: providedCommand, + initialCommandFound: commandData.aliases[0], err: null, }; } From cde6a54ed977ea51ff89c79b768f2f26a41dec9c Mon Sep 17 00:00:00 2001 From: Elvis Wei Date: Mon, 6 Jan 2025 20:59:46 -0600 Subject: [PATCH 6/7] fix small voting bug --- changelog.md | 1 + src/config/trainerConfig.js | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 3378cc1..bc38825 100644 --- a/changelog.md +++ b/changelog.md @@ -6,6 +6,7 @@ - Fix some performance issues - Fix `/help` bug - Add vote, events to tutorial? +- Fix a weird voting bug TODO: diff --git a/src/config/trainerConfig.js b/src/config/trainerConfig.js index 62683e8..db63e90 100644 --- a/src/config/trainerConfig.js +++ b/src/config/trainerConfig.js @@ -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: { From a18b4f75e8b8af762441dd0e1753a0e5faf3c0a1 Mon Sep 17 00:00:00 2001 From: Elvis Wei Date: Mon, 6 Jan 2025 21:14:05 -0600 Subject: [PATCH 7/7] add more tutorial things --- changelog.md | 2 +- src/config/questConfig.js | 36 ++++++++++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index bc38825..c21c669 100644 --- a/changelog.md +++ b/changelog.md @@ -5,7 +5,7 @@ - Increase spawned Pokemon duration 15 min -> 30 min - Fix some performance issues - Fix `/help` bug -- Add vote, events to tutorial? +- Add vote, events to tutorial - Fix a weird voting bug TODO: diff --git a/src/config/questConfig.js b/src/config/questConfig.js index acda343..a6a2c1c 100644 --- a/src/config/questConfig.js +++ b/src/config/questConfig.js @@ -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"); @@ -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, @@ -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: "⚙️", @@ -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, },