Bump Command on Bot.

Hello! I wanna do an bump command, that sends a message on a specific channel. If u know how to do that, please, ping me.
71 Replies
d.js toolkit
d.js toolkit12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
mallusrgreat
mallusrgreat12mo ago
#how-to-get-help
drexxdv
drexxdvOP12mo ago
bruh everyone send me that
mallusrgreat
mallusrgreat12mo ago
then read it
drexxdv
drexxdvOP12mo ago
and no help me i do
savage unreal
savage unreal12mo ago
channel.send('content')
mallusrgreat
mallusrgreat12mo ago
we will never help you with writing code, but we can help you with fixing
savage unreal
savage unreal12mo ago
all users here are annoying, you should try to help
mallusrgreat
mallusrgreat12mo ago
??
drexxdv
drexxdvOP12mo ago
but i need to send the invite to the server on ejecuted command, the name, the owner... etc
savage unreal
savage unreal12mo ago
we don't need to do this, but we can direct the user on how to do it ejecuted?
mallusrgreat
mallusrgreat12mo ago
i dont think its possible to see who executed the command
treble/luna
treble/luna12mo ago
Again, we are here to provide help if you have issues We're not writing code for you
drexxdv
drexxdvOP12mo ago
i know
savage unreal
savage unreal12mo ago
☝🏿
drexxdv
drexxdvOP12mo ago
but help me
mallusrgreat
mallusrgreat12mo ago
sure but this person looks like he hasn't even tried help you with what?
savage unreal
savage unreal12mo ago
you're not sure about this, you shouldn't judge a person, but rather try to help them
drexxdv
drexxdvOP12mo ago
to do the command no write code
mallusrgreat
mallusrgreat12mo ago
We're not writing code for you
drexxdv
drexxdvOP12mo ago
by example a guide
treble/luna
treble/luna12mo ago
Try it yourself first. The guide and the docs will help you a lot
d.js docs
d.js docs12mo ago
:guide: Home: What's new read more
savage unreal
savage unreal12mo ago
discord.js
discord.js
discord.js is a powerful Node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
savage unreal
savage unreal12mo ago
latest version i thinnk
mallusrgreat
mallusrgreat12mo ago
that's the docs not the guide
mallusrgreat
mallusrgreat12mo ago
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
drexxdv
drexxdvOP12mo ago
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
mallusrgreat
mallusrgreat12mo ago
have you read it?
savage unreal
savage unreal12mo ago
this will help just as much
drexxdv
drexxdvOP12mo ago
some times i read some pages
mallusrgreat
mallusrgreat12mo ago
well that isn't helpful you need to listen to messageCreate event and make the code act according to the message sent
drexxdv
drexxdvOP12mo ago
slash i want slash
mallusrgreat
mallusrgreat12mo ago
uhh so your bot has a /bump command and you want the bot to listen to the /bump command?
treble/luna
treble/luna12mo ago
The guide has everything you need
drexxdv
drexxdvOP12mo ago
its registered
treble/luna
treble/luna12mo ago
Read it
d.js docs
d.js docs12mo ago
const channel = client.channels.cache.get("222086648706498562");
const channel = guild.channels.cache.find(channel => channel.name === "general");
const channel = client.channels.cache.get("222086648706498562");
const channel = guild.channels.cache.find(channel => channel.name === "general");
- Caches in discord.js are Collections which extend the native Map structure. - learn more
treble/luna
treble/luna12mo ago
thats how you'd send a message to a specific channel
drexxdv
drexxdvOP12mo ago
thx it will be useful but the invite and the info how ?
mallusrgreat
mallusrgreat12mo ago
what invite and info
treble/luna
treble/luna12mo ago
also, send a single message
drexxdv
drexxdvOP12mo ago
i want to send a message with info
mallusrgreat
mallusrgreat12mo ago
you'd have to do that yourself that's your job
drexxdv
drexxdvOP12mo ago
and a invite
d.js docs
d.js docs12mo ago
:method: TextChannel#createInvite() Creates an invite to this guild channel.
treble/luna
treble/luna12mo ago
read. The. Docs
drexxdv
drexxdvOP12mo ago
But i literaly dont know how, i say
mallusrgreat
mallusrgreat12mo ago
<TextChannel>.send('info and invite link goes here')
treble/luna
treble/luna12mo ago
We arent the docs Put some effort in yourself and search the docs
mallusrgreat
mallusrgreat12mo ago
we've already helped you with the d.js part, now it's entirely upto the logic of your code which we won't help with here
drexxdv
drexxdvOP12mo ago
breh i need send an invite on a channel, and the invite needs to be the invite of the server on command is runned ive got the code for create the invite and that, but, how i send the invite?? i can use
await interaction.reply(`Invite link: https://discord.gg/${invite.code}`)
await interaction.reply(`Invite link: https://discord.gg/${invite.code}`)
? ah ok i have all my code finished but i have this error
treble/luna
treble/luna12mo ago
you dont have to send a message for every word and actually send the error
drexxdv
drexxdvOP12mo ago
No description
d.js docs
d.js docs12mo ago
- ReferenceError: "x" is not defined: learn more - TypeError: Cannot read properties of undefined/null (reading "x"): learn more
drexxdv
drexxdvOP12mo ago
The code (Its an spanish bot lol)
No description
treble/luna
treble/luna12mo ago
You access invite but never define it You only define it in the then callback
drexxdv
drexxdvOP12mo ago
breh what can i do?
treble/luna
treble/luna12mo ago
define the invite before that this is basic js really Or move your embed in your then callback
drexxdv
drexxdvOP12mo ago
that was an idea i try lol javascript its stupid, u can use console.log and no write nothing and it will work not possible
treble/luna
treble/luna12mo ago
It is but ok, then move the embed into the then callback
drexxdv
drexxdvOP12mo ago
what callback
treble/luna
treble/luna12mo ago
the then callback
drexxdv
drexxdvOP12mo ago
i try but gives error on "const"
treble/luna
treble/luna12mo ago
and that error is
drexxdv
drexxdvOP12mo ago
.then(invite => const bumpEmbed = new EmbedBuilder()
^^^^^
SyntaxError: Unexpected token 'const'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1195:20)
at Module._compile (node:internal/modules/cjs/loader:1239:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at Module._load (node:internal/modules/cjs/loader:972:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47
.then(invite => const bumpEmbed = new EmbedBuilder()
^^^^^
SyntaxError: Unexpected token 'const'
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1195:20)
at Module._compile (node:internal/modules/cjs/loader:1239:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at Module._load (node:internal/modules/cjs/loader:972:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47
treble/luna
treble/luna12mo ago
thats not how a callback works This is basic js Do you have any js experience at all?
drexxdv
drexxdvOP12mo ago
meh
treble/luna
treble/luna12mo ago
Then learn it, #rules 3 #resources
drexxdv
drexxdvOP12mo ago
breh
treble/luna
treble/luna12mo ago
did you really have to ping me for that?

Did you find this page helpful?