#development

1 messages · Page 649 of 1

lofty hamlet
#

Does not work for me :/

warm marsh
#

Yea, IDK why.

lofty hamlet
#

:/

amber fractal
#

It doesnt sort because your trying to sort letters

warm marsh
#

letters?

amber fractal
#

The array is an array of words

#

Right?

#

Not much to see in that thing

warm marsh
#
let array = [
    "singular", 
    "double", "double", 
    "triple", "triple", "triple",
    "quad", "quad", "quad", "quad"
];
let count = array.reduce((obj, value) => {
    obj[value] = obj[value] + 1 || 1;
    return obj;
}, {});

let sorted = Object.keys(count)
                .filter(key => count[key] > 1)
                .sort((a, z) => console.log(count[a], count[z]));
#

test code

lofty hamlet
#

Ok

#

Me ?

warm marsh
#

No.

lofty hamlet
#

Oh ok

warm marsh
#

obj = { 'singular': 1, 'double':2, 'triple':3, 'quad':4 }

amber fractal
#

Im on a phone and I really dont feel like opening any console

warm marsh
#

Fair

#

It works everywhere else apart from when used node.

opaque eagle
#

What r u trying to do?

keen karma
#

Wth is all this

loud salmon
#

@keen karma its code

keen karma
#

I know it’s a code but for what ?

loud salmon
keen karma
#

They say a code for discord bots ? Idk bye !

west spoke
earnest phoenix
#

.\

west spoke
#

yeet dotpost

spare goblet
#

]]dotpost

covert turtleBOT
#

Please do not post random punctuation marks or letters to clear your messages and/or to get attention. This is considered spam as you are not contributing anything to the conversation. Should you need to get the attention of the chat, simply start by saying hello. Should you need to clear your messages, right click on the channel then click "Mark As Read"; this can be done from mobile by holding down on the channel. Further offences will result in the appropriate consequence.

stray gazelle
#

is wiki command is nsfw?

spare goblet
#

@stray gazelle It depends on what it outputs

#

Some wiki commands from some bots only output a wiki link, whereas some may put a wiki image/content that is NSFW

stray gazelle
#

mine don't send any nsfw image...only link or words @spare goblet

#

and it's gets rejected 😦

spare goblet
#

Can we take this to DMs as it's not really related to development blobthumbsup

stray gazelle
#

sure...and sorry

keen karma
#

Hello

drowsy sentinel
#

What's up?

earnest phoenix
#

Anyone can help me

drowsy sentinel
#

yeet ask2ask

covert turtleBOT
#

By asking if you can ask a question, you have already asked a question so simply just ask the actual question. State exactly what the problem is so someone can help you as soon as possible.

earnest phoenix
#

How to change private bot to public bot

drowsy sentinel
wooden lance
#

^

proper inlet
#

I need to get all the messages in a certain guild in which there are invitations. How can I do this using discord.js?

quartz kindle
#

you can only get 100 messages at a time

spare goblet
#

you can only grab 100 messages, so just grab messages and filter

lofty hamlet
#

@warm marsh i'm back I was sleeping

proper inlet
#

I need the array elements to be sent in turn every 2500 milliseconds, but they are sent after 2500 ms immediately. What am I doing wrong?

var array = ["1", "2", "3"]; 
array.forEach(function(number) {
var time = 2500;
setTimeout(function() {
message.reply(number);
}, time)
});
mossy vine
#

the forEach doesnt get stopped by the setTimeout

proper inlet
#

And how then can I do what I need?

mossy vine
#
const sleep = (milliseconds) => {
  return new Promise(resolve => setTimeout(resolve, milliseconds))
}

array.forEach(async function(number) {
    message.reply
    await sleep(time)
})```
proper inlet
#

Thank you

inner jewel
#

that'll do exactly the same

#
> const sleep = (milliseconds) => {
...   return new Promise(resolve => setTimeout(resolve, milliseconds))
... }
undefined
> const array = [1,2,3,4,5]
undefined
> array.forEach(async x => {
... console.log(new Date().getTime(), x)
... await sleep(2500)
... })
1562334664847 1
1562334664851 2
1562334664852 3
1562334664852 4
1562334664853 5```
#

the function you pass to forEach can take more than one argument

#

the second is the index

#
> const array = [1,2,3,4,5]
undefined
> array.forEach((x, index) => setTimeout(() => console.log(new Date().getTime(), x), 2500 * (index + 1)))
undefined
> 1562334728116 1
1562334730622 2
1562334733119 3
1562334735619 4
1562334738119 5```
mossy vine
#

oh

#

@proper inlet ^

lofty hamlet
#

Hi

#

My code :

            if (!Dresseurs[sender.id]) return message.channel.send("Erreur : `Vous devez être un Dresseur pour effectuer cette commande : ?start`")
            let arrayOfItems = Dresseur.Sac.concat(Dresseur.SSac.concat(Dresseur.LSSac.concat(Dresseur.LGSac))).reduce((obj, value) => {
                obj[value] = obj[value] + 1 || 1;
                return obj;
            }, {});
            let duplicated = Object.entries(arrayOfItems)
                .filter(innerArray => arrayOfItems[innerArray[0]] > 1)
                .map(innerArray => `**${innerArray[0]}** x` + "`" + innerArray[1] + "`\n");
            if (duplicated.length == 0) return message.channel.send("Vous n'avez aucun Pokémon en plusieurs fois")
            if (duplicated.length >= 30) {
                nuber = 30
            } else {
                nuber = duplicated.length
            }
            message.channel.send(`__Voici les ${nuber} premier Pokémons que vous avez le plus en plusieurs fois :\n\n__` + duplicated.slice(1, 30).join().replace(/,/gi, ""))
            break;```
#

I want sort by the innerArray how i can make this

west spoke
#

innerArray[number, word]

tulip solar
#

Fuck I wanna make a web dashboard for my bot but don’t know where to start.

#

Anyone have any pointers or tips?

lofty hamlet
#

Hu ? @west spoke

quartz kindle
#

@tulip solar get a webserver, make a website, figure out oauth2, connect to your bot's database, do things

tulip solar
#

Thanks Tim

wide ruin
#

i have a program that runs by doing npm start in the folder on cmd.exe

#

how do i do it from a file

lofty hamlet
#

Example : i have this now :

#

But i want sort

quartz kindle
#

put a sort before your .map()
something like this .sort((a,b) b[1] - a[1])

lofty hamlet
#

Ok i go test

quartz kindle
#

@wide ruin you want to start it by double clicking a file?

#

make a .bat file

lofty hamlet
#

.sort((a,b) b[1] - a[1])

#

@quartz kindle

#
                .sort((a,b) b[1] - a[1])
                          ^

