#development

1 messages ยท Page 1191 of 1

earnest phoenix
solemn leaf
earnest phoenix
#
    name: 'kick',
    description: "This kicks the user mentioned.",
    execute(message, args){
if(message.member.permissions.has("KICK_MEMBERS")){
const user = message.mentions.users.first();
if (user) {
    const member = message.guild.member(user);
    if (member) {
        member
        .kick()
        .then(() => {
            message.reply(Successfully kicked ${user.tag});
        })
        .catch(err => {
            message.reply('I was unable to kick this user.')
            console.error(err);
        });
        }
    } else {
        message.reply("You didn't mention a user to kick!")

    }

} else {
    message.reply("You do not have permisson to execute this command!")
}
    }
}```
#

how do i make it so i cant kick myself

solemn leaf
#

check

#

if the pinged use

#

==

#

message.author

misty sigil
#

Use an if statement

solemn leaf
#

ezz pzz

sudden geyser
#

check if member is equal to yourself

#

such as comparing user IDs

earnest phoenix
#

oki

sand skiff
#

wait

#

if my bot

#

will i be able to make a website

#

with .gg

#

like

#

or

dense vessel
#

dont
ladder
type
please

sand skiff
#

sorry

dense vessel
#

and nope

sand skiff
#

oh

dense vessel
#

you'd have to buy ur own site host

sand skiff
#

are those for verified ones only?

#

oh

slender thistle
sand skiff
#

oh

#

ok

#

thx

#

what is the best way to create a website for free?

slender thistle
#

There's no really best way to have a free website other than using a free domain

sand skiff
#

free domain?

#

what is that

slender thistle
#

websitename.domain

sand skiff
#

so

#

is gg a paid domain?

slender thistle
#

yeah

sand skiff
#

ohh

#

and com

slender thistle
#

Most of them are

sand skiff
#

ok

#

i need a partner to help me create my bot

#

๐Ÿ˜ญ

slender thistle
#

well,

#

-needdev

gilded plankBOT
#

DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.

sand skiff
#

none of my good scripter friends reply

#

like ever

#

oo

brave orchid
#

I need some help About canvas

slender thistle
#

Sometimes it's easier to maintain a project solo than with people you don't know blobshrug

dense vessel
#

Sometimes it's easier to maintain a project solo than with people you don't know :blobshrug:
this^

slender thistle
#

well, easier and safer

dense vessel
#

u can rely on urself the most

quartz kindle
#

unless you're a lazy bum like me

dense vessel
#

or me ye

quartz kindle
#

then your projects take ages to get done

thick gull
#

or have lots of money

#

:)

dense vessel
#

then your projects take ages to get done
or you have loads of unfinished ones

slender thistle
#

lmao Tim

thick gull
#

or you learn a language and then give up on a project and forget about it resulting in lots of unfinished projects

COULD NOT BE ME

slender thistle
#

I promised to help someone rewrite their bot in fucking winter
5 months later, I only rewrote the main file

thick gull
#

shiv rewrite my bot

#

2 robucks

slender thistle
#

Is it in Python?

thick gull
#

no its in roblox lua

slender thistle
#

Sure, I'll slap a mem leak somewhere

thick gull
#

there are no libs for roblox lua cause you cant run stuff like discord bots in it

#

but there has to be a way

dense vessel
#

if its code then its possible

#

are refractors and switch cases recommended for js bots?

quartz kindle
#

why not

dense vessel
#

idk im rewriting my bot so i thought about doing that more efficiently

sick cloud
#

@quartz kindle heyo, does djs light have an option to work with a custom sort of caching system

#

like quickly adding a custom external cache and just letting the lib use it through scaffold funcs

quartz kindle
#

you'd need to write it yourself

#

if you want to hack djs to use an external storage you'd either need to rewrite almost every djs method out there to support async calls

sick cloud
#

f

quartz kindle
#

or use something like better-sqlite3 which is synchronous

#

so you can hack it into collections

sick cloud
#

so there's no easy enough way to do so

#

puts out my plans of using something like redis to handle the caching

quartz kindle
#

you're not the first to try

#

the problem is that all djs internal functions use .cache.get and such

#

you cannot hack them to use redis because the entire lib expects it to be sync

sick cloud
#

yeah

#

so it'd just be a mess to go through probably

quartz kindle
#

ye

#

but its doable if you use better-sqlite3

sick cloud
#

maybe eris is better, though it has zero good voice

quartz kindle
#

eris has the same problem

sick cloud
#

i'm just trying to make a small music bot but pull mem use and such as low as it can go

#

yeah

earnest phoenix
#

@solemn leaf Oi

<Video Title>.replace(/\&\#\d+\;/g, group => String.fromCharCode(group.match(/\&\#(\d+)\;/)[1]))```
#

This would make it work

slender thistle
#

discord.py
In TextChannel.edit, the overwrites kwarg expects a target-PermissionsOverwrite dictionary where target can be either a role or a member. Is it possible to simply pass discord.Object as the target?

Reason for my assumption is because I feel that discord.py internally simply gets the .id property of the target and sends it in request payload

solemn leaf
#

