#development
1 messages · Page 1342 of 1
Some methods exists on djs and even god doesn't understand how they work 
the issue is the the way they intent to do it is wrong
await should block until the UI shows the typing indicator
many sense
awaiting startTyping() will never resolve until you use stopTyping() which is the most retarded thing i have ever seen
It took me 5 hours to figure out the usage of it

yeah lmfao
just use this await message.client.api.channels(message.channel.id).typing.post();
What does that do?
starts typing
oh nice, they expose the api light that?
Does it resolve?
nice to know
yes, this one resolves as soon as it sends
Thank god, no more retarded bs of use 2 methods to resolve a promise
there is a race condition now. if i dont wait for the ui to update then i might stop typing before i start typing
not if you use the above method
Before i knew how it worked, i was like:
await message.channel.startTyping();
await message.guild.members.fetch();
message.channel.stopTyping();```
=> Wait why no result? (Kalm)
=> CPU usage goes up (Panik)
=> Tries to stop it from typing (Kalm)
=> It doesn't stop (Panik)
cpu usage shouldnt go up from that
It went up because of it fetching the members and i didn't realize lmao
Wait wtf, d.js methods made me see hallucinations, now that's a hack, 
Yes
How so?
TypeError: Cannot read property 'count' of undefined
res is undefined.
res is undefined
no its not
res && res.count || 0
ok
you dont even need to call msg.channel.stopTyping(); after await msg.client.api.channels(msg.channel.id).typing.post(). it automatically updates after the bot sends a message to the channel
thanks
@proven lantern yes, thats how discord works
there is no api endpoint to stop typing
it automatically stops as soon as it sends a message
only new messages tho, it doesnt stop if you edit a message
how does msg.channel.stopTyping(); stop the typing indicator if there is no api
឵឵
@proven lantern it doesnt, not directly
djs keeps a count of "how many times did i start typing in this channel"
each time you do startTyping it increases the count by one
or by a specific number of your choice
then when you use stopTyping, it decreases the number
that is so confusing
if the number is not 0, it keeps renewing the typing indicator
why would they do this
no idea
hey quick question y'all
I was really happy that my bot went up this morning, but it's been less than 12 hours and it already hit the cap
I know stuff like that can happen but I'm also a little concerned because I'm not sure if this is abnormal
My token is secured and all but I don't know if there are ways bots can get messed with beyond that
as long as you don't have a public eval command somewhere, your bot will most likely be fine
whjere can i apply for privliged intents
same place where you apply for verification
@sonic lodge what exactly do you mean by a public eval
an eval command that anyone can use
same place where you apply for verification
@quartz kindle /verification?
im already verified
then you need to contact discord
support?
yes
not too sure how to google this but how can i create the source of a webhook like the api does
i know how to receive data from top.gg api webhook
but how can i create my own, for data to send from one server to another
what language do you code in?
you can use the ws package (https://www.npmjs.com/package/ws), it has some examples too
thank you!
ws is not webhooks tho
ws is for real time communication like online games and chat apps
yeah it's not really making sense
i want to send data of one node.js server to another
completely different IPs
for webhooks you just need a webserver and and http lib
LMAO I READ THAT AS WEBSOCKET
xD
im tryna create webhook like the top.gg api
how can i create my own "Put the link here where we will send POST requests"
how do i convert a scientific notation such as this one: 3.8e-7 to a normal number in javascript
have an interval that posts requests to a list
can i not just have it so every time i access the page it sends the data
sure
if i go to a specific url, another server sends data to that url i opened
i've never done anything like this besides the top.gg webhook so don't think i will understand everything
then its not a webhook, just a regular request
ah okay
a webhook is a reverse request basically, its when you receive something without needing to ask for it
what would i have in the server i want sending data
but if you open a page, then request data, then you are asking for it
do you have a nodejs webserver? like express?
i want to open a page and another server will send data to it
yes
this is for my bot
got express and everything
so when a person opens your page, you make a request to another server
for example
app.get("/someurl", async (req,res) => {
let data = await fetch("another url or ip address").then(response => response.json())
res.send(data)
})
using node-fetch in the example above
this would be in the server i am receiving data in?
the server that is running the webpage or website
how can i create my own "Put the link here where we will send POST requests"
@uncut river well to be technical, it would be something like
<a href="javascript:requestJavaScriptCodeHere">random text highlighting link</a>
i have right now an app.get("/url") posting the data
u said, link that sends post requests xD
can i just recommend axios?
node-fetch gang
XHR 
and?
its very good at sending http requests
source code wise, i find that axios is just a lamer version of fetch
in that coding style, fetch works better
node-fetch is lighter anyway
node-fetch is not that light
xmlhttprequest is longer to type but more comprehensive
but im too used to the fetch api
tbh we can all just make a 5 line fetch function made off of direct http.request
but hey, what r modules for right
i did that lmao
@uncut river
i would recommend axios for sending http requests (https://www.npmjs.com/package/axios)
and express for recieving (https://www.npmjs.com/package/express)
thats just my opinion, but i have used both for http traffic and they are fairly easy to learn
so we're actually discussing different ways of sending an http request
i use this now
the usage is almost the same as fetch
but no more res.json() or res.text()
wack
if the data doesnt change often, you can cache it
but like, use a database
wym
i use a database
i want to access in browser tho
and make a usage page
like unbelieveaboat
not copy, but that idea
rather than me
going throught database browser
and looking at the arrays
of each
500+ guilds
im confused why you would need to transfer data over http for that tho...
the databse is in a .db file
my main server doesn't have a front end
and can't have one
so what does it serve?
if the database is in the same machine as the webserver, you can access it from the webserver directly
it just a program if it has no front end 🤔
just the ip
it says not found
well..
it's a shared IP with a bunch of servers
oh so it does respond, it just lies xD
oh you mean it dosnt serve http requests
i believe so
so you have 2 machines?
so it serves ssh then?
it has ssh i believe but idk how to use
my friend is hosting it, my bot has the same IP as one of the minecraft servers

kinda weird
oh my
it has it's own resources don't worry
how do you do anything on this server without knowing how to use ssh
never tell someone ur thing is secure
that sounds as insecure as a hackthebox challenge

im lying?
f
okay well don't worry about that, thats not what im here for lmao
fyrlex
yes?
not srs
what makes it better than VSCode?
not bloody srs xD
ssh is used in command line interfaces

what makes it better than VSCode?
@uncut river ssh is a communication form, not a language
its how you talk to a server without somthing like remote desktop
ssh is a command line interface
@lean ivy used in*
fair
i mean i don't think i've had to run anything through a command line yet
cuz u can do ssh on node from a simple built in module
okay i will learn that, thank you for the tips
but the server cannot be accesed through the IP
hmm?
it's because i now have an app.get
also.. u said it uses ssh and u have nothing for that end
i can basically hook up to ur pc, share some nice ipc
dont swear
for some reason, putting the IP in the url never worked
and basically rape ur pc
my apologies

i hope it picks up on the loophole u left
amen
agreed
luv dat
:l
i just added my first public bot
cuz, not everyone's bot is famous
much appreciated tho
its sittin in queue
same
what do you consider "famous"
not everyone has a bot like you
50 is famour
so ill get the role some time around next year
bruh u can make a discord bot in roblox language 🤮
500?
nasty langauge
if my bot gets accepted by here
a good amount of people get into development from roblox
i did come from roblox and i hate lua with a passion
have a bot that is useful
@lean ivy that isnt made already
@viscid gale it's been over 2 years
0
oh
whats ur bot
@vivid parrot
my bot is a stonks bot
8 ball?
same my bot is also a stock bot
and you can set your own
simulates futures investment model
same my bot is also a stock bot
@errant perch any real life model?
yes
it gets all stocks from the us market, some forex markets, and crypto
if you want to dm me a invite for your bot i would love to check it out
im gonna make a part called jubilee that resets the scores, so there can be and end to the game and winners each 50 rounds(rounds pass relatively fast)
sounds cool
it gets all stocks from the us market, some forex markets, and crypto
@errant perch oh na i dont use real data, else it ain't stonks :}
i just use concepts xD
woogie, see, it may be cool and all, but, it a game in a chat server
september
early september
still interesting
u should be approved probably in the next few weeks
when you get approved you get around 20-30 servers
interesting yes, but nobody really cares.. i mean i can get invloved in random servers ppl make since im a legend in some games
but i got homework bruh :{
bru
dw, not games u play, io games and, yea Gladiabots
i do suggest u play it.. flowchart to control ai that fight each oter in 3 different methods
collection, domination, elimination
okay quick question back to the database posting
bruh sounds complicated
so posting my database, brings my cpu usage to 80% for a hot 3 seconds, would sending to another server do the same for my bot server?
ik, flow charts sound assy but this flow chart code is more intuitve than lego ev3 code
lol
at least give it a try
the game (based on making AI) could use programmers in the competition
i like your funny words magic man
nah im probably to dumb for you
how do i convert a scientific notation such as this one: 3.8e-7 to a normal number in javascript
yw
Very good work
Is a bot in 10000 servers running eris-sharder and other eris extension packages consuming 6GB of memory normal?
i don't thinks so
nevermind it's consuming 4gb instead, the other 2gb came from pm2 and mongodb
that sounds more normal
@quartz kindle do you know if d.js is lazy caching on mentions without intent?
ping pls if you know
@opal plank seems like it
hey I am having some trouble getting the dblpy library working
I'm trying to detect when a user votes triggered by a !vote command and then followed by a vote link pasted in chat and a 2 minute waiting period to check if the user has voted within that time
for testing purposes I just voted for my bot and then called this:
print(await self.dblpy.get_user_vote(ctx.author.id))
and it is returning false
how long does it take for a vote to register?
or am I doing this wrong
I don't get what I am doing wrong
My code ^^
at RequestHandler.execute (/root/app/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
method: 'post',
path: '/channels/763617382748651531/messages',
code: 50006,
httpStatus: 400
} Unhandled Rejection at Promise Promise {
<rejected> DiscordAPIError: Cannot send an empty message
at RequestHandler.execute (/root/app/node_modules/discord.js/src/rest/RequestHandler.js:170:25)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
method: 'post',
path: '/channels/763617382748651531/messages',
code: 50006,
httpStatus: 400
}
}```
How is it an empty message ?
why is your description an array
In the code you send you also define everything twice, so I doubt you use the code above
It wouldn't even run to begin with
Everything ?
I don't think I have done that
Yes you were right
I was messing uo
Up
ХУЙ
does anyone know how to do a "test vote" to check if my code is working?
yes
there is a test button
go to your bot's page
and go to the webhooks section
there should be a 'test' button
okay thanks!
Missing module i guess
what module do i missed?
what module do i missed?
@clever vector canvas
how to install
npm i canvas
how to make a voting reward command?
.bot-description {
color: white; /*or whatever color*/
}
</style>
<h1><center>Tyneris - Bot</center></h1>
<h3>Tyneris is a fully multi-functional, customizable bot. Includes: moderation, role management, fun and more. </h3>
<h2>Orders</h2>
<ul>
<li>&help - Shows available commands</li>
<li>&help modération</li>
<li>&help gestion</li>
<li>&help config</li>
<li>&help utilitaire</li>
<li>&help fun</li>
<li>&help bot</li>
</ul>
<h2>Language:</h2>
<p>This bot is French, language translation done but not added</p>
<h2>A future:</h2>
<p>Currently the bot is at a very advanced stage, however with the upgrade to V.12, there will be further improvements. Addition: RSS, language If you want to hear from the bot or simply, if you have questions <a href="https://discord.tyneris.fr">the official Tyneris server</a> is there for that, do not hesitate to take a look.</p>
<h2>Other:</h2>
<p>Tyneris needs permissions to be able to send messages Tyneris is updated regularly, downtime is kept to a minimum to allow players to get the most out of it!</p>
<p>Join <a href="https://discord.tyneris.fr">the official Tyneris server!</a> •Quick Notes for Updates! • Report bugs, add suggestions or even talk to the community to get together and play together! • Ask questions if you get stuck or want to learn more!</p>
<center><img class="image1" src="https://zupimages.net/up/20/42/68wn.png" alt="ordi" title="ordi-img" >
</center>
@swift umbra that ?
Lock command-
It's the basic code(structure):
@commands.has_permissions(manage_channels=True)
async def lock(self,ctx, channel: discord.TextChannel):
channel = ctx.channel
overwrites = {ctx.guild.default_role: discord.PermissionOverwrite(send_messages=False)}
await channel.edit(overwrite=overwrites)
await ctx.send("Succesfuly Locked the channel!")```
Error- ***discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.***

@swift umbra no😭
if you want see the page
bot/733773484714360913
okay
doesnt work
how can i get invite link with guild id
i have copied url of webhooks
and paste in webhooks url
i test webhooks but
nothing happens
Command = Auto Message
Database = MongoDB
Discord.JS = v12
There are no errors in the lines. The problem does not appear. But every time I run the command the database is rebooted and the bot restarts at the same time.
Command (auto-message.js): https://hasteb.in/ayugahex.js
Command (auto-message-remove.js): https://hasteb.in/ogequsul.js
Models/TimeCommand.js = https://hasteb.in/hirimoni.js
Events/Client/Ready.js = https://hasteb.in/sajahavo.js
You emit the ready event in your auto-message.js file
You connect to your DB in your ready event
So every time auto-message.js is used it reconnects
What should I do?
aws - I looked at it, the bot uses too much ram now
azure - uhhh, I uhh, yeah I just... yeahhhhhh I think it’s off the table
heroku - 
How much RAM does it use
600mb+
Get a paid VPS
I can’t
Then no reason to make a public bot if you can't even support it
U can get a paid one for like 5 dollars a month
600mb+ and 1+ core for 100 guilds? Just rework your code and you can stay on a free host
Which also costs money 
I’m trying to remake everything but it just takes so long
-ask2ask @sick fable
@sick fable
Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.
Please read https://dontasktoask.com/ for an explanation on why this is an issue.
I think I’ve done like 4/18-19 commands so far
Then just finish that
Lock command-
It's the basic code(structure):
@commands.has_permissions(manage_channels=True)
async def lock(self,ctx, channel: discord.TextChannel):
channel = ctx.channel
overwrites = {ctx.guild.default_role: discord.PermissionOverwrite(send_messages=False)}
await channel.edit(overwrite=overwrites)
await ctx.send("Succesfuly Locked the channel!")```
Error- ***discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.***
They have a 8gb pi4
Ight I’ll try remake them all
Then why aren't they using that
My code and error
I tried @twilit rapids
.addField("» users" , bot.guilds.reduce((a, b) => a + b.memberCount, 0).toLocaleString(), true)
.addField("» servers", bot.guilds.size.toLocaleString(), true)
.addField("» Channels", bot.channels.size.toLocaleString(), true) did not work, what can i do?
Log the debug event
When I tried to use the command the bot was completely bricked
It wouldn’t do anything
Log the debug event
What do the debug logs say
.addField("» users" , bot.guilds.reduce((a, b) => a + b.memberCount, 0).toLocaleString(), true)
.addField("» servers", bot.guilds.size.toLocaleString(), true)
.addField("» Channels", bot.channels.size.toLocaleString(), true) help me
no I’m trying to say the rpi is too slow, the bot starts in seconds on my current vps it take minutes on my rpi
Log the debug event and see what's really happening
client.on('debug', (msg) => {
console.log(msg)
})
it’s not a bot issue
I’m gonna start it again and watch my webmin get pinned at 100% usage
I mean if you're just gonna ignore what I say and don't test it then my work here is done
😦
Not you @sick fable someone else is receiving help at the moment
@sick fable remove the
self
@slender thistle k
If I remove it then also idk why tf it shows that error