SyntaxError: missing ) after argument list
earnest phoenix
#

Missing a )

lofty hamlet
#

Yes but where wtf

earnest phoenix
#

a[1]))

lofty hamlet
#

No :/

earnest phoenix
#

Yes

#

ah nl

lofty hamlet
#

No

quartz kindle
#

actually i missed a => lmao

earnest phoenix
#

Ahh

#

Tim u r 2 fast

quartz kindle
#

(a,b) => b[1] - a[1]

lofty hamlet
#

Ok ok

wide ruin
#

@quartz kindle if i run a bat from a folder

#

does it automatically start up with the current dir selected

earnest phoenix
#

No

lofty hamlet
#

He work thx tim

west spoke
#

mk

#

im trying to draw data from a url in java

#

and return it as a string

#

ive tried for so fking long

#
class onCreate {
    //@org.jetbrains.annotations.NotNull
    public static String main(String args[]) throws Exception {

        final URL url = new URL("http://neko-bot.net");
        final BufferedReader in = new BufferedReader(
                new InputStreamReader(url.openStream()));
        final String inputLine = in.readLine();


        //inputLine;

        in.close();
        return inputLine;

    }
    
}
wide ruin
#

@quartz kindle

#

if i run it by double clicking

#

it loads firefox

#

its a .html

#

but idk what npm start loads

#

pretty sure main.js

#

but i just get win script host errors

quartz kindle
#

lol wut

wide ruin
#

its a js file

quartz kindle
#

you have to make a bat file

#

to run it with node

wide ruin
#

what if they dont have node?

#

when somebody runs it

quartz kindle
#

they will have to install it

wide ruin
#

how can i just run a js file then?

quartz kindle
#

you cant

mossy vine
#

you cant

quartz kindle
#

the whole purpose of node.js is tu run js files without a browser

#

if you want to make a packaged software that people can just run, you need to use soemthing like electron or nw.js

#

electron and nw.js are like an embedded browser window with integrated node

wide ruin
#

so if i made a bat

#

and lets say we install node when people install it

#

how do i do npm start when they run it?

#

because it wont load on the right dir

quartz kindle
topaz fjord
#

@west spoke wut

wide ruin
#

"

Try calling the .exe with %~dp0, like this: %~dp0MyProgram.exe.

%0 contains the full path to the called .bat file.

~dp says to get the drive and path, including trailing .
"

#

wot

west spoke
#

Im trying to get values from a url and return with a string, and use setText in the android SDK

wide ruin
#

what does it even mean @quartz kindle?

quartz kindle
#

literally what it says

#

you never made a bat file before?

wide ruin
#

yeah i can make one

quartz kindle
#

so, in the line where you write for example "node mybot.js"

wide ruin
#

just this?

quartz kindle
#

you should add those before

wide ruin
#
pushd %~dp0
npm start```
quartz kindle
#

yes that should work

wide ruin
#

ok thanks

#

is there a way to hide the cmd window?

mossy vine
#

if you wanted that all along you couldve just used pm2

wide ruin
#

uuh what

amber fractal
#

Pm2

#

It's a process manager

#

Literally it's "process manager 2"

wide ruin
#

ok ill look

quartz kindle
#

there is a way to hide the cmd window, but the cmd window is the bot itself

#

if you hide it, you cant shut it down easily

wide ruin
#

its not a bot but ok

quartz kindle
#

well, your app

wide ruin
#

so basially if you hide the window it shuts down

amber fractal
#

pm2 can run anything though

#

Yeah, the terminal is the app

mossy vine
#

if you really want to do it with a bat file, just do start /b node yourstuff.js

quartz kindle
#

you can hide the window and keep it running, but then people wont know it is running

wide ruin
#

it has a window that appears

#

kinda obvious

quartz kindle
#

if you're working on a desktop app, i suggest using electron or nw.js

wide ruin
#

its using electron currently

quartz kindle
#

then you should be able to run it from electron.exe

wide ruin
#

theres not an exe

quartz kindle
#

you need a prebuild version of electron

wide ruin
#

is there a way to just minimise cmd?

#

(with a command)

quartz kindle
#

yes, but it depends on how your files are structured

wide ruin
#

wdym how thet are structured?

quartz kindle
#

for example you can run something minimized from a bat file using start /min file.exe

west spoke
#

May have gotten it

quartz kindle
#

a bat file can run something inside itself, like when you run commands from a cmd, or a bat file can launch something to run externally, and then close itself

#

it depends if your app needs to run in a command window or not

wide ruin
#

start /min file.exe didnt work

quartz kindle
#

you didnt literally type file.exe, did you?

wide ruin
#

i did npm start /min main.js

quartz kindle
#

that wont work because npm runs in the command window

#

/min only works if you're launching an external window

#

your project really sounds like something that should be done with electron or nw.js, but if you really wanna go that way, the simplest way would be to run cmd from your bat file

wide ruin
#

whats the easiest way without a cmd window?

quartz kindle
#

something like start /min cmd.exe "yourdirectory/npm start main.js"

#

the easiest way without a cmd window is you build your project on top of a precompiled electron or nw.js and just run the exe lol

wide ruin
#

pushd %~dp0
start /min cmd.exe "npm start main.js"

#

would what work?

quartz kindle
#

nope because the directories are wrong

#

cmd.exe exists in the windows folder, not in your project, but npm start must be run from your project

wide ruin
#

so what do i need to do instead?

quartz kindle
#

you can try something like start /min cmd.exe "%~dp0npm start main.js" (untested)

wide ruin
#

it doesnt load

#

like cmd opens, then mins

#

but nothing gets typed

#

@quartz kindle

quartz kindle
#

start cmd.exe /k "%~dp0npm start main.js" try this

wide ruin
#

'C:\Users\\Downloads\\npm' is not recognized as an internal or external command,
operable program or batch file.

quartz kindle
#

your main.js is in the downloads folder?

wide ruin
#

no

quartz kindle
#

when why is it in the downloads folder?

wide ruin
#

its in the same dir as the bat

#

no im hiding folder names

quartz kindle
#

so the folder is correct?

wide ruin
#

\\ is just a folder im hiding the name in

#

yeah its right

quartz kindle
#

if you type npm normally it works?

wide ruin
#

yeah

#

"npm start" in the dir from above works fine

quartz kindle
#

try this then

#

start cmd.exe /k "cd %~dp0 & npm start main.js"

wide ruin
#

the npm opens cmd

quartz kindle
#

hmm?

wide ruin
#

running that just opens a different cmd window

quartz kindle
#

and what happens in that window?

wide ruin
#

normal electron opening only

quartz kindle
#

so its working?

wide ruin
#

i didnt want a cmd think open tho

quartz kindle
#

ok, but its working right?

#

then just add the /min now

#

i wanted the window to be seen to see if it works

wide ruin
#

yeah

#

where do i add the /min?

quartz kindle
#

start /min

wide ruin
#

thanks

wide ruin
#

@quartz kindle just out of interest

#

how can i make a file to start it on mac?

mossy vine
#

@wide ruin iirc for mac you need to write a shell script as you would for linux

quartz kindle
#

or use electron precompiled binaries lol

wide ruin
#

no clue about either

mossy vine
#

so if i get this right, you are working on a node project and would like to have an easy way for all people to start it?

wide ruin
#

yes

mossy vine
#

since its electron, you can build/package it for public releases, and tell people to just run npm start to test it

stray garnet
#

exports.run = async (client, message, args) => {

    const useruser = 'Command ran by: ' + message.author.username;
    const userurl = message.author.avavtarURL;

  const exampleEmbed = new Discord.RichEmbed()
  
  .setColor("RED")
	.setTitle('idk')
	.setURL('https://discord.js.org/')
	.setAuthor('Yuqii')
	.setDescription('Test Command')
	.setThumbnail()
	.addField('test', 'test')
	.addBlankField()
	.addField('test', 'test')
	.setTimestamp()
	.setFooter('test', 'test');
      
} 
module.exports.help = {
     name: "test",
     aliases: []
}```