@earnest phoenix so
${results[0].replace(/&#\d+;/g, group => String.fromCharCode(group.match(/&#(\d+);/)[1]))}

thick gull
#

really looks like i mashed my keyboard to me there

earnest phoenix
#
${results[0].title.replace(/\&\#\d+\;/g, group => String.fromCharCode(group.match(/\&\#(\d+)\;/)[1]))}```
#

@thick gull That's how regex works

dense vessel
#

holy

earnest phoenix
#

Like you let your cat walk on your keyboard

thick gull
#

is this how all languages were made

#

some just

#

slammed their keyboard

#

really seems like it to me

solemn leaf
#

worked

dense vessel
#

gj

earnest phoenix
#

K made that myself

sick cloud
#

@quartz kindle based on the defaults of the light package though, dropping it into an existing music bot, should it still work or would there be some issues with how it'd work

earnest phoenix
#

Gave me some headache

thick gull
#

now aki make it play the video @everyone

#

:)

sick cloud
#

very much wanting to use it but i dont want to make dev painful

thick gull
#

totally didnt ping everyone in a server with a bot like that

solemn leaf
#

@thick gull no

#

it gonna eb embed

#

so everyone ping wont work

thick gull
#

good

solemn leaf
#

this was just for test

thick gull
#

` `

#

can be escaped

#

with userinput

#

:)

earnest phoenix
#

Damn I'm happy i know regex that i can make things like that

#

Regex is so helpful

sudden geyser
#

Regex is like riding a bike. Looks impossible at the start then gets easy later on.

earnest phoenix
#

But regex Should be avoided as much as possible

solemn leaf
#

@earnest phoenix would like to see the docs for this

sudden geyser
#

Why avoid it? Embrace it

earnest phoenix
#

No i mean

sick cloud
#

regex gets resource intensive

earnest phoenix
#

Idk why people say, "avoid using regex as much as possible"

#

"it's slow"

#

Wot

#

Regex is not slow and never was

sudden geyser
#

It can be slow.

dense vessel
#

how does one even learn regex tho

sudden geyser
#

You can write it poorly as well for how small it can be.

#

You learn regex by trying it out.

#

Press on Cheatsheets or RegEx Reference on the side

dense vessel
#

thanks lite

earnest phoenix
#

It can be slow.
@sudden geyser Yes if you include millions of characters just for a single regex

clear wraith
#

@rancid dune Ask your question in here, please.

sudden geyser
#

I don't remember how long it was but there was some giant regex someone wrote to match all email addresses

#

it was like 300k characters

sharp thicket
#

hmm does anyone know a good music library and the version of it since im hosting on heroku

earnest phoenix
#

music library?

sharp thicket
#

module*

#

like discord.js

sudden geyser
#

I hear talk about erela.js

earnest phoenix
#

The best way to play Stream buffers of a youtube video or whatever is using ytdl-core

sharp thicket
#

do i have to provide links for it?

pale vessel
#

youtube-dl mmLol

sharp thicket
#

or just names?

earnest phoenix
#

ytdl-core can only search for links

#

You can use an npm package like simple-youtube-api to get videos with names with an api key

sharp thicket
#

so if i do like

rancid dune
#

@clear wraith

sharp thicket
#

prefixplay song

#

it will search the song?

#

And play it

earnest phoenix
#

Of course

clear wraith
#

Yes? @rancid dune

earnest phoenix
#

If the song exists

sharp thicket
#

then i just do .catch this song was not found?

earnest phoenix
#

A stable music system is way harder than you think, but up to you to make one

sharp thicket
#

oh ok

earnest phoenix
#

@sharp thicket Can work but i always use try catch

sharp thicket
#

um one more question

#

im using heroku for hosting how do i add it ?

#

ok found it

brave orchid
#

I need help

sharp thicket
#

with?

brave orchid
#

Canvas

faint prism
#

Very descriptive

brave orchid
#

Yea.D

#

I want use

#

Custom font

#

And

#

I used in glitch

#

But ฤฑ cant use in my pc or vds

faint prism
#

<canvas style="font-family: comic sans ms> </canvas>

brave orchid
#

In glitch 0 problem

forest drift
#

is there a specific format to upload ur bots files to a private github or can u just upload ur entire project folder as is if it already runs fine on node and on heroku?

earnest phoenix
#

github isn't a server platform

#

it's just file hosting for repos

#

it doesn't care what type or what language your project is in

brave orchid
#

@faint prism ฤฑ know

forest drift
#

i wanna upload my files to there so i can then import them to glitch.com

faint prism
#

You know what?

brave orchid
#

<canvas style="font-family: comic sans ms> </canvas>
@faint prism

earnest phoenix
#

lol good luck, auger

brave orchid
#

But not worked in pc

#

And vds

#

I can use only in

#

Glitch

faint prism
#

lol good luck, auger
@earnest phoenix ๐Ÿ˜ฌ

#

Ghostping

earnest phoenix
#

i mean neither are meant to be used as a platform for hosting bots in the first place

#

both glitch and heroku started cracking down on projects misusing their platform

forest drift
#

yeah but whats the fun in using theings for their intended purpose XD

faint prism
forest drift
#

both glitch and heroku started cracking down on projects misusing their platform
@earnest phoenix according to their forums discord bots are allowed ;-;

earnest phoenix
#

they made that statement a while ago

faint prism
#

We are all just ultracrepidarians

earnest phoenix
#

they recently announced that they will start blocking and terminating projects using uptimer-esque bots

#

"recently"

high bough
#

Sad

forest drift
#

what can i use for a discord bot that has a database ๐Ÿ˜ญ

high bough
#

No more free platform then

forest drift
#

fck

faint prism
#

what can i use for a discord bot that has a database ๐Ÿ˜ญ
@forest drift mongodb atlas

forest drift
#

?

#

never heard thatone before

high bough
#

what can i use for a discord bot that has a database ๐Ÿ˜ญ
@forest drift MongoDB Atlas and mongoose module

faint prism
#

Google it. It's a free nosql database

high bough
#

Google it. It's a free nosql database
@faint prism Google

forest drift
#

tell me more please

faint prism
#

Are you asking me to Google it for you?

high bough
forest drift
#

so its like heroku but supports databases?

quartz kindle
#

no

high bough
#

No

#

It doesn't host your bot

#

It hosts your cloud database

faint prism
#

It is a cloud db

forest drift
#

so i wont have to come back to my pc to find 500 pings from my friend pinging me complaining that the bot is down

quartz kindle
#

you guys misunderstood him, he wants a hosting service that supports databases, not a database

forest drift
#

oh...

high bough
#

Any VPS works

faint prism
#

Databases. Plural?

high bough
#

Get a cheap one

forest drift
#

so, could i combine it and heroku?

high bough
#

Yes

forest drift
#

it hosts the database and heroku the bot?

high bough
#

Use mongoose

#

it hosts the database and heroku the bot?
@forest drift Yes

forest drift
#

:D

#

I shall live again

faint prism
#

Vps

brave orchid
forest drift
#
const sequelize = new Sequelize('database', 'user', 'password', {
    host: 'localhost',
    dialect: 'sqlite',
    logging: false,
    storage: 'database.sqlite',
});
const strvarsave = sequelize.define('strvarsave1', {
    name: {
        type: Sequelize.STRING,
        unique: true,
    },
    description: Sequelize.STRING,
});
#

thast what i currently use for the database

faint prism
#

@faint prism ฤฑ said ฤฑ want use custom font file
@brave orchid then use CSS. What's the problem?

high bough
#

Well mongoDB doesn't use sqlite i don't think

forest drift
#

;-;

high bough
#

Idk

brave orchid
#

For discord bot

earnest phoenix
#

mongo and sqlite are polar opposites

forest drift
#

so i have to recode almost a thousand lines... eh not even suprised anymore

faint prism
#

Well mongoDB doesn't use sqlite i don't think
@high bough it uses BSON iirc

high bough
#

Ahh, yeah, that's right

forest drift
#

so... what database host could i use thatd work with sqlite...

faint prism
#

Sqlite is relational,
Mongodb is non-relational

brave orchid
#

let text = Canvas.registerFont("/app/9a74334b-2f2a-4a8c-8c2d-9a81bd279d6b%2Ff7b0877a-f406-4222-bd77-33e69195fcd0%2FBebas Neue Pro Bold.otf", { family: "myFont" })

#

Like this

#

This is in glitch

faint prism
#

Is that a question?

high bough
#

it's just so funny that I made my mongoDB login smlt

mongoose.connect(
  `mongodb+srv://${login.mongodb.username}:${login.mongodb.password}@${login.mongodb.cluster.url}.mongodb.net/${login.mongodb.cluster.database}?retryWrites=true&w=majority`, {
    useUnifiedTopology: true,
    useNewUrlParser: true
  }
).catch(err => console.log(err));
brave orchid
#

I want use this in my PC or vds

faint prism
brave orchid
earnest phoenix
#

you could've made that less of a pain by using ef core ๐Ÿ™ƒ @faint prism

#

consider migrating your code to it later on

forest drift
#

ah god i just spent today coding the sqlite stuff... eh i got nothing better to do

#

been coding for almost 3 days straite... (shown in my current status) who needs a life...

earnest phoenix
#

i've been working with electron for the past week

#

a pain

#

but such a beauty

forest drift
#

i mean without sleep

earnest phoenix
#

yeah me either :)

sudden geyser
#

What are you using it for? Just for learning?

forest drift
#

skillz, props to u dude

faint prism
#

you could've made that less of a pain by using ef core ๐Ÿ™ƒ @faint prism
@earnest phoenix I've never used Entity Framework, but it's something I've considered learning. With my current approach, I'm free to make my db context anything I want without refactoring

forest drift
#

imma have mental issues by the time i get this bot working

earnest phoenix
#

the beauty of โœจ abstraction โœจ

faint prism
#

Mhmm

forest drift
#

im considering making a new computer with my old motherboard just to host the bot now...

#

would that work?

earnest phoenix
#

yeah

forest drift
#

ive only ever run it for 24 hours on my current computer

earnest phoenix
#

you can even run it on a mini pc, i.e raspberry pi

forest drift
#

would it be worth it?

earnest phoenix
#

if your internet is reliable, go for it

forest drift
#

i have a rasberry pi 3 thats just collecting dust :D

earnest phoenix
#

polymorphism is the beauty of c# @faint prism ๐Ÿ™ƒ

forest drift
#

how do u code a raspberry pi 3 -___-

earnest phoenix
#

"code" ?

forest drift
#

well setup

faint prism
#

Lol

earnest phoenix
#

there should be a plethora of tutorials online

forest drift
#

the one i have is a completely factory default one...

faint prism
#

Just install an is like you would any Linux dist

#

And boom

forest drift
#

they scammed me, i was given a corrupt 16gb sd card for it

faint prism
#

It's a server

forest drift
#

i have fedora 32 software on this computer im using rn

#

would that work to setup a raspberry pi?

#

i wonder if i could make a bot that u can codse in commands from discord :D

#

like where it adds new module.export files that u custom conde on the actual discord server :D

faint prism
#

I mean yeah it'd work

#

I'd recommend Ubuntu Server 20.04 LTS

forest drift
#

is making a bot that secretly gathers data without the users concent and stores it externally allowed okeh

sudden geyser
#

Considering you need to state what data you collect no

forest drift
#

;-;

#

darb

#

*darn

sudden geyser
#

What do you need to collect which you don't want to state to your users anyway.

forest drift
#

that ruins the fun... welp back to a boring helpful bot pandasad

#

What do you need to collect which you don't want to state to your users anyway.
@sudden geyser ;-; no comment... just maybe every message they send to build a database on every user that comes in contact with the bot to later be used as an april fools day update where u can type (prefix)what did i say(?) where itll then send a completely random message u once sent, showing the day, time, server and channel where the message was sent

#

would that kinda thing be allowed?

faint prism
#

Not without their consent

forest drift
#

darn... its not rly a suprise if they already know ๐Ÿ˜ญ

faint prism
#

TOS says you can't use a user's data in a way that is considered unexpected or will surprise them

forest drift
#

how would i get their concent without them rly knowing?

faint prism
#

What

#

That's sketchy af

forest drift
#

thats not called malitious, thats called boring

faint prism
#

You HAVE to ask the user

forest drift
#

i mean like have a checkmark reaction embed, where it says "do u accept this bots t's and c's and privacy policy?" with a link to a 20k page doc where theres 3 lines that mention the gathering of data for later use?

sudden geyser
#

You need to get "consent" from the user. An example of consent would be having the user run a command where they basically say "Yeah I agree". Heck, even interacting with the bot can be consent.

#

They're also requiring bots to have privacy policies as well so you could look at that.

forest drift
#

so, with a link to a 20k line page, theyll just accept and never be the wiser?

#

i like ur thinking ๐Ÿ˜

#

lol

sudden geyser
#

bring your lawyer owoOmegaNom

earnest phoenix
#

This is just like oauth2 applications

cloud girder
#

I need an server creator

#

Bot

forest drift
#

bring your lawyer :owoOmegaNom:
@sudden geyser i already have an army of them cause im bound to stuff up

slender thistle
#

Get a fucking DPO also mmLol

earnest phoenix
#

<The hell is DPO btw>

cloud girder
#

I need an server creator bot what i can use

lone coyote
#

Dpo?

slender thistle
#

Data protection officer

forest drift
#

oh no the mod ;-; nothing to see here heh heh ๐Ÿ˜… deffinately not planning a way to legally log every users data without their knowledge lol, what would make u think that heh heh ๐Ÿ˜…

cloud girder
#

Guys I need an server creator bot what i can use

slender thistle
#

Mainly mocking GDPR here

#

Meh by now I ran out of fucks to give

cloud girder
#

@slender thistle

lone coyote
#

Btw Shivaco, Thanks for your help with my bot in the past

forest drift
#

oh phew its a cool mot ๐Ÿ˜…

slender thistle
#

Your legal responsibilities to ensure compliance with Discord ToS, not mine

cloud girder
#

@slender thistle did tou see my letters

slender thistle
#

I did and

#

-hardrequest

gilded plankBOT
#

You seem to have asked for a very specific bot/feature. You likely won't find it on the site if you haven't searched already. You can try and put a request on Fiverr or Freelancer.

cloud girder
#

Bruh

forest drift
#

so if there was a link to a 20k page doc and 3 lines requested the permission to log their every action where they have to click accept on that 20k page document?

#

thatd count as getting concent?

lone coyote
#

Put it in the middle to end

#

And yes it should, but ianal

forest drift
#

:D

slender thistle
#

I'm not a lawyer

forest drift
#

Welcome to the jamie show, legal ways to break the law XD

slender thistle
#

FWIW put it somewhere where the user can clearly see it

earnest phoenix
#

Are you guys talking about privacy policy

slender thistle
#

User consent

forest drift
#

right got it, make everything size 15 and that concent size 6 XD

lone coyote
#

Shivaco, I know I say this everytime I see you, but thanks for your help on my bot, as really nobody else helped

slender thistle
#

etc etc explicit and informed user consent

forest drift
#

do u rly need concent to tracj a users every move eh

slender thistle
#

Yes

forest drift
#

no fun

slender thistle
#

Nothing legal is fun

forest drift
#

T-T im underage and in a different country... safe :bliss:

slender thistle
#

and if you're in this industry to track users, have fun if you get lawsuits thrown your way

forest drift
#

nununu

slender thistle
#

Your parents may be held accountable legally still

forest drift
#

not my plans

earnest phoenix
#

do u rly need concent to tracj a users every move eh
@forest drift Have you realized that oauth2 would never do anything unless you authorize it?

#

This case is that thing of a kind

#

It needs consent

forest drift
#

ah ok

#

so, just somehow trick them into concent?

#

.... all for a future april fools command... the work i do for so little

earnest phoenix
#

Ask them if they want their data tracked or not

forest drift
#

hahahaha

#

yeah, thatll deffinately get 100% yes

#

i wish it was that easy

slender thistle
#

That's the pain of compliance with a company's guidelines

earnest phoenix
#

Or just do an announcement, say who allows their account to be tracked react with ๐Ÿ‘, if no then react with ๐Ÿ‘Ž

#

All easy

slender thistle
#

You either comply or get shit thrown your way

earnest phoenix
#

do u rly need concent to tracj a users every move eh
welcome to discord

forest drift
#

yup

earnest phoenix
#

discord tracks almost every move you make lol

#

if you open up inspect element you can see the element for it

forest drift
#

but there are always ways to get someones concent without them actualy knowing theyre giving concent to tracking

#

discord tracks almost every move you make lol
@earnest phoenix so true

marsh lava
#

does anyone here know how to make commands two words long

earnest phoenix
#

Discord already tracks what you do
Asks users to ask for consent to track others data
Discord logic

forest drift
#

if i, a 15yr idot can code custom discord themes, imagine what someone with skills can do

slender thistle
#

That's storing user data without consent and you are liable to have your access to API restricted

#

or possibly even a fucking lawsuit if it's severe enough and if Discord cares

forest drift
#

again... all for a april fools command....

slender thistle
#

or just don't make it and don't bother

earnest phoenix
#

behind the scenes all companies sell and exchange data, they're just legally obliged to say they aren't

slender thistle
#

Simple as it is

earnest phoenix
#

<Says like if many cares about their user object for example to be stored>

forest drift
#

welp im stuborn and now set on getting the data for the april fools command, time to learn law :/

earnest phoenix
#

But it's discord's ToS

lone coyote
#

@forest drift relatable

forest drift
#

anyone know how a 15yr can become a lawyer and potentialy take on discord all for an april fools command? ๐Ÿคฃ

lone coyote
#

No sorry

forest drift
#

darn... welp time for my plan B

earnest phoenix
#

Do you really need to get your whole reputation and maybe your life because of a lawsuit to be applied to be ruined for an april fools thing?

split hazel
#

worst case scenario your account and bot gets banned

forest drift
#

Do you really need to get your whole reputation and maybe your life because of a lawsuit to be applied to be ruined for an april fools thing?
@earnest phoenix yes XD

mystic pike
#
            message.channel.send('no');
        } else {```
how do i make it so if the message contains @ everyone it says no
forest drift
#

worst case scenario your account and bot gets banned
@split hazel i mean thats not too bad?

split hazel
#

well depends

slender thistle
#

This is why I sometimes hate the Discord bot dev community

#

no one takes legal shit seriously

forest drift
#

just lose 300+ friends, multiple servers, a few bots... worth it for the april fools command

earnest phoenix
#

Discord doesn't care much, devs don't also

#

Nothing is in place

mystic pike
#

what april fools command

forest drift
#

i wanna track user data to eventualy make a command where u type (prefix)what did i say(?) and itll post a random message uve posted in the past, including the timestamp, date, server, channel

earnest phoenix
slender thistle
#

@mystic pike if question.includes("@everyone")

earnest phoenix
#
                                     ^

ReferenceError: prefix is not defined```
mystic pike
#

thank you

slender thistle
#

A blind guess but you get the point

earnest phoenix
#

Could someone help?

forest drift
#

u have no prefix ;-;

earnest phoenix
#

I do

forest drift
#

its literally in the error message, just check over the variable names

earnest phoenix
#
            message.channel.send('no');
        } else {```
how do i make it so if the message contains @ everyone it says no

@mystic pike js if (message.content.match(new RegExp(`\<\@\&?${message.guild.id}\>`))) { return message.channel.send("No"); }

mystic pike
#

the question.includes works

earnest phoenix
#

Well up to you

#

@earnest phoenix Define prefix at least

slender thistle
#

why use regex for everything

earnest phoenix
#

Because yes

slender thistle
#

also the ateveryone isn't converted into a mention

forest drift
#

can i somehow sponsor dbl just long enough to make them add a :troll_face: emoji?

earnest phoenix
#

It's in my config

forest drift
#

did u link ur config?

earnest phoenix
#

Works for every other command

slender thistle
#

not everything is money. Try to suggest it to admins

earnest phoenix
#

@earnest phoenix js let prefix = <Your config file>.prefix;?

slender thistle
#

High chances of it being rejected

forest drift
#

did use
const {prefix} = ect
or smt else?

#

High chances of it being rejected
@slender thistle i shall prepare a 25 hour long speach and start a roit for it lol, also btw the sponsor was a joke, i have no money, this is 2020

earnest phoenix
#

can i somehow sponsor dbl just long enough to make them add a :troll_face: emoji?
@forest drift Did you think they would listen

forest drift
#

nope

earnest phoenix
#

Hell in the no of no

forest drift
#

i just rly want a :troll_face: emoji

#

itd be perfect

#

and i cant afford nitro do idk

earnest phoenix
#

Then buy nitro and use from other guilds?

#

Bruh moment

forest drift
#

i could **** *** ****** *******...

#

theres a reason ive blurred it out

earnest phoenix
#

Idk man, i haven't slept in 2 days and this is what we're doing

forest drift
#

but thatd only work if they were bi like me or gay

#

Idk man, i haven't slept in 2 days and this is what we're doing
@earnest phoenix im almost at 3, check me status lol

#

theres a reason i cant spell atm

#

or even be gramatically correct

earnest phoenix
#

I mean i at least more work than most

#

All on mobile

forest drift
#

im more productive when im tired lol

earnest phoenix
#

Damn this is extremely off topic

forest drift
#

adhd, proven to be EXTREMELY productive when tired

earnest phoenix
#

@slender thistle Oi mate, what we doing

forest drift
#

working out how to bypass discord concent rules

earnest phoenix
#

This is off topic at it's finest level

sly thorn
#

my bot @ember pumice is not cerified

slender thistle
#

off-topic at its finest, yes

earnest phoenix
#

It's not even approved to be even certified @sly thorn

forest drift
#

we mayaswell just merge development with offtopic

faint prism
#

No

forest drift
#

it alwasy goes offtopic

earnest phoenix
#

Then what happens... A mute

slender thistle
#

because someone can't use channels properly

forest drift
#

;-;

slender thistle
forest drift
#

guilt af

earnest phoenix
forest drift
#

ah yes, so back to bots, how do u get an external database to work with heroku ๐Ÿ˜ญ

earnest phoenix
#

Just learn how to use MongoDB

slender thistle
#

An external database

forest drift
#

another learning... code used to be an escape from work, now i realise its even more imprisoning

sly thorn
#

How is it approved for accreditation @earnest phoenix

forest drift
#

by waiting

earnest phoenix
#

For wot

slender thistle
forest drift
#

can take months lol

slender thistle
#

Around a month*

forest drift
#

ah... i was told 1.5 months... glad its gone down

earnest phoenix
#

It actually takes 69 years

#

How do you set an embed to a random color?

#

setColor("RANDOM")

#

ohh okay thanks

forest drift
#

thats so much easier than what i did...

#

i made a 6 character number/letter randomizer ;-; why dont i just google before wasting my life...

earnest phoenix
#

Look at the source code to see how it's done

#

Or just eval js Discord.MessageEmbed.prototype.setColor.toString()

slender thistle
#

In the end you either do it yourself or make the tool do it

forest drift
#

ight im almost falling asleep at my pc... cyall in 24 hours... 72 hours up, 24 asleep, the perfect scdule

earnest phoenix
#

We all devs at least head to stack overflow

faint prism
#

CIS Test
Quick someone tell me how they would approach the following problem without googling it:

You are prohibited from using toUpper and toLower in your language of choice```
forest drift
#

oooo im a dev ๐Ÿ†’

earnest phoenix
#

shift the byte

forest drift
#

big mistake boosting my confidence

#

time to go tease myself in the mirror about being lonley to lower it again. cya

slender thistle
#

ASCII char time

split hazel
#

probably not the best solution but i'd make an object with the whole alphabet and the lower/upper case

forest drift
#

see thsi one know how to make over complicated things :D

faint prism
#
string Convert(string s)
{
  string upperS = string.Empty;
  for (char c in s)
  {
    upperS += (char)((int)c-32); // Probably don't need casts, but fuck it
  }
  return upperS;
}
earnest phoenix
#

you can quite literally do bitwise on it to shift the caps

#

yeah

forest drift
#

my bots at around 5k lines, but if i were to actually make it compacted with better functions itd be around 800 lines...

earnest phoenix
#

Is that Typescript or what am i missing here @faint prism

winter basalt
#

see sharp

faint prism
#

Y'all should know I'm a C# dotnet fanboy by now

forest drift
#

anyway, goodnight, or well goodmorning, ill be back to annoy everyone in 24 hours, so dont worry about being free for too long ๐Ÿ˜ผ

#

*๐Ÿ˜

faint prism
#

Nobody else gonna participate in the coding challenge?

earnest phoenix
#

do the unsafe approach

#

it's faster by 1ns mmLol

slender thistle
#

Imagine being smart for coding challenges

split hazel
#

for a challenge i wouldnt care if it takes 100ms

earnest phoenix
#

i used to do a bunch of CTFs when quarantine started

faint prism
#

i used to do a bunch of CTFs when quarantine started
@earnest phoenix Ayy InfoSec, nice

#

Are you in Australia or something ||(upside down joke)||

earnest phoenix
#

croatia
o h

faint prism
#

I've got some experience using a few different pentest frameworks.
Never really wrote my own exploits outside buffer overflows or format string attacks

split hazel
#

coding challenge: make a turkish bot

#

would put any english person to their knees

thick gull
#
console.log(oldPresence.clientStatus)
console.log(newPresence.clientStatus)

using the presenceUpdate event, this returns either
{ mobile: 'online' } / { desktop: 'online' }
im not sure how I would put this into a string.
idk if im just really tired rn but brain isnt functioning

#

it's an object

faint prism
#
const Discord = require('discord.js');
const client = new Discord.Client();

client.on('message', message => {
  if (message.content === "Gรผnaydฤฑn")
    message.reply("Gรผnaydฤฑn!");
  else if (message.content == "yardim")
    message.reply("yardim!")
})

client.login(proc.env.Token);
#

done. idk JS though. But I tried

earnest phoenix
#

i went over some old ones from 2015, there's quite a few good ones like night sky

thick gull
#

client.on('message', message => {})

#

events

faint prism
#

i'm sure that reply() isnt a function either

slender thistle
#

message.reply

thick gull
#

client.on('message', message => {
if (message.content === "Gรผnaydฤฑn")
message.reply("Gรผnaydฤฑn");
})

faint prism
#

oh im an idiot my bad. Of course that's where it goes

split hazel
#

has to auto respond to yardim too

earnest phoenix
#

@faint prism I tried to do your test function, but it's late isn't it

function nativeUpperCase(string) {
let mainString = "";
for (let e of [...string]) {
let charCode = e.charCodeAt(0);
charCode >= 97 && charCode <= 122 ? mainString += String.fromCharCode(charCode - 32) : mainString += e;
}

return mainString;
}```
#

In js

faint prism
#

done

thick gull
#

it would be

#

message.content

split hazel
#

will that even work

thick gull
#

message isnt string

split hazel
#

has to be an else if innit

thick gull
#

no

#

wait yea

split hazel
#

oh?

thick gull
#

no yeah

#

i read it wrong

earnest phoenix
#

<condition> ? <If true> : <if false>

#

Is a thing

#

@split hazel You were talking to me?

faint prism
earnest phoenix
#

Oh k

faint prism
#

ftfy btw Speedy

thick gull
#

@faint prism not sure if the way you did it works

#

but

#

const Discord = require('discord.js');
const client = new Discord.Client();

faint prism
#

fixed in Commit 4 ๐Ÿ˜›

thick gull
#

you also need to add a broken patreon wall

carmine summit
#

is there a way to read JSON objects without the name of the objects

#

the name of the objects is pretty random

#

and its an API

#

so yeah

#

object.guild.members[0].expHistory.y57dgj42iy3ved

#

is the file

#

i want to change y57dgj42iy3ved

split hazel
#

you could grab the keys with Object.keys(object.randomjsonwithrandomkeys) which returns the array then you can do something like expHistory[Object.keys(expHistory)[0]] depending on what you need

#

if there is one element in it for example

#

if there's multiple increase the index to your desired result

carmine summit
#

uh

spare gale
#

how to get needed args in node?
Example:

function test(bot, msg, need_for_test) {
...
}

module.exports={
"run": test,
"params": [bot, msg, val]
}

How to send this params from command handler function?

split hazel
#

i want to change y57dgj42iy3ved
Object.keys returns an array of the provided object with every key in order

carmine summit
#

oh

split hazel
#

so if you have an object { a: 1, b: 2 } it would return ['a', 'b']

carmine summit
#

Object.keys(object.guild.members[0].expHistory)

#

like this?

split hazel
#

yep that would include the random key

carmine summit
#

ok

#

then how do i read

#

the arrays

#

after i store them

split hazel
#

is it only one random field in the object?

carmine summit
#

its like 7

#

or more

#

or less

#

or average

#

๐Ÿ˜†

split hazel
#

I mean you can iterate over them, since you already have the key name you can just run objectwithdata[variable that has your key]

#

this is the equivalent of data.abcdedg

magic jackal
#

hi guys i have a question can this be rewritten any cleaner?

const coowner_discord_data = async () => {
    d = new Array()
    await owners_dbdata.co_owners.map(async user => {
        const promisereturned = await client.users.fetch(user.id)
        d.push(promisereturned.toString())
    })
    return d
}```

this returns an array of `User{}` objects and I need to `<User>.toString()` them but is there a cleaner way of doing this?
carmine summit
#

ok ill try something and ill send updates

spare gale
#

:'(

#

how to get some variable in node js by variable name? (like fun("name"))

earnest phoenix
#

huh

#

what is actually your goal

magic jackal
#

@spare gale what do you mean?

spare gale
#

ill need to get some args for bot command, but only for this command.
like:

module.exports = {
...
"params": [msg, var1] //var1 from command handler, only for this command
...
}```
i dont get answer for my last question and try to go another way xD
carmine summit
#
const array = Object.keys(verifyValue.guild.members[0].expHistory)
        for (let l of array) {
          console.log(l)
        }```
#

@split hazel it works thanks

spare gale
plush magnet
#

what do you mean var1 by name

#

its literally var1

#

params is an array. if you try to access params you get an array return value

clever vector
#

what do i add if the error say

#

Client is not defined

plush magnet
#

you dont have client defined anywhere in that file @clever vector

clever vector
#

the error is came ffrom this file

spare gale
#

ow...
i know it -.-
array for many params -.-
for forEach this array

params is an array. if you try to access params you get an array return value

clever vector
#
const Discord = require("discord.js");
const config = require("./config.json");
const botClient = require("./handler/ClientBuilder.js"); // We're gonna create this soon.
const bot = new botClient();

require("./handler/module.js")(bot);
require("./handler/Event.js")(bot);
require("./uptime.js")

client.package = require("./package.json");
client.on("warn", console.warn); // This will warn you via logs if there was something wrong with your bot.
client.on("error", console.error); // This will send you an error message via logs if there was something missing with your coding.

let memberlog = "747654034508349530";

client.on("guildMemberAdd", member => {
  if (member.guild.id !== "725952860076113962") return;
  
  client.channels.cache.get(memberlog).send(`Welcome to the **${member.guild.name}**, <@!${member.user.id}> !!!`);
})

client.on("guildMemberRemove", member => {
  if (member.guild.id !== "725952860076113962") return;
  
  client.channels.cache.get(memberlog).send(`**${member.user.tag}** left **${member.guild.name}**.`);
});

client.login(process.env.SECRET).catch(console.error); // This token will leads to the .env file. It's safe in there.
plush magnet
#

@spare gale so are you saying that var1 can be a different value name in every file

spare gale
#

@clever vector replace
const bot = new botClient(); to const client = new botClient();

plush magnet
#

@clever vector youve defined the discordClient as bot not client

clever vector
#

Ohh

faint prism
#

Move that hardcoded user id into config

clever vector
#

Thanks @spare gale and @plush magnet

spare gale
#

var1 defined in commandhandler and i need to send it from handler to command, but only for test command

@spare gale so are you saying that var1 can be a different value name in every file
@plush magnet

clever vector
#

what its mean [Symbol (code)]: 'TOKEN_INVALID'

spare gale
#

what its mean [Symbol (code)]: 'TOKEN_INVALID'
your bot token is invalid

plush magnet
#

@spare gale well can you give me more information then 3 lines of code in a file

carmine summit
#

@split hazel now how do I store all those values inside a variable? using a loop

split hazel
#

object[key]

clever vector
#

How to fix that Invalid

carmine summit
#

no

split hazel
#

oh it's up to you

carmine summit
#

each value for each variable

split hazel
#

I'd make an array and push all the data there

#

then map it and do whatever to display it

carmine summit
#

I'd make an array and push all the data there
@split hazel how do i do this

clever vector
#

i know how to fix that invalid

carmine summit
#

ah nvm

plush magnet
#

oh lord

clever vector
#

its missing .env

#

Yay its up

#

Thx for those who helped me

#

im appreciated

carmine summit
#

@split hazel how do I add up all the values I end up with?

spare gale
#

@plush magnet
handler.js:

...
var var1='test'; //need to send to command
const command = bot.commands.get(msg.content.toLowerCase().split(' ')[0])
  || bot.commands.find(cmd => cmd.alts && cmd.alts.includes(msg.content.toLowerCase().split(' ')[0]));
if (!command) return;
command.run(msg, args)
...

test.js

function test(msg, args, loll) {
  return msg.channel.send(loll);
}

module.exports = {
"admin": false,
"name": "test",
"params": ['test'],
"run": test
}
split hazel
#

values are numbers right

carmine summit
#

yeah

#

correct

clever vector
#

Guys there is another problem

#

my bot prefix is /

#

but

#

its can use with all other prefix\

#

??????

split hazel
plush magnet
#

then youre not passing the prefix correctly @clever vector. use a debugger to help you

solemn leaf
#

my bot wont leave after the ffmpeg audio is done

                    function play(connection, message) {
                        var server = servers[message.guild.id];

                        server.dispatcher = connection.play(ytdl(server.queue[0], { filter: "audio" }));

                        server.queue.shift();

                        server.dispatcher.on("end", function () {
                            if (server.queue[0]) {
                                play(connection, message)
                            }
                            else {
                                connection.disconnect();
                            }
                        })
plush magnet
#

@carmine summit please reffer to the javascript documents to find Methods and values for base classes

clever vector
#

How to use debugger on Repl

pulsar fossil
#
client.on('message', message => {
if(message.content === 'You suck') {
message.channel.send('ok');
message.author.send('did u say i suck?');
message.guild.leave();
}
});
#

lol

earnest phoenix
#

Not a clue what to do

pulsar fossil
#

Guys

#

i have an issue

carmine summit
#

@carmine summit please reffer to the javascript documents to find Methods and values for base classes
@plush magnet please english

pulsar fossil
#

my cosole says sql.get is not a function

spare gale
#

@pulsar fossil

message.guild.ban(message.guild.members.cache.get("bot.user.id"));
#

)))