either your traceback output is fucked with manual exception output or you're just not posting the full traceback
Lol wait
@twilit rapids there I used the debug and the fking bot crashed from too high latency issue
Show the logs?
It’s not the bot my internet it fucking awful
Did you update to Djs v12.4.0
oh god new v12
ouiiiii
I just update it to v12.4
And it didn’t even respond to the heartbeat
and then crashed
it’s in Ethernet
What if you ping discord.com
Simply run ping discord.com
I had that issue a while ago as well, couldn't receive any guild packets in time (90k unavailable guilds)
I then contacted Mason and they fixed it, you might just wanna wait with booting for like 60-120 minutes and then try again


No idea if he's responsible for the API, but that's the dude who announced the verification
On Discord Developers
damn my rpi experience made someone kick my bot
doubt
It’s Spanish
my bots English
why does this code says in 0 servers but its in 3 "on " + str(len(client.guilds)) + " Servers."
Use client.guilds.cache iirc correctly
Might be wrong, I don't code js, just experience
https://discordpy.readthedocs.io/en/latest/ @gilded compass
should i learn .NET or do i stick with js
If i have a list like: js module.exports = { test: [ "test1", "test2", ], } how can i add something to the "test" list?
i need to "edit" the file for pushing it permanent, if i restart the app the argument pushed dissaperars and i dont want it
If i have a list like:
js module.exports = { test: [ "test1", "test2", ], }how can i add something to the "test" list?
i need to "edit" the file for pushing it permanent, if i restart the app the argument pushed dissaperars and i dont want it
@jovial nexus module.exports.test bruh
you can literally access your own exported stuff inside the same file that exported
there are 2 files
test.js is the list and app.js is the app
ok thx
and how can i clear the cache of all the app?
if i do data.push(test) it pushes test to data cache no?

