#development

1 messages · Page 1447 of 1

young flame
#

it does

lusty quest
#

validate it inside your command

young flame
#

i even tried with a id

lusty quest
#

how did you fetch the channel?

eternal osprey
#

should i maybe create a client.on("message", messaeg)? Riht now i only have one for guildmemberadd.

lusty quest
eternal osprey
#

yeah

lusty quest
#

this starts a small questionary

#

how did you get message inside the event?

#

since its not there by default

young flame
eternal osprey
#

yeah that is the problem

lusty quest
young flame
#

o

eternal osprey
young flame
#

ok

lusty quest
eternal osprey
#

okay i will try.

#

yeah i have stored the last sent message

#

how do i actually get the channel it is in?

lusty quest
#

you can just get it from the message object

#

so

young flame
lusty quest
#
msg = await user.send("wellcome")

then 
msg.channel.createMessageCollector()
eternal osprey
#
 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.

lusty quest
#

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

eternal osprey
#

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'createMessageCollector' of undefined

lusty quest
#

hmm

lusty quest
eternal osprey
#
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.

lusty quest
#

you you use then. the message variable will be not defined. you can pass it in there with a lambda function

eternal osprey
#

lambda is return value right?

lusty quest
#

if you pass it in with the lambda function you dont need to store the message object

#

=>

eternal osprey
#

okay hmm.

lusty quest
#

.then(msg=> msg.channel.createMessageCollector()

#

something like this

young flame
eternal osprey
#

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

lusty quest
#

yea bcs the message is probably empty

eternal osprey
#

yeah

young flame
#

H

lusty quest
#

i would use awaitmessage

lusty quest
eternal osprey
young flame
#

UnhandledPromiseRejectionWarning: TypeError: message.guild.channels.fetch is not a function

lusty quest
# eternal osprey awaitmessaeg where?
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
young flame
#

@lusty quest is message.guild.channel.delete(); a thing?

lusty quest
young flame
#

message.channel.delete(); ??

lusty quest
#

this will work

young flame
#

ok brb

#

it doesnt have to get the channel by name to see if its a ticket

#

i mean

#

H

#

idkkk

eternal osprey
#
 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

lusty quest
#

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

eternal osprey
#

i am going to save it to mongodb

lusty quest
#

but encrypt user informations.

eternal osprey
#

but i first need to have the base down

lusty quest
#

you dont want some lawsuite bcs some chinese guy hacked into your vps

eternal osprey
#

okay.

#

yeah i understand.

lusty quest
# eternal osprey ```js const message = await author.send("Please write down your email starting ...
 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
eternal osprey
#

but

#

basically if i go to the dm and type my mail

#

it doesn't save to the file.

lusty quest
#

idk never worked with files. they are annoying to work with

#

also insecure and easy to corrupt

eternal osprey
#

ah okay! Thanks for the huge help btw!

young flame
#

@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?

lusty quest
#

would use the reaction add event

#

this way it will always work and dont depend on any collectors

young flame
#

but would'nt that be for like any reaction with the check?

lusty quest
#

yea but you should filter out that it works only with the wanted conditions

young flame
#

hm

lusty quest
#

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

eternal osprey
#
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?
earnest phoenix
#

you shouldn't save to the file in the first place

eternal osprey
#

i know

#

but it is just the base

earnest phoenix
#

it doesn't support concurrency

eternal osprey
#

i am going to save it to mongodb later on

#

but it does not send any errors or whatsoever.

lusty quest
#

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

lusty quest
#

also you could just use the author of the collected message to the the username

whole knot
#

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()
lusty quest
#

just dont send anything?

#

wait nvm

lusty quest
#

to revert it pass false

whole knot
#

You mean like client = await channel.connect().setDeaf(True)?

#

true does not work here

lusty quest
#

if you use js or ts

earnest phoenix
#

read the doc link i sent you

whole knot
earnest phoenix
#

...ok?

whole knot
#

I read the docs indeed, otherwise I would not be here :)

earnest phoenix
#

the method i sent you is the one you need to use

whole knot
#

Removing * causes also new errors

earnest phoenix
#

you cannot just

#

copypaste from the docs lol

whole knot
#

Well, someone was trying to help me and said this could be done like this 🤔

earnest phoenix
earnest phoenix
whole knot
#

Do not offend friends of mine, thanks 😄

#

We all make mistakes

loud ingot
#