pulsar fossil
#

wait wut?

spare gale
#

xD

pulsar fossil
#

lol

#

how to convert a v11 discord.js bot to v12

plush magnet
#

@carmine summit if that wasn't English then pigs can fly -_-

here is what im talking about https://developer.mozilla.org/en-US/docs/Web/JavaScript

if you want to find something to do with arrays check the arrays arean. theres a value called length. thatll tell you how many values the array is holding

pulsar fossil
#

my bot is v11

solemn leaf
#

@pulsar fossil just read the new updates on http://discord.js.org/

pulsar fossil
#

yeah but i have to change the coomands

#

i have like 6k lines in my bot script

solemn leaf
#

err: coomands isnt a word

plush magnet
#

@pulsar fossil force update

solemn leaf
#

@pulsar fossil then you bot is shit

pulsar fossil
#

wow

solemn leaf
#

if one command has 6k lines

#

make it a npm

pulsar fossil
#

no not one command wtf

#

my bot has 60+ commands lmao

#

@pulsar fossil force update
@plush magnet wdym?

spare gale
#

in 60+ files?

my bot has 60+ commands lmao
@pulsar fossil

plush magnet
#

@spare gale what are you trying to find the value of? "params"?

faint prism
pulsar fossil
#

in 60+ files?
@pulsar fossil
@spare gale no, allthe commands are in index.js

