#development

1 messages ยท Page 360 of 1

bright spear
#

wait what

#

why are you sending it in postman Thonk

jagged plume
#

showing it works

#

no code needed

bright spear
restive silo
#

try without the setInterval in not sure but it might not get executed instantly rather than after 3600000 seconds at first

pale light
#

oh right, theres the base delay because of the setInterval

bright spear
#

yeah, it worked without that

restive silo
bright spear
#

why is it in there Thonk

restive silo
#

dunno

pale light
#

idk

restive silo
#

whoever wrote that isn't the best

#

i guess

pale light
#

cough

bright spear
#

tonkku posted it

pale light
#

pinned by tonkku

restive silo
#

i said nothing

#

i mean

bright spear
#

#BlameTonkku

pale light
#

run far away

restive silo
#

anyway, just dont loop it, and you are fine

earnest phoenix
fleet epoch
#

Should I use dblposter to post my stats to the server easy

young cradle
#

Nop

#

Use if you want and is lazy to make it yourself

#

But there are plenty of better ways to do it

fleet epoch
#

Hmm

#

Would it work the same?

young cradle
#

Wdym?

fleet epoch
#

Does it compete it's task

#

Idc how it does it really,i just need my stats posted

bright spear
#

What lib are you using?

young cradle
#

Yeah it does from what i read

fleet epoch
#

Js

bright spear
young cradle
#

But still bad

bright spear
#

Just use the pinned one

#

Lol

fleet epoch
#

How bad

young cradle
#

Really bad, because first you'll have a new dependency only for that when you can write yourself in 10 lines, second because it "checks" your lib when doing anything, didn't fully read the source code, but looks broken

fleet epoch
#

Oh k

#

I'll see if I can get the piece of code I have working

pale light
#

Just use snekfetch

#

is ez

fleet epoch
#

I do, then it breaks on me, I think I might of put my token other than my bot key idk

#

where can I find the key I need so I know I don't mess up

pale light
#

go into your bot's profile page

#

wait

#

my internet broke

stone kiln
#

did it?

fleet epoch
#

Mine does that some times

#

It sucks

pale light
#

maybe dbots is being really slow

#

can't access it at all

#

rip

#

ok so

#

scroll to the bottom

#

select your bot

#

and the token will appear

fleet epoch
#

I use that and it still breaks

#

const snekfetch = require('snekfetch');
const key = 'YOUR DBL KEY';

