#development
1 messages · Page 1103 of 1
no
f @everyone ping
^^ didn't ping anyone
admins are smart they disabled it
also can someone help me
hm?
before i put the code
it is a discord bot list bot
so
if you want then you can help
case "submit":
message.reply("Enter the client ID of the bot");
let collecter = message.channel.createMessageCollecter({time:60000});
collecter.on("collect", m => {
let clientID = m.content;
collecter.end;
});
Have I done this right?
ok
r/madlads they chose no when i asked to protect their data 🤣 not my fault if they get robbed cross-servers
and i maxed out the reactions
so people can't choose no on the second one
@earnest phoenix only if the bot list is a website iirc
How to host bot on github
GitHub is code storage
i know for heroku
not a host
i mean editor
Please don't use heroku as anything whatsoever
There*
lol i m confused
GH not host
Create a repository and drag your files in the GitHub tab
@slender thistle i already
once that's done, connect your GitHub to your Heroku account
What's the error
I'm so fucking done
Uh oh
With people saying they have better bot commands despite the fact they use Discord Bot Maker
With people saying they have better bot commands despite the fact they use Discord Bot Maker
@delicate shore holy fuck lol
View build log
@earnest phoenix only if the bot list is a website iirc
bot is a website
where's the logic
being a website
💥 brain died
VPS*
No
umm
a VPS can be used for both testing and production
That runs 24/7
Ok
Karens like me who use it for bots: yes but actually no