dafaq it does not give me any Response
mossy vine
#

cause you arent sending anything

wide ruin
#

send the embed

stray garnet
#

oh well now i see it...

quartz kindle
#

if you package an electron app with precompiled binaries, people will be able to install/run it simply by downloading a zip file, extracting it, and running the executable

earnest phoenix
#

someone know how to check if a user was kicked ?

#

no events about that in the docs

slender thistle
#

onMemberRemove or something similar, fetch audit logs

earnest phoenix
#

okay

topaz fjord
#

@earnest phoenix there is not event for that

earnest phoenix
#

ik

stray garnet
#

How to display the Profile Picture of the User that Ran the Command?

wheat jolt
#

@stray garnet msg.author.avatarURL

stray garnet
#

thx

wheat jolt
#

this will return an URL

#

With the avatar of the command author

#

You're welcome

slim heart
low wasp
#

What command r u running?

slim heart
#

npm i discordjs/discord.js

low wasp
#

Update git and npm

#

Or manually compile it

slim heart
#

oh w8 havent installed git yet

#

thatll do it

low wasp
#

Lol

#

That may help

wet jackal
#

@tulip canyon

latent oasis
#

How to send huge amount of files to vps via putty?

#

If u know easier way to do it, ping me

quartz kindle
#

zip and unzip

#

@latent oasis

tulip wave
#

Or just just move a whole folder across. Might take a while depending on the network speed

quartz kindle
#

the problem is you cant send multiple files at once via sftp, so if you have 100k files, they will go 1 by 1, which is orders of magnitude slower

late plank
#

you can certainly have simultaneous uploads

inner jewel
#

not over a single connection

late plank
#

correct, but that’s obvious

#

use an ftp client that supports that, i.e. filezilla or smth

split hazel
#

i uploaded all xenforo files w/ filezilla without zipping them and it did so fine

#

just took a while

#

around 20-30 minutes

late plank
#

I’m not sure what the default # of simultaneous uploads are, but it can be tweaked to make the process faster depending on your connection

slim heart
#

thatd likely only be a max of like 5-10 minutes if it was zipped first

opaque eagle
#

How can I convert a value in seconds to smth like x days, x hours, and x minutes etc depending on how much time is there?

low wasp
#

What lib?

earnest phoenix
#

you can use humanizer, if using js

low wasp
#

Or moment.js

#

@opaque eagle ^

slim heart
#

@opaque eagle adding onto browser ^.
use moment and a package i use is moment-duration-format on npm. its really nice and does literally exactly what you just said

split hazel
#

I wrote my own function for my giveaway bot, works nicely and adds things like "second's'"

#

Don't hesitate to ask if you need it 😏

opaque eagle
#

ty peeps

earnest phoenix
#
Debugger listening on ws://127.0.0.1:38190/20cf25a7-f74a-47ea-b211-f0351d601083
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Apex Legends ready for battle
index.js:10
Database {open: <accessor>, filename: "apexbotstats.db", mode: 65542}
index.js:44
Error: SQLITE_ERROR: no such table: accounts
index.js:53
Error: SQLITE_ERROR: near "TABLE": syntax error```
#
var db = new sqlite3.Database('apexbotstats.db')```
#
                db.prepare('CREATE TABLE IF NOT EXISTS accounts (discname TEXT, apexname TEXT, platform TEXT)')
                console.log(db)

                db.each(`SELECT * FROM accounts WHERE discname = '${msg.author.id}' AND apexname = '${username}' AND platform = '${platform}'`, function(err) {
                    if(!err)
                    {
                        console.log(err);    
                        db.prepare(`INSERT INTO TABLE accounts WHERE (discname, apexname, platform) VALUES (${msg.author.id}, ${username}, ${platform})`)            
                    }
                    else{
                        console.log(err);
                        db.prepare(`INSERT INTO TABLE accounts WHERE (discname, apexname, platform) VALUES (${msg.author.id}, ${username}, ${platform})`)
                        }
                    })
                })```
#

Can somebody help me?

low wasp
#

Provide error and we may be able to help

west spoke
#

^

earnest phoenix
#
Debugger listening on ws://127.0.0.1:38190/20cf25a7-f74a-47ea-b211-f0351d601083
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Apex Legends ready for battle
index.js:10
Database {open: <accessor>, filename: "apexbotstats.db", mode: 65542}
index.js:44
Error: SQLITE_ERROR: no such table: accounts
index.js:53
Error: SQLITE_ERROR: near "TABLE": syntax error```
#

it was the first one

low wasp
#

Add db.sync()

earnest phoenix
#

Where?

low wasp
#

After declaring the database

inner jewel
#

apexname = '${username}' AND platform = '${platform}' nice sql injection

topaz fjord
#

Natan

inner jewel
#

never use ${}/string concatenation in sql queries

topaz fjord
#

Lavaplayer doesn't need external nodes right?

inner jewel
#

unless you like users doing whatever they want with your db

#

no

topaz fjord
#

Ok

#

Cool

#

It's pretty nice

earnest phoenix
#

ok , and what should i replace with?

inner jewel
#

prepared statements

earnest phoenix
#

oh

#

with "" or without?

#

i'm new with sqlite , so

#

...yeah 😃

inner jewel
#

google "node sqlite3 prepared statements"

low wasp
#

apexname = username + ' AND platform = ' + platform

