billytheape
billytheape
DIAdiscord.js - Imagine an app
Created by billytheape on 6/14/2024 in #djs-questions
Possible to _never_ purge/sweep specific cache?
Our bot frequently checks roles & server memberships On our bot initialization, we have makeCache: Options.cacheEverything() set However, when we go to check members, we still frequently have to make api calls to get the member and I'm guessing it's because the cache still has some kind of limits. Am I wrong? Or is there another way to ensure that the members cache is never swept or otherwise purged? Thanks in advance :PrayGe:
4 replies
DIAdiscord.js - Imagine an app
Created by billytheape on 1/27/2023 in #djs-questions
Possible to spawn for a single server with sharding?
I'm looking to have my bot do some specific processes in my server alone using a cron job (assigning roles based on database values, etc). I'd prefer to save the resources of spinning up and connecting to every server & several shards when running this. Is it possible to spawn an instance of the bot targeting a single server? Or should I just make a whole new bot for this? Thanks in advance <:pepe_pray:1011147706539966525>
10 replies
DIAdiscord.js - Imagine an app
Created by billytheape on 12/4/2022 in #djs-questions
Slash commands not showing in some servers
Hi, we have an issue we have had a few users report where slash commands for our bot do not show up for the admins of the server. They are able to see commands from other bots, and they can also see the bot in the members list, but they do not get the prompt when they start typing our slash commands. I understand this is not likely to be a discord.js issue itself, but are there any possible reasons for this behavior that I'm missing? The bot definitely has permission to view the channel the user is attempting to use, and they gave it admin permission in the server to be fully sure. Slash commands work fine for our bot in 99.9% of servers, but apparently just not in a few.
12 replies
DIAdiscord.js - Imagine an app
Created by billytheape on 11/22/2022 in #djs-questions
Modal Submit, how to edit triggering ephemeral?
If I'm triggering a modal from an ephemeral message button, is it possible to edit the original ephemeral message during modal submit? When I try interaction.message.edit(...) I get an error "Unknown Message". The message object seems to be populated as expected...
17 replies
DIAdiscord.js - Imagine an app
Created by billytheape on 11/7/2022 in #djs-questions
Presence Intent added, Shard now takes too long to become ready
Hey, so today I got the guild presence intent added for my bot. However, simply including it in my presences causes the startup to fail. Even without trying to actually do anything besides login, I get Error [ShardingReadyTimeout]: Shard 0's Client took too long to become ready. This is the case if I have 2 shards or 10 shards. For reference, my bot is in just over 4k servers. These are the intents I'm now requesting when the failure occurs:
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildPresences,
]
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildPresences,
]
I already have access for the Server Members Intent, and everything works fine if I simply comment out GatewayIntentBits.GuildPresences (except of course I cannot receive the guildMemberAdd and guildMemberRemove events) Please help! npm list discord.js: [email protected] node -v: v16.13.0
51 replies
DIAdiscord.js - Imagine an app
Created by billytheape on 10/27/2022 in #djs-questions
Show modal and remove previous ephemeral
Hi, I have a flow with my bot where the following steps are taken: 1) A user clicks a button on a bot's message 2) Bot responds with an ephemeral message with additional buttons 3) User clicks a button on ephemeral and modal appears 4) User submits modal, bot responds with a final ephemeral This is working great, however -- I would like for the ephemeral message from step 2 to be removed when the modal is opened. I have tried to call interaction.deleteReply prior to interaction.showModal but this does not work, and I just get "Interaction Failed". And it seems like during the modalSubmit phase in step 4, the context of the original ephemeral from step 2 is lost and I cannot find a way to remove it then either. I have it working without the modal, where I can simply update the ephemeral message from step 2 with the final ephemeral message. But it doesn't seem like there is like an interaction.updateWithModal action that can be taken.
5 replies
DIAdiscord.js - Imagine an app
Created by billytheape on 8/21/2022 in #djs-questions
Bot memory consumption
26 replies