yeah
You're just limited on resources afaik, that's about it
of course...
An API isn't something that allows ports
No for
Ports are allowed to be used through your Internet connection settings (router settings, if you wish)
Glitch gives you port 3000
yes
why do u even want glitch to give u a port
But
and PGamerX i will jump off my window if you don't switch to repl.it in 30 minutes
yeah
Yes but
yeah
expressjs
Thing
you can
and PGamerX i will jump off my window if you don't switch to repl.it in 30 minutes
@earnest phoenix
I can't I already paid for second month of glitch
The only option you have is to try to cram your two programs into one
Listener
if that's whatcha after
Listener
so you mean you want to listen for http requests
i used port 3000 once and it didn't interfere
What do you have running
use their https://glitch.com/edit/#!/remix/hello-express they used express to make a smol website
Discord bot
@delicate shore smart
a Discord bot doesn't need a port
by itself, at least
the same file is running both my webpage and my bot
wait
message.mentions.users.first would give you the user that was first mentioned in that message
yeah
but then how would you get the username of that user
umm
a = ...first()
a.username
easier to store the user object in a variable instead
^^^^
never know when you need it
why
wouldnt u await that? i dont know it just seems like u would need to
for a website and a discord bot at the same time?
And turns off my bot
You're running something on that port
A Discord bot doesn't need a port
The communication with Discord happens over websockets
PGamer, glitch isnt meant for websockets, like discord bots, you're bound to get disconnected
It is using that port in that
Stop typing like that
delete it bruh
var FirstMentioned = message.mentions.users.first()
var ProfileEmbed = new Discord.MessageEmbed()
.setTitle(FirstMentioned.username)
would that work?
the text is white but the background is also white evenn though im setting it to black any one know why ?
pretty sure you can't display an embed with onlya title
yeah im planning to add the pfp too
how are u setting it to be black, coltz?
@potent ridge What's your CSS
<style>
body {
background-color: #333333;
}
</style>
use color instead of background-color
wait
Why are you setting background color of the entire page
if you wanted to get the pfp for a user that was first mentioned
read the docs
FirstMentioned.displayAvatarURL right?
i have problem 
whats ur problem?
module.exports = { name: 'help', description: "this is a help command!", execute(message, args){ const embed = new MessageEmbed() .setTitle('__**BOT COMMANDS**__') .setColor(0xFFACAC) .setDescription('**🎲FUN**\nannoy, Fish, Poll, Ping, say\nAnime, Meme, play(Rock,Paper or Scissors ) \ncringe\n\n**📘MODERATION**\nVotekick(user), Mute, giverole (role)(user)\n**🎶EMOTES**\nSlap, Hug, kill, Bite, lick'); .setImage('https://cdn.discordapp.com/attachments/733538577350131762/733612973574062140/CloseRevolvingLadybug-size_restricted.gif ` ')
message.channel.send(embed)
}
};`
ignore
@digital ibex its still the same
the image
```js
// ur code here
```
what's the problem
wait
@slender thistle im trying to set the background of this
wait
You probably added a semicolon at the end of the .setDescription function
@sinful delta
Ok
OHHH, THANK U THANK UUU
im trying to make a command that grabs that username and pfp of the person first mentioned in the message
can anyone tell me why
My bot stops so I guess it's not possible
var FirstMentioned = message.mentions.users.first()
var ProfileEmbed = new Discord.MessageEmbed()
.setTitle(FirstMentioned.username)
.setImage(FirstMentioned.displayAvatarURL())
isnt working?
P.S. it's
.longdescription
@slender thistle is this for me ?
what isnt working?
the code
What's your discord.js version
me?
yes
iirc users dont have the displayAvatarURL method
they do
Ok
ive used displayAvatarURL before and its worked
An avatar is attached to a user
oh, my bad
Your discord is version is 12 or 11
oh
@hardy steeple in v12 its a function
if your v11 its not
As asked by shivaco
npm ls discord.js
require('discord.js').version :p
did u do npminit
yes
or just check ur package.json
npm init discord.js
lemme check my package\
There it is written
do you mean this this ?
my html / css isnt very good
<head>
<style>
html {
color.longdescription: #333333;
}
</style>
</head>
selector {
/* rules for `selector` go here */
}```
for me?
no
No
k
your selector in this case is .longdescription because there's elements with class="longdescription" in the page's HTML
@slender thistle
@weak rain click More in top right and then 'logs'
var FirstMentioned = message.mentions.users.first()
var ProfileEmbed = new Discord.MessageEmbed()
.setTitle(FirstMentioned.username)
.setImage(FirstMentioned.displayAvatarURL())
Hmmm, does any of those links provide any useful information?
i seriously dont know @fast yacht
is supposed to grab the username and pfp of the person first mentioned in the message
but it aint workin
is their any other host?
Is their any free vps
is sends back an error when i test the command
what error
TypeError: Cannot read property 'username' of undefined
at Client.<anonymous> (C:\Users\Mom_admin\Desktop\NOTABOT\node_modules\index.js:29:38)
at Client.emit (events.js:315:20)
if you get an error, the first thing you should do is post the error
<head>
<style>
.logdescription {
color: #333333;
}
</style>
</head>
still the same
that error means user was not found
@potent ridge Could you elaborate on what you want?
To change the color of text in the long description, edit .longdescription .content
no not the text
color is text color
wait
background-color
let me show you
background is background color or image
i have that code attached to the command =profile
am i meant to do =profile (mention)
because i did and it returns another error
color is text color
background is background color or image
Is their any free vps
@weak rain no
@slender thistle WHAT SHOULD I DO
@weak rain pay to host ...
@hardy steeple we cant magically fix your code, you need to show and explain what is happening, show your full code, your full error, show examples of what you tried, an example of what happens when you use the command, etc...
why would it be free
<head>
<style>
.longdescription {
background: #333333;
}
</style>
</head>
sol ike this ??
well i have and it didnt
try being more specific, like .longdescription .content
thank you tim
what should i do to host ?
pay
or use your own pc
Go through the build logs and search for an error
is there something as guild.membercount
yes
is their any other host like heroku?
no
Ok
rtfd
is that nice?
there is repl.it, glitch, heroku, and possibly cloudflare workers (havent tried them)
yeesh
On glitch
@delicate shore i use glitch
you could buy a better vps for that
What do you get in return
but another host
I'm shifting to Digital Ocean
good option
Or the one @misty sigil told me
also very good option
I pay $1.88/month for specs good enough to host a few Discord bots with all caching enabled
nice
I pay $1.88/month for specs good enough to host a few Discord bots with all caching enabled
@slender thistle where
thats pretty cheap i think
It's a discount, actually
pretty cheap indeed
but without it I'd pay $2.50
i pay $4/mo 
but SkySilk have fairly cheap prices 
name?
i pay $3
yearly? :^)
and get 1 month free every year
oof
so basically 2.75/month
honestly i'd recommend unlimited bandwidth because
fuck
unlimited
Repl is paid
whats your budget @weak rain
@misty sigil till now never used paid hosts
but my bot is 24/7 online
How can I get PUBLiC feature ?
i use galaxygate
its been good so far
yes
its KVM virtualization, it allows anything a normal computer allows
Oo
most vps hosting allows all ports
you could even install windows on it
80, 8080, 30, 3000, 420, 69, you name it, as long as it's under 65535
420
yes
Wow
why 25565
wait did i get it wrong
brings back memories
@slender thistle is their any other host?
fixed it
like heroku
no
@weak rain we already told you
you dont get free 24/7 hosting
there is repl.it, glitch, heroku, and possibly cloudflare workers (havent tried them)
@quartz kindle
there is repl.it, glitch, heroku, and possibly cloudflare workers (havent tried them)
you dont get free 24/7 hosting
@misty sigil I do
I'm not the only person here :^)
Free hosting and 24/7 are not exactly compatible
how to get live code on github
Someone has to pay for electricity and maintaining the machine(s) in the end
yea
there is also amazon and google which offer free for 1 year deals
additionally, google has a free forever plan
as long as you dont exceed limits
additionally, google has a free forever plan
@quartz kindle are they good?
but it probably will not handle a bot
and how?
@slender thistle ```js
require("./index")
var express = require("express");
var http = require("http");
var app = express();
// Ping The Apps.
//app.use(express.static("public"));
// http://expressjs.com/en/starter/basic-routing.html
//app.get("/", function (request, response) {
// response.sendStatus(200);
//});
// Request Listeners.
var listener = app.listen(3000, function () {
console.log("Your app is listening on port " + listener.address().port);
});
//setInterval(() => {
// http.get(http://${process.env.PROJECT_DOMAIN}.glitch.me/);
//}, 270000);```
much better than glitch and heroku
Don't you need a credit card for those?
this is where glitch
yes
but you need a credit card to register
uses
yes you do
port
but you need for heroku too
but you need a credit card to register
@quartz kindle :/
you have 12 month free trial too, and then you can use the free forever one
how to get live code on github
I need understanding on a Roblox Bot coding, as it says there is an error somewhere in my code, but won't show me it
wdym live code on github
how to get live code on github
Just fix your Heroku error if you're so desperate to get free hosting?
@quartz kindle codes
to host
Just fix your Heroku error if you're so desperate to get free hosting?
@sullen harness how should i
creating server invites on join/without anyone with create invite perms's command usage is against TOS right?
Google and trial n error
why does glitch uses port?
what is the output?
Your email is in that btw
I just created a project and I only see a server.js file that you can edit.
nice way of covering that up
I can easily remove that and host my own stuff on port 3000
I can easily remove that and host my own stuff on port 3000
@slender thistle will my bot work if i remove that
creating server invites on join/without anyone with create invite perms's command usage is against TOS right?
@misty sigil You answered to this?
yes
What does your code even look like
very against tos
What does your code even look like
@slender thistle wym
just some stupid devs were stupid enough to show an SS with on join invite
And my partner was like why cant we do for our bot
(new coder)
report that
yo @slender thistle my bot works after removing that but
is their any link for
it gives me a annoying loaidng
hostings
https://www.oxide.host @weak rain
@tulip grove
repo?
to host bot on glitch
you literally
we have live code
Dont host bots on glitch
i use it as a editor\
I host bots on Glitch, and it broke all my bots
worst excuse ever
VSC Is like waaay better ;-;
define "broke"
sublime text 3
got them IP banned?
i use sublime text3 and vsc
Notepad
I still have an old bot running on Glitch 24/7?
both are good
It gives an error on my code without any actual way to fix it
notepad++ honestly
what kind of error
I still have an old bot running on Glitch 24/7?
@sullen harness i made one
and its online too
was thinking to shift on github
but
glitch does not allow any sort of pinger bot to keep the project alive anymore
} catch { but will not send me to the error
they started terminating discord bot projects doing that
Welp, if it goes, it goes
How many bots can you host on 1 vcore actually?
YO @slender thistle thanks a lot 🙂 i can now use discord bot api :::::::))))))
glitch does not allow any sort of pinger bot to keep the project alive anymore
@earnest phoenix you know how bots are meant to sleep after 5 minutes of inactivity and the bots are violating the rules by making Glitch lag
i pay 10$/month
well Glitch is lagging because of that, by what I mean
why not pay 10$ on a proper vps?
yeah i know flxwer, that's why they made that against their TOS
oh, aight
why not pay $3 instead of $10 for a proper vps?
i have a code
why not pay $3 instead of $10 for a proper vps?
@quartz kindle yes
i want to merge it with another
exactly what tim said
what should i do?
i think DO has some 3$ packs
I might switch to VSC if it's simple enough to do so
what