or use a database
if i do data.push(test) it pushes test to data cache no?
@jovial nexus everything in a js file is stored in RAM
its a 20 line bot ,im not going to use a db
you'll 1000% need it later
and it's better than editing a js/json file because SYNTAX ERRURS
is a bot that kicks users if it detects he is playing fortnite bruh
@jovial nexus you're a fucking god
how can i delete items from this: ListOfCogs = self.client.cogs?
I understood not a single bit from that
What is self.client.cogs? What type is it? What do you want to remove from it?
btw its python
oh wait I'm dumb, am I not
How to get dev badge?
ah-ha, mappingproxy by default
But why?
ah-ha, mappingproxy by default
whut?
how can i delete items from this:
ListOfCogs = self.client.cogs?
@gilded compass Could you elaborate on the "delete items" part?
@swift umbra so no one will get from now on?
@gilded compass Could you elaborate on the "delete items" part?
@slender thistle this is the way it shows all loaded cogs but i want to make osme exceptions
76 servers required for that right?
Badge useless anyway 
To verify you need to be in over 75 servers ye
You don’t get a badge etc anymore
I believe it’s still 76 servers when you get the message
@slender thistle can i dm you its easy to write
sure
is a bot that kicks users if it detects he is playing fortnite bruh
@jovial nexus oh shit i did that too back thenwas good for lulz
Hello can someone help me to make a css for the background image on my bot "profile" on DBL please ?
;-;
Imagine making a bot that kicks Dbl mods 
lol
Not specifically make the CSS for you, but I can point out the selectors you might need to use
._.
Eh you shouldn't straight up abuse it
whats eris for?
it's a Discord API wrapper for JS
hey @tawdry oracle nice to see you
So how to make the css ?
eris needs to install discord.js too?
You will need to have knowledge of how to use css. Angel
hey @tawdry oracle nice to see you
@jovial nexus hey man good to se u 😄
You will need to have knowledge of how to use css. Angel
@zealous sable ._. eof don't know lol (imma forgive this idea lol)
and what does eris do??
should i learn
.NETor do i stick with js
or python or AHK or smth?
@tawdry oracle it is a wrapper for the discord api written in js
https://abal.moe/Eris/ @tawdry oracle
Eris, a NodeJS Discord library
it basically allows you to easily interact with the api without having to do requests and storing stuff and tokens and all that jazz
hey guys
i have a question
how would i get the id's of all the members in a server, and save that to a txt file?
in javascript?
i have tried searching examples but i could not find any, literally NOTHING.
ah that's somethin out of the box
yeah maybe that explains why i could not find any exmaples on the interent.
i know it is possible, don't know how to perform it tho.
i have tried searching examples but i could not find any, literally NOTHING.
@eternal osprey because there is not a tutorial for everything in the entire universe
yeahi understand.
some stuff you gotta do on your own
do you know how to do it?
try running a for loop on the members cache of the guild then log their IDs
in just general steps, don't get into the coding toomuch.
<%=user.presencce.status%> i am using it but giving error
hmmm
Cannot read property 'status' of undefined
<%=user.presencce.status%> i am using it but giving error
@nocturne sparrow spelling of presence wrong
please learn to read
328| <%if(user){%>
329| <p><%=user.tag%></p>
>> 330| <a href="#"><i<%if(user.presence.status=="dnd"){%> style="color: red;"<%}%><%if(user.presence.status=="idle"){%> style="color: yellow;"<%}%> class="fa fa-circle text-success"></i> <%=user.presence.status%></a>
331| <%}%>
332| <%if(!user){%>
333| <p><%=bot.user.username%></p>
Cannot read property 'status' of undefined```








presence is attached to a member
Bot in html script?
More like a dashboard
Never tried it
Can someone tell me how I put my custum css? I have it , I know I put it in detailed desc of your bot but i don't know how...
Bot in html script?
@little mango discord.js has a webpack version which works on browsers
<style> tag @halcyon shadow
Oh never knew ill give it a shot later on
<link rel="stylesheet" href="css url"> @halcyon shadow
or that if you have the CSS hosted somewhere else
are you know how i can use @slender thistle
ye it's hosted via discord =/
what
<link rel="stylesheet" href="css url"> @halcyon shadow
@nocturne sparrow the stylesheet have to be modified in image for a background or i'm wrong?
i dont understand
"stylesheet" have to be modifed?(changing the word)
you dont change this
You will just write the url of the file in the "href" section.
hmm the url is https://cdn.discordapp.com/avatars/737355806101733448/ff1bf7f0161c24542c03ec9d971ba396.png but the background doesn't appear -_-
are you using bg-image ?
gneu? what's that (the url is a discord url lol)
<%=user.presence.status%>
328| <%if(user){%>
329| <p><%=user.tag%></p>
>> 330| <a href="#"><i<%if(user.presence.status=="dnd"){%> style="color: red;"<%}%><%if(user.presence.status=="idle"){%> style="color: yellow;"<%}%> class="fa fa-circle text-success"></i> <%=user.presence.status%></a>
331| <%}%>
332| <%if(!user){%>
333| <p><%=bot.user.username%></p>
Cannot read property 'status' of undefined
how do i fix this
<style>
body {
background-image: url('https://cdn.discordapp.com/avatars/737355806101733448/ff1bf7f0161c24542c03ec9d971ba396.png');
}
</style> ```
@halcyon shadow
eof
.notif {
max-width: 700px;
max-height: 250px;
min-height: 100px;
overflow-wrap: break-word;
}
but the text still goes off the border of the element. Why? (it's a <p element inside a pre element btw)
still not working @nocturne sparrow
here how I did
I'm trying to get my bot to add a message where people can react with different emojis. This is the code:
if(message.author.bot) {
return;
}
if(message.content.toLowerCase() === '.roles') {
const embed = new RichEmbed();
embed.setTitle('Server Roles');
embed.setColor('PURPLE');
// embed.setDescription(':ErrorChanCackle: - CackleTime\n') +
// ':ErrorChanGiggle: - GiggleTime\n';
message.channel.send(embed);
}
});```
And this is the guide i am following:
https://www.youtube.com/watch?v=PpEr4pjrYRE
But everytime I get the error:
TypeError: RichEmbed is not a constructor
at Client.<anonymous> (D:\discord-bot\index.js:176:17)
at Client.emit (events.js:326:22)
at MessageCreateAction.handle (D:\discord-bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (D:\discord-bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (D:\discord-bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (D:\discord-bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (D:\discord-bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (D:\discord-bot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (D:\discord-bot\node_modules\ws\lib\websocket.js:797:20)
Today we will look at another way to write a Role Reaction bot using the DiscordJS library.
P.S: I will be doing a Server Boost giveaway and ANOTHER Nitro Giveaway. Check out my Discord for more details TBA.
Discord: https://discord.gg/bZSwjPy
----------------------------...
@halcyon shadow you cant use in there
S:o ?
append that after the url() thing
Brain no comprendo
yo soy hombre
uh what?
I don't speak spain
what is comprendo ?
What just I meme I know :p
it is spanish
bruh
@dark grove that video is outdated, change RichEmbed() to MessageEmbed()
anyone know how to use a link in the name of an embed pre-created by a bot template? (node)
instead of watching that vid, use the guide at http://discordjs.guide/
instead of watching that vid, use the guide at http://discordjs.guide/
@clever dust or https://anidiots.guide
anyone????
@earnest phoenix learn how hyper links work and read docs
im not a coder i just need help
@earnest phoenix learn
ok first, what does "an embed pre-created by a bot template" mean?
i use a pre-created bot for my server and you can customize it in the file manager
and it lets me customize embeds in this
this specifically is for reaction roles
Ok well, if you want to know how that bot works, you need to look at that bot's documentation and go to their support server.
This is for development, like, programmers, not "How do I use this bot I Found".
hahahah
well i have that open but there isn’t anything about what im trying to do specifically
Ok well, good luck with it, we have literally no idea how to use that bot
find their support page or discord.
but its not abt the bot
Yes it is.
i just need to know if its possible to have a link with text over it as the title
meaning they click the title for the link
library?
like i said im not knowledgeable at all with this stuff
sorry if i dont understand
right. So... we have literally no idea what code you're using, what library you're using, and you have no idea what you're doing.
I don't think we can help you.
well is there a way I could find what library it is?
You really should learn the language. You're not going to get anywhere if you don't.
@earnest phoenix You mean hyperlink?
yes @earnest phoenix
and i dont have the time @umbral zealot
Show your code
Then use a pre-made bot that's hosted for you
Ill give you the code
if you do'nt have time to learn, most people don't have time to help you and hold your hand.
Though there's always a help vampire victim somewhere willing to get their blood sucked I guess.
i just wanted some help bro tf
Okay, can you show your code?
I'll help you.
@earnest phoenix can we dm rather than in here?
Ya sure
not tryna get clowned any further
bruh I'm not laughing at you I'm telling you that you should take the time to do things and not rush.
^
how do i get the id of a member?
<member>.id
bruh
as i am trying to get the ids of all the members in a guild.
@pale vessel shut the fuck up you fucking morron.
i am asking ain't i?
i am asking a question and he says bruh
and you just said one member
jeremy just leave it
so <member>.id is technically correct
yeah?
DOCSumentation.
i haven't said something to Adib,\
i am glad he helped me.
however flaze says bruh
isn't it member.user.id in d.js
member also has the id property
TIL
hey what have i done wrong in this code : ```js
const list = client.guilds.cache.get("734123033782124575");
list.members.forEach(member => console.log(member.user.username));
})
})
client.login(token)
list.members.cache
fairly certain you need intents to pull member lists now
@eternal osprey @misty sigil
it works.
nah
why not fetch
just to receive updates, not fetch them all but idk tbh
why only get
do you not need guild_member intents to pull the whole list?
maybe
im farily certain you do
do you not need guild_member intents to pull the whole list?
@opal plank not in djs iirc
its just hella slow
without the intent
thats lazy caching
i know it is caching.
as users talk or get mentioned, they get added
it is not getting the most recent member list
I’d think you would but cache fills up with member objects from messages
if you restart your bot and instantly try that it shouldnt have any member in it
but it just gets the list from the cache.
if you restart your bot and instantly try that it shouldnt have any member in it
@opal plank apart from the bot iirc
say, you do that under the ready event, you'll have 0 members/users
and members that are in VCs iirc
just a sidenote, without intents you wont be able to properly log your users
it’s not
mongoose is easy
I’ll teach you the basics
a schema is a format that you follow
whats the bes wrapper for discord.js??
lemme look at some of my schemas
discord.js IS a wrapper @tawdry oracle
@misty sigil essay about using mongoose please
better than discord.js
what do you want to wrap in a wrapper ?
lemme look at some of my schemas
@misty sigil
Ok
your other option is eris or d.js-light
Wait discord.js light is somethin?
He's god of d.js
imagine even having that much ^
imagine not using 3573gb of ram
126G how??