@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 Confused_Shrek

whole knot
#

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
#

that method is on a guild

#

as per docs

loud ingot
#

@earnest phoenix come pls

earnest phoenix
#

which im starting to doubt you actually read

loud ingot
#

Bauzy help this guy

loud ingot
earnest phoenix
#

oh my fucking god

#

we stan a minimodder

whole knot
#

Well, I just want to change it in one guild so where am I wrong? 😅

loud ingot
earnest phoenix
#

the method needs to be called on a guild object

#

not on a VoiceClient

loud ingot
#

So @earnest phoenix come here pls

earnest phoenix
loud ingot
whole knot
#

@loud ingot Oh, no problem, thanks for your time mate! 😋

eternal osprey
#

const list = client.guilds.cache.get("734123033782124575")

lusty quest
summer torrent
#

did you enable GUILD_MEMBERS intent

lusty quest
#

i would just get the author of the collected message.

eternal osprey
#

because i have to get the member object right?

lusty quest
#

why?

#

there is no need

#

you dont want to give it a role

#

or something in this direction

stark abyss
#

okay so I have a number like Date.now() in js how can I change that to something like 1 hour 1 min ago

earnest phoenix
#

check out humanizer

summer torrent
#

moment js ?

stark abyss
#

ok ty

quartz kindle
#

or just do simple math?

eternal osprey
#

list.members.cache.map(

#

so it would become:

stark abyss
#

yeah i made a function instead

eternal osprey
#
fs.writeFileSync("./members.txt", return member.user.username + " " + member.message.first().content}).join("\n")); 
       }).catch(error => {```
quartz kindle
#

error: illegal return statement

lusty quest
eternal osprey
#

yeah

#

exactly what i am doing now

lusty quest
#

removes some unnecesary code

eternal osprey
#
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
eternal osprey
lusty quest
#

bcs it makes no sense

#

you try to get something from the member object that is idk where defined

eternal osprey
#

hmm okay

earnest phoenix
#

you can use collected.first() to get the message

#

then get the content, author, attachments etc. whatever you want

eternal osprey
#

aha okay!

earnest phoenix
eternal osprey
#

console.log(${collected.first().author} + ${collected.first().content}) like this right

earnest phoenix
#

yep

eternal osprey
#

doesn't do anything either, btw i already looked at the docs.

earnest phoenix
#

remove the await

eternal osprey
#

i have 2 awaits

#

the await message.channel.....

earnest phoenix
eternal osprey
#

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()
     });```
earnest phoenix
#

Are you trying to collect the message in their DM?

eternal osprey
#

yeah.

earnest phoenix
#

<message>.channel<User>.dmChannel

eternal osprey
#

member.dmChannel would work too right?

earnest phoenix
#

No

#

member.user

eternal osprey
earnest phoenix
#

just replace message.channel to author.dmChannel

eternal osprey
#

(node:5744) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'awaitMessages' of undefined

earnest phoenix
#

Did you do author.dmChannel?

#

wait what is "author"

#

guildmember or user

#

If so what did you define author as

eternal osprey
#

member coming from the client.on

earnest phoenix
#

msg.member or msg.author

#

author.user.dmChannel

#

yes try this ^^

#

Assuming author is a guild member

eternal osprey
#

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()
     });
    ```
earnest phoenix
#

You should always use a collector instead of awaiting them

regal current
#

b!badges

earnest phoenix
eternal osprey
#

guys it worked!

#

thanks!

earnest phoenix
#

🎉

#

Np

eternal osprey
#

 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

earnest phoenix
#

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'
})```
sudden geyser
#

noop

pale vessel
#

Unfortunately not

earnest phoenix
#

Can someone host my bot for free?

#

Pls

sudden geyser
#

noop

earnest phoenix
#

😦

#

How i get bot developer role?

pale vessel
#

Submit a bot to the list

#

and get it approved

sudden geyser
umbral zealot
#

people still asking 4 months after the badge was removed smh

pale vessel
#

Evie, may I know whether I can still get the Verified Bot Developer badge or not? I'm really looking forward to it. Thanks. 🥺

umbral zealot
#

har har har

pure lion
#

im trying to install the typescript compiler but

#

-g isn't setting to path

#

and when i clone i get that error

earnest phoenix
#

npm install -g typescript

#

then try tsc

#

yo

pale vessel
#

yo

earnest phoenix
#

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

pale vessel
#