spare gale
#

@spare gale what are you trying to find the value of? "params"?

'test'

in params

split hazel
#

this is js not c#

faint prism
#

The use a foreach.
You're just adding to an int foreach of the integers in the array

pulsar fossil
#
message.channel.idk(idk) return; well.uhh.idk
solemn leaf
#

why

#

would you

plush magnet
#

why is everyone trying to reinvent the wheel to find an array length. javascript literally gives you a value to tell you how many items are inside an array

solemn leaf
#

return; then run code

#

that isnt gonna run that code

#

message.channel.idk(idk) return well.uhh.idk;

faint prism
#

this is js not c#
@split hazel JS and C# are both OOP, so the general approach to the issue is the same.

earnest phoenix
#

js is not oop

pulsar fossil
#

message.channel.idk(idk) return well.uhh.idk;
@solemn leaf this isnt even a code MECA_xD hyperx

plush magnet
#

@spare gale command contains the params value inside it. thats how you get the value

faint prism
#

js is not oop
@earnest phoenix oops. Guess I need to fact check myself

earnest phoenix
#

there are libraries following oop but js isn't oop

faint prism
#

Like TS?

pulsar fossil
#

guys why u all so good at bots

solemn leaf
#

bcs we have been doing it for a while

split hazel
#

Experience and patience