snekfetch.post(https://discordbots.org/api/bots/{client.user.id}/stats)
.set('Authorization', key)
.send({ server_count: bot.guilds.size})

pale light
#

k

fleet epoch
#

Why would it not work

pale light
#

hm

fleet epoch
#

I put it in my ready area

bright spear
#

The setinterval says it will only run once an hour

pale light
#

@fleet epoch can you share your full code for the update in a code block here

fleet epoch
#

On phone for the night

#
  1. Can't access code, 2. Can't make code blocks on my phone
pale light
#

kk later then

fleet epoch
#

Gn

#

I gtg to bed also

#

I'll ping you when I can tomarrow

pale light
#

k

#

cya I'm off

languid dragon
#

I need technical kinda help:

let Pages = {
    'page_1': {},
    'page_2': {},
    'some_3': {},
    'yep_lul': {}
}

Can I use a for (let page in Pages) {}
Say you're on "page_1"
How would you iterate "pages" and proceed to the next object?

earnest phoenix
#

Never use for...in

languid dragon
#

;-;

earnest phoenix
#
for(const key of Object.keys(obj)) {
    const element = obj[key];
}
languid dragon
#

legend

earnest phoenix
#

Well, back to your issue, since you know the key, there's no need to loop through Pages, you need need to loop through the page_1 object.

#

Unless you want to show them all (which kinda defeats the purpose of pagination).

languid dragon
#

its more i have Pages.page_1 currently showing in an embed

#

and now i need Pages.page_2

earnest phoenix
#

I feel like this is a reaction pagination thing.

languid dragon
#

may be

earnest phoenix
#
const keys = Object.keys(Pages);
let pos = keys.indexOf('page_1');
pos++;

for(const key of Object.keys(Pages[keys[pos]])) {
    // uwu
}

allenThink

languid dragon
#

mmmmm yes

#

ill take a lookie

earnest phoenix
#

Feel free to ping me.

languid dragon
#

i appreciate your help btw hart

austere meadow
earnest phoenix
#

Oh god for...in

austere meadow
#

whats wrong with for..in

#

yes its not great but

#

its not awful

earnest phoenix
#

It loops over the whole prototype.

#

It's awful.

austere meadow
#

thats fine for small things like this

earnest phoenix
#

It's never fine.

austere meadow
#

its not ideal for larger objects

languid dragon
#

removes all my for..in's

austere meadow
#

ikr rip blobsad

jagged plume
#

same

languid dragon
#

regardless it's good to hear from everyones point of view

austere meadow
#

i only use for..of on like client.guilds or other stuff

earnest phoenix
#

A lot of electrons died that day rip

inner zinc
#

same happens if you use a normal for~

earnest phoenix
#

What happens when you use a normal for for what?

inner zinc
#

electrons die!

#

maybe

earnest phoenix
languid dragon
#

incoming noob question again

#

say "current page" is the Pages.page_1

#

how would i know exactly what the object is called

#

idek

#

ignore that im gonna do some googling

earnest phoenix
#
const currentObj = Pages.page_1
const key = Object.keys(Pages)[Pages.indexOf(currentObj)]
bitter sundial
#

๐Ÿฅ„ mmLol

languid dragon
#

tonkku

earnest phoenix
#

Thonkku

languid dragon
#

i will rekt u

#

i never ask dev questions ok

#

i feel like such a noob rn

wise nexus
crimson raft
#

?

wise nexus
uncut slate
#

it's export default

#

not exports default

wise nexus
#

yeah i noticed

#

๐Ÿคฆ i am tired

#

lol

clear tulip
#

oops

#

wrong channel

short siren
#
     snekfetch.get(`https://discordbots.org/api/bots/363695248997613575/votes`)
      .set("Authorization", key)
      .then(res => {
        if(body.includes(message.mentions.members.first().id)) {
          return message.channel.send("Has upvoted")
        }
        message.channel.send("You havn't upvoted")
       }).catch(console.error)``` Failed ๐Ÿ˜ฆ
jagged plume
#

body isnt defined

short siren
#

ohh cwap i forgot

cold ginkgo
#

I'm trying to make a database in python so I can make a currency system for my bot but I am clueless on how to append to the database and how to properply make one, any help will be appreciated โค

pale light
#

@python experts

restive silo
#

for a SQL based database

earnest phoenix
#

shit

cold ginkgo
#

@restive silo alright thanks ๐Ÿ˜ƒ

restive silo
#

its an ORM so should be pretty nice to inlcude in your code

#

np thumbsUp

pale light
#

owo

vague arrow
#

What Bot Library should I use?

pale light
#

depends on your experience

#

are you new to coding?

vague arrow
#

Ish, I do know JavaScript

restive silo
#

well there are 3 big libs for JS

vague arrow
#

Ok

#

Thank you!

restive silo
pale light
#

You should try Eris

#

seems cool

restive silo
#

Eris is pretty lightweight and resource gentle, Discord.js is very abstracted and have a lot more utiloty aswell as uses more resources because of that,

#

but i heard that it isn't the best

night imp
#

smh I use Roblox.lua

#

Get on my level

fleet epoch
#

lol

night imp
#

I use the Roblox engine to send and process data on their servers

pale light
#

wowa

night imp
#

jk but it is possible probably

pale light
#

maybe

fleet epoch
#

can someone help me

pale light
#

whats the issue

fleet epoch
#
client.on("ready", () => {
    console.log("Serving in " + client.guilds.size + " guilds");
    console.log(client.users.size + " users use " + client.user.username)
        const snekfetch = require('snekfetch');
const key = 'My bots token';
snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
    .set('Authorization', key)
    .send({ server_count: client.guilds.size})
});```
#

comes off as a socket type error

#

only when i add the snekfech part

#

socket hang up

pale light
#

hmmm

#

idk, but you probably shouldn't run it on the ready event

#

make it into a command

fleet epoch
#

a command? ok...

#

so like %dbupdate

pale light
#

yeah

fleet epoch
#

ok

#

it will be only accessible to me

pale light
#

yeah

restive silo
#

thats not the reason

pale light
#

ik its not

inner jewel
#

what's the exact error message?

pale light
#

It just shouldn't be in the ready event anyways

restive silo
#

while using snekfetch you need to use .then()/.end() on it or await it or you will never end the request

inner jewel
#

i post on ready, join and leave

restive silo
#

Gus told me that

pale light
#

I don't do that

fleet epoch
#

oh i need a .end?

restive silo
#

.end()

fleet epoch
#

ok ill add that

#

thats probilly why

restive silo
#

or .then() / await it

pale light
#

I don't think .end() is necessary, but its probably better

restive silo
#

it is

pale light
#

I don't use it

#

ยฏ_(ใƒ„)_/ยฏ

restive silo
#

you await it or use .then()

fleet epoch
#

i dont need a .then

restive silo
#

or?

fleet epoch
#

ill just use a .end

pale light
#

I don't use any

#

of those

restive silo
#

are you using snekfetch?

pale light
#

maybe its the .catch()?

#

yes

restive silo
#

yea .catch() will also attach a .then() listener

pale light
#

kk

restive silo
#

because using .catch() is the same as the second parameter of .then()

fleet epoch
#

ok command is finished

#

YES

#

it worked

#

its now locked to only me

#

ok i need help, how do i push code to github?

pale light
#

whats your ide

#

/editor

fleet epoch
#

i have git on here, i also have notepad++ and microsoft code

abstract mango
#

@fleet epoch it's the same as any other time you push code

fleet epoch
#

idk how i do that though

#

first time using git

abstract mango
#

theres a command called git push Thonkeng

fleet epoch
#

hmm

#

k

abstract mango
#

you also need a remote (aka server/origin) to push to

#

you can just set it to your github repo and call it a day usually

#

although you do want to use a ssh remote to make sure you don't need to enter a password

fleet epoch
#
git push -u origin master```
abstract mango
#

yes

#

the ssh remote requires a ssh key

#

if you haven't added that already

fleet epoch
#

what xD

#

i dident do the ssh key stuff yet

abstract mango
fleet epoch
#

uh, how do i log out of the current respitory im in using git bash lol

cold ginkgo
#

@restive silo could you possibly help me make a database

fleet epoch
#

weird

#

its like git hates me

restive silo
#

im sorry but i dont know much about pyhton, isn't my prefered language aswell as i never really worked with either python not d.py or disco

#

so i might not be helpful at all

inner jewel
#
  1. don't create a database
#

it's extremely complex

restive silo
#

Natan its not

cold ginkgo
#

oboi

inner jewel
#

yes it is

restive silo
#

SQL based stuff like Postgres is EZ

#

but like

inner jewel
#

using is one thing

#

creating is another

fleet epoch
restive silo
#

to integrate it into the code is anooying

inner jewel
#

creating the database

restive silo
#

thats why most peeps use ORM

inner jewel
#

means you'll be responsible to write to files, make it concurrent if that's a need, etc

cold ginkgo
#

so then what should I use

#

๐Ÿค”

restive silo
#

i would recommend a Database like Postgres or MySQL but Nathan seems to have an other options ๐Ÿ‘€

cold ginkgo
#

I'm trying to make one rn

inner jewel
#

make one or use one?

#

making a database is most likely not what you want

cold ginkgo
#

oboi

restive silo
#

oh wow

#

Natan memes at the best

#

well yea ise SQLite, Postgres or MySQL i guess

pale light
restive silo
#

these are the most known and famous sql one's

pale light
#

SQLite wooo

cold ginkgo
#

sqlite3?

pale light
#

yeah

#

good for js

ornate totem
#

only recommend mysql3 for web framework

#

tb sqlite is better for js

restive silo
#

postgres is pretty neat

ornate shadow
#

anyone knows why?

#

isn't embed : embed the correct way to do it?

#

for a RichEmbed()?

inner jewel
#

.send({embed: embed})

ornate shadow
#

oh

#

right

#

thanks xD

restive silo
#

you can short stuff up if you do .send({embed})

ornate shadow
#

oh I can do that?

#

it doesn't affect anything?

restive silo
#

no its the same as doing .send({embed: embed})

ornate shadow
#

ok, thanks! ^_^

restive silo
#

but shorter

ornate shadow
#

๐Ÿ˜„

earnest phoenix
#

404 background information not found

earnest phoenix
#

IU wanna know how to get a server invite to a server called SonVatanTR using the eval command.. (Discord.Js)

rich kiln
#

well

#

i think this is against tos

compact wave
#

what are the color codes for rich embeds

rich kiln
#

any

jagged plume
#

you can use any colour you like

compact wave
#

like red like the color codes

rich kiln
#

you mean in hex?

earnest phoenix
#

It's a decimal.

compact wave
#

yes

restive silo
#

i guess you are using D.js ?

rich kiln
#

@earnest phoenix some libs uses Hex instead of decimal

earnest phoenix
#

Uh no

rich kiln
#

yup

earnest phoenix
#

All libs have to use decimal in the end.

rich kiln
#

ยฏ_(ใƒ„)_/ยฏ

earnest phoenix
#

Those libs just provide a nice way to convert #FFF to decimal.

#

0xFFFFFF is offered by the language compiler/interpreter and results in a decimal.

#

PS: In JS, if you are going to use hexadezimal, use 0xYOUR_HEXADEZIMAL.

compact wave
#

module.exports = class CoinCommand extends Commando.Command {
    constructor(client) {
        super(client, {
            name: "kill",
            memberName: "kill",
            group: "fun",
            description: "Kill a user!"
        });
    }

    async run(message, arg) {
        let user = message.mentions.users.first();
        if(user === undefined) {
            message.channel.send("Please specify a user to kill!");
            return;
        }
        let embed = new Discord.RichEmbed().addField(title, value);
        .setColor("#EE82EE")
        .setTitle("Kill")
        .addField((message.author.username + " murdered " + user.username + "๐Ÿ”ซ")
        message.channel.send({
            embed: embed
    }
}
#

whats wrong

#

hmmm

meager kindle
#

Hey guys, I can't get client.user.id to work in discord.py, the command isnt recognized and i defined client = discord.Client() earlier in my code

#

i'm trying to implement this:

import aiohttp

dbltoken = "token"
url = "https://discordbots.org/api/bots/" + bot.user.id + "/stats"
headers = {"Authorization" : dbltoken}

async def on_ready():
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)

async def on_server_join(server):
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)

async def on_server_remove(server):
    payload = {"server_count"  : len(bot.servers)}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)
ornate shadow
#
    while(!encounter) {
        console.log(`You're in the while loop.`);
        con.query(`SELECT * FROM characters WHERE encounter_id = ${k}`, (err, result) => {
            if(err) throw err;

            console.log(`You're in con.query.`);

            if(!result[0]) {
                encounter = k;
                console.log(`You're in the NOT RESULT.`);
            } else {
                k++;
                console.log(`You're in the ELSE.`);
            }
        });
    }