Up to you

pure lion
earnest phoenix
sudden geyser
#

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

pale vessel
#

For me it's the first since I have a lot of commands

lusty quest
#

buttons will be most likely easyer

#

and less spammy

pale vessel
#

If you have a reaction for every category, yeah

earnest phoenix
#

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

pure lion
#

how do i put stuff on path

#

this is so annoying

earnest phoenix
#

so there seems to be a problem with my command handler

pure lion
#

yes?

sudden geyser
#

oh no

earnest phoenix
#
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

pale vessel
#

xd just use ?.

earnest phoenix
#

i can literally just put ["none"]

sudden geyser
#

If you're using Node.js v14 I recommend you use ?. btw

earnest phoenix
earnest phoenix
#

fixed

#

thank you guys

eternal osprey
#
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.

umbral zealot
#

Did you know writing user information to disk without their explicit was against the discord terms of service?

eternal osprey
#

they literally are being told that this is being saved

umbral zealot
#

Ok then use a database that's secured and encrypted, as per ToS.

eternal osprey
#

i will.

lusty quest
#

told him this already a while ago

eternal osprey
#

i am just doing this for now.

earnest phoenix
umbral zealot
#

Ok don't do this for now. Don't break the ToS "for now". That's still breaking the ToS.

lusty quest
#

just spin up a local MongoDB server instead of waiting for the deployment

umbral zealot
#

You don't temporarily break the law. You just don't.

lusty quest
#

as you said you want to use Mongo

eternal osprey
#

but right now i am not deploying the bot.

#

i am testing it on my own.

umbral zealot
#

Then don't write this code

#

Period.

#

We will not help you break the terms of service.

surreal prawn
#

Hello

lusty quest
#

writing bad code for "testing" is bad practise anyways

earnest phoenix
#

bruh his enitre hard disk might be protected

surreal prawn
#

i need help with something

#

im kinda new into making bots

earnest phoenix
#

you are always welcome to ask for help

surreal prawn
#

can anyone tell me how i can make a bot give a role when you react to a message

earnest phoenix
#

😄

eternal osprey
#

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.

umbral zealot
earnest phoenix
umbral zealot
#

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.

eternal osprey
#

have you ever heard of people being taking into custody, for hacking their own computer?

surreal prawn
pure lion
#

trying to write a discord lib, i need zlib-sync but

umbral zealot
#

That is besides the point. It's breaking the ToS, we won't help you.

pure lion
#

im not sure what to do here

eternal osprey
umbral zealot
#

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.

eternal osprey
umbral zealot
#

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.

eternal osprey
#

i will migrate it to a more secure database.

umbral zealot
#

Good! 👍

tired panther
#
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"
earnest phoenix
surreal prawn
#

Thank you

umbral zealot
earnest phoenix
#

And as always you can ask for help from the pros in this channel (just not me xD)

surreal prawn
#

this community is prob the best discord community tbh

tired panther
#
 let jb;
   jb = jb+1 ;
    
    newop.leaves = jb ;
#

@umbral zealot like that

earnest phoenix
#

@tired panther bruh

umbral zealot
#

hmm

tired panther
earnest phoenix
#

you aren't defining a value for jb in the first place

#

so naturally doing math on an undefined variable returns NaN

tired panther
earnest phoenix
#

no it's not

#

you have to explicitly tell javascript that it's a number with a value zero

umbral zealot
tired panther
#

let me try xD

earnest phoenix
#

if you just put let <variable name> and a semicolon then it's value is set by NaN by default

umbral zealot
#

I mean no it's set to undefined 😛

#

but of course undefined + 1 is NaN

earnest phoenix
#

when i tested earlier it was saying NaN but ok

quartz kindle
#

why not just newop.joins++

earnest phoenix
#

nevermind he is

umbral zealot
#

But he could probably do that

earnest phoenix
#

is he even here

eternal osprey
umbral zealot
#

No.

quartz kindle
#

Lol

earnest phoenix
#

what does API latency mean?

eternal osprey
earnest phoenix
#

thanks

pure lion
#
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

pale vessel
#

Did you install build tools

pure lion
#

yeah

onyx wind
#

Hi, how its possbile..

My bot without shard showning ~20k members, but when i using shards (5) then my bot showing ~13k members

pure lion
#

probably have to reinstall

pure lion
onyx wind
#

nah i getting from all shards

pure lion
#

code?