what
vsc is a code editor, not a hosting service
lmao
I know


to api of top.gg
@delicate shore https://www.top.gg/api/docs
And I tried transferring a bot code to VSC and it didn't work
or buy a Pi and host it yourself for free
https://vilros.com/collections/raspberry-pi?page=1&rb_snize_facet13=boards
what didnt work lol
I mean, let your VSC debugger run indefinitely and you got yourself free hosting.
for editing, not for running, as vsc is an editor, not a host
vsc does not change how the files work wtf


what
For some reason, both .find() and a for (let x of y) loop returns the names to be undefined, even though they're defined in the database.
https://cdn.discordapp.com/attachments/734520305145479198/738731688728985660/unknown.png
lol
@summer acorn show more code
can we merge 2 codes in VSC
Define "merge"
you can do that in any editor lol
a code is just a certain snippet of text
i mean
bruh
you can merge them if you copy paste
when trying to list the tags
case "list":
let tags = [];
for (let tagInstance of res.tags) {
tags.push(tagInstance.name);
console.log(tagInstance)
}
embed = new MessageEmbed()
.setColor(branding)
.setTitle("Tags")
.setDescription(`\`${tags.join('` `')}\``)
message.channel.send(embed);
break;
stop thinking about VSC as a 3 headed monster. Its just like notepad. Copy paste with extra features
theres no reason whatsoever merging or copying code over would error
when trying to send the tag
let args = message.content.slice(res.prefix.length).split(/ +/);
let tagName = args.shift();
let tag = res.tags.find(t => t.name = tagName);
if (!tag.value) return;
vsc is like a fancier notepad
@summer acorn console.log(res.tags)
vsc is not gonna change the file itself
open 2 codes at a time
unless its ts
yes
in same window
in which case it'll run as js not ts
@slender thistle nice catch
well, breakpoints at least
:^)
holy...
@summer acorn shiv already found you the problem
ah
I literally did not realize I did = and not ===
lol
i have sharded bot how i can get shard counter??
see
k
the listing still doesn't work though
the names in there is still undefined
same name files disapeared
i m merging 2 codes
to 'merge' them, you open both and copy the contents of one onto the other one
if what i think is happening
you are drag and dropping them
ok nevermind, I figured it out. It was a very similar issue.
and replacing them cuz same name
If your code relies on that file, probably
im completely lost tbh, how is the merging related to your file names?
if thats your main file, you need to point it on package.json
apart from that, name it whatever you want
now for the 'merging', you open both files you want to merge and copy the contents of one to the other(not replace)
kk
im making a request to discord api and its showing it with that for some reason, any ideas?
a role with zws as name?
^
@weak rain what are you even trying to do? sounds like you're trying to run two separate projects, not "merge" them lol
which is the best vps ?
@weak rain what are you even trying to do? sounds like you're trying to run two separate projects, not "merge" them lol
@quartz kindle hm
which is the best vps ?
@weak rain what are you looking for?
i've heard good things about DO, though its personal option most of the times
^
before knowing that, as me, being a user of oxide, https://www.oxide.host/
what are the prices for DO
Digital Ocean should have some less than 5$ prices iirc
indeed, as i said, its usually preference
Someone tell me fAST\
Lol
anyone
2GB ram
stop asking people to go to api
$4.67/month.
1x vCore (3.70ghz)
2048MB DDR4 ECC Ram
32GB Storage (SSD)
200mbp/s Port Speed
Unmetered Bandwidth
1x IPv4, 1x IPv6 (/112)
Automated Backups
Multiple Locations
Virtualized by KVM
people will answer you when they can and want to
ok
$2.5 ($1.88 with my discount) per month
Is that skysilk
yup
Kewl
but i have unmetered bandwidth
Same
I don't need unlimited bandwidth so /shrug
Did you mean: ¯_(ツ)_/¯
@slender thistle that was some promotional price they had going right? normal prices now are like $4+
Host wars
¯_(ツ)_/¯
I got an email about it
My discount is for being a beta tester
olol
I thought 1tb storage
@slender thistle name?'
huh what
Why would he need to know that
cuz he was looking for vps
^~
@quartz kindle I guess they raised their prices then
€4
4gb RAM
2 vcores
300gb
Unlimited
code please.
and I'm not surprised really
quikc queston, does anyone know how i can send data users put in the option tag?
with input its just name="whatever"
html btw
and in the backend its just req.body.whatever and it shows u what u put in the input box, any ideas?
apparently i never registered in skysilk beta
even though im pretty sure i did
i have the emails and shit
but says my email is not registered
¯_(ツ)_/¯
Sounds like a ticket to support :^)
Don't know honestly, I've been their customer ever since they released out of beta and only had very small problems with their occasional maintenance
@sinful sorrel run it as mjs if you trying to use new ES stuff
hmmm now that i think about it, whats your node version?
hmmm now that i think about it, whats your node version?
@opal plank node: '12.18.0
im trying to make a command that gives you the username and pfp of the person first mentioned in a message
currently my code is
case 'profile':
var FirstMentioned = message.mentions.users.first()
var ProfileEmbed = new Discord.MessageEmbed()
.setTitle(FirstMentioned.username)
.setImage(FirstMentioned.displayAvatarURL())
message.channel.send(ProfileEmbed)
however it sends back this error:
Can someone help me remove that shitty border next to the image?
ypeError: Cannot read property 'username' of undefined
at Client.<anonymous> (C:\Users\Mom_admin\Desktop\NOTABOT\node_modules\index.js:29:38)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (C:\Users\Mom_admin\Desktop\NOTABOT\node_modules\discord.js\src\client\acti
Did you even read the error? Your username isnt defined
@hardy steeple message.mentions.members.first();
Don't spoonfeed
the point is that its supposed to be the person first mentioned in the message
@hardy steeple message.mentions.members.first();
^
yet if i mention someone in the message nothing ha[[ens
Use a mention?
As GP said
yes sorry im new ok
mentions.members. not mentions.users
Can someone help me remove that shitty border next to the image?
anyone'
try
var
k
TypeError: FirstMentioned.displayAvatarURL is not a function
at Client.<anonymous> (C:\Users\Mom_admin\Desktop\NOTABOT\node_modules\index.js:30:38)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (C:\Users\Mom_admin\Desktop\NOTABOT\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
im using .displayAvatarURL to show the pfp
its not wkring tho
lemme try a let
FirstMentioned.user.displayAvatarURL
SyntaxError: Cannot use import statement outside a module
?[90m at wrapSafe (internal/modules/cjs/loader.js:1054:16)?[39m
?[90m at Module._compile (internal/modules/cjs/loader.js:1102:27)?[39m
?[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)?[39m
?[90m at Module.load (internal/modules/cjs/loader.js:986:32)?[39m
?[90m at Function.Module._load (internal/modules/cjs/loader.js:879:14)?[39m
?[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)?[39m
?[90m at internal/main/run_main_module.js:17:47?[39m
it still doesnt work
wait
ypeError: Cannot read property 'user' of undefined
at Client.<anonymous> (C:\Users\Mom_admin\Desktop\NOTABOT\node_modules\index.js:29:38)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (C:\Users\Mom_admin\Desktop\NOTABOT\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
is the error it gives
even when i mention someone it doesnt work\
lemme try a let
hey there! I asked a question on StackOverflow yesterday about mongo DB. if you have any answer, can you share it here or there please? thx :) https://stackoverflow.com/q/63176051/13230118
@opaque seal i read the docs and used .username property but it still doesnt work
it sends an error
TypeError: Cannot read property 'user' of undefined
at Client.<anonymous> (C:\Users\Mom_admin\Desktop\NOTABOT\node_modules\index.js:29:38)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (C:\Users\Mom_admin\Desktop\NOTABOT\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
my code is
let FirstMentioned = message.mentions.members.first();
var ProfileEmbed = new Discord.MessageEmbed()
.setTitle(FirstMentioned.user.username)
.setImage(FirstMentioned.user.displayAvatarURL())
message.channel.send(ProfileEmbed)
that's just weird. I've never seen this
should i move it
yes I think
yes.
k
ahah
events.js:292
throw er; // Unhandled 'error' event
^
Error: 1001:
at Shard._onWSClose (/home/container/node_modules/eris/lib/gateway/Shard.js:1810:51)
at WebSocket.emit (events.js:315:20)
at WebSocket.emitClose (/home/container/node_modules/ws/lib/websocket.js:191:10)
at TLSSocket.socketOnClose (/home/container/node_modules/ws/lib/websocket.js:858:15)
at TLSSocket.emit (events.js:327:22)
at net.js:674:12
at TCP.done (_tls_wrap.js:574:7)
Emitted 'error' event on Client instance at:
at Shard.emit (/home/container/node_modules/eris/lib/gateway/Shard.js:2111:26)
at Shard.disconnect (/home/container/node_modules/eris/lib/gateway/Shard.js:118:18)
at Shard._onWSClose (/home/container/node_modules/eris/lib/gateway/Shard.js:1863:14)
at WebSocket.emit (events.js:315:20)
[... lines matching original stack trace ...]
at TCP.done (_tls_wrap.js:574:7) {
code: 1001
}
Does anyone understand this error?
I use eris.js. I think it is saying the shard crashed???
I heard eris has issues with unexplained shard crashes
"The immediate cause of the "error code Error 1001" warning is a failure to correctly run one of its normal operations by a system or application component."
i moved my index file
not like it did anything in particular
for some reason it was in node_modules
No you just have to handle the error
@solemn latch yeah but you can handle them but still, it doesn't resume the connection properly somehow, which is the reason why i moved back to d.js
yeah i know but i needed to move it because its not a node module
@pale vessel I handle it and it resumes the connection fine
not for me
i still have errors in my console
vysion had the same issue, which made me switch lib
Do you handle shardDisconnect and shardReconnect and error?
of course
so im trying to make a command that takes the first person you mention in the message and gives you their username and pfp
I used to have this issue
its not working tho and i dont know why
here is my code:
let FirstMentioned = message.mentions.members.first();
var ProfileEmbed = new Discord.MessageEmbed()
.setTitle(FirstMentioned.user.username)
.setImage(FirstMentioned.user.displayAvatarURL())
message.channel.send(ProfileEmbed)
But it now just handles it and continues the connection, and it doesn't stop music streams or anything like that
and heres the error:
if you handle it, it'll still emit an error about what happened anyway, so that's not it
No it doesn't
I suck at API
as in me logging the error
TypeError: Cannot read property 'user' of undefined
at Client.<anonymous> (C:\Users\Mom_admin\Desktop\NOTABOT\index.js:29:38)
at Client.emit (events.js:315:20)
how do i fix it?
Well it emits the error, it's your call to handle it however you wish, I log it to a channel with a webhook.
the event shouldn't trigger, that's why
i tried to read the docs but i cant find answers there
@golden condor that's the thing, you can't simply ignore errors
I don't, all of them are just cloudflare restarting the proxy and/or connection reset by peer. And then the connection resumes and uptime doesn't reset
what does cloudflare have to do anything with this
im trying to make a command that takes the first person mentioned in the message and gives you their username and pfp
you know it's a problem when docs can't help you
im trying to make a command that takes the first person mentioned in the message and gives you their username and pfp
@hardy steeple
Avatar command ?
yeah pretty much
my current code is
let FirstMentioned = message.mentions.members.first();
var ProfileEmbed = new Discord.MessageEmbed()
.setTitle(FirstMentioned.user.username)
.setImage(FirstMentioned.user.displayAvatarURL())
message.channel.send(ProfileEmbed)
what does cloudflare have to do anything with this
@pale vessel cloudflare sometimes like to kill the connection on discord's side, can't do anything about it
@hardy steeple there is no mention
like how doesn't it happen on d.js
yeah but when i do mention someone no message sends
you're right
But djs does the handling for you
let FirstMentioned = message.mentions.members.first();
var ProfileEmbed = new Discord.MessageEmbed()
.setTitle(FirstMentioned.user.username)
.setImage(FirstMentioned.user.displayAvatarURL())
message.channel.send(ProfileEmbed)
@hardy steeple
It happens across all libs no matter the Lang
okay, sure, show me how it did that in the source
@delicate shore thats my code exactly
TypeError: Cannot read property 'user' of undefined
at Client.<anonymous> (C:\Users\Mom_admin\Desktop\NOTABOT\index.js:29:38)
at Client.emit (events.js:315:20)
Huh
i have the exact same code you put
let FirstMentioned = message.mentions.members.first();
var ProfileEmbed = new Discord.MessageEmbed()
.setTitle(FirstMentioned.user.username)
.setImage(FirstMentioned.user.displayAvatarURL())
message.channel.send(ProfileEmbed)
Why use that
when i mention someone no message sends
const Discord = require("discord.js")
module.exports = {
name: 'avatar',
description: "displays avatr of person",
async execute(msg, args){
const member = msg.mentions.users.first() || msg.author;
const Embed = new Discord.MessageEmbed()
.setColor("RANDOM")
.setTitle(`${member.username}`)
.setImage(member.displayAvatarURL({ size: 2048 }))
.addField(`Link`, `[Click Me](${member.displayAvatarURL()})`);
msg.channel.send(Embed);
}}```
lemme reset token and restart vsc
when i dont reset my token and make too many edits my bot send 10 messages for one command
I'm on mobile rn, can't be much help
but still
when i dont reset my token and make too many edits my bot send 10 messages for one command
@hardy steeple use command handler
Code
We need code

import {moment} from 'moment';
function isDate(string) {
{
moment(string).format(["MM-DD-YYYY", "YYYY-MM-DD"]);
}
} exports.isDate = isDate;
huh

Idk why people can't just get around Eris errors. I accept the ready event once and then set a custom var in the client as the uptime to show the actual uptime of the bot and use a function (client.getUptime()) to get it
Don't use import
what must i use
Require
.
https://canary.discordapp.com/channels/264445053596991498/272764566411149314/738747236204281927 well i decided to add an auto restart now, hope this fixes it
Pretty sure you don't need to import it again if you already required it.
@shy turret no just use the error and disconnect events
like this?
client.on('error', () => {
});
Yes
i guess i can make it auto restart using that
You don't need to
so if i just add that the problem wont happen again? (i dont think that is how it works though)
like it will kinda ignore the error?
Does someone know what's the animation of this bot profile image https://top.gg/bot/649535694145847301
You just have to handle the errors and it will be fine. As it tells you it said unhandled error.
so i could just add that code ok kthx
still gonna keep the auto restart though because it clears some ram
One message removed from a suspended account.
Smh
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
No it's an es6 thing
One message removed from a suspended account.
One message removed from a suspended account.
*es6
One message removed from a suspended account.
One message removed from a suspended account.
@delicate shore i put in the exact same code as you and still an error when i dont mention anyone and no message when i do
console.log(callum) // => undefined```
es6 is alr in js
it comes in node
alright well i tried
nothing related to that
i can do import Discord from "discord.js"; for example in js
Its not realted to Ts
^
ts has some esNext and newer feature
that es6 is enabled in newer node versions
just switch your module to mjs or enable type module on your packacge to enable imports
node.js 12.6 or newer it is enabled ^
@sage bobcat its not a Ts feature
@hardy steeple do you still need help I looked and I think I see the problem
im okay thanks tho
K
https://kyoya.click-if-you-da.re/NOGYQ1 why is this not working? its not showing anything..
if you have Ts you can specify which ES you want
i might rewrite my bot to ts.
Fortunately TS is built on top of JS. So not much conversion
There are some benefits to using TS over JS even though it's compiled down to JS (and earlier versions of JS in fact)
you get errors beforehand?
built in docs?
optimiziation?
lemme grab a link for ya
I wouldn't use it myself and would rather prefer a language that offers those features to me directly rather than what feels like a wrapper
TypeScript has forever altered the lives of JavaScript developers. Learn why TS is so awesome and the basic concepts required to be successful using it https://angularfirebase.com/typescript-the-basics/
Deep Dive https://github.com/basarat/typescript-book
TypeScript Docs http...
watch this
its a good 'for dummies' of why to use it
well: js -> ts -> oop languages.
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)``` error :/
:/\\
huh?
Confused me
@opal plank any guess?
code?
the error
of music.js
😡
show full error
@nova dock move to #general if you arent going to keep at channel topic
throw err;
^
Error: Cannot find module '../config.json'
Require stack:
- /app/commands/music/music.js
- /app/handlers/command.js
- /app/server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
at Function.Module._load (internal/modules/cjs/loader.js:526:27)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/app/commands/music/music.js:4:25)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)
internal/modules/cjs/loader.js:613
throw err;
^
Error: Cannot find module '../config.json'
Require stack:
- /app/commands/music/music.js
- /app/handlers/command.js
- /app/server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
at Function.Module._load (internal/modules/cjs/loader.js:526:27)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/app/commands/music/music.js:4:25)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)````
i think config.json
there we go, now we are talking
it is
where is you config?
and where is your file requiring it?
Wow Nice!!!
const { MessageEmbed } = require("discord.js")
const { QUEUE_LIMIT } = require("../config.json");
thats in your index.js?
no