#

can anyone explain to me why does it loop endlessly with only the first console log spamming?

pale light
#

what the hec happened to the formatting there xd

ornate shadow
#

it's copy pasta

#

it copies the indents aswell

pale light
#

how do you know it loops endlessly

#

can I see console

ornate shadow
#

cuz it logs out endlessly

#

the console?...

pale light
#

the console mesages

#

the console.log stuff

ornate shadow
#

it seems I can't write more than 2k characters

pale light
#

you can't

ornate shadow
#
You're in the while loop.
You're in the while loop.
You're in the while loop.
You're in the while loop.
You're in the while loop.
You're in the while loop.
You're in the while loop.
You're in the while loop.
You're in the while loop.
You're in the while loop.
pale light
#

only the first one logs?

ornate shadow
#

as I said, yes

pale light
#

well you're trying to get the encounter value right

ornate shadow
#

btw let k = 1

pale light
#

nvm

ornate shadow
#

what?

pale light
#

I can't read this formatting

#

its too painful

#
  while(!encounter) {
           console.log(`You're in the while loop.`);
            con.query(`SELECT * FROM characters WHERE encounter_id = ${k}`, (err, result) => {
                   if(err) throw err;

                            console.log(`You're in con.query.`);

                  if(!result[0]) {
                            encounter = k;
                            console.log(`You're in the NOT RESULT.`);
                  } else {
                            k++;
                           console.log(`You're in the ELSE.`);
                  }
        });
 }
#