inner jewel
#

wrong

#

that's still vulnerable

low wasp
#

Really...

#

How do u do it then?

inner jewel
#

any kind of string concatenation with user input in sql queries allows for injection

#

you do it with prepared statements

low wasp
#

Hmm... True

#

Eg ```php

$sql = $db=>prepare("INSERT INTO ? ('1','2') VALUES (?,?));
$sql=>execute(array($username, $platform));```
A PHP version that is safe?

#

@inner jewel??

inner jewel
#

idk php

#

but that looks like it's using prepared statements

#

so it should be safe

low wasp
#

It's not directly inputting the variables into the query string

opaque eagle
#

Code: https://gist.github.com/SinistreCyborg/881ddbda2daefa72e00f8d77a402ad8f
Depending on whether you mention a user, a role (or its name), or nothing, the command must show info about that user, role, or if u didn't specify anything, info on the server itself. The getters for each type return an embed object, to which the embed's color and footer info are added on to, in lines 28-31. Only the color and the footer show up, meaning nothing from the getters are showing up.

low wasp
#

Gist are personal we can't access them

slim heart
#

Um

#

That’s not true at all lol

earnest phoenix
#

wot

#

gists are public

#

lol

#

it's why they're... gists

slim heart
earnest phoenix
#

the secret tag on gists means whether the gist will appear on the discover page or not

opaque eagle
slim heart
#

At text: `Requested by ${message.author.username}#${message.author.discriminator}`, why not message.author.tag

#

But anyways who’s asking what I’m lost

opaque eagle
#

I'm using Eris, not discord.js

#

Hmm I figured out the problem

#

typeof this.subject simply returns object, not the exact class it's an instance of

slim heart
#

Typeof wouldn’t return the class

#

To check class do ... instanceof Class

opaque eagle
#

Yep it all works now... I replaced typeof this.subject with this.subject!.constructor.name

#

My code readability rating is gonna plummet after this commit lmao

#

Yep... my code complexity rating dropped down from a C to a D

earnest phoenix
#

This code it's ok ? ```db.serialize(function() {
db.prepare('CREATE TABLE IF NOT EXISTS accounts (discname TEXT, apexname TEXT, platform TEXT)')

        var stmt = db.prepare("INSERT INTO TABLE accounts WHERE (discname, apexname, platform) VALUES (?,?,?)");
        for (var i = 0; i < 20; i++) {
            stmt.run("discname" + msg.author.id, "apexname" + i, "platform" + i);
        }
        stmt.finalize();

            stmt = db.prepare("SELECT * FROM accounts WHERE discname=? AND apexname=? AND platform =?")
            stmt.each(msg.author.id, args[1], args[2], function(err) {
                    console.log(row.discname, row.apexname, row.platform);
                }, function (err, count) {
                    stmt.finalize();
                });
            });```
#

nvm i found something i did wrong

#

at insert it's not table

#

i deleted it

#

i want CREATE TABLE line

#
            db.run('CREATE TABLE IF NOT EXISTS accounts (discname INT, apexname TEXT, platform TEXT)')    

            var stmt = db.prepare("INSERT INTO accounts VALUES (?,?,?)");
            for (var i = 0; i < 20; i++) {
                stmt.run("discname" + msg.author.id, "apexname" + i, "platform" + i);
            }
            stmt.finalize();

                stmt = db.prepare("SELECT * FROM accounts WHERE discname=? AND apexname=? AND platform =?")
                stmt.each(msg.author.id, args[1], args[2], function(err) {
                        console.log(row.discname, row.apexname, row.platform);
                    }, function (err, count) {
                        stmt.finalize();
                    });
                });``` no errors but isn't insert anything
#

isn't creating

#

...

#

what should i do?

stray garnet
#

How to have more than one .setURL in an Embed?

low wasp
#

Set url is for the title only 1 title

stray garnet
#

ok

low wasp
#

You can have links like this tho [ABC](https://google.com)

#

@stray garnet

#

In embeds only

stray garnet
#

ok

near igloo
#

HELLO DEVELOPERS

low wasp
#

Hi

stray garnet
#

HELLO NON DEVELOPER

#

lol

near igloo
#

XD

#

i need help

low wasp
#

How may we be of service

slender thistle
#

yeet ask2ask

covert turtleBOT
#

By asking if you can ask a question, you have already asked a question so simply just ask the actual question. State exactly what the problem is so someone can help you as soon as possible.

near igloo
#

i need help

stray garnet
#

Just ask it

low wasp
#

Ask

near igloo
#

thx i donr need coffe mr coffe bot

#

ok

#

how wll i make a link of my web page

#

how wll i make a link of my web page

low wasp
#

We need more information

near igloo
#

so any 1 can search it

#

okok

stray garnet
#

Hmm

near igloo
#

?

stray garnet
#

Tell us more.

low wasp
#

This may help

near igloo
#

i have created a brouser

#

for my fans

stray garnet
#

You mean Website.

near igloo
#

yup

stray garnet
#

ok

low wasp
#

Refer to the video I sent you then

near igloo
#

ok

#

w8 web maswter tools?

low wasp
#

Yes a Google provided tool

near igloo
low wasp
near igloo
#

ok lamme mail this link to my laptop

earnest phoenix
#

Ummm

#

someone knows to use sqlite?

sharp pilot
#

raises hand

#

what's up

earnest phoenix
#

=))

#

i have a command who's doing nothing

#

let me send it to you

#

wait 2 sec

sharp pilot
#

alright