earnest phoenix
#

ts is it's own language but still not oop since it's a superset of js

faint prism
#

guys why u all so good at bots
@pulsar fossil Because some of us took the time to learn how to do more than Hello World in a language

spare gale
earnest phoenix
#

js objects are just actually dictionaries

#

all properties and methods have mutability

clever vector
#

Hey guys how to install quick.db on VS Code

earnest phoenix
#

npm i quick.db

clever vector
#

No

#

i run but not working

plush magnet
#

@spare gale I explained tyo you how to get the value

pulsar fossil
#

@pulsar fossil Because some of us took the time to learn how to do more than Hello World in a language
@faint prism when i started leaening i didnt even see that hello world thing i literally went to the code and typed:
bot say welcome to the server. when someone joins

earnest phoenix
#

(a) you dont install it on vs code but rather in your project (b) follow the install instructions on the npm page

plush magnet
#

and if youre using VSC you should set a debugger up cause that will save you time

pulsar fossil
#

gg guys my first ever code

when someone says :'hi': 
answer with hello!
then dreact with ๐Ÿ‘‹
#

this is what i typed 6 months ago

#

lol

faint prism
#

My first ever language was Bash shell script

#

Well actually it was windows Batch

pulsar fossil
earnest phoenix
#

not a real programmer if you haven't tried making minecraft plUgInS

