#development
1 messages · Page 453 of 1
<client>.emit('guildMemberAdd', msg.member);
${__dirname}/../assets/welcome.jpg also works
@sick cloud it still doesn't work and ive used both samaurai and aetheryx's solutions to test it:
client.emit is the same as the event going off normally
either way it still gives me the same error
whoops it ghot through that part
thgeres another section giving an error
@earnest phoenix use canvas-constructor
its faster xd
what is canvas-constructor?
nrn
It's a library made to interact with canvas
https://www.hastebin.com/asadihuzuz.js I need help changing this so Mysql my orginal plan was to do sqlite but i forgot how to create a database so im using Mysql
<
can someone please help me
also sqlite by opening the database it create automatically the file/db if it doesn't exist
for example in the command line, if you type sqlite file.db then file.db will be created (and know you have to CREATE TABLE)
Hel did you get your name from the German movie btw?
I have a Database with Mysql
I have that name since 2005-7 xD
but the create tbale thing
i can't figure out
CREATE TABLE reportdev();
that no work
what are you making the table for
ohhhh, you don't know how to design your database? x)
also what's in your report?
I am
making a bug, issure,improvement and other thing report command
and I need a database
so the command can fetch from the database
and send the report to a channel in the support server
would put something like id integer primary key, user_id integer not null, label text not null, issue text not null, resolved integer default 0
wait
hm?
would put something likesql CREATE TABLE report IF NOT EXISTS (id integer primary key autoincrement, user_id integer not null, label text not null, issue text not null, timestamp integer not null, resolved integer default 0);
maybe that
where id => issue id (autoincremented)
user_id => the discord id of the user that make the report
label => issue, bug, etc
issue => the second question, also the detailled
timestamp => for calculating the time of the issue
resolved (boolean if you have already inspect and/or resolve the issue (also you could make a code like 0 => nothing, 1 => read, 2 => resolved, 3 => declined, etc)
@earnest phoenix
Whats that for
you could extend your feature by letting you respond through the bot to the user in private message, for searching not resolved issue (with SELECT statement)
make statistic etc
what you don't get it?
Everything
about that
last one
do I put that
in the create table thing?
this
ok wait make an error
CREATE TABLE IF NOT EXISTS report(id integer primary key autoincrement,
user_id integer not null,
label text not null,
issue text not null,
timestamp integer not null,
resolved integer default 0);```
nah make an error i wrote CREATE TABLE table_name IF NOT EXISTS instead of CREATE TABLE IF NOT EXISTS table_name
sorry it's something late for me x)
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'autoi
ncrement,user_id integer not null, lable text not null, issue text not null' at
line 1
mysql>
show what you wrote
mysql> CREATE TABLE IF NOT EXISTS report(id integer primary key autoincrement,us
er_id integer not null, lable text not null, issue text not null, timestamp inte
ger not null, resolved integer default 0);
Yes
mysql is a little bit different xd
yeah
CREATE TABLE IF NOT EXISTS report(
id INT AUTO_INCREMENT,
user_id INT NOT NULL,
label VARCHAR(255) NOT NULL,
issue TEXT NOT NULL,
timestamp LONG NOT NULL DEFAULT CURRENT_TIMESTAMP,
resolved BOOL DEFAULT FALSE
PRIMARY KEY(id));
that should be good @earnest phoenix
also i'm going to bed, if you have other question, ping me or dm me
good night
I'm using discord.js. When I use message.member.setNickname('myNicknameGoesHere') to change someone's nickname, I get UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions as an error. I think the bot is missing permissions, but it has the higest role with all permissions granted.
@turbid tiger so the bot has the Manage Nicknames pemissions, it has the highest role, and the person is not the owner?
Hmm
I am the owner of the server, so no to the last question.
How do you delete ownership?
you'll have to transfer it to someone else in server settings -> members
Alrighty, let's see if this works then.
Now it's saying that it's not a function. Geez message.author.setNickname is not a function
its member not author
Stupid question: how about changing it for a different player? Say const player = message.mentions.users.first();, how could I change player's nickname?
Hey all! I was wondering would anyone have any recommendations for good vps (affordable too)?
As much as I like to stay on free, i think it’s time for me to move to a paid vps
GalaxyGate is pretty good rn
@uncut slate hows the ping to discord?
15-30ms
more than enough
I run 6 bots on my $10 droplet with plenty of room to spare
about 90% CPU and 50% RAM free
Oh wow six bots? D: that’s a lot...
May I please have a link to your bot on dbl?
yee my bot has 3k servers and still runs on a 10$ VPS
and quite not the cheapest one out there
bots don't need much
My VPS is $5/month. No need to ask for donations I’ll just cut back on a coffee per month.
I don't. then again I don't pay for my VPS
I don’t feel good about asking for donations tbh
May I ask where do you host it on?
digital ocean
Oh yeah!! I heard a lot of good things about them
Yeah, they’re really great.
i pay my vps entirely with donations personally
DO is nice because if you're a student and haven't used DO before you can get $50 worth of credit there
through the github student pack
Why isn't this working?
const m = await msg.channel.messages.filter(m=>m.id==='471944000576684035');
why do you await it
msg.channel.messages is a collection right
using filter won't return a promise
though it should still work 
also what are you trying to do, find a specific message?
( @sick cloud ) hi
edit an embed in a bots message @heady zinc
i made a mistake on an embed so i'm trying to edit it
yeah and then edit it
remember that filter doesn't return the message in question
it returns an array of messages that matched the filter
so use .first()?
you'd prefer using messages.find()
oh
or even .get() actually
get failed
because messages are mapped by their id
message.edit(stuff)```
if get failed that mean the message isn't in the cache
that should work
so you'd have to fetch the message
there should be a <channel>.fetchMessage() method
i can't look at the docs right now but iirc that's its name
You can also do
sentM.edit("Edited")
});```
search?
search bar on the docs
are you using v12
master, yeah
you're saying that now? lol
well i assume everyone uses the stable build
^
because that's best practice
wtf
where are the methods to fetch messages
oh wait
i see
indeed that's how it works in v12 i forgot
msg.channel.messages.fetch() @sick cloud
returns a promise
so await that?
ye
yeah
v11 devs are silly tbh
but a lot of it will just be find+replacing stuff
find: message.channel.fetchMessage
replace: message.channel.messages.fetch
i mean
the silly ones are d.js devs
they just don't have any clue of when to release something
one fucking year
why does it matter when v12 is released
it's already pretty stable on master
i would consider it to already be released, it's just a matter of fixing bugs
like a beta version i suppose
"pretty stable" is not acceptable for production in big bots
i used v12 for the longest time and i had no issues with it
the only real issue i had was recently but that was due to an issue with snekfetch
honestly paradox
what is wrong with d.js
yes
with the biggest community over all discord libs
the whole one year to release v12 is fucked tho
i would agree
i dont know what they're doing
not like it matters to me anymore 
however i would consider v12 to almost be a rewrite
not a full on rewrite but it changes a lot of stuff backend
for the better
in most cases
in an ideal world you wouldn't need to rewrite your software that often
i mean
that much rewrites is the proof of an ever-improving lib
or just hydra being a meme
i would lean towards the latter 
i suppose development has shifted heavily since v9
v12 looks like the ultimate form of what d.js tried to achieve until now
yeah
you just have to understand how to read the docs
and there you go
d.js pretty much does everything for you
it's not really a wrapper for discord's api anymore
the docs are incredible for d.js
it's more of a wrapper for the entire bot development process
it does so much things not directly related to the api
tbh lavalink was big pain for me to set up the first time i used it
not acceptable
why is lavalink better
i want 1kb music!!!!!
my first lavalink node takes half of the ram my bot use
@sick cloud better quality and it's java based
well
the main thing is that it does most of the job for you
the only reason i got it is because the quality is 10 times better and it's less prone to errors
you don't have to go through the pain of figuring out how to download youtube, soundcloud or twitch livestreams and stream them
lavalink does it for you
but yeah the thing is lavalink will at least on my side still use ~250mb of ram even without streaming anything
the upside of that is that the ram usage won't grow much with a lot of streams
250mb of ram is nothing 
especially when you got 40gb to use
its pretty small
it's noticeable on small-scale bots
iDEALLY you'd like it to not use that much
..
my giveaway bot uses 200mb to just idle :V
i'd even say its noticeable on medium sized bots
true
then again what counts as medium
what about it isn't working
i would say so
lmfao
10000-80000 medium
every bot is small 
and the rest big fat asses
ok
only with the right advertising kek
bye
i think the problem with bots these days is its like a job application
people just look at your resume (your description) and if it's not good enough, you're out
they'll also consider server size and shit
since they don't have the time to look at the whole full description for every bot
they just look at the front cover
well
STOP WELLING
that's the thing i don't like with d.js
it's too easy
and then it just overflows the market with bad boats
good
he's annoyed by the ridiculous ram usage of d.js lul
ye when you see dank memer only using 30gb
if the module is easy to use its a good module isnt it
it is just not scalable
well
d.js does its job
its mainly meant to be easy to use and introduce you into the world of bots
though it was supposed to be scalable at first
at least that's what i assume from the shards spawned as child processes
but how can you hate the module for what makes it good 🤔
i said that was a side i didn't liked
or well
not quite accurate
i don't like the consequences of it
but eh can't do anything about that

canvas (if you use js)
Honestly, discord.js shouldn't become a meme, or recognised as what newb devs use to make useless bots. discord.js is definitely the easiest, and is the perfect starter point for new developers. But if you put effort into learning JavaScript fully, discord.js is as capable as any other API wrapper. Not every bot that new developers make are bad every time, though most tend to be small bots that only solve a small area of Discord usability, or are just useless completely. The outcome of the bot shows with how much effort you decide to put in. Crap bots only take >1 hour approx. to make. Putting in effort for a good bot, and setting up proper updating and supporting systems will take 1 week or more. I use discord.js since I find JavaScript the most universal language, and you have access to things like npm, which are really helpful with running on VPS and installing modules easier, as well as there being a larger range.
Thats my opinion on discord.js. Honestly, whatever discord.js can do, pretty much all of the others can too.
Unless you use Bot Maker you're good to go
w-why indeed
Wow that is long, woah
because people were talking about d.js and their opinions on it
so what's a shard?
apparently my bot has shards
apparently bots can have shards*
Sharding is something you need to look into when your bot reaches 2.5k guilds ( you should look into it with 1.5k)
yeah i have 11 so i think i'm a bit off
ye
Shards basically split the bot's performance into several processes for better performance.
Something like that.
ooh
Is it? My bad then.
@wild tide if you check pins there's an unbiased description of both eris and d.js
Sharding is required from Discord to split the load in the main Websocket connection up into multiple connections, single threaded languages like js often use something like that to also loadbalance the bot and split it into multiple processes since thats the only way to use more than 1 CPU core
if your bot reaches 2.5k guilds you need to have atleast 2 websocket connections where each Shard has his own websocket connection and handles an amount of the total guilds from your bot
so each own WS connection is a Shard
I am far from that, either way. :^)
Oh.
hey, stupid question
what's the benefit of workspaces?
i just edit raw JS files rn, i have a few separate for a few different things, but it's raw JS with no workspace
and i see people with VS code working in workspaces and i imagine there's efficiency with doing so
i'd also like to know the answer
it can be helpful when working on different projects but i don't think it's really that important
i'd presume it'd be for those people who are really proactive about their productivity and organization
id also like to know
well generally
literally my workspace is just a couple of JS files plus a folder called 'test' where i do dev before copying over to main
i dont use git or anything fancy
never reaally done much with vscode
Kinda allows you to work on multiple projects at once I guess?
ooh
Like I usually open one for frontend and one for backend when I'm going fullstack
ye
ooh
Hej
Hey
@earnest phoenix error message?
It
Lol chill @earnest phoenix
corresponds to your MySQL server version for the right syntax to use near '(id))
' at line 1```
🤔
@fluid basin i'm just a little pissed after responding like this and getting this:
maybe id outside of the ()
?
No missed a , xd
CREATE TABLE IF NOT EXISTS report(
id INT AUTO_INCREMENT,
user_id INT NOT NULL,
label VARCHAR(255) NOT NULL,
issue TEXT NOT NULL,
timestamp LONG NOT NULL DEFAULT CURRENT_TIMESTAMP,
resolved BOOL DEFAULT FALSE,
PRIMARY KEY(id));
sooooooooooooooooo
Another reason is that I usually switch from project to project
So I sometimes do want to come to working on one after some while, and which I keep it open as another workspace
is there ANY other way than snekfetch for loading an image to Canvas from an URL? anyone got a solution?
ERROR 1067 (42000): Invalid default value for 'timestamp'
You'll need the image itself
🤔🤔🤔🤔
So you would have to retrieve it in some way
Bte snekfetch is no longer maintained I assumr
maybe not CURRENT_TIMESTAMP and just have it as CURRENT TIMESTAMP ?
@fluid basin how, all i can get is a buffer
CREATE TABLE IF NOT EXISTS report(
id INT AUTO_INCREMENT,
user_id INT NOT NULL,
label VARCHAR(255) NOT NULL,
issue TEXT NOT NULL,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
resolved BOOL DEFAULT FALSE,
PRIMARY KEY(id)
);
Syntax checker say its correct
@earnest phoenix
funny need syntax checker for sql lool
Oh I see
-> id INT AUTO_INCREMENT,
-> user_id INT NOT NULL,
-> lable VARCHAR(255) NOT NULL,
-> issue TEXT NOT NULL,
-> timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-> resolved BOOL DEFAULT FALSE,
-> PRIMARY KEY(id)
-> );
Query OK, 0 rows affected (2.09 sec)```
idk if this is right Hel
xD
did i do it right
Can you without asking a system for activating and disabling control in a certain server?
plz
without asking?
I am not english i have difficulty to use this language
try using google translate
ok
So can you help me ?
Query OK -> everything nice 😄 @earnest phoenix
yes
Ok
Now Idk what to do xD
I need to be able to access it for my command
https://www.hastebin.com/omujuyodew.js <---- Idk if things have to be changed so it works with Mysql
If so I will just ask my friend
he can help me with that
@eager spoke Where can I find the database file i just made?
i need help
any vc
wont join any vc
send code
Is your server/pc blocking udp connections?
iirc thats glitch 👀
No, It used to join vc's earlier but suddenly it wont
@earnest phoenix you should really read documentation/tutorial about mysql/database
Oh ok
mysql work as a server, sqlite use files as database
How would I make a bot automatically discern between channels to pick
Get the guilds channels.
And loop through
Can't I do like guild.channels.some?
There's message.member.roles.some
Well the some method only checks if the channel will meet a criteria.
It will return a boolean.
You probably want to get the channel which would mean using a method like forEach
That might work. I just need a channel to send welcome messages to
And it's not the same for everyone
You could also take user input.
So to enable welcome messages they have to mention a channel
or something like that.
Im trying to play some sound files with my bot but im getting Error: FFMPEG not found
tho i already installed ffmpeg
Try running npm install ffmpeg-binaries
if (message.content.startsWith(prefix + "byeee")){
client.guilds.forEach(guild=> {
const defaultChannel = guild.channels.find(c => c.name.toLowerCase().includes('general') && c.type === "text")
if (!defaultChannel) return;
defaultChannel.send("lol");
defaultChannel.send("lol");
console.log('sent')
})
}```
that should work right
Why are you sending two messages
Which library
discord.js
yeah
so?
doesn't output anything
Doesn't log?
doesn't log
Remove the if statement for the default channel return
Or just comment it out and try again
Why do you use the includes method
then what would i do
im just trying to mass message all guilds
yes that may be api bannable and im totally fine with it right now
Oof not sure if that works
Pretty sure there's an api limit for sending messages
You can't send tons of messages at the same time I believe
c.name.toLowerCase() === "general"
aha it worked
It can also be used to check if something is in a string.
how'd i go about sending a message to all guilds where the bot has access to send a message to?
code?
module.exports.run = (bot, message, args) => {
if (!message.member.hasPermission("ADMINISTRATOR")) return message.channel.send("This command requires the ADMINISTRATOR permission")
if (!message.mentions.channels.first() && args.join(" ").toUpperCase() !== 'NONE') return message.channel.send(Usage: g!joinleave #channel)
let newChannel;
if (args.join(" ").toUpperCase() === 'NONE') newChannel = '';
else newChannel = message.mentions.channels.first().id;
** db.updateText(welcomeChannel_${message.guild.id}, newChannel).then(i => {**
message.channel.send(Successfully updated welcome channel to **${message.mentions.channels.first()}**)
})
}
is updateText a function?
Does anyone know how to make it so when a person goes offline it gives them a role and when they come online it takes the role away?
for discord.js btw
track member update events
How would I do that?
its in d.js docs
remove the await
bot.on('guildMemberAdd', async member => {
no no
the await was a problem wen no present
its canvas
wen no await that eror (node:16903) UnhandledPromiseRejectionWarning: TypeError: Image or Canvas expected
bot.on("presenceUpdate", (oldMember, newMember) => {
offline = await member.guild.createRole({name: "offline",
color: "#ff0000",
permissions: []
})
await newMember.addRole(offline.id);
});
this is my code so far
I don't know how to make it check when someone goes offline
or goes online
Can somone show me how to write text on a image using JavaScript? I tryed canvas and Jimp and cant figure it out
@earnest phoenix compare the old member to the new. Get the presence property and act according to that
btw people can just set their status to invisible and get the offline role
Ik
But oh well
how do you grab emojis from other servers to use?
isn't it
emoji: "emojiname:emojiID"
?
Plz can you help me
i have create a system to activate desactivate command so the problem is the command disabled on all server
How would I lock a command to myself only?
@obtuse wind check if the user ID of the person trying to execute the command matches yours
I mean many people ran the command
already
so I'm trying to lock the command for myself only
Do u use js
Only people with the administrator permission should be able to use it, and yes I do
yea i do
I use discord.js and node.js
discord.js has a property to check if users have a certain permission
would it be (!msg.author.hasPermission((etc)))
oh thanks
np
So would it be ".hasPermission(checkOwner)"
just do this:
if(message.author.id != yourid) return;
mkay
does anyone here know anything about skyslik cloud?
its free
Rip I got (node:9156) 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(). (rejection id: 2)
or if u want a better code u have just to use this :
const credentials = require('./urconfig.json');
if(credentials.ownerID.includes(message.author.id)) {
return message.channel.send('ur error message');
}
@ruby dust i got it
how do i use it?
to run my bot?
just like any other vps
but it doesnt have VM like the windows interface and i dont know how to use it
google is ur best friend
XD
well you asked about skysilk specifically, so the question "how to use a vps" would be more relevant in this case
you create a container and choose OS you want for your VM
I'm using Ubuntu 16.04
ok ill use that too
nearly any OS you'll choose will be interactable by a terminal
iirc ssh key is only used to access root
will i need root?
but you do have to create a private key with putty's key generator
yesi do
root is like admin access on windows
nvm
i have a public one
XD
@ruby dust what does the root do?
like download npm if needed?
read my previous message
initially you won't have any users registered on your machine
so you'll need root to create some
it's basically running programs with admin access, which you then generally trust the program to not mess up with your machine's system files
¯_(ツ)_/¯
waht would be the host name?
do you have a private key?
is that on putty keygen?
that's on filezilla 🤔
what would be the host tho?
and the password is the password i made
well, google might help you then ¯_(ツ)_/¯
ok
one morequestion
was will the port be
If I use snekfetch to get a response like this, how can I get memes[0].url
{ "success": true, "data": { "memes": [ { "id": "61579", "name": "One Does Not Simply", "url": "http://i.imgflip.com/1bij.jpg", "width": 568, "height": 335 }, { "id": "101470", "name": "Ancient Aliens", "url": "http://i.imgflip.com/26am.jpg", "width": 500, "height": 437 } // probably a lot more memes here.. ] } }
finally got in
@ruby dust it gave me a warning that it might not be my computer
like the vps
do i ignorethat
oh wait, I think I do remember
if you first time log into the server it'd ask if you trust the host
yeah that's normal
how to create max length message
yes
after that question how do i run the bot?
ok
how do i put the password in putty?
@ruby dust
wait
nvm
i got it
how do you install npm on putty
and node
google.com
And that's more like "installing npm on <Your VPS OS>"
Because PuTTY is not the OS itself
Correct
Whatever OS you are on download it on that terminal
idk if there isnte
i dont have one
its on my raspberry pi
i use skyslik
SkySilk is not the OS, either
Which OS do you have on your vps?
there isnt a VM interface like window
Tf do you have as an OS? Linux?
Its cli only servers
Ubuntu? CentOS? Debian?
trying
Blame my Ubuntu 16.04 then :p
its apt install npm
It was apt-get
but when i try it it says failed
Distro and version
Don’t forget sudo
Isnt he root?
Is sudo required on root
No
When you add a repo you have to sudo apt update
Only for non-root users
And he is on root, afaik
Substitute do
I feel like there's too many people trying to help so I am off. Cya people and gl
Putty is a tunnel to your vps
You don't fckin update PuTTY
Try a linux tutorial
oof
It would be more useful than anything
Ya trying to install node or smth
Node installs npm automatically 
here
this might help
@earnest phoenix
ok
this is for debain terminal tho
If i remember correctly
wait no
its for everything
it says npm is not installed
but node is install
i did apt install node-legacy
is that correct?
Can someone help me pull memes from Reddit?
In JavaScript. I googled like 20 different things and everything came up with JavaScript memes on r/programmerhumor
appending .json to a subreddit url gives you the page in JSON
query param docs you can find here https://www.reddit.com/dev/api/
Reddit gives you the best of the internet in one place. Get a constantly updating feed of breaking news, fun stories, pics, memes, and videos just for you. Passionate about something niche? Reddit has thousands of vibrant communities with people that share your interests. Alt...
Hello, i am using discord.py and may i ask how to make certain commands work only in NSFW channels
Rewrite or async?
Check if the channel has the nsfw option
Thx @uncut slate
@eager spoke Discord.py async doesn't have that
Join discord.py server Google can help ya and use ?tag install rw in #testing there
But well, if you don't wanna migrate to rewrite, you can't check if the channel is marked as NSFW
Rewrite has breaking changes sometimes and all that stuff, so it's up to you whether or not to move your bot to rewrite
F
tutorials why
Hm?
Oh
RIP
@earnest phoenix You need to install Node.js, not the legacy
how?
yes
im usering a vps
on putty
tho
which section is that?
is it this
pacman -S nodejs npm
nvm
@uncut slate when I go to https://reddit.com/r/memes.json I can't read it at all to make out a structure
Firefox Developers Edition has one built in. 
I write my json parser on a case to case basis because Java json parsers are bad 
anyone know this error
module.js:549
throw err;
^
Error: Cannot find module '/root/index.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
ahhh
nvm
nvm
Also pacman is archlinux packet manager
why is this
Error: Cannot find module './config.json'
is ./config.json correct?
Well, is the config.json file in the same directory as the file that's trying to use it?
./ = your cwd. If your trying to get it from /files/, you'd need to use ./../config.json as an example.
yes
How are you trying to require it then?
So you have /<file>.js and /config.json in the same folder?
👀
Try config.json alone?
Or put your config in a .js file and use require('./config'); 
How to tell when a user updates his/her avatar?
const Discord = require("discord.js")
module.exports.run = async (bot, message, args) => {
message.channel.send("Griffin....").then(Message => {
bot.setInterval((fn, delay, ...args) => { Message.edit("I am sorry..."); }, 5000);
bot.setInterval((fn, delay, ...args) => { Message.edit("I never meant to hurt you..."); }, 8000);
bot.setInterval((fn, delay, ...args) => { Message.edit("I just wanted to make you happy..."); }, 8000);
bot.setInterval((fn, delay, ...args) => { Message.edit("I guess I failed at that..."); }, 8000);
bot.setInterval((fn, delay, ...args) => { Message.edit("Seems how we are no longer friends..."); }, 8000);
bot.setInterval((fn, delay, ...args) => { Message.edit("I am sorry for what I did..."); }, 8000);
bot.setInterval((fn, delay, ...args) => { Message.edit("You mean a lot too me and I was foolish..."); }, 8000);
bot.setInterval((fn, delay, ...args) => { Message.edit("I lost you and I lost a little bit of me too..."); }, 8000);
bot.setInterval((fn, delay, ...args) => { Message.edit("Please forgive me..."); }, 8000);
bot.setInterval((fn, delay, ...args) => { Message.edit("Let's be friends like we used to before all that happened..."); }, 8000);
bot.setInterval((fn, delay, ...args) => { Message.edit("Even if we can't..."); }, 8000);
bot.setInterval((fn, delay, ...args) => { Message.edit("I still care about you..."); }, 8000);
bot.setInterval((fn, delay, ...args) => { Message.edit("Always will :heart:"); }, 8000);
});
}
module.exports.help = {
name: "sorry"
}
can someone please help me
after a certain point
it speeds up
and doesn't wait

that code looks so messy
also @earnest phoenix ratelimit
its trying to edit the message at the exact interval
yea
all of them cant be 8 seconds
Oh yea
I should change that too ><
const Discord = require("discord.js")
module.exports.run = async (bot, message, args) => {
message.channel.send("Griffin....").then(Message => {
bot.setTimeout(() => { Message.edit("I am sorry..."); }, 3000);
bot.setTimeout(() => { Message.edit("I never meant to hurt you..."); }, 5000);
bot.setTimeout(() => { Message.edit("I just wanted to make you happy..."); }, 6000);
bot.setTimeout(() => { Message.edit("I guess I failed at that..."); }, 4000);
bot.setTimeout(() => { Message.edit("Seems how we are no longer friends..."); }, 6000);
bot.setTimeout(() => { Message.edit("I am sorry for what I did..."); }, 4000);
bot.setTimeout(() => { Message.edit("You mean a lot too me and I was foolish..."); }, 6000);
bot.setTimeout(() => { Message.edit("I lost you and I lost a little bit of me too..."); }, 7000);
bot.setTimeout(() => { Message.edit("Please forgive me..."); }, 4000);
bot.setTimeout(() => { Message.edit("Let's be friends like we used to before all that happened..."); }, 8000);
bot.setTimeout(() => { Message.edit("Even if we can't..."); }, 4000);
bot.setTimeout(() => { Message.edit("I still care about you..."); }, 5000);
bot.setTimeout(() => { Message.edit("Always will :heart:"); }, 4000);
});
}
module.exports.help = {
name: "sorry"
}
Like that?
why are you trying to edit many times at the same time?
huh....
Why
are people telling me different shit everythime :/
so all timeouts that you have with 4000, will all run at the same time after 4 seconds
:/
@earnest phoenix if you did setinterval once you run the command the bot will always try to edit the message
I just want to fix this ugh
until you stop it
This is getting so complicated ><
SO many people
have told me something different
timeout 500;
timeout 500
// all 3 time outs will go at the same time after 500ms
timeout 500;
timeout 600;
timeout 700;
// one will go after 500ms, the next one after 600ms, the next one after 700ms. a waiting time of 100ms bewteen each one```
the timer for all timeouts is set immediatelly
So wait
in js there is no such thing as waiting for a function to finish
only promises and async functions can "wait"
you can do 2 things
either timeout 3000; timeout 8000; //3000+5000 timeout 14000; //3000+5000+6000 etc... or timeout(timeout(timeout(6000), 5000), 3000) etc...
ummmmmm
idk
How would I even use that?
Would i have to put it at the end
of each message edit?
it doesnt matter how you do it as long as you understand the concept
yea
if you want to wait for a timeout to finish before you do the next timeout, you have to put the timout one inside each other
it is supposed to delay right?
or you make all timeouts at once, but have their timers work in the sequence you want
<
for example if you want to wait 5 seconds, you do the first at 5000, and the second one at 10000
so there is a 5 second delay between them
Oh ok
so wait
Message.edit("I lost you and I lost a little bit of me too...")
timeout 5000;
like that?
no...
oh...
i just did it to show you