onyx wind
#

thats output [ [ 46, 51, 54, 44, 55 ], [ 1256, 1955, 6127, 2425, 1547 ] ]

pure lion
#

also 5 shards at 20k members- how many servers?

onyx wind
#

250

pure lion
#

one shard is enough at that size

onyx wind
#

Yeah im know but my bot is 24/7 free radio, so you know

lusty quest
#

shards split the member count across the shards

red coral
#
        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?
onyx wind
#

you cant set 2 descriptions

#

use \n indstead

main trench
#

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?

red coral
#

k

pale vessel
#

Just 50

#

It replaces it

main trench
#

Hmm

onyx wind
#

thats quick.db

main trench
#

Quick.db

lusty quest
#

it should add

earnest phoenix
pale vessel
#

Ah, add not set

atomic vault
#

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

onyx wind
lusty quest
#

join the 2 sub arrays

onyx wind
#

thats non sense

pure lion
#

array.flat()

onyx wind
#

im asking why the member count is diffrent in shards and non sharded bot

lusty quest
#

bcs usually sharded bots used to be 2 different instances

earnest phoenix
#

@onyx wind send the code which calculates the member count

lusty quest
#

it still is with the sharding manager

sudden geyser
#

You need to fetch the member count from each shard and add them up

pure lion
lusty quest
#

saw it running for a few hours on a Pentium 2

pure lion
#

shittttttttTTTTTTTTTTTT

earnest phoenix
#

is it hard to make a pagination system?

pure lion
#

i just want my lib to work ooohhhhh

earnest phoenix
earnest phoenix
#

i even made h bot

tired panther
pure lion
#

but i made it first

earnest phoenix
#

stop programming start hing

pure lion
#

no i want to program

earnest phoenix
#

noob

#

🇳 🇴 🇴 🇴 🇴 🇴 🇧

tired panther
#

what do u want to programm?

tired panther
earnest phoenix
#

it's that simple to make pagination systems why didn't anyone tell me about this package

tired panther
#

never heard from it to xD

#

I used a array embed[i]

#

that worked for me

delicate shore
#

Getting number of current voice connections of my bot

#

discord.js

#

V12

pale vessel
#

client.voice.connections.size

willow mirage
#

@pale vessel help me

#

so now what

pale vessel
#

wait

willow mirage
#

do i have to do something in cloud flare

pale vessel
#

Nah

willow mirage
#

but how i can connect it to cloud flare

#

@pale vessel ?

pale vessel
#

I don't think you can

willow mirage
#

oh

earnest phoenix
#

my pagination system for my help command is finally working

pale vessel
#

🎉

earnest phoenix
#

thanks

willow mirage
pale vessel
#

Yes

marble juniper
#

how can I convert an array buffer which is a webp to a jpg array buffer

willow mirage
#

can i unfork after that ?

pale vessel
#

did you try using the webp conversion thing

pale vessel
marble juniper
#

yeah

#

but

willow mirage
#

oh ok

pale vessel
#

Wait until it gets merged

marble juniper
#

it converts buffers to webp

willow mirage
#

so now i wait for the admin

marble juniper
#

and I want

#

the opposite

#
const pic = await axios.get(url, {
  responseType: 'arraybuffer',
})
earnest phoenix
#

what was the permission that lets you remove reactions

marble juniper
#

I mean this arrayBuffer

pale vessel
marble juniper
#

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

earnest phoenix
#

@pale vessel you need a bonk with a newspaper your mind no work today eh

marble juniper
#

not converting webp to jpg

pale vessel
#

what

earnest phoenix
#

you keep reading questions wrongly

pale vessel
marble juniper
#

I have an array buffer

#

which is a webp

#

and I want to convert that

#

to jpg

willow mirage
#

@pale vessel how long u watied?

pale vessel
pale vessel
marble juniper
#

I want to convert the buffer

#

thats all

willow mirage
#

but i have to wait for the admin right ?

pale vessel
#

Yes

willow mirage
#

ok

pale vessel
marble juniper
#

also I want to convert buffers

#

not files

#

I don't want to write the buffer as files

pale vessel
#

Not sure if there is any other way but you can still just use a temp path

#

Only accepts a path though

slender wagon
#

is there a way i can find the difference between 4 numbers in cpp by using functions

pale vessel
#

Brain can help

slender wagon
#

I am stuck, it is for my homeworks but i don't know shit abt cp

