#development
1 messages · Page 1447 of 1
validate it inside your command
i even tried with a id
how did you fetch the channel?
should i maybe create a client.on("message", messaeg)? Riht now i only have one for guildmemberadd.
so you want to send a DM to the User that joins?
yeah
this starts a small questionary
how did you get message inside the event?
since its not there by default
message.guild.channels.cache.find(`ticket-${message.author.id}`);
yeah that is the problem
use fetch. cache.find only finds cached channels
o
ok
send a DM to the user and store the message object. then use the stored message object to get the channel
okay i will try.
yeah i have stored the last sent message
how do i actually get the channel it is in?
msg = await user.send("wellcome")
then
msg.channel.createMessageCollector()
message = await author.send("Please write down your email starting with + : Example: +test123@hotmail.com")
.then
const filter = m => m.content.includes('+');
const collector = message.channel.createMessageCollector(filter, { time: 15000 });
collector.on('collect', m => {
console.log(`Collected ${m.content}`);
});```i will try this!
thanks.
you could also use await message so it will take anything the user writes. then you can use Regex to check if its a valid email adress
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'createMessageCollector' of undefined
hmm
message.guild.channels.fetch()
const message = await author.send("Please write down your email starting with + : Example: +test123@hotmail.com")
.then
const filter = m => m.content.includes('+');
const collector = message.channel.createMessageCollector(filter, { time: 15000 });
collector.on('collect', m => {
console.log(`Collected ${m.content}`);
});```basically what i did.
it sends the messages.
just still doesn't egt the message.
you you use then. the message variable will be not defined. you can pass it in there with a lambda function
lambda is return value right?
if you pass it in with the lambda function you dont need to store the message object
=>
okay hmm.
still says is not a function
i see what i am doing wrongg
i am basically sending a dm to a new user
and they have to wrtie +(email)
but it gives me this shit: (node:13448) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'content' of undefined
yea bcs the message is probably empty
yeah
H
i would use awaitmessage
it should be valid. is your message valid?
awaitmessaeg where?
UnhandledPromiseRejectionWarning: TypeError: message.guild.channels.fetch is not a function
message.channel.awaitMessages(filter, { max: 1, time: 30000, errors: ['time'] })
.then(collected => {
message.channel.send(`${collected.first().author} got the correct answer!`);
})
.catch(collected => {
message.channel.send('Looks like nobody got the answer this time.');
});``` you dont need to filter it just store the message and read out the content
const Platform = await message.channel.awaitMessages(m => m.author.id === message.author.id, {
max: 1,
time: 30000,
errors: ['time']
}).catch(() => {
// If the user doesn't answer to the question, save "The user didn't respond" as the answer
return message.channel.send(`${language(guild,`ABORT`)}`);
});
```i use it this way in one of my bots. i can just use Platform.first().content
@lusty quest is message.guild.channel.delete(); a thing?
not really. guild only has the channels manager not the channel object
message.channel.delete(); ??
this will work
ok brb
it doesnt have to get the channel by name to see if its a ticket
i mean
H
idkkk
const message = await author.send("Please write down your email starting with + : Example: +test123@hotmail.com")
.then(msg=> msg.channel.createMessageCollector())
message.channel.awaitMessages(filter, { max: 1, time: 30000, errors: ['time'] })
.then(collected => {
fs.writeFileSync("./members.txt", list.members.cache.map(member =>{return member.user.username + " " + member.message.content}).join("\n"));
})```
something in me tells that this is horribly wrong
wtf?
yea
you have 2 collectors
also why storing in a txt file?
never store any user credentials unencrypted and never in a txt file
it is just for now
i am going to save it to mongodb
but encrypt user informations.
but i first need to have the base down
you dont want some lawsuite bcs some chinese guy hacked into your vps
const message = await author.send("Please write down your email starting with + : Example: +test123@hotmail.com")
await message.channel.awaitMessages(m => m.author.id === message.author.id, {
max: 1,
time: 30000,
errors: ['time']
}).then(collected => {
fs.writeFileSync("./members.txt", list.members.cache.map(member =>{return member.user.username + " " + member.message.first().content}).join("\n"));
}).catch(error => {
console.error()
});
``` would try something like this
idk never worked with files. they are annoying to work with
also insecure and easy to corrupt
ah okay! Thanks for the huge help btw!
@lusty quest question
if i have it so if they react to a check it closes the ticket
how would i have it like wait for a reaction?
would use the reaction add event
this way it will always work and dont depend on any collectors
but would'nt that be for like any reaction with the check?
yea but you should filter out that it works only with the wanted conditions
hm
i use it on one of my bots.
it fires some code if someone reacts with 👍 on a message my bot reacted already on
so the bot add the reaction. if a user reacts also with it it executes more code
this also adds the benefit that it will still listen to the reaction even if the bot restarted
const message = await author.send("Please write down your email starting with + : Example: +test123@hotmail.com")
await message.channel.awaitMessages(m => m.author.id === message.author.id, {
max: 1,
time: 30000,
errors: ['time']
}).then(collected => {
fs.writeFileSync("./members.txt", list.members.cache.map(member =>{return member.user.username + " " + member.message.first().content}).join("\n"));
}).catch(error => {
console.error()
});
``` this is really strange. I get the dm from the bot and then type +(mail) but it does not save it to the txt file. What is the problem?
you shouldn't save to the file in the first place
it doesn't support concurrency
i am going to save it to mongodb later on
but it does not send any errors or whatsoever.
does the file exist?
but anyways, even if it would be temporary i would then spin up a local MongoDB server to do it directly correct
where is list defined?
also you could just use the author of the collected message to the the username
Someone here knows if it is possible to deafen the bot after it joined a channel? I tried different methods (voice_state_update) but they did not work 🤔
Talking about this code snippet:
# connect to author's voice channel
if not client:
if ctx.author.voice is None:
raise commands.CommandError("You need to be in a voice channel")
else:
channel = ctx.author.voice.channel
client = await channel.connect()
did you tryed .setDeaf(true)?
to revert it pass false
You mean like client = await channel.connect().setDeaf(True)?
true does not work here
if you use js or ts
read the doc link i sent you
Thanks but as already mentioned: "I tried different methods (voice_state_update) but they did not work" so I am kind of lost
...ok?
I read the docs indeed, otherwise I would not be here :)
the method i sent you is the one you need to use
Well, someone was trying to help me and said this could be done like this 🤔
these are the only params you need to pass
whoever told you that you can copypaste the method signature and expect it to work is retarded
@whole knot removing the ***** will still have errors, because there is a comma behind, and if there’s a comma from nowhere, it will return an error
So maybe remove the *,
Maybe that’ll work 
Yeah, that is what I was doing, made a bad explanation there but I know how this works 😄
It gives out the following error: 'VoiceClient' object has no attribute 'change_voice_state'
@earnest phoenix come pls
which im starting to doubt you actually read
Bauzy help this guy
If you got nothing helpful to say, and is here to just criticize him, just shut your mouth
Well, I just want to change it in one guild so where am I wrong? 😅
No, I just gave you my opinion
I’m not very familiar with discord.py, so I don’t think I can help further on 😰
So @earnest phoenix come here pls

@loud ingot Oh, no problem, thanks for your time mate! 😋
above
const list = client.guilds.cache.get("734123033782124575")
why did you need the member object?
did you enable GUILD_MEMBERS intent
i would just get the author of the collected message.
how would i do it else then?
because i have to get the member object right?
why?
there is no need
you dont want to give it a role
or something in this direction
okay so I have a number like Date.now() in js how can I change that to something like 1 hour 1 min ago
check out humanizer
moment js ?
ok ty
or just do simple math?
so i should delete the map function
list.members.cache.map(
so it would become:
yeah i made a function instead
fs.writeFileSync("./members.txt", return member.user.username + " " + member.message.first().content}).join("\n"));
}).catch(error => {```
error: illegal return statement
just get the user from the collected message
removes some unnecesary code
await message.channel.awaitMessages(m => m.author.id === message.author.id, {
max: 1,
time: 30000,
errors: ['time']
}).then(collected => {
console.log(member.message.first().content)
fs.writeFileSync("./members.txt", member.user.username + " " + member.message.first().content).join("\n");
}).catch(error => {
console.error()
});
```this doesn't even log anything
how would i get the user from a collected message?
bcs it makes no sense
you try to get something from the member object that is idk where defined
hmm okay
you can use collected.first() to get the message
then get the content, author, attachments etc. whatever you want
aha okay!
https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=awaitMessages and here is the docs link
exactly what i have done
console.log(${collected.first().author} + ${collected.first().content}) like this right
yep
doesn't do anything either, btw i already looked at the docs.
remove the await
yeah opkay
still nothing
const message = await author.send("Please write down your email starting with + : Example: +test123@hotmail.com")
message.channel.awaitMessages(m => m.author.id === message.author.id, {
max: 1,
time: 30000,
errors: ['time']
}).then(collected => {
console.log(`${collected.first().author}` + `${collected.first().content}`)
fs.writeFileSync("./members.txt", collected.first().author + " " + collected.first().content).join("\n");
}).catch(error => {
console.error()
});```
Are you trying to collect the message in their DM?
<message>.channel → <User>.dmChannel
member.dmChannel would work too right?
so message.channel becomes member.user.dmChannel.
just replace message.channel to author.dmChannel
(node:5744) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'awaitMessages' of undefined
Did you do author.dmChannel?
wait what is "author"
guildmember or user
If so what did you define author as
member coming from the client.on
msg.member or msg.author
author.user.dmChannel
yes try this ^^
Assuming author is a guild member
okay the error stopped working
but it is still not writing to the file nor logging any of the given variables.
const list = client.guilds.cache.get("734123033782124575"); //change this to your own server id. > right click your server inco > copy-id!
const message = await author.send("Please write down your email starting with + : Example: +test123@hotmail.com")
author.user.dmChannel.awaitMessages(m => m.author.id === message.author.id, {
max: 1,
time: 30000,
errors: ['time']
}).then(collected => {
console.log(`${collected.first().author}` + `${collected.first().content}`)
fs.writeFileSync("./members.txt", collected.first().author + " " + collected.first().content).join("\n");
}).catch(error => {
console.error()
});
```
You should always use a collector instead of awaiting them
b!badges
const collector = author.user.dmChannel.createMessageCollector(filter, { time: 15000 });
collector.on('collect', m => console.log(`Collected ${m.content}`));
collector.on('end', collected => console.log(`Collected ${collected.first().author} items`));
fs.writeFileSync("./members.txt", m.author + " " + m.content).join("\n")``` one last question before i leave. M is not defined?
also tried this> fs.writeFileSync("./members.txt", collected.first().author + " " + m.content).join("\n");
collected is undefined here too
m is a parameter returned from the collector which you closed but trying to use it again
<Collector>.on("collect", m => {
// Do whatever with 'm'
})```
noop
Unfortunately not
noop
people still asking 4 months after the badge was removed smh
Evie, may I know whether I can still get the Verified Bot Developer badge or not? I'm really looking forward to it. Thanks. 🥺
har har har
im trying to install the typescript compiler but
-g isn't setting to path
and when i clone i get that error
yo
should i make a pagination system for pages of my help command or do i just make it help <page> returns the commands on that page
Up to you
did
second option then
Put yourself in the users shoes and ask: do I want to type help <page> every time, or would it be more intuitive to navigate with buttons
For me it's the first since I have a lot of commands
If you have a reaction for every category, yeah
i don't have much commands yet so i'll go with the second option for now but I'll make a pagination system soon
so there seems to be a problem with my command handler
yes?
oh no
let cmd = bot.commands.get(command) || bot.commands.find(c => c.aliases.includes(command));
i define aliases as null when there are none
how the fuck can i be so dumb
xd just use ?.
i can literally just put ["none"]
If you're using Node.js v14 I recommend you use ?. btw
repl no node update
or this
let cmd = bot.commands.get(command) || bot.commands.find(c => c.aliases ? c.aliases.includes(command) : false);
fixed
thank you guys
const collector = author.user.dmChannel.createMessageCollector(filter, { time: 15000 });
collector.on("collect", m => {
fs.writeFileSync("./members.txt", m.author + " " + m.author.username + " " + m.content).join("\n");
})```hey, different users have to be saved in the members.txt but the file actually rewrites itself once a new member has been added.
so there is always only 1 member in the txt file.
how do i fix that it won't overwrite the existing memberrs.
Did you know writing user information to disk without their explicit was against the discord terms of service?
they literally are being told that this is being saved
Ok then use a database that's secured and encrypted, as per ToS.
i will.
told him this already a while ago
i am just doing this for now.
does google firebase's realtime database work with that
Ok don't do this for now. Don't break the ToS "for now". That's still breaking the ToS.
just spin up a local MongoDB server instead of waiting for the deployment
You don't temporarily break the law. You just don't.
as you said you want to use Mongo
Then don't write this code
Period.
We will not help you break the terms of service.
Hello
writing bad code for "testing" is bad practise anyways
bruh his enitre hard disk might be protected
you are always welcome to ask for help
can anyone tell me how i can make a bot give a role when you react to a message
😄
i am literally still in the process of making. Once the base is done, i will rewrite the code to a more secure database (for example mongodb).
right now i am just using it on my self.
Then do that now, or don't do it at all.
Make a reaction collector that gives the member a role when it collects a reaction
there is literally no point in doing this intermediate, shit way of trying to write logs. Period. Don't do it. we won't help you do that.
have you ever heard of people being taking into custody, for hacking their own computer?
yes but how do i make a reaction collector
That is besides the point. It's breaking the ToS, we won't help you.
im not sure what to do here
it actually is right on point. It comes down to the same situation. You are writing something for yourself, and performing it on yourself (just like i am doing right now).
You are writing user data to an unencrypted, unsecured location.
It doesn't even matter if it's your data or not. It's discord data.
i am writing MY information on MY harddisk.
sure.
Don't care what your personal justification is, that is NOT the way to do it.
do it right, or don't do it at all.
i will migrate it to a more secure database.
Good! 👍
let newop = {new: "Join the support server" , remind: 250000 , joins: 0 , leaves: 0, prefix: "%"} ;
``` when I overwrite throught newop.joins = newop.joins +1 ; there comes that joins is "NaN"
I'm not very experienced with collectors in discord.js but you can read about them at their docs
https://discord.js.org/#/docs/main/stable/class/ReactionCollector
Thank you
how exactly are you overwriting it?
And as always you can ask for help from the pros in this channel (just not me xD)
this community is prob the best discord community tbh
@tired panther bruh
hmm
why?
you aren't defining a value for jb in the first place
so naturally doing math on an undefined variable returns NaN
ah , that is defined with 0
no it's not
you have to explicitly tell javascript that it's a number with a value zero
Works perfectly fine fo rme.
let me try xD
if you just put let <variable name> and a semicolon then it's value is set by NaN by default
huh
when i tested earlier it was saying NaN but ok
why not just newop.joins++
he's not changing the original variable
nevermind he is
But he could probably do that
is he even here
am i allowed to use json for testing?
No.
Lol
what does API latency mean?
the amount of time an api takes to respond to its api call.
thanks
708 verbose Windows_NT 10.0.18363
709 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "ci"
710 verbose node v12.16.3
711 verbose npm v6.14.4
712 error code ELIFECYCLE
713 error errno 3
714 error zlib-sync@0.1.7 install: `node-gyp rebuild`
714 error Exit status 3
715 error Failed at the zlib-sync@0.1.7 install script.
715 error This is probably not a problem with npm. There is likely additional logging output above.
716 verbose exit [ 3, true ]```trying to install zlib-sync
time to ping tim
he probably knows whats going on because he made a discord lib too :D
aw shucks he's offline
Did you install build tools
yeah
Hi, how its possbile..
My bot without shard showning ~20k members, but when i using shards (5) then my bot showing ~13k members
probably have to reinstall
you're getting the member count from one shard instead of them all
nah i getting from all shards
code?
thats output [ [ 46, 51, 54, 44, 55 ], [ 1256, 1955, 6127, 2425, 1547 ] ]
also 5 shards at 20k members- how many servers?
250
one shard is enough at that size
Yeah im know but my bot is 24/7 free radio, so you know
shards split the member count across the shards
const Embed = new Discord.MessageEmbed()
.setColor('#f02016')
.setTitle(`Among Us Night at 6:00pm!`)
.setDescription(`Today will be a special night!`)
.setDescription(`Tonight ATB will be playing Among Us while Recording with everyone in this server!`)
.setFooter('Among Us Youtbe Night!')
message.channel.send(Embed);
}``` only one of the description on the embed works what do i do?
Quick question im doing a money system and if I have $100 and I do db.add(database stuff, 50) would that give me $150 or $10050?
k
Hmm
what database?
thats quick.db
Quick.db
it should add
$150 if you're storing it as a number or $10050 if you're storing it as a string
Because strings basically glue together but numbers do... number stuff
Ok thanks
Ah, add not set
i am makking a bot which check if server get boosted then send a message and give a role to boosted member
when i tryed to get channel id by .find and send a message by .send it send is undifined
so is there way to fix that?
join the 2 sub arrays
what to do?
array.flat()
im asking why the member count is diffrent in shards and non sharded bot
bcs usually sharded bots used to be 2 different instances
@onyx wind send the code which calculates the member count
it still is with the sharding manager
You need to fetch the member count from each shard and add them up
right are build tools installed or is my pc potato https://alebot.is-inside.me/lJmtsYIe.png
saw it running for a few hours on a Pentium 2
shittttttttTTTTTTTTTTTT
is it hard to make a pagination system?
i just want my lib to work 
I just want you to stop wasting quality time doing programming when you can do h 
MAKE ME BITCH i am in pain
i even made h bot
yes xD, Did for someone else and he wantet easy to understand xD
but i made it first
stop programming start hing
no i want to program
what do u want to programm?
New out of box xD
it's that simple to make pagination systems why didn't anyone tell me about this package
lol
never heard from it to xD
I used a array embed[i]
that worked for me
wait
do i have to do something in cloud flare
Nah
I don't think you can
oh
my pagination system for my help command is finally working
🎉
thanks
@pale vessel this is right, right ?
Yes
how can I convert an array buffer which is a webp to a jpg array buffer
can i unfork after that ?
did you try using the webp conversion thing
Sure yes
oh ok
Wait until it gets merged
it converts buffers to webp
so now i wait for the admin
and I want
the opposite
const pic = await axios.get(url, {
responseType: 'arraybuffer',
})
what was the permission that lets you remove reactions
I mean this arrayBuffer
need to convert this arraybuffer (webp array buffer) to a jpg buffer
ok
but
I don't want to convert images to webp
I want to convert webp images to jpg
still
it says for converting other image formats to webp
@pale vessel you need a bonk with a newspaper your mind no work today eh
not converting webp to jpg
what
Wdym
@pale vessel how long u watied?
I don't remember
but i have to wait for the admin right ?
Yes
ok
yes, it does that
also I want to convert buffers
not files
I don't want to write the buffer as files
Not sure if there is any other way but you can still just use a temp path
There's a module for it that uses the same tool https://www.npmjs.com/package/webpconv
Only accepts a path though
is there a way i can find the difference between 4 numbers in cpp by using functions
Brain can help
Yeah, ping Brain I guess
everything in google shows only for 2 numbers but none for 4
All 4 numbers need to be the same?
no like input 4 different numbers
and then it shows the difference between all of them
Just subtract them no?
#include <iostream>
#include<conio.h>
using namespace std;
int main() {
// Declare Variables
int *p1, *p2;
int num1, num2, diff;
cout << "Pointer Example C++ Program : Find a difference between two Numbers \n";
cout << "\nEnter Two Numbers for Find a Difference : \n";
cin>>num1;
cin>>num2;
p1 = &num1;
p2 = &num2;
diff = *p1 - *p2;
cout << "Difference :" << diff;
getch();
return 0;
}
``` is there a way i could modify this and make it 4
i mean i did try but idk if i did it right
C++ ?
same
i have basics but not so deep
mhm
I guess, my issue is the question asking for a mathematical difference, or if they are just different.
math question
if i have an array of commands:
bot.commandsArray = [...bot.commands.values()];
and I'm making a pagination system where every page has a max of 3 commands
how would i calculate how many pages I'd need?
For example, the difference between 2 and 6 is 4.
If they are diffrent is true.
i tried Math.round(bot.commandsArray.length / 3); but it doesn't work
LOL
how the fuck would someone find the difference between four numbers
I smh fixed it
I have no clue how
But I fixed it
P O G G E R S
is there any way to get data from a json without reading the entire thing?
No
oof
{
"embed" : {"color": "#8a2be2", "nothing": "test"}
}
```` thats a json file, why can not I access color
How are you trying to access the color
Also is that the entire json file
Because if so you are missing the {
} around it
see again, forgot to copy that
embed.color
JS?
Can you share the code?
testmessage.setColor(embed.color)
For getting the obj from json
Any error?
annot read property 'color' of undefined
at Object.execute (C:\Users\shahn\3D Objects\Botcode\sharding\commands\command.js:20:41)
Can you assign variables like that?
wdum?
Yes, you can.
so why isnt it working?
its saying i need to join voice channel but im already in voice channel! ```
const voiceChannel = message.member.voice.channel;
if(!voiceChannel) return message.channel.send('You need to join voice chat to use this command!');```
You could just do this I think: const config = require('../config.json'); and then config.embed.color
then I have to export the module, yes that is a solution
If that works then you're just not reading the json file correctly
message.channel.send(client.errors.genericError + err.stack).catch();
TypeError: Cannot read property 'genericError' of undefined
Why am I getting this error?
bcs errors is not defined
did you define client.errors?
its client.error
?
thats an event not a property lol
there is no client.error or client.errors
client.error is a thing
trying to install zlib-sync
C:\cygwin64\home\h\coding\github\our.discord\node_modules\zlib-sync>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-b
in....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
The system cannot find the path specified.
i have build tools installed
but yea its an event
where is client.error a thing?
forget about it its an event
@pure lion do you really know assembly
do you really have build tools installed? also python installed?
can you show the full logs?
@willow mirage Did you set up GitHub pages?
Oh
It was not merged
That was just a reviewer
You need to wait for the person with write access
Why would I lie about knowing assembly
that would take long ?
In a sec
Not sure
dice why are you here
It's not dice it's fake dice
fairly sure that's real dice
No it not real dice they fake dice
prove it
no one helped me 😦
are you using intents?
ye
do you have the 'GUILD_VOICE_STATES' intent?
ye
i have
@gusty quest I don't think you are a verified bot developer
I don't see the point in telling people things like that.
no for Kyoya
okay
@quartz kindle sorry I'm late, i re installed build tools and tried again
C:\cygwin64\home\h\coding\github\our.discord\node_modules\zlib-sync>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-b
in\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
The system cannot find the path specified.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta
but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! zlib-sync@0.1.7 install: `node-gyp rebuild`
npm ERR! Exit status 3
npm ERR!
npm ERR! Failed at the zlib-sync@0.1.7 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\h\AppData\Roaming\npm-cache\_logs\2020-12-12T17_50_32_066Z-debug.log```
a
how to convert a webp file into jpg
I tried webp-converter
but it just doesn't work for some reason
thing is the js file webp-converter runs in is in a folder
and outside of the folder is another folder with the images
and so on
where is the webp coming from?
images/87035804367.webp
and the js file with the webp-converter in it is in
events/scan.js
is it your file or is it from discord
do you have node-gyp? npm install -g node-gyp
yes
my file
why not just convert it online
what's so special about your files in your images dir
I just want to covert the webp to jpg
they're most probably static so why not convert them now
they aren't static
that sounds like a bad idea
the bot downloads one and puts it in the images
and then has to use that one
basically temporary images
that sounds like a really really bad idea
I did
are you using them only once? or you do need them multiple times across restarts?
im using the images only once
https://slurpfire.xyz/images/YMGq0.png Any idea how to make it look like this with css? I did try but it made all the text go away 
and I need to download convert the webp too
why?
cuz im doing image processing and that one has to be with a local file
just use codeblocks, that should work fine.
same as in discord.
just don't question it I just need local image files ok
Krista did you tried to remove the entire node modules and reinstall?
image processing from local files is such a waste of resources
@glass nacelle i did npm ci
Hello guys who now how will be the code for a webhook like this but need in c#
then switch
tfjs-node to be exact
does it accept png buffers?
yeah
try
npm cache clean --force
and delete the package.lock
try using the sharp library
its one of the best image manipulation libs for node
it supports webp input and output
Hello, I'm using Discord.js. Is it possible to listen to an event that fire when the bot leave a guild?
OK nice thx
how do i make folders in a github repo?
i have mmy bot create a role on setup
but how do i like
after its created get the roles id
@pure lion do you have any alias commands or any custom cmd commands?
i found this on a similar github issue
SOLVED
Had nothing to do with path, nothing to do with python 3 vs 2 (although I think python 2 is still required), nothing to do with version, or with apm vs installing in atom (which I did check).
I had previously installed some alias commands for windows by setting my registry HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun to point at an alias file. I had completely forgotten about doing this however. Removing this key solved everything
also other similar issues point to this SO: https://stackoverflow.com/questions/15485632/node-js-npm-error-message-system-cannot-find-the-path-specified
I just read webp as weeb you weebs
this is what I did now
lol
very buff
💪
don't question why the url is a path
just
don't question that
@marble juniper why no file:// protocol in url
Why the URL is the path?
looool
alias of which command in particular
tim how do i remove the value of HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
Im curious:
Can discord bots stream in a voice channel?
people are talking about it but theres no method
never used regedit?
regedit
uh open regedit?
undocumented
removed actually
ah regedit
iirc
where is that
just type regedit
win search bar
windows + R -> regedit
a h
All right sir do you see that flag icon on your keyboot?
lmao
I can change it to buffers tomorrow
I worked on my bot for 10 hours straight
without breaks
im tired af
knock yourself out with a pan
Just one
2 (at most)
ReferenceError
do i do
they can iirc
1 shard is up to 2500 lol
tiM ItS NoT ThErE
yea its up to 2500
i would start looking into sharding with 800 guilds
recommended is 1 shard for every 1000
which means that it's removed
since discord recomends 1k servers per shard
im so confused
im using 2000 per shard
tim i havent deleted it or anything
try other solutions in that stackoverflow link
oof
oof
Hahaha
and they dont stop coming and they dont stop coming and they dont stop coming https://alebot.is-inside.me/t6w2VuXv.png
oof

i once accidentally deleted my db and it was like 25 files and 35 thousand items
my manga folder is 500k items
my pc is so slow
mines like fucking 40gb wtf do you keep on there
286 manga titles
oh never mind its done
that extra 20gb better be sfw tim or else 
95% of it is sfw
@quartz kindle https://alebot.is-inside.me/rINYSfk6.png
That locale mix 
fuCK
im pretty sure its cygwin's fault
that physicly hurts
sdiojghsduihgosidhg
where does it hurt? arms? legs?
no comment
Boomer


stop using these "newish" words...
ok zommer poggerssssssssssss!!
@quartz kindle should i try it on my vps or just in a different dir outside of cygwin?
well i used yarn and it works but with npm it did't
ah
gonna install yarn
yarn to the rescue lmao
ynra
Any idea on why the icons I try to link to fontawesome don't show up? This is a HTML question, sorry if i'm breaking rules or anything, just need some help
Oh
Link would be link rel="" href=""
Still doesn't show up though
<script src="https://kit.fontawesome.com/dd4ae8d29b.js" crossorigin="anonymous"></script>
Like this?
Yes
Yeah don't want to show up
Try adding it at the bottom instead
@tight bronze add defer to the script tag
is he trying to use a script tag in the description
What do you mean?
Yeah
Oh god, it's not their website?
ah
script tags can't be used in descriptions
unless you're tim colour
thats what I wanted to say lol
You need to use FontAwesome's CSS
yeah
Ah
you can use iframes
no script tags
in top.gg scripts are not allowed you will need to use the css
<link
rel="stylesheet"
href="https://use.fontawesome.com/releases/v5.12.0/css/all.css"
/>
Ah I'll try that then thanks
Yeah alright
HELP PLSSSSSSSSError: /home/container/node_modules/better-sqlite3/build/Release/better_sqlite3.node: invalid ELF header at Object.Module._extensions..node (internal/modules/cjs/loader.js:1065:18) at Module.load (internal/modules/cjs/loader.js:879:32) at Function.Module._load (internal/modules/cjs/loader.js:724:14) at Module.require (internal/modules/cjs/loader.js:903:19) at require (internal/modules/cjs/helpers.js:74:18) at bindings (/home/container/node_modules/bindings/bindings.js:112:48) at Object.<anonymous> (/home/container/node_modules/better-sqlite3/lib/database.js:9:24) at Module._compile (internal/modules/cjs/loader.js:1015:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10) at Module.load (internal/modules/cjs/loader.js:879:32)
😦
did you copy your node_modules to a unix machine lol
most likely
One message removed from a suspended account.
body {
height: 100vh;
background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
overflow: hidden;
filter: drop-shadow(0 0 10px white);
}
@function random_range($min, $max) {
$rand: random();
$random_range: $min + floor($rand * (($max - $min) + 1));
@return $random_range;
}
.snow {
$total: 200;
position: absolute;
width: 10px;
height: 10px;
background: white;
border-radius: 50%;
@for $i from 1 through $total {
$random-x: random(1000000) * 0.0001vw;
$random-offset: random_range(-100000, 100000) * 0.0001vw;
$random-x-end: $random-x + $random-offset;
$random-x-end-yoyo: $random-x + ($random-offset / 2);
$random-yoyo-time: random_range(30000, 80000) / 100000;
$random-yoyo-y: $random-yoyo-time * 100vh;
$random-scale: random(10000) * 0.0001;
$fall-duration: random_range(10, 30) * 1s;
$fall-delay: random(30) * -1s;
&:nth-child(#{$i}) {
opacity: random(10000) * 0.0001;
transform: translate($random-x, -10px) scale($random-scale);
animation: fall-#{$i} $fall-duration $fall-delay linear infinite;
}
@keyframes fall-#{$i} {
#{percentage($random-yoyo-time)} {
transform: translate($random-x-end, $random-yoyo-y) scale($random-scale);
}
to {
transform: translate($random-x-end-yoyo, 100vh) scale($random-scale);
}
}
}
}
Any idea on why this doesn't work?
I have
<div class="snow"></div>
A lot of these after
https://npmjs.com/@top-gg/sdk use this. dblapi.js is deprecated
@quartz kindle how do fix https://cdn.yxridev.com/u/GsDCg08F.png
change your column encoding to utf8mb4
@quartz kindle I did that but still the same issue https://cdn.yxridev.com/u/Yz75dbIR.png
You may also have to set the server property character_set_server to utf8mb4 in the MySQL configuration file.
to save the data with utf8mb4 needs to make sure:
character_set_client, character_set_connection, character_set_results are utf8mb4: character_set_client and character_set_connection indicate the character set in which statements are sent by the client, character_set_results indicates the character set in which the server returns query results to the client.
See charset-connection.the table and column encoding is utf8mb4
Hello bot does not execute the hug command
what is the code?
Do someone know how to read an embed message from a bot with another (py)?
I don't know the code, I don't understand the bots, but the bot is on the server!
we don’t offer support for other bots
I tried many thing but i don't find how
@quartz kindle I did all the things but it just does the same thing I dont really understand the last step tho
@misty sigil but thank you for your time
The last step is an advice/order
When you create a column, you must chose a type, and you need to avoid some
you could run an query to alter your complete DB
yeah all my collums have the right encoding but Im just getting the same Incorrect string value: '\xF0\x9F\x98\x8E C...' for column error
thank u
@molten yarrow when my bot tried to query the db to add a guild with emojis in the name it just breaks down and does nothing
yeah i know, i had the same issue long time ago
ALTER DATABASE
database_name
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci;
run the query but change the db name to yours
still giving the same error
did your restart your mysql server?
you want me to restart it everytime I run these commands
same error AGAIN https://cdn.yxridev.com/u/NmwF7Ich.png
you can try alter the table aswell, maybe it helps
MessageReactionAdd:
const guildModel = require('../models/GuildConfig');
const createTicket = require('../functions/createTicket');
module.exports = async (client, reaction, user) => {
if(reaction.message.partial) await reaction.message.fetch();
if(reaction.partial) await reaction.fetch();
if(user.bot) return;
var guild = reaction.message.guild;
var guildDoc = await guildModel.findOne({
guildID: guild.id,
guildName: guild.name
});
if(reaction.message.channel.id === '784323767819173908') {
if(reaction.emoji.name === '🎟') {
createTicket(guild, user, guildDoc);
}
}
}
Create Ticket Function:
module.exports = async (guild, user, guildDoc) => {
guildDoc.get('ticketCount') += 1;
await guildDoc.save();
const ticketChannel = await guild.channels.create(`ticket-${guildDoc.get('ticketCount')}`, {
type: 'text',
permissionOverwrites: [
{
allow: ['VIEW_CHANNEL', 'SEND_MESSAGES'],
id: user.id
},
{
deny: ['VIEW_CHANNEL', 'SEND_MESSAGES'],
id: guild.id
}
]
});
}
I got this error:
(node:38456) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of null
Message Event:
const { MessageEmbed } = require('discord.js');
module.exports = async (client, message) => {
if(message.author.bot) return;
if(message.channel.type == 'news') return;
if(message.channel.type == 'dm') return;
const prefix = '?';
if(!message.content.startsWith(prefix)) return;
if (!message.member) message.member = await message.guild.fetchMember(message);
const args = message.content.slice(prefix.length).trim().split(/ +/g);
if(message.content.startsWith(prefix + 'new')) {
let embed = new MessageEmbed({
timestamp: new Date,
color: '#9237bd',
description: 'React with 🎟 for open a ticket.'
});
const msg = await message.channel.send({ embed: embed });
msg.react('🎟');
}
}
all the collums have the correct encoding and im pretty sure the tables do too
yeah they do https://cdn.yxridev.com/u/DqosUcu5.png
Someone can help me?
clearly guildDoc is undefined. Probabaly because guildModel.findOne() returned nothing.
What i do now (sorry for my english)
Fix the query if you're sure it should return something. If it can return undefined, you need to stop the function before it continues so it doesn't crash.
in messageReactionAdd since that's where guildDoc would be undefined.
doesn't work ):
can you log the full string you're trying to save?
its trying to save 😎 CLUB PS3 😎
@umbral zealot probably i don't have I did' t understand anything of what you meant as I am not English
can you try using a show query?
how do I do this
i think from mysql cli
Here is the code
show INSERT INTO ...
ight hold on
Other than "learn programming" I'm not sure what I can say to help.
[ERROR HANDLER]: Error: ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect string value: '\xF0\x9F\x98\x8E C...' for column 'guildName' at row 1
[ERROR HANDLER]: Error: ER_PARSE_ERROR: 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 'INSERT INTO `guild-data` (guildName, guildID) VALUES ('???? CLUB PS3 ????', '779' at line 1```
thats what it outputted
No one answered my question sadly! 😦
avoid using var btw
@quartz kindle halpppp #development message
thats all it shows?
yes
what if you insert something without emojis
it works fine without emojis
what does it output
uhh ill check
the show stops it from working
same error as the other guild
testing the emojis guild again it still doesnt work
same emoji invalid thing error
uh i forgot, add this to your code where you create mysql connection
"charset" : "utf8mb4"
lmao
nice :3
who needs a Tim when you have an Alina
only because i had the same problems.... xDD