i had 32G vps but I went to 4G
const mongoose = require("mongoose");
const Guild = new mongoose.Schema({
id: {
type: String,
}, prefix: {
type: String
}
});
module.exports = mongoose.model("Guild", Guild);
``` this is a basic guild schema
Oh
Ok
But one thing
How can one set the values
And how can one get the value
updateOne
you can save data into the database by ```js
const Guild = require('./path/to/schema')
const data = new Guild({
id: "guild ID here",
prefix: "guild prefix here"
})
data.save()
to find one you can ```js
const Guild = require('./path/to/schema')
const doc = Guild.findOne({id: "guild ID here"})
if it doesn't find anything it returns null
wait it saves in my local
and updateOne is also possible i guess
I can change it remotely ? Without running command
if you're using atlas, on the web
if you're self-hosting a cluster, it'd need to be done via MongoDB compass
Nope
although beware of the security setup
Not self hosting
if you want to change something in the databse by evaling, that's possible yes.
if you want to change something in the databse by evaling, that's possible yes.
@restive furnace
Not evaling I meant using web server
its possible too
Oh
but only if port forwarded
But it seems it isn't possible in quick.db as guided by Mathew
Oh
i use the official mongo wrapper
Ok
Is there any advantage in using mongoose over the official package
Is there anything wrong with how I wrote this line?
embedMsg.message.react('735903870609391657')
Console tells me:
at Client.<anonymous> (D:\discord-bot\index.js:182:22)
at Client.emit (events.js:326:22)
at MessageCreateAction.handle (D:\discord-bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (D:\discord-bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (D:\discord-bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (D:\discord-bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (D:\discord-bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (D:\discord-bot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (D:\discord-bot\node_modules\ws\lib\websocket.js:797:20)```
client.on("message", async message => {
if(message.author.id === "345138133429649408"){
if (message.content.startsWith(prefix + "list")){
const list = client.guilds.cache.get("734123033782124575");
list.members.cache.forEach(member => fs.writeFileSync("./memberlist.txt", member.user.id));
sentMessage = await message.channel.send("<@" + message.author.id + ">" + " The member list has been updated!")
sentMessage.delete({ timeout: 15000 })
}
}
``` hey why does my code only save 1 member id in the txt file (which happen to be mine)?
How to connect to mongoDB
@dark grove where is embedMsg defined?
are you kidding me?
mongoose.connect('mongoURL', {
useNewUrlParser: true,
useUnifiedTopology: true,
});
@delicate shore ^^
you're saving users in a .txt file??!? @eternal osprey
I meant where can I get the URL
bruh, use a database for the love of god
from the atlas page
yeah @opal plank
@eternal osprey your code rewrites the file everytime the member is iterated to
so basically only the last is saved
Ale
A TEXT FILE DATABASE
Alr

you are not being helpful but ok
@delicate shore its on the cluster page, it has the "connect" button
lemme put this in a nice and simple way @eternal osprey
@dark grove where is embedMsg defined?
if(embedMsg) {
embedMsg.message.react('735903870609391657')
.then(reaction => console.log('Reacted with' + reaction.emoji.name))
.catch(err => console.error);```
Alright thanks
USE A DATABASE FOR THE LOVE OF GOD
for YOUR sanity, OUR sanity, and your CODE's sanity
Why tf mongo dbtakes so much time loading
i know i complain about json databases but TEXT FILE DATABASES
@opal plank shut the fuck up please. I am using my mongodb for lots of thig but this fucking project will only be used for 1 fucking server with 5 fucking members.
please shut the fuck up both of you.
Bru-
@delicate shore not for me, i think its something on the webui cuz its fast when i compass in
imagine being rude to people trying to give you good practices advice
chill out guys
and read rules
Kk
@opal plank you are being rude to me.
howcome?
how
you can indeed give tips, i love that!
They never said you any abusive word
they gave advise
you are the one being stubborn and triggered by it
this comes over as rude.
guys just take this to DMs if you want to fight
almost making fun of someones code.
An emoji makes you feel offended?
ok fuck this im out
wasn't you the guy that had minecraft pe videos on his youtube channel?
then please go complain to a mod if you feel offended, this it not the place to argue @eternal osprey
wasn't you the guy that had minecraft pe videos on his youtube channel?
@eternal osprey
Me ?
yeah it was you
No I don't upload Minecraft
I don't even own it
you had your yt connected to discord.
What ?
anyways, lets leave it.
You are mistaken
how i can show user's status
you guys should learn one thing
Dont give free advice if they arent asking
just answer what he asked if u wanna and mind your own stuff
Who am I yelling at today
not me this time

@small prairie the best. Thanks 0/
Not me either
@nocturne sparrow what lib
It's been 19 mins and mongo website isn't loading
anyways @dark grove is there a messageembed.message property?
@dark grove is there a messageEmbed.message property?
wait i think not. old youtube guides screwed me over again
F
how i can show user's status
@nocturne sparrow what library?
messageEmbed IS the meesage
js
but how would i make sure that my code doesn't only save 1 member id?
I am just gonna use quick.db bye
js is a lang
discordjs
i forgot where the answer was
ye i know
It takes so much time loading
<user>.presence
https://discord.js.org/#/docs/main/stable/typedef/PresenceStatus https://discord.js.org/#/docs/main/stable/class/Presence?scrollTo=status <user>.presence.status
but how would i make sure that my code doesn't only save 1 member id?
@eternal osprey create a variable
add the ID to the string in the foreach statement
write the file after the loop is done
that should return an array of statuses
now working
Or you guys just use .map
Thanks for help tho Matthew
aye no problem
btw @delicate shore this was your channel
@opal plank i am doing for dashboard <%=user.presence%> its isnt working
mistakenly said minecraft instead of fortnite.
cuz it returns multiples things
not one
presence is a object iirc
which contains status and some other stuff
lemme check docs rq to refresh
@opal plank
@nocturne sparrow
Thanks
if(message.author.id === "345138133429649408"){
if (message.content.startsWith(prefix + "list")){
const list = client.guilds.cache.get("734123033782124575");
fs.writeFileSync("./memberlist.txt", list.members.cache.map(member =>{return member.user.id}));
sentMessage = await message.channel.send("<@" + message.author.id + ">" + " The member list has been updated!")
sentMessage.delete({ timeout: 15000 })
}
} ```




was good for lulz