#

cpp*

pale vessel
#

Yeah, ping Brain I guess

slender wagon
#

everything in google shows only for 2 numbers but none for 4

solemn latch
#

All 4 numbers need to be the same?

slender wagon
#

no like input 4 different numbers

#

and then it shows the difference between all of them

solemn latch
#

Just subtract them no?

slender wagon
#
#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

willow mirage
#

C++ ?

slender wagon
#

yes

#

that's why i have no clue abt this

willow mirage
#

no clue

#

im not good in C++

slender wagon
#

same

willow mirage
#

i have basics but not so deep

slender wagon
#

mhm

solemn latch
#

I guess, my issue is the question asking for a mathematical difference, or if they are just different.

earnest phoenix
#

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?

solemn latch
#

For example, the difference between 2 and 6 is 4.
If they are diffrent is true.

earnest phoenix
#

i tried Math.round(bot.commandsArray.length / 3); but it doesn't work

earnest phoenix
#

ikr

#

dumb

slender wagon
#

my homeworks require this but with 4 numbers, it kinda got me confused lmao

earnest phoenix
slender wagon
#

i have no clue

#

that's what my hw says

earnest phoenix
#

I smh fixed it
I have no clue how
But I fixed it

P O G G E R S

crimson vapor
#

is there any way to get data from a json without reading the entire thing?

pale vessel
#

No

crimson vapor
#

oof

tired panther
#
{
"embed" : {"color": "#8a2be2", "nothing": "test"}
}

```` thats a json file, why can not I access color
hollow sedge
#

How are you trying to access the color

#

Also is that the entire json file

#

Because if so you are missing the {

} around it

tired panther
tired panther
hollow sedge
#

JS?

tired panther
#

node js yes

#

any idea?

hollow sedge
#

Can you share the code?

tired panther
#

testmessage.setColor(embed.color)

hollow sedge
#

For getting the obj from json

tired panther
#

yes

#

const { prefix, owner , pinvite, embed} = require('../config.json');

pale vessel
#

Any error?

tired panther
#
annot read property 'color' of undefined
    at Object.execute (C:\Users\shahn\3D Objects\Botcode\sharding\commands\command.js:20:41)
hollow sedge
#

Can you assign variables like that?

tired panther
#

wdum?

hollow sedge
#

Like {prefix, owner, pinvite, embed}

#

Ig there wasn't an error tho

sudden geyser
#

Yes, you can.

tired panther
#

so why isnt it working?

gusty quest
#

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!');```

hollow sedge
tired panther
hollow sedge
#

If that works then you're just not reading the json file correctly

earnest phoenix
#

message.channel.send(client.errors.genericError + err.stack).catch();

#

TypeError: Cannot read property 'genericError' of undefined

#

Why am I getting this error?

lusty quest
#

bcs errors is not defined

quartz kindle
#

did you define client.errors?

lusty quest
#

its client.error

quartz kindle
#

there is no client.error or client.errors

lusty quest
#

client.error is a thing

pure lion
#

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

lusty quest
#

but yea its an event

quartz kindle
#

where is client.error a thing?

lusty quest
#

forget about it its an event

pure lion
#

am i invisible today

#

oh no

#

oh poo

hollow sedge
#

@pure lion do you really know assembly

willow mirage
#

@pale vessel help

#

it is approved but the website is not working

quartz kindle
#

can you show the full logs?

pale vessel
#

@willow mirage Did you set up GitHub pages?

willow mirage
#

yep

#

@pale vessel now wha

pale vessel
#

Oh

#

It was not merged

#

That was just a reviewer

#

You need to wait for the person with write access

willow mirage
#

ah

#

f

pale vessel
#

Not F, you'll be approved

#

more like Pog

pure lion
willow mirage
#

that would take long ?

pure lion
pale vessel
#

Not sure

pure lion
#

Hey flzae

#

I am coding

#

!!!

pale vessel
#

pog

#

!!!

misty sigil
#

dice why are you here

earnest phoenix
misty sigil
#

fairly sure that's real dice

earnest phoenix
#

No it not real dice they fake dice

misty sigil
#

prove it

misty sigil
#

are you using intents?

gusty quest
#

ye

misty sigil
#

do you have the 'GUILD_VOICE_STATES' intent?

gusty quest
#

ye

misty sigil
#

huh

#

weird

gusty quest
#

i have

earnest phoenix
#