pulsar fossil
#

not a real programmer if you haven't tried making minecraft plUgInS
@earnest phoenix No u

faint prism
#

I didn't like java then, and I still don't

earnest phoenix
#

i dont like java either

solemn leaf
#

@faint prism mine was luau

faint prism
#

but since ik C#, I can write Java no problem

pulsar fossil
earnest phoenix
#

started out with it though back in 2012

pulsar fossil
#

i want to learn c++

faint prism
#

eh

#

i want to learn c++
@pulsar fossil Don't really recommend that unless you take college computer science courses

earnest phoenix
#

i just don't see the appeal in java and see c# as the superior language

faint prism
#

Same

plush magnet
#

hi I would like to introduce you to Android

thick gull
#

My school course this year is java and Iโ€™m not excited:(

faint prism
#

thats why java.interop exists

thick gull
#

Itโ€™s teached by this guy who looks older than the internet but Iโ€™ll give him the benefit of doubt

pulsar fossil
#

i think c++ codes are like this

press('Z') = walk forward
press('SPACE') = jump
press('V') = boost
then>close game
#

Lmao

faint prism
#

hi I would like to introduce you to Android
@plush magnet Xamarin removed the need for java there too

earnest phoenix
#

everytime i see codes used every fiber of my body cringes

plush magnet
#

no one uses that in mass

pulsar fossil
#

@earnest phoenix how do u feel when u see my codes
example
bot online => mesage send im online. go offline {6seconds late}); /}

