#development
1 messages · Page 1079 of 1
What I need is to automatically update the servers that is
what is the code for this?
The code from the first example will work for you
autopost too 
Whichever one you want to use
and how i should wait untill the bot post the serverount?
|Invite Me | Support Server |
It should immediately try to post it
if person clicks he go there
That's hyperlinks, PGamerX
how to do in embed?
[Your text](Your URL)
in quotation marks
alr
aka inside the string
:V failed to post because i don't put the token
:V
Nvm I am just gonna give up
I give up! ! !
gonna let u down
ok
i have a question
i am making a website
on glitch
how can i change this
i know the wording
but the logo
that i don't know
Can someone maybe help me in dms
@acoustic orchid what's ur problem?
Idk how to make the commands looking nice and let them all work @tranquil sandal
do you know any programming language
Uhmm idk how to use js
then learn
then learn.
Lol I mean I have never did something like this before
follow tutorials
Wich tutorials do u mean then
and then https://discord.js.org/ for more complex in-depth info about stuff
Oh I am to broke for this stuff
mybot.js
client.commands.find(cmd => cmd.aliases && cmd.name).execute(message);
if (!command) return;
ping.js
module.exports = {
name: 'ping',
description: "this is a ping command!",
aliases: ['hi', 'testping'],
execute(message){
message.channel.send('pong!');
}
}
@hazy sparrow from what im seeing your find method is just filtering for commands which have aliases and name properties defined
i have name property defined for everything
which would explain why it pulls up the incorrect command
okay so how can i make it check for the filename
compare the strings 👁️ 👄 👁️
ill try that wait
i don't use js so i can't help you much
but i'd suggest doing research
beleive me or not creating a bot for faccebook using the official way is a real fucking pain in the ass
i get this errors can someone help?
here the error
how do i check if they user doesn't have the permission from this?
if($yes->permissions & 0x00000020)
why is that a bmp file
i dont download random files from discord. either paste them in a pastebin or hastebin site or use a different format
Discord JS
Would it be better if I load objects in a variable before, like:
const someVar = client.users.cache.get("someID");
Instead of requesting that resource every get() ?
code
I'm using the same resource and exporting it in other files
const commandFiles = readdirSync(join(__dirname, "commands")).filter(file => file.endsWith(".js"));
for (const file of commandFiles) {
const command = require(join(__dirname, "commands", ${file}));
client.commands.set(command.name, command);
}
@valid holly you request it from the cache so i dont think there is a difference
if you would fetch it i would only do it once and then use the cache
That is what I was thinking aswell, but wasn't sure.
did it resulted in undefined?
Does anyone know a good WORKING Lavalink client for discord.js?
The one in the Lavalink git rep doesnt work
Theres multiple listed there iirc
yes
Gonna try erela now
Ah yes
Erela errors:
(node:16180) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined
at Map.spawn (F:\Github\Little-Music\node_modules\erela.js\dist\lib\stores\PlayerStore.js:40:50)
at Object.execute (F:\Github\Little-Music\commands\lavalink.js:16:45)
at Client.<anonymous> (F:\Github\Little-Music\index.js:94:15)
at Client.emit (events.js:311:20)
at MessageCreateAction.handle (F:\Github\Little-Music\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (F:\Github\Little-Music\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (F:\Github\Little-Music\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
at WebSocketShard.onPacket (F:\Github\Little-Music\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
at WebSocketShard.onMessage (F:\Github\Little-Music\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
at WebSocket.onMessage (F:\Github\Little-Music\node_modules\ws\lib\event-target.js:125:16)
(node:16180) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:16180) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
Now it works. The VoiceChannel of the user was wrong defined
SyntaxError: Invalid or unexpected token
2:23 PM
at Module._compile (internal/modules/cjs/loader.js:703:23)
2:23 PM
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
2:23 PM
at Module.load (internal/modules/cjs/loader.js:628:32)
2:23 PM
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
2:23 PM
at Module.require (internal/modules/cjs/loader.js:666:19)
2:23 PM
at require (internal/modules/cjs/helpers.js:16:16)
2:23 PM
Jump Toat Object.<anonymous> (/app/index.js:47:19)
2:23 PM
at Module._compile (internal/modules/cjs/loader.js:759:30)
2:23 PM
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
2:23 PM
at Module.load (internal/modules/cjs/loader.js:628:32)
const commandFiles = readdirSync(join(__dirname, "commands")).filter(file => file.endsWith(".js"));
for (const file of commandFiles) {
const command = require(join(__dirname, "commands", ${file}));
client.commands.set(command.name, command);
}
client.on("message", async message => {
if (message.author.bot) return;
if (!message.guild) return;
i get the error and here is the code
Please learn how to use codeblocks
where can i learn
Misly how can i like set the volume and get infos abt the node etc do you know that?
Check their documentation
ty
now i get this
SyntaxError: Unexpected identifier
SyntaxError: Unexpected identifier
What
at Module._compile (internal/modules/cjs/loader.js:703:23)
2:27 PM
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
2:27 PM
at Module.load (internal/modules/cjs/loader.js:628:32)
2:27 PM
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
2:27 PM
at Function.Module.runMain (internal/modules/cjs/loader.js:826:10)
2:27 PM
at internal/main/run_main_module.js:17:11
onst commandFiles = readdirSync(join(__dirname, "commands")).filter(file => file.endsWith(".js"));
for (const file of commandFiles) {
const command = require(join(__dirname, "commands", `${file}`));
client.commands.set(command.name, command);
}
like this?
Please learn how to to use JavaScript
/ learn how to use discord
:/
lol that doesnt help
or even a better idea
don't copypaste your big ass blocks of code here and instead send a link to a text sharing service
🧠
yes but it's cluttering the channel
it reduces readability and clutters the chat preventing other questions from really being seen
using favicon
@misty sigil but i am not sure how to do that in glitch
the thing whereb we need to tell file
location
and name etc
My Monitor Down 
Learn html
Does anyone know how i get the stats from the 1. Node?
nodes: NodeStore [Map] {
'IP' => Node {
erela: [Circular],
websocket: [WebSocket],
reconnectAttempts: 0,
calls: 1,
options: [Object],
retryAmount: 5,
retryDelay: 30000,
stats: [Object]
},```
I tried: ``client.music.nodes[0]``
e
hi
does anyone know how I can fix Promise { { _misc: [ 'Only dictionaries may be used in a DictType' ] } } ?
my code:
async function sendWebhook(content, username, avatarURL, webhook) {
const fetch = require('node-fetch');
const hook = await fetch(`https://discord.com/api/webhooks/${webhook.id}/${webhook.token}`, {
method: 'post',
body: { content: JSON.stringify(content), username: JSON.stringify(username) }
}).then((e) => e.json());
return hook;
}```
what im doing: ```js
await sendWebhook('hi', 'hi', 'https://bob.png', webhook);
i believe the error is coming from body:.., and i dont know how to fix it
why are you stringifying the content
it should already be a string
same goes for username
hey
i am not good at html
how can i bring it in centre
it has something to do with p
use a flexbox
Can someone tell me why the custom status does not work
module.exports = {
TOKEN: 'private token' )
PREFIX: '.',
STATUSMSG: 'Yee'
}
use a flexbox
@earnest phoenix how
</br></br><h1 class="ariel" style="font-size:60px;"><span style="color: #ffffff;"><p style = "text-align:centre;">Black Sheep</p></span></h1>
i tried this but never worked
@earnest phoenix is this supposed to work
you misspelled center
also
you have a space after equals
you should also use a flexbox for aligning regardless
it's modern web design 101
margin: 0 auto; 😎
nvm
How can I get my bot to properly restart with a command? Eg !restart
depends how you host it
pm2
oh ok
that's not reliable
If a bot is made from a website will it get approved if its nice bot
if it works
@earnest phoenix hi, any ideas why im getting { message: 'Cannot send an empty message', code: 50006 } ?
method: 'post',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: { content: 'hi', username: 'bob' }
isnt the content type supposed to be application/json
if you're sending form urlencoded
the body can't be json
also you're sending an object again
instead of a string
use application/json since it's easier
kk
so
would I do, content: JSON.stringify(content), username: JSON.stringify(username).... ?
you'd want to make the entire body json
afaik
I mean I have no context and idk what you're using
Can I have some help please.
ReferenceError: SpiderBotUptime is not defined
at Object.<anonymous> (C:\Users\Jon\Desktop\SpiderBot Project\index.js:52:13)
at Module._compile (internal/modules/cjs/loader.js:1200:30)``` I get this error when Ive defined SpiderBotUptime function.
--
```js
function SpiderBotUptime() {```
but I think that may be what you want
make the body json?
we already talked about this
content and username are already strings
you do not
like body: { content, username } ?
need to stringify them
you need to stringify the actual body object
which again
i told you this the other day too
if you're doing it for something as simple as that
stringifying takes time so you should just use string literals
yeah
heroku temelde VPS'dir, ancak ücretsiz olarak github ile de senkronize edebilirsiniz.
yani
napacam
how can i use template literals instead of json.stringify?
this i confusing me
so I have a test bot developed with git auto deploy and a git repo, and the main bot in aother folder on the same vps. my idea is to, with a command, transfer every edited file from the test bot folder to the main bot folder and make it restart to apply the update, but my brain os too slamm to do that. anyone have an idea on how i can do this?
so like
@misty sigil napacam
depo olarak github'a klasör ekleyebilirsiniz.
Can I have some help please.
ReferenceError: SpiderBotUptime is not defined
at Object.<anonymous> (C:\Users\Jon\Desktop\SpiderBot Project\index.js:52:13)
at Module._compile (internal/modules/cjs/loader.js:1200:30)``` I get this error when Ive defined SpiderBotUptime function.
--
```js
e.Uptime = function SpiderBotUptime() {```
onu aradım
define it smh
did you define it in the scope
yapamadım
thats-
ki
@misty sigil 
off topic
ohk
ok im just gonna stay here and ask
how long does an embed field value get
1024
field = 1024
ok nice
im getting this, js { message: '400: Bad Request', code: 0 }
total=6000
what i done: ```js
body: { content: 'bob' }
try without ``
"
content
Nvm i fixed my issue
it's missing its quotes
that's not a valid json
json is an object
yes, as you can see
yeah 1 sec lemme change
so i have 2 bot folders with almost the same files, but one is more recent. i just want, thanks to js code, to transfer files from a folder to another. how can i do that
@tight plinth you... drag and drop...?
i mean
not sure i understand what you want to do tbh
@tight plinth no @
@idle rampart shut
his is the code: js await fetch(`https://discord.com/api/webhooks/${webhook.id}/${webhook.token}`, { // <--- here method: 'post', headers: { 'Content-Type': 'application/json' }, body: `{ "content": "bob" }` }).then((e) => e.json()).then((e) => { return e });
fs.Rename @tight plinth , though im unsure how to check file timestamp/date
so i have a github repo linked to a test bot. this bot is only for testing. the testing bot restarts each time the github repo has a new commit. i also have the main bot, in another folder. i want a command that somehow pushes the commits to the main bot in one time
stat might be able to do it
am i clear enough
you could
why not
script the command to run git with a target instead of using FS
THOUGH
the alternative COULD be doing a fs.stat
i think that should give a modification timestamp
THEN you could use fs.rename
git clone might also be able to do just that and check files size/modification date before attempting to replace them
I'm trying to call a function but its undefined partly. But I've defined the name when I made my function-
I can console.log it and it returns as [Function SpiderBot~~~~] because i didnt call it
but when i try call it i cant start my bot o.o
yes
some of you guys are best in world
like erwin and clarkson and beoing and dice
and flapeze
and one more
tim
and some more i forgot the name
How to add custom reply from www.botghost.com
go ask in their support server
@idle rampart #memes-and-media for tr
Also,he is not turk...
it's <:name:id>
no you did not
just look at it
it's your code
oh my fucking god
your bot isn't in the guild the emoji is in
does the bot have use external emoji perm
How to add custom reply from www.botghost.com
frick
enable it explicitly
you might be overwriting it with some other roles or channel overwrites
if not
then the bot isn't in the guild
or you have the wrong id
yeah
that should be fine
lmao
just here to give back
aint fair if im just asking questions and not helping back, no?
sense of community
also, tim, finally ported my shit to Typescript
what a foken nightmare it was. Wasnt too hard but the amount of fixes that had to be done was well over the three digits
Js never again
JavaScript will always haunt you.
is there a way to find the content of a webhook?
fuck that, Js just says 'fuck it all' and runs the code even though there are plenty of bugs around
Ts was good enough to point me them out
Mobile users can't create webhook?
if so, can u link me to the discord docs pls
How can I fix this? D:
@solid falcon i dont see a way rn, though log onto the mobile website rather than the app
you don't even use djs
yeah
Anyone?
webhooks come as message events, no?
no
should have a payload the same as message
How to know id of a person for example 1994947102038 how to know the id
lemme check something rq
it should
how am i meant to get the id?
well, judging that it has a message ID it usually leads me to believe its treated as message
u cant right click on the webhook
you can tho
i'll try sending a webhook, one sec
not the BOT
right click and nothing happens
the message
what
right click the message
here, not on the avatar
but i need get the content, is it the same for webhooks as a ergular message?
https://discord.com/developers/docs/resources/channel#get-channel-message
https://discord.com/developers/docs/resources/channel#message-object
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
works just fine
has same payload as message from what i can tell
treat it as message
Anyone knows how to fix?
no i mean
im unsure what the issue is tbh
Canvas Error
the message payload HAS the content, embed fields on it
you can treat it as a message
But idk why
if i make the api request using the webhook message id- ah
oki, lemme see what i can do
thank
same as you would do for message
here
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Someone? D:
get channel message is what i need, thank though :)
New error
np

Someone knows what's wrong?
Vale did u copy your node_modules folder to somewhere else?
Initilize client first
Vale did u copy your node_modules folder to somewhere else?
@molten yarrow Yes
I did
To my bot hoster
clearly not
you need to rebuild it and not copy
just npm install
it should work if you copy
unless you use absolute path
not if its another architecture
or at least it has been working for me
@earnest phoenix stop using vars
Left my folder and right the hoster
it has nothing to do with that
Code:-
%{DOL}%onlyAdmin⦍You do not have permission to do this Command!⦐
%{DOL}%clear⦍999999⦐
%{DOL}%title⦍**Reset Chat**⦐
%{DOL}%description⦍
ballot_box_with_checkSuccesfully reset the chat
⦐
%{DOL}%footer⦍%{DOL}%username reseted the chat⦐
%{DOL}%color⦍ffffff⦐
%{DOL}%deletecommand
%{DOL}%deleteIn⦍10s⦐
%{DOL}%suppressErrors```
Is this code correct
whats this
lol
XD

oh
Scratch
discord.scratch better
#development message please read the error
;__;
it has nothing to do with your host

???? 
Canvas is real picky about how its installed
You arent even showing the full error smh
try reinstalling canvas
on your host
yeah i had same error when copy over my canvas folder
from win10 on winserver
"Several people are typing..."
i guess it's because it's a native module
i successfully made an eval coommand 🥳

deleted node_modules folder and installed again but on winserver
yep
by defining it
smh
@molten yarrow and this will work 100%?
Because it's a level system with Canvas Rank Card
<your message reaction object>.count
What version djs?
yes
isn't it reactions.cache ?
Stop there
go there to learn about djs
Depends on the version
How do i get the track id of a playlists track in spotify with the spotify web api?
ID of all tracks?
prob check api docs
read the guide
@summer torrent no of one single track
@earnest phoenix Look at https://discord.js.org
You won't understand if you dont grasp js or djs
If you don't understand this, you shouldn't make a bot.
you are collecting those reactions i assume
check whats returned from the collector
either you are collecting those reactions
OR you are checking for one message
in which case client is what contains the emoji
idk what your 'reactions' is set to
awaitReactions?
aight lets see
what does it say it returns?
it is, i just linked above
yeah
im guessing his issue is that he isnt chaining his code on the returned promised
but msg.awaitReactions..
the code must be erroring before that
cuz agree/disagree isnt a variable, its a string
chain the returned collection onto a .then
should work better
@earnest phoenix
this is why you look at the docs
if(command === "eval"){
const owners_id = ["587663056046391302"];
if (!owners_id.includes(msg.author.id))
return msg.channel.send("You not owner boi"); const args2 = msg.content.split(" ").slice(1);
const clean = text => {
if (typeof(text) === "string")
return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
else
return text;
}
try {
const code = args2.join(" ");
let evaled = eval(code);
const eval2 = new Discord.MessageEmbed()
.setTitle("Output")
.setDescription(`${clean(evaled)}` ,{code:"xl"})
if (typeof evaled !== "string")
evaled = require("util").inspect(evaled);
msg.channel.send(clean(evaled));
msg.channel.send(eval2)
} catch (err) {
msg.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
}
};```
what should i do 😭
115 commits to be done 
what
whats so special about vsc version control lol
just use bash/linux subsystem lmfao
guys what have i done wrong
turkish in #memes-and-media @earnest phoenix
@earnest phoenix awaitReactions returns as collection of message reactions
it looks fine to me
@digital ibex but see the output
i saw
@summer torrent already told them, and provided a guide and shit
it looks fine
it looks fine
😩
varisk
it doesn't really teach u why
error?
theres nothing wrong with it, i ask u and u just ignored
that eval shall error btw
what would happen if it doesnt have perm to send message?

ignoring again 🗿
theres nothing wrong with it, i ask u and u just ignored
@digital ibex i dind't
then whats wrong with it?
if im not owner, it'll try to send msg
if it doesnt have send message
console spam
cuz theres no catch block nor perm check there
you said look at the picture
Yeah
me?
yes
i said nothing wrong
i said see picture
🗿
it should tell the promise etc
🗿 🗿
@delicate shore try with indexOf()
Its happened to me somewhat using includes
and when I tried with indexOf() it worked. Still dont know whats the problem
should work absolutely fine with includes(
Wow!
Lol
also he pointed out something with 'output'
so i assume it passed that check fine
with include
https://discordapp.com/channels/264445053596991498/272764566411149314/735873123668197488
I Still didn't get it what is the use of this?
this
eval?
eval is basically running commands as console
that eval
you can try things without modifying any code of your bot.
wdym ur main code?
hello
Im having a problem in my bot, it's first time to host a discord bot on linux vps
can anyone help me in it
So erwin
sup
Way should i do ?
as?
@scenic grotto which linux? ubuntu? amazon linux?
afaik it should work fine
@quartz kindle ubuntu
log evaled
if(command === "eval"){
const owners_id = ["587663056046391302"];
if (!owners_id.includes(msg.author.id))
return msg.channel.send("You not owner boi"); const args2 = msg.content.split(" ").slice(1);
const clean = text => {
if (typeof(text) === "string")
return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
else
return text;
}
try {
const code = args2.join(" ");
let evaled = eval(code);
const eval2 = new Discord.MessageEmbed()
.setTitle("Output")
.setDescription(`${clean(evaled)}` ,{code:"xl"})
if (typeof evaled !== "string")
evaled = require("util").inspect(evaled);
msg.channel.send(clean(evaled));
msg.channel.send(eval2)
} catch (err) {
msg.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
}
};```
Holy
copying it over cuz im tired of going back and fourth
@scenic grotto run apt install build-essential
This is old code
then i try to node server.js ?
then reinstall your node modules
then give me recent code
@delicate shore Are you running that embed in Try or outside Try?
and show result
yes
if(command === "eval"){
const owners_id = ["587663056046391302"];
if (!owners_id.includes(msg.author.id))
return msg.channel.send("You not owner boi"); const args2 = msg.content.split(" ").slice(1);
const clean = text => {
if (typeof(text) === "string")
return text.replace(/`/g, "`" + String.fromCharCode(8203)).replace(/@/g, "@" + String.fromCharCode(8203));
else
return text;
}
try {
const code = args2.join(" ");
let evaled = eval(code);
const eval2 = new Discord.MessageEmbed()
.setTitle(clean(evaled), {code:"xl"})
.setDescription(`\`\`\`js\n${clean(evaled)}\`\`\``)
if (typeof evaled !== "string")
evaled = require("util").inspect(evaled);
// msg.channel.send(clean(evaled));
msg.channel.send(eval2)
} catch (err) {
msg.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
}
};
Latest code
Output
await it
what is the command to download or create node modules ? because i was watching multiple videos and i did't understand very well
await the eval
Ok
use the node package manager
actually
npm install will reinstall all node modules from your package.json file
holdup
@scenic grotto run
apt install build-essential
@quartz kindle
What
it says Error
what command did u run?
Eval
@scenic grotto doesnt matter, the process is continuing
Code ?
wait some more
msg.channel.send("Boooooooomer")
How
the eval is fine
Ok
new Promise()
you should be able to just await it
he can make it asynchronous ig
Errors were encountered while processing: redis-server
its fine, redis-server is not a requirement
just resolve the promise
@delicate shore what do you event want to show? the message is sent successfully regardless
Hi
his eval is fine
its the fact that .send() is a promise
thats logging that
he just isnt resolving his promise
same reason why console.log() stuff returns undefined but also logs
they might want to eval 1+1 and show that output instead of console.logging
is there a command i could write and it deletes a folder ? bec im deleting node modules and it's taking so much time
but if he resolves the promise, then his eval command will output a huge wall of text containing a message object, or simply return [object Object] if not using inspect
Tim lime this
prob isnt only going to be for sending messages/other things that make noticeable changes in the client
@scenic grotto rm -r node_modules
its much faster than deleting through an ssh client
now npm install
yes
just copied a snippet i had before
idk what's happening
But now this is happening

no clue about that tbh
Ok
it should just read cache
root@vmi380150:~/bot# node server.js
(node:11790) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
(node:11790) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.
at WebSocketConnection.<anonymous> (/root/bot/node_modules/discord.js/src/client/ClientManager.js:48:41)
at Object.onceWrapper (events.js:422:26)
at WebSocketConnection.emit (events.js:315:20)
at WebSocketConnection.onClose (/root/bot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:393:10)
at WebSocket.onClose (/root/bot/node_modules/ws/lib/event-target.js:124:16)
at WebSocket.emit (events.js:315:20)
at WebSocket.emitClose (/root/bot/node_modules/ws/lib/websocket.js:191:10)
at TLSSocket.socketOnClose (/root/bot/node_modules/ws/lib/websocket.js:850:15)
at TLSSocket.emit (events.js:327:22)
at net.js:674:12
at TCP.done (_tls_wrap.js:567:7)
(node:11790) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:11790) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
root@vmi380150:~/bot#```
👍
@scenic grotto one of your packages failed to build, it looks like you have a log of dependencies that you're not using in your package.json
you should clean it up and remove everything that you dont need
i was using the same code before in a windows vps
and it was working fine
you should clean it up and remove everything that you dont need
what should i remove ?
im new to discord bots and these stuff
still, you have 526 packages, many of them outdated with vulnerabilities
show your package.json
@quartz kindle
any adventurous soul willing to give me a hand?
on?
For me ?
since i ported all the code to Ts, i need to check the commands to make sure there arent any issues before i push it to the main branch
Ok
if anyone willing to go thru my docs and test it, i'd appreciate it
I'm but I dont know Ts.
@scenic grotto you probably dont need all of those, check which ones you're actually using in your code, for example, that you have require("package-name") somewhere in your files
and remove what you're not using
its just to test the commands, nothing related to the language
i didn't understamd
for example env and dotenv both do the same thing, but one is 8 years old and outdated
how do i know if i use or don't in my bot?
in your code
if you're using a package, you will have require(packagename) in your code
Guys
so i search with CTRL+F require(package name?)
Atm, if I want to buy dev license, I will still get the perks right? Like announcment channels and stuff?
you can search for require yes
why do you have canvas twice lol
twice as fast ;p
also, are you actually using all of those in your code?
Canvas and canvas 
or are you just requiring them and then not using them at all?
idk , someone made the code for me
oh boy
the fucking level of spoonfed this boy just got is insane
ok sorry idk if u can help me
anyway, you have dependency issues and bad code, but that is not the main problem
the actual reason your bot fails to start is because your token is wrong
despite all other problems you have, this problem in particular is the reason it doesnt start
omg ;/ i was sarching for the problem for about 4 hours and it was just this 🤦♂️
i mean the error is pretty self explanatory
also, good luck in a few months, you will need it :^)
i dont see how you couldnt picture that yourself
when djs v11 stops working
thanks for helping me
any one know why muy command handler wont work? cuz I had it working but needed async and that broke it so I rewrote it like 3 times and now it wont run saying that "files" is not defined however the code in the events file to define it is there. it is ```js
let msgArray = msg.content.split(" ")
let cmd = msgArray[0]
let args = msgArray.slice(1)
let files = client.commands.get(cmd.slice(prefix.length)) || client.aliases.get(cmd.slice(prefix.length));
}
any clues to why this is happening
Try my command handler 
what is that } doing there?
?
let and const are block scoped and {} is a block.
if you defined them inside a block, for example {let a = 10} they will only exist inside that block
Do you even know js?
yeah but not well
hence why i asked, that is that } doing there
fair enough
is that code inside a block? if so, you'd need to show more code
Probably end of a block
yeah that is use out side of the block
let files;
... dosomethingelse {
files = bla
}
console.log(files)
Is it possible to somehow make the eval accept the await without including it inside an async function like this?
(async () => {
await //some promise
})()``` but instead do this
```js
await //some promise```
I don't think so
But you can do js eval(`async function h(){ ${args.join(' ')} } h() `)
you'll just get Promise<Pending>
how i get my project in glich to gethub ?
@amber fractal i won't, i have a check if the evaluation is an instance of a promise, if so await it
But in async function to return a result, you have to do
return <result> but you can't do
<result>```
Hello, I am trying to docs page for my npm package. I know of some docs pages like gitbook but I am looking to use one that can make a nice site that I can customize. Does anyone know of any program/builder I can use that is free?
@golden condor Use Discord Bot maker
That's not what I meant
jsdoc
Lol
@earnest phoenix what i do is layer it
have multiple eval functions, each for resolving a specific situation
its not perfect, but it supports almost everything i throw at it
Can anyone pls help me in dm I am trying to make my first bot with only like 2-6 mod commands
are you looking for something specific?
i want to make meme command and i know how, to make it take them from reddit i need to type npm install reddit?
Got any idea why a voiceConnection#dispatcher can be null
i want to make meme command and i know how, to make it take them from reddit i need to type npm install reddit?
Random Puppy
RandomPuppy @stiff stream
reddit is even a package
^
if theres a module named reddit, you can use it. if thats what you want
are you looking for something specific?
@solemn latch not really something spesific I only want to make a simple moderation bot that works smoothly
Use node-fetch and do whatever
well, this is more help with specifics @acoustic orchid
@stiff stream
well, this is more help with specifics @acoustic orchid
@solemn latch wdym
Then you use JSON and function
webhooks prob
@finite bough bruh, a voice connection's dispatcher can't be null
:facepalm-3:
And emojis on discord is fucked
RandomPuppy @stiff stream
@delicate shore how do i download it?
npm install Randompuppy?
if you need help with an error, or a specific thing, we can help.
general questions, like yours isnt easy to answer @acoustic orchid
@finite bough oi come to testing 1 i'll show ya
@delicate shore how do i download it?
npm install Randompuppy?
@stiff stream
Watch tutorials on YouTube
It's of 5 mins only
k
what are some common fixes i can make to stop getting ratelimited?
how can i do that when there are thousands of users on my bot?
the same thing always happens - bot stays active and runs perfectly fine, but then i announce a new update and it gets ratelimited immediately bc of all the user activity
add a cooldown perhaps?
i do have an 8 second cooldown between commands
lol
or which command is the most used
I have 3 seconds cooldown on meme and covid and weather commands
and also i increased restTimeOffset to 750 in my client options
That is it
i have multiple staging of cooldown on my commands 🤔
spamming commands gets you temp ignored for a few minutes.
I get it