@gusty quest I don't think you are a verified bot developer

gusty quest
#

ok.

#

i am

#

i have verifed bot

#

wdym

umbral zealot
#

I don't see the point in telling people things like that.

gusty quest
#

um for who did u say ?

#

for me?

umbral zealot
#

no for Kyoya

gusty quest
#

okay

pure lion
#

@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```
pure lion
marble juniper
#

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

pure lion
#

where is the webp coming from?

marble juniper
#

images/87035804367.webp

#

and the js file with the webp-converter in it is in

#

events/scan.js

pure lion
#

is it your file or is it from discord

quartz kindle
pure lion
#

yes

marble juniper
#

my file

pure lion
marble juniper
#

in images is the webp image

#

and in events the scan.js file

pure lion
#

why not just convert it online

marble juniper
#

everything has to be converted in node.js

#

*using node.js

pure lion
#

what's so special about your files in your images dir

marble juniper
#

I just want to covert the webp to jpg

pure lion
#

they're most probably static so why not convert them now

marble juniper
#

they aren't static

pure lion
#

that sounds like a bad idea

marble juniper
#

the bot downloads one and puts it in the images

#

and then has to use that one

#

basically temporary images

pure lion
#

that sounds like a really really bad idea

marble juniper
#

I JUST NEED TO CONVERT THE WEBP OK

#

aaaaaaaaaaaa

#

in nodejs

pure lion
#

fine

#

read the docs

marble juniper
#

I did

pure lion
#

hhhh

#

let me read them to you

#

are any errors being thrown? @marble juniper

quartz kindle
marble juniper
#

im using the images only once

opaque lake
marble juniper
#

and I need to download convert the webp too

quartz kindle
#

then just use them directly as buffers

#

no need to save to disk

marble juniper
#

I need to save to disk

#

in my code

quartz kindle
#

why?

marble juniper
#

cuz im doing image processing and that one has to be with a local file

umbral zealot
#

same as in discord.

marble juniper
#

just don't question it I just need local image files ok

glass nacelle
quartz kindle
#

image processing from local files is such a waste of resources

pure lion
#

@glass nacelle i did npm ci

marble juniper
#

well

#

I use tensorflow-js

#

and it doesn't accept webp buffers

light drift
#

Hello guys who now how will be the code for a webhook like this but need in c#

pure lion
marble juniper
#

tfjs-node to be exact

quartz kindle
#

does it accept png buffers?

marble juniper
#

yeah

quartz kindle
#

then convert to png in memory

#

even canvas can do that

marble juniper
#

how can I convert it then

#

the buffer

#

if it is webp

glass nacelle
pure lion
#

alrighty

#

Tim do you know whats going on with my pile of poo lib?

glass nacelle
#

and delete the package.lock

pure lion
#

alrighty

quartz kindle
#

its one of the best image manipulation libs for node

#

it supports webp input and output

subtle kiln
#

Hello, I'm using Discord.js. Is it possible to listen to an event that fire when the bot leave a guild?

quartz kindle
#

yes

#

guildDelete

subtle kiln
#

OK nice thx

pure lion
#

i deleted the lock and did a fresh install

#

same error when installing zlib-sync

static trench
#

how do i make folders in a github repo?

young flame
#

i have mmy bot create a role on setup

#

but how do i like

#

after its created get the roles id

quartz kindle
#

@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

earnest phoenix
marble juniper
#

this is what I did now

#

lol

#

very buff

#

💪

#

don't question why the url is a path

#

just

#

don't question that

earnest phoenix
#

@marble juniper why no file:// protocol in url

glass nacelle
#

Why the URL is the path?

marble juniper
#

looool

pure lion
quartz kindle
#

.toFormat("png").toBuffer()

pure lion
#

tim how do i remove the value of HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

stable eagle
#

Im curious:

Can discord bots stream in a voice channel?

pure lion
#

people are talking about it but theres no method

quartz kindle
#

never used regedit?

misty sigil
#

regedit

pale vessel
#

uh open regedit?

misty sigil
#

removed actually

pure lion
#

ah regedit

misty sigil
#

iirc

pure lion
#

where is that

pale vessel
#

just type regedit

misty sigil
#

win search bar

quartz kindle
#

windows + R -> regedit

pure lion
#

a h

misty sigil
#

or Win + R

#

and regedit

marble juniper
#

Im tired

pale vessel
#

All right sir do you see that flag icon on your keyboot?

quartz kindle
#

lmao

marble juniper
#

I can change it to buffers tomorrow

#

I worked on my bot for 10 hours straight

#

without breaks

#

im tired af

quartz kindle
#

knock yourself out with a pan

marble juniper
#

I make it buffers tomorrow

#

for now its files

#

lol

misty sigil
#

what

#

100 to 200 servers?

#

2, like, at most?

pure lion
#

el what

pale vessel
#

Just one

misty sigil
#

2 (at most)

pure lion
#

theres no autorun

#

flazepe

#

what the fuck

pale vessel
#

ReferenceError

pure lion
#

do i do

earnest phoenix
quartz kindle
#

1 shard is up to 2500 lol

pure lion
#

tiM ItS NoT ThErE

misty sigil
#

yea its up to 2500

lusty quest
#

i would start looking into sharding with 800 guilds

quartz kindle
#

recommended is 1 shard for every 1000

pale vessel
#

which means that it's removed

misty sigil
#

how about

#

1 shard per 100

lusty quest
#

since discord recomends 1k servers per shard

pure lion
#

im so confused

quartz kindle
#

im using 2000 per shard

pure lion
#

tim i havent deleted it or anything

misty sigil
#

use 1 per shard

#

watch discord burn

pure lion
#

i just opened regedit

#

nothing else

quartz kindle
pure lion
#

alrighty

#

not sure these would be the smartest to delete-

misty sigil
#

try it

#

and see

#

jk jk

pure lion
#

i suppose id just have to redo all my global installs

#

oh well

young flame
#

oof

pure lion
young flame
#

oof

pure lion
glass nacelle
#

Hahaha

pure lion
young flame
#

oof

boreal iron
young flame
#

i once accidentally deleted my db and it was like 25 files and 35 thousand items

pure lion
#

oh god...

quartz kindle
#

my manga folder is 500k items

young flame
#

oo nice

#

i have mines on a thumbstick

quartz kindle
#

its like 60gb or something lul

#

let me check

young flame
#

oh gpd

#

god

pure lion
#

my pc is so slow

young flame
#

mines like fucking 40gb wtf do you keep on there

quartz kindle
#

286 manga titles

pure lion
#

oh never mind its done

young flame
#

that extra 20gb better be sfw tim or else bonk

quartz kindle
#

95% of it is sfw

young flame
#

hm

#

ok

#

you win this time

#

mines being 92%

#

back to dayz

quartz kindle
#

92% sfw or 92% nsfw

#

xD

pure lion
pale vessel
#

That locale mix notlikenoot

pure lion
#

fuCK

quartz kindle
#

im pretty sure its cygwin's fault

boreal iron
pure lion
#

sdiojghsduihgosidhg

quartz kindle
boreal iron
#

no comment

pale vessel
#

Boomer

boreal iron
quartz kindle
boreal iron
#

stop using these "newish" words...

pale vessel
#

Ok boomer poggersssssssss!!!

#

!!

pure lion
#

it doesnt work with my other consoles

#

whatDoiDOOOOO

young flame
#

ok zommer poggerssssssssssss!!

pure lion
#

@quartz kindle should i try it on my vps or just in a different dir outside of cygwin?

quartz kindle
#

try it in a different dir

#

if it fails try uninstalling cygwin lmao

glass nacelle
pure lion
#

alrightyyyyy

#

:DDDDDDDDDDDDDD

pure lion
#

gonna install yarn

quartz kindle
#

yarn to the rescue lmao

pure lion
#

ynra

tight bronze
#

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

pale vessel
#

I'm sure it's <script src=""></script>

tight bronze
#

Oh

pale vessel
#

Link would be link rel="" href=""

tight bronze
#

Still doesn't show up though

#
<script src="https://kit.fontawesome.com/dd4ae8d29b.js" crossorigin="anonymous"></script>

Like this?

pale vessel
#

Yes

tight bronze
#

Yeah don't want to show up

pale vessel
#

Try adding it at the bottom instead

tight bronze
#

Alright thanks

#

Not working still

pure lion
#

@tight bronze add defer to the script tag

marble juniper
#

is he trying to use a script tag in the description

tight bronze
pale vessel
#

Oh god, it's not their website?

pure lion
#

ah

quartz kindle
marble juniper
#

script tags can't be used in descriptions

pure lion
#

unless you're tim colour

marble juniper
#

thats what I wanted to say lol

pale vessel
#

You need to use FontAwesome's CSS

marble juniper
#

yeah

tight bronze
#

Ah

marble juniper
#

and you can't get cert anymore

#

so yeah

pure lion
#

you can use iframes

marble juniper
#

no script tags

glass nacelle
tight bronze
#

Ah I'll try that then thanks

summer torrent
#

@tight bronze you can't use script tag

#

it is for certified bots

tight bronze
#

Yeah alright

gusty quest
#

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)

#

😦

earnest phoenix
#

did you copy your node_modules to a unix machine lol

quartz kindle
#

most likely

sage bobcat
#

One message removed from a suspended account.

tight bronze
#
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

pale vessel
#

That's...

#

SCSS?

tight bronze
#

Wrong thing

#

But I fixed it

steep marsh
#

No response

summer torrent
obtuse jolt
quartz kindle
#

change your column encoding to utf8mb4

obtuse jolt
quartz kindle
#

You may also have to set the server property character_set_server to utf8mb4 in the MySQL configuration file.

obtuse jolt
#

where is the sql config file

#

its the my.cnf isnt it

#

or something

quartz kindle
#

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

obtuse jolt
#

where is this

#

what website

earnest phoenix
#

Hello bot does not execute the hug command

fallow lichen
#

Do someone know how to read an embed message from a bot with another (py)?

earnest phoenix
#

I don't know the code, I don't understand the bots, but the bot is on the server!

misty sigil
#

we don’t offer support for other bots

earnest phoenix
#

not the other boat

#

pirdbot

misty sigil
#

we don’t provide support for any bot

#

we provide code support

fallow lichen
obtuse jolt
#

@quartz kindle I did all the things but it just does the same thing I dont really understand the last step tho

earnest phoenix
#

@misty sigil but thank you for your time

fallow lichen
#

When you create a column, you must chose a type, and you need to avoid some

molten yarrow
obtuse jolt
earnest phoenix
#

thank u

obtuse jolt
#

@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

molten yarrow
obtuse jolt
#

everything that I do jsut doesnt fix it

#

i dont get it

molten yarrow
#
ALTER DATABASE
    database_name
    CHARACTER SET = utf8mb4
    COLLATE = utf8mb4_unicode_ci;

run the query but change the db name to yours

obtuse jolt
#

still giving the same error

molten yarrow
#

did your restart your mysql server?

obtuse jolt
#

you want me to restart it everytime I run these commands

molten yarrow
#

you can try alter the table aswell, maybe it helps

humble rock
#

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('🎟');
    }
}
obtuse jolt
#

all the collums have the correct encoding and im pretty sure the tables do too

humble rock
#

Someone can help me?

umbral zealot
humble rock
#

What i do now (sorry for my english)

umbral zealot
#

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.

humble rock
#

in createTicket file?

#

or in messageReactionAdd?

#

@umbral zealot

umbral zealot
#

in messageReactionAdd since that's where guildDoc would be undefined.

humble rock
#

doesn't work ):

quartz kindle
obtuse jolt
#

its trying to save 😎 CLUB PS3 😎

humble rock
#

@umbral zealot probably i don't have I did' t understand anything of what you meant as I am not English

quartz kindle
obtuse jolt
#

how do I do this

quartz kindle
#

i think from mysql cli

humble rock
quartz kindle
#

show INSERT INTO ...

obtuse jolt
#

ight hold on

humble rock
#

@umbral zealot

#

What i do now?

umbral zealot
#

Other than "learn programming" I'm not sure what I can say to help.

obtuse jolt
#
[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

feral aspen
#

No one answered my question sadly! 😦

opal plank
obtuse jolt
quartz kindle
#

thats all it shows?

obtuse jolt
#

yes

quartz kindle
#

what if you insert something without emojis

obtuse jolt
#

it works fine without emojis

quartz kindle
#

what does it output

obtuse jolt
#

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

molten yarrow
#

uh i forgot, add this to your code where you create mysql connection

"charset" : "utf8mb4"
obtuse jolt
#

it werks....

#

i officially hate myself

quartz kindle
#

lmao

obtuse jolt
#

that was the one line that was between me and losing 5 guilds

#

fuckkkkk

molten yarrow
#

nice :3

obtuse jolt
#

who needs a Tim when you have an Alina

molten yarrow
#

only because i had the same problems.... xDD