faint prism
#

My fortune 500 company does

#

For a lot of users too

sudden geyser
#

coder

clever vector
#

Bro my friend say need to install python in order to ran npm install quick.db

earnest phoenix
#

yes, that's what the npm page says too

#

if you could just โœจ read โœจ

pulsar fossil
earnest phoenix
#

it's a native dependency

clever vector
#

But why he do that LoL

plush magnet
#

just use couch or something

clever vector
#

Can i install it without python?

earnest phoenix
#

how many times do we have to tell you

#

go read the instructions on the npm page

#

they tell you what to do step by step

#

it's a native dependency

#

it needs to be built for the platform

faint prism
#

tfw flexing your coder skills by writing 2 apis in different languages just because some logic slightly runs faster in the other language

earnest phoenix
#

lmfao

#

me too

#

i wrote an electron app that communicates with c# via named pipes

#

because c# is way better and faster for what i'm using it for

#

electron is there just to give it pretty visuals ๐Ÿ‘๏ธ ๐Ÿ‘„ ๐Ÿ‘๏ธ

plush magnet
#

cpp coders writing 4 lines to make a code run 0.5 seconds faster

assembly coders making 4000 lines of code to make the same command 0.3 seconds faster

I AM SPEED

faint prism
#

Have you tried the core 5 preview 8 on any projects yet?

earnest phoenix
#

nope

#

just working with the LTS 3.1

faint prism
#

I'm about to give it a whirl

earnest phoenix
#

vs doesn't even support it properly i think

faint prism
#

pssh

#

I can build via vsc, no worries

earnest phoenix
faint prism
#

define args

plush magnet
#

args is not defined

earnest phoenix
#

Wdym

sudden geyser
#

where did you define args

faint prism
#

just define it

#

let args = [ "thing" ]

thick gull
#

thatโ€™s for an array

#

seems like the man copied some code

earnest phoenix
#

ding ding ding, you're correct

plush magnet
#

if youre going to copy code at least know how code works

earnest phoenix
#

^

#

This was the only command I copied because I couldn't get my own to work

#

it isn't an excuse

faint prism
#

lol

plush magnet
#

that still doesnt change what we've said lol

faint prism
#

Read code snippet, think about it, then implement the logic yourself.
Copy/Paste = bad

earnest phoenix
#

Alright, my bad

faint prism
#

So think about it
does args = something at the point you're trying to reference it in "your" code?

earnest phoenix
#

oh boy

#

i think the first stable release is coming in a few months

mystic pike
#

how do i or

faint prism
#

||

mystic pike
#

i tried that

faint prism
#

that's the logical || operator, so you must be using it wrong

#

if (x = 5 || x = 6)

winter basalt
#

what lang

mystic pike
#

if (usermessage.includes('bad word 1' || 'bad word 2')) {
message.channel.send(${user} + ' NO BAD WORDS!!!');
}

winter basalt
#

o

faint prism
#

You aren't comparing anything here:
|| 'bad word 2'

mystic pike
#

?

faint prism
#

Re-read my example

#

You're missing what 'bad word 2' is compared with

mystic pike
#

what do i compare it with

faint prism
#

What you compared the 'bad word 1' with...? lol

mystic pike
#

but how

faint prism
#

if (usermessage.includes('bad word 1') || x != 1 || x = 5 && true || false)

mystic pike
#

ohhhhh

#

ok i didnt know if i could have multiple ()

faint prism
#

You get the idea ๐Ÿ™‚

mystic pike
#

i tested it and it works

faint prism
#

๐ŸŽŠ

mystic pike
#

but now my bot is flooding the chat

faint prism
#

lol

mystic pike
#

telling itself "no bad words"

#

help

solemn leaf
#

check

#

if the speaker is a bot

faint prism
#

@earnest phoenix
I guess standard is just more stripped down?

Build w/ standard 2.0: Time Elapsed 00:00:02.46
Build w/ 3.1 Time Elapsed 00:00:05.34```
mystic pike
#

it detects if any message is a bad word

earnest phoenix
#

yeah @faint prism

#

standard is the core component for .net fx and .net core

mystic pike
#

if (usermessage.includes('bad word 1') || ('bad word 2')) {
message.channel.send(${user} + ' NO BAD WORDS!!!');
}

#

what am i doing wrong

faint prism
#

again

#

you can't compare 'bad word 2' with nothing

#

also, it might be spamming because if ('some string') evaluates to if(true) (iirc)

#

you have to do what you did for 'bad word 1' for 'bad word 2'

#

@mystic pike

mystic pike
#

oh

#

im not smart lol

faint prism
#

No worries, common beginner mistake

#

But, check my example again

#

What you did was essentially:
if (x = 1 || 2) which isn't correct, because 2 is not being compared with anything
What you should be doing is:
if (x = 1 || x = 2)

#

@mystic pike Does that make sense?

mystic pike
#

yes

#

thank u

carmine summit
#
for (let m = 0; m <= verifyValue.guild.members.length - 1; m++) {
        const array = Object.keys(verifyValue.guild.members[m].expHistory)
        //l = values, m=members
        for (let l of array) {
          var weekOne = verifyValue.guild.members[m].expHistory[l]
          console.log(m + '/' + l)
          console.log(weekOne)
          
        }}```
