Squid
DIAdiscord.js - Imagine an app
•Created by ABDULLAH on 7/1/2024 in #djs-questions
How do create poll with my bot?
@ABDULLAH include the
poll
property here6 replies
DIAdiscord.js - Imagine an app
•Created by Diamond Pixals on 6/29/2024 in #djs-questions
Create a new category
Call
<Guild>.channels.create(...)
and include type: ChannelType.GuildCategory
8 replies
DIAdiscord.js - Imagine an app
•Created by navy on 6/29/2024 in #djs-questions
Fetching guild id and other properties when guild create event is fired
That looks better but try it and see
I see you removed your
client
parameter, so make sure your event listener doesn't pass in the client as the first argument29 replies
DIAdiscord.js - Imagine an app
•Created by navy on 6/29/2024 in #djs-questions
Fetching guild id and other properties when guild create event is fired
PS: I recommend using
findOneAndUpdate()
with upsert: true, new: true
and $setOnInsert
to find a document if it exists (using the id as the query), and if it doesn't exist, insert a new document with the remaining fields29 replies
DIAdiscord.js - Imagine an app
•Created by navy on 6/29/2024 in #djs-questions
Fetching guild id and other properties when guild create event is fired
Also, you should not include
once: true
since I assume you want to listen for this event multiple times instead of just the first time after your bot has started29 replies
DIAdiscord.js - Imagine an app
•Created by navy on 6/29/2024 in #djs-questions
Fetching guild id and other properties when guild create event is fired
You have no reason to construct a new Guild instance; the discord.js Guild constructor is only used internally to create an instance from API data, and you have no reason to be doing that
If you just want the guild that the bot has joined, I assume that would be
const guild = args;
(or just rename args
to guild
since that's all the GuildCreate event emits with anyways)29 replies
DIAdiscord.js - Imagine an app
•Created by navy on 6/29/2024 in #djs-questions
Fetching guild id and other properties when guild create event is fired
I recommend you use a linter to warn you of unused variables to call this out in the future since you import your DB model, yet you do not use it anywhere in your code
29 replies
DIAdiscord.js - Imagine an app
•Created by navy on 6/29/2024 in #djs-questions
Fetching guild id and other properties when guild create event is fired
(responding here because you crossposted in the main support channel)
You should use your model to create a new guild document in your database, and follow mongoose guides for how to do so (if you're using mongoose, we can't even tell)
You should not use the discord.js Guild class to construct a new discord.js Guild instance, but that is what you are currently doing for some reason
29 replies
DIAdiscord.js - Imagine an app
•Created by Mussaplays. on 6/23/2024 in #djs-questions
is there is a way to make down menu never expire?
Select menus as message components never expire; the only thing that's expiring is your collector that listens for interactions on that message
You must use your
interactionCreate
event listener with the typeguards like interaction.isMessageComponent()
to always listen for comoponent interactions14 replies
DIAdiscord.js - Imagine an app
•Created by Joãozinho on 6/11/2024 in #djs-questions
Is there any way for me to check which servers a user is on by their ID? , or any API that lets me s
With discord.js, you would have to manually fetch the member in each of the guilds that your bot is in, and those that resolve instead of reject are mutual servers with your bot and the user
You can actually get a list of all the user's servers with OAuth2 though, but not the gateway
3 replies
DIAdiscord.js - Imagine an app
•Created by emp on 6/7/2024 in #djs-questions
global slash command not working
Is there an error?
4 replies
DIAdiscord.js - Imagine an app
•Created by Fr³oN || تم النقل الي {6h3h} on 6/2/2024 in #djs-questions
Get Guilds Members
If you're using
discord-api-types
, use Routes.guildMember(...)
4 replies
DIAdiscord.js - Imagine an app
•Created by Mussaplays. on 6/1/2024 in #djs-questions
Welcome message not sending
yes
24 replies
DIAdiscord.js - Imagine an app
•Created by Mussaplays. on 6/1/2024 in #djs-questions
Welcome message not sending
![No description](https://answer-overflow-discord-attachments.s3.us-east-1.amazonaws.com/1246466104679727214/image.png)
24 replies
DIAdiscord.js - Imagine an app
•Created by Mussaplays. on 6/1/2024 in #djs-questions
Welcome message not sending
That's right
24 replies
DIAdiscord.js - Imagine an app
•Created by Mussaplays. on 6/1/2024 in #djs-questions
Welcome message not sending
The event's name must be
'guildMemberAdd'
with a lowercase "g". Events.GuildMemberAdd
returns this same string, but the casing is important24 replies