try running the con.query(SELECT * FROM characters WHERE encounter_id = ${k}, (err, result) => { part by itself and tell me what it logs @ornate shadow

ornate shadow
#

is this better now?

#

I edited it...

#

you mean in the mysql?

#

console?

#

it will show nothing

#

because there's nothing to show

#

that's why the if(!result[0])

#

I'm planning to find a missing number

#

if it doesn't output anything, it's a success for me

pale light
#

yeah so run the sql code

ornate shadow
#

I told you already

#

it doesn't show anything

pale light
#

but you have an else

#

it should still output

#

because the else should catch if there is a result

topaz fjord
#

Sup

inner zinc
#

it seems like it doesn't even call the callback~

pale light
#

._.

ornate shadow
#

I commented the while loop

#

forgot to comment the first console.log

#

I guess the query works

#

but the problem is with the while loop ๐Ÿ˜•

pale light
#

yeah

earnest phoenix
#

Uh what

ornate shadow
#

let encounter = 0 is before that

pale light
#

wait what

earnest phoenix
#

lol

#

For what the while loop?

pale light
#

encounter = 0?

#

how is there !encounter

#

then

#

๐Ÿต ๐Ÿ”ซ

ornate shadow
#

not if it gets changed in the query, doesn't it?

#

that was the point

pale light
#

No encounter = 0; means encounter is defined

earnest phoenix
#

Loris pls

#
!0 // true
pale light
#

k I'll leave it to you

#

oof

#

javascript rules

#

I'm sorry I'm used to java mmLol

#

even though my bot is made in js

#

I'm still used to java

earnest phoenix
#

JS is dynamic typed.

ornate shadow
#
    if(!result[0]) {
encounter = k;
console.log(`You're in the NOT RESULT.`);
#

basically encounter = 1;

earnest phoenix
#

For what do you need the while loop?

ornate shadow
#

it should turn false

#

I need the while loop to loop through all the results in a query starting with k = 1, k = 2, etc and when it doesn't return anything, assign that number to encounter;

earnest phoenix
#

That's not how it works

#

That's not how any of this works.

ornate shadow
#

hmm ok

#

can you help me, then?

#

what I want to achieve is this

#

I have different values of encounter_id column

#

let's say some row as 1, other row has 2, other one has 2, then 4, 4, 5.

#

so 1, 2, 2, 4, 4, 5.

#

I want to make it so that I assign the value of 3 to encounter

#

the "available" number

#

how could I do this?

earnest phoenix
#

So you basically want to make the ID consecutive?

ornate shadow
#

yes but still be able to assign the same value to others when needed

earnest phoenix
#

Why does have an ID column even duplicate values?

ornate shadow
#

like if I find the number "3" available, I want to be able to assign the number "3" to multiple rows

earnest phoenix
#

Point of an ID column is to be unique.

ornate shadow
#

I have a separate id for that. I need an encounter_id so that that ID can tie up the objects

earnest phoenix
#

Oh

#

one-to-many relationships

#

Instead of selecting rows one by one, you could just select all, look which numbers aren't used and do whatever you have to do.

ornate shadow
#

for example I have a table for spawned monsters. I want to be able to tie up 2 monsters to 1 character. that would make one encounter made up of 3 objects

#

select all?

earnest phoenix
#

Yeah, just get all rows

ornate shadow
#

didn't I do this?

#

I added the while loop so I could "find" the "missing" number

#

k=1, k=2 etc

earnest phoenix
#

That's a pretty stupid way to do it.

pale light
#

theres no point of that

ornate shadow
#

then how?

earnest phoenix
#

Just get all rows of that table and look which numbers haven't been used yet.

ornate shadow
#

is there some query for that?

earnest phoenix
#

Remove the WHERE clausel and you get all rows.

ornate shadow
#

I didn't use WHERE

#

I think you didn't understand, still

earnest phoenix
#
WHERE encounter_id = ${k}
pale light
#

you used where

earnest phoenix
#

That's not a WHERE?

pale light
earnest phoenix
#

Then what is it?

ornate shadow
#

oh that where ๐Ÿคฆ sorry

#

I didn't understand

#

hmm

#

so I'll get all the numbers and then use node.js to find the missing number

#

I'll try that, thanks

#

I'll get back if I stumble upon something again

#

again, thanks

ornate shadow
#
let embed = new Discord.RichEmbed()
    .setTitle(`Encounter!`)
    .setDescription(`This is an encounter...`);
let counter = 1;
con.query(`SELECT name FROM monsters WHERE encounter_id = ${character[i].encounter_id}`, (err, monsters) => {
    if(err) throw err;

    if(monsters[0]) {
        for(let j = 0; j < monsters.length; j++) {
            embed.addField(`${counter}. ${monsters[i].name}`); // <--- this doesn't get added
            counter++;
        }
    }
});
bot.channels.get(character[i].channel_id).send({embed}); // <--- this runs probably before adding any fields
#

I suck at async/await. can anyone help me? ๐Ÿ˜Ÿ

peak mountain
#

voice your question

#

and people eventually answer

ornate shadow
#

it's in the comments

inner zinc
#

try a console.log there?

ornate shadow
#

ok lemme do that quickly

uncut slate
#

prepared statements

peak mountain
#

huh

inner zinc
#

oh yeah true, you have to do the send inside the callback function

#
let embed = new Discord.RichEmbed()
    .setTitle(`Encounter!`)
    .setDescription(`This is an encounter...`);
let counter = 1;
con.query(`SELECT name FROM monsters WHERE encounter_id = ${character[i].encounter_id}`, (err, monsters) => {
    if(err) throw err;

    if(monsters[0]) {
        for(let j = 0; j < monsters.length; j++) {
            embed.addField(`${counter}. ${monsters[i].name}`); 
            counter++;
        }
    }
bot.channels.get(character[i].channel_id).send({embed});
});
ornate shadow
#

oh, I did a console.log and it shows up... for some reason (probably some bug that I need to figure it out) it still doesn't add the fields

#

oh, ok

#

I'll do that, thanks! ^_^

inner zinc
#

np

ornate shadow
#

a field got added so it worked! thanks! ^_^

cold ginkgo
earnest phoenix
#

more of a general question- is storing information in .txt files bad? i've been storing databases and server prefixes in .txt files... but someone told me recently that it's very ugly to read and extract data from files manually, and that i should look at yaml

prime cliff
#

Yes you should

#

Json is a better alternative

fleet epoch
#

He is using Java I think

#

So yaml is what he needs to use

#

It's like json, but for Java, Json is for javascript

dense goblet
#

do you guys have a good tutorial to make a bot?

austere meadow
#

@dense goblet not really, but i recommend you look on YouTube or Google for tutorials that will lead you on the right path

dense goblet
#

ok

young cradle
#

@fleet epoch yaml and json are both supported by both languages, XML is more commonly used for Java, but it's more about user preference rather than something defined

fleet epoch
#

Oh

#

Kk

earnest phoenix
#

๐Ÿค” uhh i primarily use python -dunno where java came from-

young wind
#

hi, i need help with something in python if anyone could help

earnest phoenix
#

i might be able to

young wind
#

how would I get the user's id from a discord.Member object?

#

lets say i got a list of members from server.members

#

and i need the member's user ids

#

how would I go about doing that?

earnest phoenix
young wind
#

yes

gusty topaz
#

@earnest phoenix for python, JSON is good since python has built in libraries for handling it

earnest phoenix
#

hmm i see, thanks

frail kestrel
#

@fleet epoch JSON can be used for python

#

and other langs

#

but the J and S in JSON stand for JavaScript

earnest phoenix
#

JavaScript Object notation iirc

neat falcon
#

My bot keeps automatically leaving the voice channel when trying to play some audio via ytdl-core Thonk

quiet bobcat
#

Do you have opusscript?

#

and ffmpeg?

#

Are there any errors in the console?

#

@neat falcon

neat falcon
#

no errors

#

i have node-opus and ffmpeg

quiet bobcat
#

Try using opusscript instead

#

what version of discord.js/eris

neat falcon
#

idk

#

d.js

quiet bobcat
#

ok

#

try this ```fix
npm -v discord.js

#

@neat falcon

neat falcon
#

5.6.0

#

lmao

#

i need to upgrade

#
  • discord.js@11.3.0
#

now on 11.3.0

quiet bobcat
#

Nice

#

ok try again

restive silo
#

Uhm, thats not quit how you get the d.js version

#

npm ls discord.js would it be

quiet bobcat
#

But it still worked zoomeyes @restive silo

restive silo
#

npm -v xyz Always shows the npm version

quiet bobcat
#

oh...

restive silo
#

Thats why it said 5.6.0

quiet bobcat
#

yeah

restive silo
quiet bobcat
#

makes sense

#

bc I have discord.js@12.0.0-dev and not 5.5.1

restive silo
#

Indeed

neat falcon
#

ok updated now to test again

quiet bobcat
#

Does it work?

neat falcon
#

nope

quiet bobcat
#

Hm

inner zinc
#

try a dispatcher.on("error"

neat falcon
#

okay

#

tried that

#

dispatcher doesn't give error

#

also how do i give people who upvoted my bot a role on my server?

inner zinc
#

idk, guess you can find that in the discordbotlist api

austere meadow
#

you'd need to iterate over the /votes api endpoint to see whos voted, then for every user who has voted, add a role

#

you can use <Member>.addRole(<Role>) on stable

pale light
#

if you don't know
https://discordbots.org/api/bots/<client.user.id>/votes

austere meadow
#

actually you'd also need to check if they are in your server as well

neat falcon
#

okay, thanks

inner zinc
#

btw, i'm using v12-dev of d.js, how can i get messages of a textChannel?

#

that aren't cached

austere meadow
#

<Channel>.messages.fetch({ limit: (number) })

#

limit isnt required but you can fetch multiple messages using it

#

or you can specify the amount you want to fetch

quiet bobcat
#

^

inner zinc
#

oh, okay i thought channel.messages was a collection ๐Ÿ‘€
thanks

earnest phoenix
#

Well

austere meadow
#

it's a MessageStore

#

which comes from Collection

earnest phoenix
#

Technically it is

#

Kind of

austere meadow
#

^

#

its a collection just has some extra methods with it

inner zinc
#

okay

earnest phoenix
#

Did stable already change to Stores?

austere meadow
#

nah

#

they are on master

earnest phoenix
#

Ya

#

< still stuck with my 11.2.1 fork

austere meadow
#

rip

earnest phoenix
#

My bot doesn't have any functionalities that requires categories.

#

Oh, but I should add animated emoji support to the fork, brb committing

crystal void
#

oh god.. what's going on in here?

earnest phoenix
#

This is a closed community, move along.

restive silo
#

...

pale light
#

oof rip

earnest phoenix
#

@scenic crest In which language are you making your dapi lib?

scenic crest
#

go

#

also, stalker much

earnest phoenix
#

I'm obviously in DAPI and saw your question.

scenic crest
#

wanted to make one in go because discordgo is awfully low level and it's quite painful for just simple stuff

#

trying to get a discordgo.Guild pointer from a discordgo.MessageCreate pointer is like:
channelid -> channel -> guildid -> guild

#

then add error checking since all non id thingies there canthrow errors ๐Ÿ˜„

earnest phoenix
#

lol

#

Sounds painful.

scenic crest
#

yeh

fleet epoch
#
snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
    .set('Authorization', key)
    .send({ server_count: client.guilds.size})
    .end()
    message.channel.send("My stats are now updated on discordbots.org");
}```
#

this forsome reason spammed my console

earnest phoenix
#

Because it's in the message event?!

fleet epoch
#

no its its own command

earnest phoenix
#

I doubt it

fleet epoch
#

and it spammed 401 error

scenic crest
#

I mean idk if anyone actually uses go but I wanna combine the speed of go with the simplicity of like d.js

earnest phoenix
#

@fleet epoch It probably spammed it because the request got spammed. Which means the command got spammed.

#

Or something else broke.

fleet epoch
#

no cause i only did the command once, im thinking something broke

earnest phoenix
#

You'll need to debug it, either way.

fleet epoch
#

should i do a .then other than i .end

earnest phoenix
#

Do you understand the difference?

fleet epoch
#

people said .then stops the request like a .end, but in .then i can add some stuff i want it to do

earnest phoenix
#

People are wrong

fleet epoch
#

it worked, just still unthoritized

#

just not spammed now

#

how am i wrong

indigo notch
#

Anyone knows how i can fix this?

let mes = await message.channel.createMessage({embed: {
    description: 'testr111'
}});

mes.edit({embed: {
    description: 'test2'
}});
//it would edit as:
"test2111"
//but i want it to edit as
"test2"```
uncut slate
#

@indigo notch client bug

indigo notch
#

so just wait until there comes a fix?

quiet bobcat
#

๐Ÿค”

uncut slate
#

pretty much but IIRC it's rare, I wouldn't worry about it

#

you might be able to trick the client into re-rendering it fully by messing with whitespace

indigo notch
#

accidently pasted my clipboard

scenic crest
#

is electron heavy on resources? I remember something along those lines being told to me

inner jewel
#

electron is a browser loading "webpages" from disk

glossy sand
#

it's heavy on resources in that there's significantly more overhead than a native ui impl

scenic crest
#

@earnest phoenix sorry for pong, this is sent in the d obj of payload right:

{
    "token": "my_token",
    "properties": {
        "$os": "linux",
        "$browser": "disco",
        "$device": "disco"
    },
    "compress": true,
    "large_threshold": 250,
    "shard": [1, 10],
    "presence": {
        "game": {
            "name": "Cards Against Humanity",
            "type": 0
        },
        "status": "dnd",
        "since": 91879201,
        "afk": false
    }
}```
earnest phoenix
#

Do you actually decompress the payloads?

#

But yes.

#

Notice: The first shard has ID 0.

scenic crest
#

I don't know if I'm using compression ngl, but if I am go's json parser is decompressing it

#

yeah I use sharding already dw

earnest phoenix
scenic crest
#

ooooh right that

#

I've never used compression before, should I?

earnest phoenix
#

Also you may want to implement transport compression, as it will be required for gateway v7.

scenic crest
#

ah

#

makes sense then

earnest phoenix
#

Transport compression means 80% less bandwidth

scenic crest
#

is the whole payload gonna be compressed or just the d?

earnest phoenix
#

The whole message.

scenic crest
#

hm ok ty

earnest phoenix
#

It's transport compression.

scenic crest
#

@uncut slate I have a d.js question !!!

uncut slate
#

k

scenic crest
#

so if I get a guild object

#

can I technically do guild.name = "whatever I want"

#

and then d.js will use that when handling internally

#

or is it write protected

uncut slate
#

you can

#

if you set client.guilds.forEach(g => g.name = 'arrayin suk kok') on boot

#

then, every message received in your message event will have msg.guild.name === ' arrayin suk kok'

#

(every guild that isn't new)

scenic crest
#

hmm le docs say it's read only but thanks anyways

uncut slate
#

oh

#

then they might've changed it

#

I know for a fact that used to be a thing

scenic crest
#

hmm alright

uncut slate
#

try it out

scenic crest
#

nah I don't actually need to

#

I was just curious

#

because JDA uses triple condoms for protection, whereas discordgo you can change w/e you want

#

so I was wondering where abouts d.js is

uncut slate
#

right

restive silo
#

since they changed to use a lot of getters now this isn't quit possible anymore atleast for some stuff, others might be editable

hushed berry
#

\๐Ÿ˜ค

wooden shoal
pale light
#

sure

#

whats it about

wooden shoal
#

It's basically a discord remake, but for controlling bot accounts instead of user accounts

prime cliff
#

"An app that allows you to be inside a bot!" yea ik what it is bloblul

jagged plume
#

i think i've seen one before

wooden shoal
#

oh really?

pale light
#

pretty neato

wooden shoal
#

thanks

jagged plume
wooden shoal
#

um...

#

idk

#

lol

jagged plume
#

guild guild

wooden shoal
#

I think so

quasi eagle
#

its obviously an animated guild

#

guild indicator

#

the animation is in a guild

wooden shoal
#

ya

jagged plume
#

animated guild indicator means the same thing

wooden shoal
#

ya imma do that instead

#

ok fixed

quasi eagle
#

the bot app thingy sounds really cool

#

but it just says "write npm test"

#

what do i install, do i install nodejs

pale light
#

yeah you'll need node js

quasi eagle
#

and electron

#

it says

abstract mango
#

lol electron

#

we already have botcord and lightcord iirc

#

both are static apps that can run without electron

earnest phoenix
#

O

quasi eagle
#

this is a fun program

wooden shoal
#

thanks ๐Ÿ˜ƒ

bright spear
wooden shoal
#

run npm install -g electron --save-dev --save-exact

#

@bright spear

#

it's not packaged right now so some development steps are required

bright spear
#

that doesnt work either, with or without sudo

wooden shoal
#

is it the same error?

wooden shoal
#

hm..

#

try just npm install electron

#

with sudo

#

this looks like an electron error

bright spear
#

failed

wooden shoal
#

hm

#

it's saying you don't have permissions

#

did you make a zip?

bright spear
#

no

#

i just cloned it and opened the folder

wooden shoal
#

ok...

#

well try to download the zip idk

earnest phoenix
#

is this reasonable ```py
async def on_guild_join(self, guild):
bots = sum(m.bot for m in guild.members)
users = guild.member_count - bots

    if bots > users/3:
        await guild.leave()
    else:
        pass```

reasonable? leave guild if a third of user count is less than bot count

languid dragon
#

ty

elder rapids
#

or just don't care if it's a bot collection

glossy sand
#

hi does anyone know a good math lib for java

#

comparable to python's numpy

earnest phoenix
#

@elder rapids wasting resources tho

elder rapids
#

Get a better server

earnest phoenix
elder rapids
#

How much will it waste

glossy sand
#

that's.... terrible

earnest phoenix
#

caching and whatnot... bleh

#

just being in a server costs resources

elder rapids
#

Not like you're already caching millions of things already?

earnest phoenix
#

not really

languid dragon
elder rapids
#

What does a simple bot collection do to your resources

earnest phoenix
#

I didn't say simple

elder rapids
#

That a thousand other regular servers don't

earnest phoenix
#

I'm only allowing dbl and ls.terminal.ink

elder rapids
#

honestly I just don't think it's worth it but that's me

earnest phoenix
#

oi

#

do you want your bot to rot away unused in botlists?

languid dragon
#

its generally pointless

earnest phoenix
#

๐Ÿ™„

elder rapids
#

It already rots away un-used in many other peoples servers

#

your point is?

earnest phoenix
#

not really I log commands

languid dragon
#

the higher guild count the better ur bot looks amirite

earnest phoenix
#

eh

elder rapids
#

good joke ken

earnest phoenix
#

I was asking if 1/3 is reasonable

#

not if it itself is reasonable

elder rapids
#

I was saying checking at all isn't reasonable ๐Ÿ˜‰

earnest phoenix
#

yes
I didn't ask that

elder rapids
#

But if you really want that route

#

if 75% is bots then ya...

#

reasonable

earnest phoenix
#

๐Ÿ‘€

earnest phoenix
#

What is this about?

wheat phoenix
#

Hello i need serious support and help.

languid dragon
#

hmm?

wheat phoenix
#

Are their any bots that can clear the chat of a discord text channel?

#

Im just wandering

languid dragon
#

There are lots

#

70% of bots can do that

wheat phoenix
#

CleanChat bot wont work

earnest phoenix
#

Clone channel and delete old channel.

wheat phoenix
#

Can you hand me a bot that can clear the chat?

earnest phoenix
#

Clearing isn't supported yet by the API.

wheat phoenix
#

i hate all my messages scattered around the place

earnest phoenix
#

"Clone channel and delete old channel."

wheat phoenix
#

Okay

#

Thanks

earnest phoenix
#

No bot needed.

wheat phoenix
#

Cool man or girl thanks

#

xD

torn nebula
languid dragon
#

Has anyone had experience with the "pug" template middleware for express.js?

glossy sand
#

i think everyone uses ejs templates

earnest phoenix
#

Not me

languid dragon
#
html
  head
    title test title
    link(
      rel='stylesheet'
      href='./assets/styles.css'
    )
  body
    h1 Registration
    div(class='testing') hello there
#

this lmao

heady bough
#

In Discord.JS, how and where should I handle promise rejections for permissions?

earnest phoenix
#

Always handle them wherever they get rejected.

heady bough
#

So within the code/commands themselves?

earnest phoenix
#

Yes.

#

Unless you have a proper command handler. Then you will want to forward the rejected promise to it and then it will handle it.

heady bough
#

Alright

earnest phoenix
#

Usually I do .catch(this.handlePromiseError.bind(new Error())) cool

restive silo
#

well or you use async/await and handle it in your command handler what is less annoying tbh

earnest phoenix
#

which just gives me a proper stack trace and forwards the rejected promise to the command handler

restive silo
#

async/await the way hype

earnest phoenix
#

I use async/await everywhere in my JS bot

restive silo
#

same

heady bough
#

..I don't think I've ever used async/await

earnest phoenix
#

Inside child processes, inside the REST API, inside the process manager.

#

It's omnipresent.

restive silo
copper crest
#

async/await makes for so much cleaner code โค

pale light
fathom pebble
#

@earnest phoenix "connection refused" try checking your firewall or smth

earnest phoenix
#

Could also mean there's nothing listening on port 80 so the OS refused to accept.

ornate shadow
#

Could anyone tell me how could I make 3 mysql query functions run in a specific order without creating a callback hell in node.js?

earnest phoenix
#

async/await

ornate shadow
#

Could you give me an example, please? I tried throwing these async await everywhere

#

Again, I suck at them

jagged plume
#

await req1
await req2
await req3

ornate shadow
#

It gave an error and crashed. Something about unidentified... Something (await word)

earnest phoenix
#

Is the function async?

jagged plume
#

aaa beat me to it

earnest phoenix
#
async function () {

}
// or
async () => {

}
ornate shadow
#

I added async to the function, yes (also a query)

#

I'm not at home rn so I can't show the code

earnest phoenix
#

What does node -v print?

ornate shadow
#

Latest version probably

earnest phoenix
#

"probably"

#

I wanna see some facts

ornate shadow
#

OK I'm gonna come back to you when I get home

#

Thanks for your will to help me. I got stuck on that... It's a wall I always bump in when I code in node.js

uncut slate
#

I'm gonna guess he's in a non-async nested function

earnest phoenix
#

hey

#

I'm gonna guess he uses an old Node.js version.

#

i want to host my bot in my phone

#

Don't

#

in termux

#

and

#

i copyed a folder from a root folder

#

and the folder with the bot are rooted

#

and i can't acces it

#

you know how i can unroot ?

#

?

gusty topaz
#

@earnest phoenix why not

radiant basin
#

Because it's destroying your phone.

#

And it has a bad performance.

austere meadow
#

if theres anyone here on the latest (or close to latest) discord.js master, do you experience any ECONNRESET's? ive been having them a lot more frequently ever since a few updates ago and its happening quite often, even when executing commands sometimes i've noticed
i dont expect much since this is probs only a me thing but i was just curious
https://please.zbot.me/kGJ2jJga.png

radiant basin
#

Just don't do it, if you don't care about performance, use glitch which is a free hoster for node.js applications. ( @gusty topaz )

tawny lava
#

@austere meadow happens to me too

#

But not too frequently

austere meadow
#

ah

#

ehh its not like THAT frequently, maybe 1 every 15-30 minutes or so?

radiant basin
#

Well, a few hours ago the discordapi had an outage. Could that be the issue?

tawny lava
#

Nah probably like once every few days

austere meadow
#

this has been happening a lot even before the outage so i doubt it

radiant basin
#

Oh ok. Discordapi has lots of outages.

inner zinc
#

it's just a connection problem appearently

austere meadow
#

@inner zinc yeah it seems that way, but this is hosted on google cloud platform so i kinda doubt it'd be a connection thing on their end

inner zinc
#

ECONNRESET usally happens for promises that couldn't succed

austere meadow
#

ahh okay

#

hmm i guess i can see how that could happen, it generally occurs (only sometimes) after a "Missing Permissions" from the API

#

it's not anything that bad it's just appearing in my console and it kinda makes me worried lmao

inner zinc
#

mh, nah, i don't think it's because of missing permissions~ :v

austere meadow
#

have you had any ECONNRESETS before to know what it might be?

inner zinc
#

yep

austere meadow
#

i appreciate your help btw blobsmile

inner zinc
#

not really sure if it's because of weak connection or connection reset, but it seems that this happens when as a timeout of promises

austere meadow
#

hmm alright, thanks for the help! i'll have a look into it to see what it might be blobthumbsup

uncut slate
#
ECONNRESET usally happens for promises that couldn't succed
#

..no?

#

uncaught promises will throw their own unhandledRejection

austere meadow
#

^ yeah true

#

and i am catching those as well

uncut slate
#

ECONNRESETs have nothing to do with promise rejections or promises

austere meadow
#

are you sure? the ECONNRESET gets triggered under unhandledRejection which is related to promises

uncut slate
#

Yes, I'm sure.

#

ECONNRESET is just your normal throw which is going to mean and unhandledRejection if you're in an async function

austere meadow
inner zinc
#

yeah, it is a connection problem :v
and in discord js, the thing that's mostly going to triggers this are promises :v

uncut slate
#

@austere meadow read what I just sent

austere meadow
#

ahh okay

uncut slate
austere meadow
#

so its nothing to worry about?

uncut slate
#

It is something to worry about, but it doesn't have anything to do with promises, or "timed out promises"

austere meadow
#

okay, thanks a lot for helping me understand it blobsmilehappy

ornate shadow
#

@earnest phoenix I finally got home. it says v8.7.0

earnest phoenix
#

Are you sure you use await in a function defined as async?

ornate shadow
#

I read about that nested async functions

#

do every function have to be async for it to work?

earnest phoenix
#

Yes

ornate shadow
#

damn

#

that might be it!!!

#

I'll try

earnest phoenix
#
async () => {
    (() => {
        await somePromise();
    })();
}

doesn't work

ornate shadow
#

I mean

earnest phoenix
#

Because the function the keyword is in isn't async

ornate shadow
#

first to be async, second to not be async, third to be async (then awaits)

earnest phoenix
#

Doesn't make sense to do that

ornate shadow
#

so all 3 have to be async

earnest phoenix
#

Just the one with the await keyword has to be

ornate shadow
#

oh?

earnest phoenix
#

But it doesn't make sense the other to not be async

#

Since you probably want to wait for the async thing to finish

ornate shadow
#

hmm... I'm gonna mess with them again and see what works and what doesn't

jagged plume
#

what is your code looking like right now

ornate shadow
#

since it's a pretty big project, I'm gonna try to sum it up and paste it here

earnest phoenix
#

Use hastebin

ornate shadow
#

oh ok

#

the functions are at lines 81, 115 and 147

scenic crest
ornate shadow
#

the 3 functions

jagged plume
#

what line am i looking at

glossy sand
#

holy shit pastebin actually works on mobile now

scenic crest
#

๐Ÿ’ฆ

ornate shadow
#

lol xD

glossy sand
#

so what's your issue

#

as specific as possible

scenic crest
#

Please use prepared statements, string interpolation can cause SQL injection attacks

ornate shadow
#

I want these 3 functions to execute in the order they're written in (well at line 146 is an IF... I can turn that into a function I guess)

glossy sand
#

i mean assuming you always control the content of the string interpolation

#

but i guess good conventions should always be followed

scenic crest
#

still bad practise imo

ornate shadow
#

I have no idea what prepared statements or string interpolation is

scenic crest
#

string interpolation is ${some.var}

ornate shadow
#

oh ok

scenic crest
#

prepared statements are pretty much statements that ensure that the query values are treated as values

#

without them users may be able to edit the actual query

#
PreparedStatement s = c.prepareStatement("SELECT * FROM `users` WHERE `user_id`=?");
s.setString(1, "123);```
#

an example

ornate shadow
#

so you're saying that I should let var x = before using x in a query?

scenic crest
#

uhh I have no idea how prepared statements work in JS sorry

#

but that would be a java example ^

ornate shadow
#

I guess I will look into that

#

thanks for the info

glossy sand
ornate shadow
#

then again, how could I make let's say the function at line 81 and the function at line 115 execute in the order they've been written?

#

I tried making the function at line 45 async and awaiting the other 2 functions

glossy sand
#

are mysql queries asynchronous?

ornate shadow
#

it didn't work

#

I don't really know about that. what do you mean?

glossy sand
#

do they block until the query is complete?

scenic crest
#

do they block the main thread/process until they're completed

reef dagger
#

NE MUTLU TรœRKรœM DฤฐYENE

glossy sand
#

i would assume no since you're passing a callback

ornate shadow
#

no, they complete randomly

glossy sand
#

arrayboy can you mute

#

i'm on mobile

#

@ornate shadow the answer would be to write each successive query operation in the callback of the previous one

ornate shadow
#

that would result in a callback hell though

#

:-<

#

a lot of copy pasting aswell

glossy sand
#

well that's what you expect when you use callbacks

scenic crest
#

already did before you fanta ๐Ÿ˜‰

glossy sand
#

alternatively you could write each query as a function and just call those functions successively in each ccallback

#

or you could try wrapping the query with a promise and using async/await

ornate shadow
#

so to use async/await on them I have to "wrap them into promises"?

glossy sand
#

yes

#

await simply blocks execution on a given thread until a promise is completed

ornate shadow
#

that's a bummer, since I don't know about promises either. I tried learning them a month ago but it seems so complicated

glossy sand
#

uhhh

#

i would teach you but i kind of have to finish a lab report

ornate shadow
#

that's very kind of you

languid dragon
#

hello

ornate shadow
#

I was planning to go to my nearest university to ask for help on this particular subject in the days to come

languid dragon
ornate shadow
#

if you could lend me a hand instead, that would be awesome

languid dragon
#

if you're referring to uh node.js and discord.js

#

then its mostly just

async function () {
    await do_something();
}

await message.channel.send('mesage')
    .then((message_object) => {

        message_object.edit('new message')    
    
    })

#

a very vague example

glossy sand
#

saves you the trouble of promisifying mysql yourself

ornate shadow
#

๐Ÿ˜ฎ

#

thanks, both of you! I'll look into those

ornate shadow
#

I'm trying to use a different but pretty similar wrapper https://github.com/lukeb-uk/node-promise-mysql and it works fine setting the connection up and all; but I bumped into this

}).then(function(result) {
    if(character[i].encounter_id) {
        con.query(`UPDATE characters SET action = 'idle' WHERE name = '${character[i].name}'`);
        let embed = new Discord.RichEmbed()
            .setTitle(`Encounter!`)
            .setDescription(`This is an encounter...`);
        let counter = 1;
        con.query(`SELECT name FROM monsters WHERE encounter_id = ${character[i].encounter_id}`, (err, monsters) => {
            if(err) throw err;

            if(monsters[0]) {
                for(let j = 0; j < monsters.length; j++) {
                    embed.addField(`${counter}. ${monsters[i].name}`);
                    counter++;
                }
            }
            bot.channels.get(character[i].channel_id).send({embed});
        });
    }
}); // <--- SyntaxError: missing ) after argument list

any ideas?

#

I turned the if statement into a function and put it into a .then()

#

am I missing something?

glossy sand
#

wait why are you using .then

#

the whole rationale for promisifying is to enable the use of async/await

ornate shadow
#

you're right

#

I turned them into async/await and no errors/crashes now!!! ๐Ÿ˜„

#

gotta test if it really works though

#

that would be awesome

#

it seems it doesn't work; in the sense that the code doesn't run at all... oh well, I guess that's my part to see where's the problem. it's great that async/await works now though! I will come back if I ever need help again, thank you! ^_^

quiet bobcat
#

Is there any way to stop people from searching nswf search terms?

glossy sand
#

tell them not to in a commanding, but not harsh tone

languid dragon
#

no you need to be gentle

glossy sand
#

or alternatively use safesearch

quiet bobcat
#

But actually, how?

#

safesearch?

languid dragon
#

it's near impossible

glossy sand
#

i assume you're talking about google?

quiet bobcat
#

Yes I am

languid dragon
#

you could however regex common words

#

"porn", "sex" etc

glossy sand
#

safesearch is google's fancy web content filtering tech

languid dragon
#

so that if they google stuff like that it stops them

glossy sand
#

are you using their api or just scraping

quiet bobcat
#

scraping

#

got it wrong re

glossy sand
#

why lol

quiet bobcat
#

idk

glossy sand
#

google doesn't like that

quiet bobcat
#

They don't?

glossy sand
#

no

#

they have a tos clause somewhere iirc

#

but anyways you should be able to filter out nsfw by enabling safesearch on the machine you're running the bot on

#

navigate to google's search settings from a web browser

quiet bobcat
#

yeah got it

#

But it still lets me search nsfw terms?

shy rose
#

Yes it just filtered the results

quiet bobcat
#

But no it didn't

#

I can still search and get the same results

shy rose
#

Then its not enabled?

quiet bobcat
#

I enabled it and saved it

shy rose
#

Try your browser with safe search on?

quiet bobcat
#

What should I even search for?

shy rose
#

Something you expect nsfw for?

quiet bobcat
#

I searched something and I still got results

shy rose
#

And see if the safe search in browser prevents it from showing

#

Oh

quiet bobcat
#

are there any other ways to block nsfw terms?

#

except for putting them in manually

earnest phoenix
#

@glossy sand @ornate shadow Use mysql2 instead of mysql.

#

For node

#

A) mysql2 has already a promise based interface.
B) mysql2 supports Prepared Statements.

ornate shadow
#

ok, nice! ^_^