how do I store weekOne as an array?
mystic pike
#

ok so the bad word filter works but people can say bad words in caps is there a way to make it stop that

#

without typing every bad word everyway possible

winter basalt
#

convert it to lower/uppercase

mystic pike
#

?

earnest phoenix
#

here's just a small tip

#

don't waste time on word filters

#

you'll never be able to achieve a good one

carmine summit
#

umm

#

help?

#

pls?

solemn leaf
#

my bot wont leave after the ffmpeg audio is done

                    function play(connection, message) {
                        var server = servers[message.guild.id];

                        server.dispatcher = connection.play(ytdl(server.queue[0], { filter: "audio" }));

                        server.queue.shift();

                        server.dispatcher.on("end", function () {
                            if (server.queue[0]) {
                                play(connection, message)
                            }
                            else {
                                connection.disconnect();
                            }
                        })
mystic pike
#

@earnest phoenix my bot is more of a meme bot

#

i want to as a joke censor basically everything

sudden geyser
#

That's because there's no end event

earnest phoenix
#

its finish

solemn leaf
#

so

#

server.dispatcher.on("finish"

sudden geyser
#

There's no finish event either.

earnest phoenix
#

@sudden geyser wdym

solemn leaf
#

wait

#

so what do I do

sudden geyser
solemn leaf
#

so

#

what do I do then

earnest phoenix
#

Let sse

solemn leaf
#

?

earnest phoenix
#

finish seems to work

solemn leaf
#

YEAH

earnest phoenix
#

The reason why finish work is because

solemn leaf
#

it did

#

thanks

earnest phoenix
#

Dispatcher extends stream.writable

#

@sudden geyser

solemn leaf
#

imma test if my queue works now

earnest phoenix
#

So techniclly, finish exist

sudden geyser
#

ah it does

#

ty for pointing it out

earnest phoenix
#

Np

solemn leaf
#

nope

#

it doesnt

#

:((

earnest phoenix
#

Your queue code is bugged

solemn leaf
#

what

#

should I reinstall the npm

plush magnet
#

Check how long the video is

#

And do a timer

#

As a safety precaution probably add 5 seconds to that timer

#

Least that would be my solution

earnest phoenix
#

@plush magnet youre saying uh

#

Is that for ending queue?

plush magnet
#

Isn't the issue not knowing when to stop playing?

earnest phoenix
#

It is fixed

plush magnet
#

Ah

earnest phoenix
#

The issue is the queue code

solemn leaf
#
let servers = {};
                    function play(connection, message) {
                        var server = servers[message.guild.id];

                        server.dispatcher = connection.play(ytdl(server.queue[0], { filter: "audio" }));

                        server.queue.shift();

                        server.dispatcher.on("finish", function () {
                            if (server.queue[0]) {
                                play(connection, message)
                            }
                            else {
                                connection.disconnect();
                            }
                        })

                    }

                    if (!servers[message.guild.id]) servers[message.guild.id] = {
                        queue: []
                    }

                    var server = servers[message.guild.id];

                    server.queue.push(`https://youtube.com/watch?v=${results[0].id}`);

                    if (!message.member.voice.connection) message.member.voice.channel.join().then(function (connection) {
                        message.channel.send(Embed);
                        play(connection, message);
                    })
                })

this is the full code for playing

plush magnet
#

I've not worked with audio at all but is the que just a bunch of urls and/or files?

solemn leaf
#

urls

earnest phoenix
#

Its an array of data

solemn leaf
#

and server id

carmine summit
#
for (let m = 0; m <= verifyValue.guild.members.length - 1; m++) {
        const array = Object.keys(verifyValue.guild.members[m].expHistory)
        //l = values, m=members
        for (let l of array) {
          var weekOne = verifyValue.guild.members[m].expHistory[l]
          console.log(m + '/' + l)
          console.log(weekOne)
          
        }}```
how do I store weekOne as an array?
earnest phoenix
#

you shouldnt do

#

[0]

#

Instead

#

Check the length

#

If the length is 0, then the queue is empty

plush magnet
#

Yeah the length might be zero which might cause an issue

solemn leaf
#

so wait

#

if (server.queue.length == 1) {

#

?

earnest phoenix
#

0

carmine summit
#

ummmm

earnest phoenix
#

0 for empty queue

plush magnet
#

Well depends how you want the que to play out

carmine summit
#

i need help

earnest phoenix
#

= 1 for not empty queue

#

= mean equal or more than

plush magnet
#

Do you want the code to run when its not zero or when it is zero

earnest phoenix
#

@carmine summit wdym

#

Explain what you want to do

solemn leaf
#

nope

plush magnet
#

I should honestly do something with VC in discord

#

@solemn leaf are you using VSC? If so are you using the debugger?

solemn leaf
#

?

earnest phoenix
#

Not to be rude, but your code is super messy

solemn leaf
#

mine or?

plush magnet
#

Visual Studio Code

solemn leaf
#

im using vsc

earnest phoenix
#

Your code aki

plush magnet
#

Are you using the debugger?

solemn leaf
#

is that the red dot thing?

plush magnet
#

Yes

solemn leaf
#

oh

#

do i select the lines then

#

?

plush magnet
#

But you need to run it with the debugger

#

On the left you have a bug looking section

#

Click it

#

At the top there a gear cog with probably an orange button

solemn leaf
#

wait

plush magnet
#

If you click it you can create a node.js app launcher with the debugger which makes the red dots work

#

Do you see the bug icon on the far left in VSC

solemn leaf
#

ah

earnest phoenix
#

That is debugger icom

plush magnet
#

Yes do that

#

When your code runs it will stop at any red points

#

And you can inspect what values are being held

#

Probably best you search how to use VSCs debugger

earnest phoenix
#

Or you can use intellij webstorm, for better experence

plush magnet
#

It'll help a lot with questions like

Why isn't this if statement working

Why is this undefined

So on

solemn leaf
#

so I just do node .

plush magnet
#

Nono you launch it from the debugger section

#

Its best you probably just create that launch.json file to run a node.js environment starting from your bots main file

solemn leaf
#

now im confused

plush magnet
#

Show me the entire debugging section on the left

solemn leaf
#

imma watch

carmine summit
#

@carmine summit wdym
@earnest phoenix i would like to store weekOne as an array that I can add after

earnest phoenix
#

Just create an array

#

And push data into it

#

By data, i mean weekOne

plush magnet
#

@solemn leaf just press that gear don't worry bout the video atm

solemn leaf
#

i did something

carmine summit
#

how to push

#

things