earnest phoenix
#
            db.run('CREATE TABLE IF NOT EXISTS accounts (discname INT, apexname TEXT, platform TEXT)')    

            var stmt = db.prepare("INSERT INTO accounts VALUES (?,?,?)");
            for (var i = 0; i < 20; i++) {
                stmt.run("discname" + msg.author.id, "apexname" + i, "platform" + i);
            }
            stmt.finalize();

                stmt = db.prepare("SELECT * FROM accounts WHERE discname=? AND apexname=? AND platform =?")
                stmt.each(msg.author.id, args[1], args[2], function(err) {
                        console.log(row.discname, row.apexname, row.platform);
                    }, function (err, count) {
                        stmt.finalize();
                    });
                });```
sharp pilot
#

ah, the one thing i haven't done yet: this

earnest phoenix
#

=))))

sharp pilot
#

what package are you using for it?

earnest phoenix
#

sqlite3

sharp pilot
#

oh i hate it //j
have you considered dblite?

earnest phoenix
#

no

sharp pilot
#

understandable

#

it's like 3:30am where i'm at but gimme a bit

earnest phoenix
#

at me it's 10:30 p,

low wasp
sharp pilot
#

ooo that's nice
i've heard of that but haven't touched it tbh

low wasp
#

I use it and it works like a charm

earnest phoenix
#

it's more easy then sqlite

low wasp
#

Yes

earnest phoenix
#

i will try it later or tomorrow

#

now i'm not at home

sharp pilot
#

good luck with it

proper inlet
#

How can I sort all the guild channels? (using discord.js)

quartz kindle
#

sort by what? sort in discord or sort in the bot? by name or by id?

proper inlet
#

I was sealed, not sort, iterate using loop foreach (sorry for my english, i don't know how can i say it)

#

I found I talked about it

message.guild.channels.forEach(channel => {

});
near igloo
#

hello

#

i for got how to mail

#

any 1 can teac me plz??????????????????

warm marsh
#

No.

#

Google it.

split hazel
#

We can only help you if you give more detail, not spoon feed

earnest phoenix
#

Speedy

wide ruin
#

js:

#

how do you check if a string ends with "?", then remove it if it does?

earnest phoenix
#

.replace('?', '')

late hill
#

Strings are like arrays of characters

earnest phoenix
#

@wide ruin

late hill
#

You can use it's length to be able to get the last character

earnest phoenix
#

or slice the begging

late hill
#

How would getting the beginning

#

Help him know the end

maiden mauve
#

you could just use last array index

#

theres like 10 ways in js to do that with a string

earnest phoenix
#

that will remove any question mark in the string and you couldnt be able to tell where @earnest phoenix

slender thistle
#

string[:-1] if talking in py?

maiden mauve
#

var lastChar = myString[myString.length -1];

#

stackoverflow accepted answer

earnest phoenix
#

A npm module exist for hex color? Like check if a hex color exist

wide ruin
#

Thanks

maiden mauve
#

Anyone have a rough guesstimate of how many servers a local machine can host with a small mongo based bot?

#

Like, 100-150 users prompting query commands

#

I wanted to test my game on a larger audience but not sure if a laptop or something would be cool with that

warm marsh
#

Could just use charAt();

maiden mauve
#

I feel like js has an endless dictionary of string helpers

#

the .match codes are like reading brainf**k code though.

mossy vine
#

@earnest phoenix what do you mean by "hex color exist"

maiden mauve
#

I would guess he means the range of hex that correlates to a color

#

maybe for bad user input?

earnest phoenix
#

yes

maiden mauve
#

I'm not really an expert but Hex colors are 000000 through FFFFFF right?

mossy vine
#

correct

maiden mauve
#

16 units x 6 ?

mossy vine
#

you could use d.js resolveColor function

maiden mauve
#

so if the input is longer than 6, bzzt

mossy vine
#
  static resolveColor(color) {
    if (typeof color === 'string') {
      if (color === 'RANDOM') return Math.floor(Math.random() * (0xFFFFFF + 1));
      if (color === 'DEFAULT') return 0;
      color = Constants.Colors[color] || parseInt(color.replace('#', ''), 16);
    } else if (color instanceof Array) {
      color = (color[0] << 16) + (color[1] << 8) + color[2];
    }

    if (color < 0 || color > 0xFFFFFF) {
      throw new RangeError('Color must be within the range 0 - 16777215 (0xFFFFFF).');
    } else if (color && isNaN(color)) {
      throw new TypeError('Unable to convert color to a number.');
    }

    return color;
  }```
#

just remove the color = Constants.Colors[color] part and you should be good to go

#

works with hex inputs, hex as string, rgb, random, and an array of rgb

maiden mauve
#

scope question: My bot generates a list of players based off the documents in a Mongo db (Players->playerSchema)
As the project grows:
a) People in server 1 don't care about people in server 2,3,4...
b) The find {} query to build array of playerlist is going to continually expand and increase time to process

#

example of command

#

should the solution be in the organization of mongo, or filtered in the command?

late hill
#

What's the purpose of the list

#

It's a leaderboard?

maiden mauve
#

Yeah, basically. But all encompassing

#

It lists people who are dead/afk, etc so you can know who your able to attack

late hill
#

Oh

#

Well you can limit the query

#

And you can also skip documents

#

So you could implement pages

#

Using that

earnest phoenix
#

@mossy vine wtf is that

maiden mauve
#

so add a property to schema of the server id and just skip it?

earnest phoenix
#

its in what language ?

late hill
#

Are you using some npm module

#

To interact with mongo

maiden mauve
#

npm, mongoose, mongo

late hill
#

Then you can use .limit() on the query

#

and .skip()

#

So like

#

At first you could just limit by 10

#

Which would get the first 10 documents

maiden mauve
#

the first 10 matching my find etc?

late hill
#

Then for the next page, you limit by 10 and skip 10

#

Which would give the next 10

#

yes

#

You can use .sort() to sort it if you want

maiden mauve
#

ah that's a relevant way to handle a larger load

late hill
#

If you're not using sort it'll be based on document creation time afaik

maiden mauve
#

I'm very proud of my sort command, im pretty new to the async world

#

players.find({}).sort({ level: -1}).exec(function(err,playerArray) { ...

#

I just revamped a json structure into mongo

#

but now I'm thinking bigger picture with multiple servers

late hill
#
Gambler.find().sort(sort).skip((this.page - 1) * this.display).limit(this.display).exists(this.stat.name);```
#

Taken from my leaderboard class

maiden mauve
#

.display is a config of how many to show?

late hill
#

yeh

#

a number

#

I also use exists because some of the stats only apply to some users

#

Users that don't have the stat won't show on it that way

maiden mauve
#

Yeah, that's the whole next level I suppose

#

I've seen many bots that have "prev" "next" buttons that seem to alter an embed

slim heart
#

Do you think there’d be any reason why Array#flat isn’t working every since I moved to a new machine? It just says not s function

cursive gale
#

hey can someone help me? I made a custom event handler and it says that message is not defined i'm sending my code and err

late hill
#

Array#flat is like ~new ig

cursive gale
late hill
#

Outdated system ig

#

?

slim heart
#

It says it was introduced in v10

cursive gale
#

i sent it

tight heath
#

well message is not defined

mossy vine
#

yeah theres no message on guildMemberAdd

tight heath
#

on guildMemberAdd

maiden mauve
#

why are you redefining a passed variable?

tight heath
#

just pass bot, member

#

without message

#

since on guildMemberAdd no message is invoked

cursive gale
#

ohh ok

slim heart
#

I check my node version by doing npm ls node right?

tight heath
#

node -v

slim heart
#

Mk

cursive gale
#

is there a way i can pass all the thing in 1 word?

tight heath
#

yes but it's ugly

#

just do it like this tbh

cursive gale
#

like that?

mossy vine
#

no thats uh

#

even worse

cursive gale
#

then

mossy vine
#

guildMemberAdd doesnt pass a message

tight heath
#

.run(bot, member)

cursive gale
#

so what do i do?

maiden mauve
#

that editor looks like a christmas tree

slim heart
#

oh wait node never updated ree

cursive gale
#

lol

#

it's VSC

tight heath
#

ye with a 🅱asic theme

mossy vine
#

@maiden mauve its atoms One Dark Pro theme

cursive gale
#

every noob's best coding buddy

slim heart
#

how exactly do i update node? i tried rerunning the installer (and no n doesnt work cuz im on windows)

maiden mauve
#

ah, I fell in love with sublime text default for js

cursive gale
#

yeah

maiden mauve
#

I just like the contrast

cursive gale
#

but i like One dark more

tight heath
#

I liek sublime

cursive gale
tight heath
#

@slim heart uninstall old one via control panel, download new msi from https://nodejs.org

#

is my guess

#

if the rest no worky

cursive gale
#

like that?

tight heath
#

yes

#

now in line 15

#

change message.guild

#

to member.guild

late hill
#

If you're on windows

tight heath
#

and you're gtg

cursive gale
#

uhh

late hill
#

Just the msi file with new update should replace the old version

cursive gale
#

kk

#

replaced

tight heath
#

have fun then

cursive gale
#

ty

#

maiden mauve
#

@late hill btw thanks I'll comment that off for future ref

late hill
maiden mauve
#

did you use a Reaction based page Wes?

late hill
#

Nah

#

It's just number input

maiden mauve
#

ah, so its a filtered leaderboard

late hill
#

top stat page

maiden mauve
#

oh man I'm excited I just got the greatest idea

#

imagine there are 100 players in my find query

#

the players place in the sort determines the page loaded

#

nerdgasm

late hill
#

😂

earnest phoenix
#

How would I change the background color of my description?

quartz kindle
#

in the website?

earnest phoenix
#

yes

quartz kindle
#

use css

earnest phoenix
#
<style>
body {
  background-color: #2c2f33;
}
</style>```
#

like that?

quartz kindle
#

yes, but you need to be aware of the context

#

body is the body of the entire website, not the description field

#

the html and css you write is injected into an existing structure

earnest phoenix
#

so how would I go about doing it? im sorry im not familiar with html/css

quartz kindle
#

use the element inspector / dev tools / f12

earnest phoenix
#

so

#
<style>
#content {
  background-color: #2c2f33;
}
</style>
#

?

quartz kindle
#

content is a class, not an id. ids use #, classes use .

earnest phoenix
#

ah ok, got it thanks blobReach

#

and how would i embed a gif?

#

i tried using <img src =... but it just shows a small icon

quartz kindle
#

img src should work, what does it show?

#

whats the gif url?

earnest phoenix
#

the gif

#

what it looks like

quartz kindle
#

remove the v

#

.gif not .gifv

earnest phoenix
#

ah tyty

wide ruin
#

whats the easiest way to wait 1 second in js?

mossy vine
#

await a promise that resolves in a setTimeout

wide ruin
#

ok so if i have a console.log, then i wait 1 s, then console.log

#

how do i do it?

split hazel
#

He just told you

wide ruin
#

i dont get what it means

split hazel
#

Then you should probably learn a bit more js

mossy vine
#

read abuot promises and setTimeout, and then combine the 2

maiden mauve
#

wouldn't those be different?

#

if you declare an async function and await the promise

#

versus just waiting 1 second

#

@lethal ridge what is the purpose of waiting 1 second

split hazel
#

Not really development related

stray garnet
#

oh shit worng channel

maiden mauve
#

this popped up on console

#

that means it failed to send a message?

mossy vine
#

i think so, yeah

maiden mauve
#

hm

mossy vine
#

you can catch the promise or something

#

or abuse .then

maiden mauve
#

does the bot being a part of this server incur strange behavior

#

with people testing?

mossy vine
#

bots can read the human communicating channels

#

but cant respond

maiden mauve
#

my bots only on 1 server and no input given

mossy vine
#

so if a command is triggered in one of those channels, you will get a discordapierror

maiden mauve
#

ah

#

so if someone uses a command for my bot

#

its listening but can't react

mossy vine
#

exactly

maiden mauve
#

👀

#

nothing escapes the watchful eye of mongo

pale marsh
#

@maiden mauve I'd recommend not sharing the info your bot collects about users in here

#

Or anywhere actually

maiden mauve
#

oh

#

I see how that's a tad unbecoming

#

it stores name and flake for index purposes

#

It's set to save anyone who uses a command... ie ?help etc.

#

@pale marsh to reassure you 😉

pale marsh
#

🤦

#

I don't wanna know what data you collect. Just don't send screenshots of it here dude

maiden mauve
#

👍

onyx summit
inner jewel
#

depends on discord

onyx summit
#

like in js you would need to await the leave to send the message after he left

#

Yeah I'm talking about coding it so it will execute after he left

inner jewel
#

you can listen for a voice channel leave event and check if the user is the bot

onyx summit
#

god I hate java already

#

2 bad for me

cedar nova
#

halo bro

#

does anyone have autorole script and no auto nick ?? if there may I ask for it ???

onyx summit
#

what is no auto nick?

formal mauve
#

im having trouble importing the dbl library

onyx summit
#

what lang?

formal mauve
#

i keep getting "unresolved import 'dbl'"Python

#

i ran pip install dbl

#

and it installed

#

but it wont import?

onyx summit
#

||sry I don't know shit about python||

formal mauve
#

all good

cursive gale
#

hey please ignore where it says message ik it will be member but i have tried console logging and channel is undefined can someone help me

slim heart
#

please read up on promises and js scopes

cursive gale
#

ok so how do i make it actually set it without the function that .then(msgs => )

slim heart
#

by googling how to do it properly

cedar nova
#

please give me script auto role and auto nick brooo

slim heart
#

because you clearly dont know what youre doing

mossy vine
#

@cedar nova no

onyx summit
#

async/await or put the stuff in the then function

cursive gale
#

yeah i kinda don't

slim heart
#

so figure it out

cedar nova
#

@mossy vine ohhh no

slim heart
#

we're not gonna walk you through it

cursive gale
#

yes np

cedar nova
#

😭

cursive gale
#

but can i get a quick fix for it

slim heart
#

what youre doing tho is that youre defining somethin in a callback while looking for it outside of it

#

we're not gonna give you code no, thats spoonfeeding

onyx summit
#

@cedar nova ur job to do it, nodoby needs the bot doing the same shit just with another name

cursive gale
#

like i'm trying to make a welcome message

onyx summit
#

read up async/await to fix ur problem above

cursive gale
#

with a command that sets welcome channel

#

and i'm pulling that channel

slim heart
#

you need to do this
.then(etc=>{
etc2 = whatever;
stuff interacting with etc2
})

#

if you put it outside of it itll be undefined

cursive gale
#

hmm

onyx summit
#

I don't get his code anyway, doesnt make any sense to meshrug

spare goblet
#

use async await or resolve promise by .then()

slim heart
#

thats all the help youll get here tho please

#

yea i dont either just whatever lol

cursive gale
#

when i put the channel.send and if(!channel) inside the .then

#

then it also dosen't work

onyx summit
#

show how you did it

cursive gale
#

kk

slim heart
#

google please. like i said i answered, if you dont understand you need to do more research yourself sorry

spare goblet
#

can you wrap your code or something? because you're not showing entire code in ur screenshot

onyx summit
#

but I don't even get what that code is supposed to do, fetchMessages for welcome messages????

cursive gale
#

that i do get but i'm asked for a quick fix for it

slim heart
#

just, stop chy4e if hes doing it like that let him do it,

#

idk what hes doing either but let him go off

cursive gale
#

no fetch the channel from a discord channel i'm using a discord channel as db

slim heart
#

i-

mossy vine
#

uh..

cursive gale
#

why star? am i missing out ?

mossy vine
#

okay guys, i think we reached peak dbl

quartz kindle
#

using a channel as a db lmao

cursive gale
#

yee

#

i'm broke ok?

slim heart
#

no

#

just no

#

it doesnt even cost money i-

maiden mauve
#

random js question, variable <= 0 -- can this result in a boolean or do i need to check if its a number?

quartz kindle
#

i mean, you could just use sqlite or even json files

slim heart
#

its a boolean if im understanding u correctly

cursive gale
#

json like to crupt

slim heart
#

it means less than or equal too

maiden mauve
#

I'll clarify

onyx summit
#

variable <= 0 will always return a boolean, if I got you right

cursive gale
#

and mysql take too much space

onyx summit
#

dude...

quartz kindle
#

sqlite takes almost no space

cursive gale
#

i use free hosting

slim heart
#

guys just stop let him go. clearly this is beyond us all lmao

cursive gale
#

that offers like 100MB storage

onyx summit
#

why not sqlite? or no fs?

cursive gale
#

i have tried all ways of a db

maiden mauve
#

if ( variable >= 0 && variable <= 10 ) .... if the input is "" could this be read as false === 0

quartz kindle
#

well, thats still enough space for several thousands of records, but anyways

onyx summit
#

well using a channel is the most retarded thing you can do, then better use jsons and write them atomic

quartz kindle
#

back to your issue

#

what was your problem again?

cursive gale
#

like

#

chaneel is undefined

#

but it is not

#

but code says it is

quartz kindle
#

its outside the promise scope

cursive gale
#

tried with this too

#

dosen't send the message

#

or my ping is 1yr

onyx summit
#

maybe ur great "db" is just bullshit and doesnt work

cursive gale
#

it does

quartz kindle
#

put the console.log inside the scope

cursive gale
#

i have made soo many stuff with discord db

#

k

quartz kindle
#

and see what it says

cursive gale
#

yes

#

it said this

onyx summit
#

its empty ye

cursive gale
#

hmm

maiden mauve
#

@onyx summit more straight forward, does js comparison operator use strict to differentiate string/boolean/integer share of 1/0 ?

#

or does it confuse a blank string with false and 0

quartz kindle
#

that was returned by console.log(channel)?

cursive gale
onyx summit
#

try it

maiden mauve
#

don't make me do something

#

😭

#

👍

onyx summit
#

just open a browser windows lmao

maiden mauve
#

I was writing a conditional and just got this random fear

#

how far can js go bonkers

onyx summit
#

you do realize that your "db" can't have over 100 entry's because you can only fetch 100 at a time?

quartz kindle
#

@cursive gale looks like thats the output of console.log(welcomedb.messages)

cursive gale
#

hmm

#

wait i'll send screenshot of the db

sage bobcat
#

One message removed from a suspended account.

cursive gale
quartz kindle
#

put console.log(msgs) at the beginning of the .then()

onyx summit
#

@sage bobcat someone even made a package for it, but it was a joke and nobody should ever use that

quartz kindle
#

that package is amazing

onyx summit
#

sqlite, no? jsons, no? any free db, no?

cursive gale
#

hmm

maiden mauve
sage bobcat
#

One message removed from a suspended account.

maiden mauve
#

as I feared

cursive gale
#

i got a long message when i did console.log(msgs)

maiden mauve
#

you have to check type ;D

onyx summit
#

@sage bobcat yes, but the author said nobody should ever use it, its a joke

cursive gale
#

type is text

bright spear
#

You would need to cache all the messages in that channel

#

Not a good idea

#

Just use a real db

cursive gale
#

hmm

onyx summit
#

fetchmessages works, but limited to 100

cursive gale
#

when i get donations then i'll use sqlite

onyx summit
quartz kindle
#

now console.log(channel) right after you define channel, and before you send the message

onyx summit
#

WHY

#

WHY DONATIONS

bright spear
#

@cursive gale you don't need to pay to use a DB...

onyx summit
#

and how many guilds does your bot has?

cursive gale
#

cauz i'm broke

onyx summit
#

sqlite is free

cursive gale
#

it's in dev rn

bright spear
#

You don't need to pay

cursive gale
#

ik

onyx summit
#

json is free

cursive gale
#

but

onyx summit
#

psql is free

bright spear
#

And you probably won't get donations

onyx summit
#

^^

#

I got 3000 Guilds and nobody donates shit

cursive gale
#

sqlite took like 50MB last time i used it

onyx summit
#

and?

#

then use jsons, but write them atomic

quartz kindle
#

you need to offer something for donations

bright spear
#

Try cloud firestore

cursive gale
#

and i use hosts that has like 100MB storage

#

cloud firestore?

#

is that free?

quartz kindle
#

free up to a certain number of reads/writes iirc

cursive gale
#

yes i will have premium commands

onyx summit
#

then use jsons and stop crying, or elephant db, they give you 10MB, heck I will even give you my rethinkdb db

quartz kindle
#

but its more than enough for a few thousands of operations/day

bright spear
cursive gale
#

thanks

bright spear
cursive gale
#

i'll try it out

bright spear
#

Yw

quartz kindle
#

which by the way, google also offers google compute engine, which is a full vps completely free for 12 months

cursive gale
#

i'm not 18 yet..

quartz kindle
#

with 20gb of storage

cursive gale
#

^^

#

i have tried everything

quartz kindle
#

there is also glitch/heroku

#

but they are bad

cursive gale
#

every "free" vps thing

bright spear
#

And most devs arent 18 yet lol

cursive gale
#

yeah

quartz kindle
#

you just need a credit card, you can borrow one from someone

maiden mauve
#

just how big do you think your bot will be

quartz kindle
#

unless your family/friends situation is really bad

maiden mauve
#

the free servers/storage is pretty generous for projects

bright spear
mossy vine
#

oh that kinda sucks ngl lmao

bright spear
#

?

#

I've been using it fine

maiden mauve
#

my bot on a single server uses 80kb/ 512 MB of free Mongo DB

quick mason
#

hello

cursive gale
#

wow

quick mason
#

@ashen kraken

cursive gale
#

i will use fire store now

#

or firebase

bright spear
#

Glitch should be fine until you get to like 4000 servers

maiden mauve
#

but really, server costs are pretty minimal until you get to professional applications

#

theres no reason a teenager can't put $50 a month in a paypal/bank

quartz kindle
#

50 a month??? you can get vps's for $3 a month

maiden mauve
#

yeah

#

I'm thinking lawns mowed + fatigue + out of shape

#

😉

cursive gale
bright spear
#

What

#

How did u get that

cursive gale
#

yeah

#

idk

bright spear
#

What did u type or whatever

pearl parcel
#

I'm trying to setup a system whereby users can schedule things with my bot (node js), but i'm having trouble with timezones. The server runs on UTC, but obviously users will be from all different timezones. So if they try to schedule something for, say 10:00, 10:00 server-time is not going to be what they expect in their time. Is there a way to find out the user's timezone? I thought that new Date() would be client-based and show their time, but it seems to always show the server time, when different users call the command which displays that date/time.

Or does anyone know if there are any examples of other open source bots who do scheduling, so I can see how they do it?

quartz kindle
cursive gale
#

ty

quartz kindle
#

@pearl parcel its impossible to get user timezone/location

cursive gale
#

i got that when i clicked create project

quartz kindle
#

@pearl parcel what you can do is to ask them to define their timezone and save it in your database

#

or ask them "what time it is for you right now" and edit the time accordingly

pearl parcel
#

ok ty

onyx summit
#

why would you think new Date would be the time of the client

pearl parcel
#

cos it is when you use it as a timestamp in an embedded msg

bright spear
#

You can't run any code client side

cursive gale
#

i got it

bright spear
#

The timestamp localizes cuz it's a discord feature

cursive gale
#

i'm banned form dev services on google

topaz fjord
cursive gale
#

and the reason i'm not gonna tell

#

ouch

pearl parcel
#

o

bright spear
#

Tf

quartz kindle
#

country restrictions?

onyx summit
cursive gale
#

no

#

ty

onyx summit
#

don't

#

use

#

it

vague chasm
#

o

glad charm
#

Yikes.

onyx summit
#

This project was written as a joke

#

what you are doing is even worse

#

so don't do that

#

any of this

cursive gale
#

nope

#

not gonna

onyx summit
#

thats what you are doing all the time..

#

but worse...

cursive gale
#

i'm gonna stick to my next lvl discord channel storing things way

onyx summit
#

you can only fetch 100 msges at a time

#

||if you really can't do shit about it dm me and I will let you host the bot on my server, I do this for 4 other ppl atm||

vague chasm
#

what if u do

#

fetchMessages({limit: 40000000})

onyx summit
#

then reject

vague chasm
#

@onyx summityo i want free hosting too lol

glad charm
#

handing out your token

#

Thonk HMMMMMMMMMMMM

onyx summit
#

yes, thats the downside, I could be an ass and steal ur token

cursive gale
#

uhm

#

should i trust u then?

glad charm
#

If you are able to use GCP you get a free year with a afree $300 limit.

cursive gale
#

i mean someone once did it to e

#

@glad charm read my messages above

#

i'm banned

glad charm
#

are able to u

cursive gale
#

for a reason that i must not tell

maiden mauve
#

the only reason you'd ever give token to anyone?

#

to host your bot? (but then they'd have source code too?

glad charm
#

Famously said by JaGeX Never give your password, not even to family or friends

#

Or some shit like that.

cursive gale
#

yeah

#

i wanted free hosting

split hazel
cursive gale
#

but that guy stole my token

#

BTW let's get on topic now

onyx summit
#

I currently host for @molten slate @tepid stirrup @green swan

topaz fjord
#

Yeah I wouldn't trust free hosting

opaque eagle
#

^

topaz fjord
#

Also if you can't use gcp azure gives a year free trial

onyx summit
#

shrug do what you want

split hazel
opaque eagle
#

(Line 18 of Guild.ts)

glad charm
#

type => Var

#

You seem to have () => Case

#

Just replace () with type?

opaque eagle
glad charm
#
If you want to use @OneToMany, @ManyToOne is required. Where you set @ManyToOne - its related entity will have "relation id" and foreign key.```
#

And we can see that the Guild is ManyToOne

#

I'm not familiar enough with this, sorry.

slim heart
#

is there some regex thatll test for special characters

#

anything that isnt numbers and letters

glad charm
#

Yeah you can specify not numbers or letters.

slim heart
#

how exactly :p?

inner jewel
#

just use a character class for everything but alphanumeric

#

[a-zA-Z0-9] matches only alphanumeric

glad charm
#

So you can do /^[a-zA-Z0-9!@#$...etc/g

inner jewel
#

add a ^ and it negates

glad charm
#

^^^ Best girl has the right idea.

inner jewel
#

[^a-zA-Z0-9]

#

or you can test it's only alphanumeric

#

aka the whole input matches ^[<alphanumeric>]+$

slim heart
#

Oh alright, what’s the ^?

inner jewel
#

outside a character class, it's the beginning of the string

#

$ is the end

slim heart
#

Ah i see perfect thank you so much

inner jewel
#

^ inside a character class is "everything but these"

slim heart
#

Oh I see ok

maiden mauve
#

"4567 stuff is fun4you 67".match(/^\d+|\d+\b|\d+(?=\w)/g); //=> ["4567", "4", "67"]

#

I attempted to decipher the documents on js string filters

#

but it's a brain ache

sage bobcat
#

One message removed from a suspended account.

onyx summit
wide ruin
#

how do you get a string, and output each character 1 second apart?

#

js

#

like how do you use setTimeout and stuff

low wasp
#

Split it into an array

onyx summit
#

or use Array.from(string)

#

and then loop with it with
for (const thechar in thearray)

glad charm
#

or "stringhere".split("")

wide ruin
#

s.split("")

#

so i have that

low wasp
#
console.log('5 seconds later')
}, 5000)```
onyx summit
#

I don't think that will work

#

with a loop

maiden mauve
#

setInterval( () => {
...
}, 1000);