#development

1 messages · Page 570 of 1

lusty dew
#

Welp

#

Not gonna interfere anymore

earnest phoenix
#

im thick af

restive bough
#

bruh

earnest phoenix
#

Lmao

restive bough
#

there is an doc

#
inner jewel
lusty dew
#

Lol

#

Wassup Yasmin

inner jewel
#

smh spider stealing my mute

lusty dew
#

ooo he got muted?

keen drift
#

yeah lmao

lusty dew
#

Thank god not trying to be rude

#

Anywayy

#

ima go and try and make a discord.js doc cmd

#

Oh wait

#

I forgot I had a question of my own

amber fractal
#

Nice

lusty dew
#

In a help cmd how could I make certain cmds show up for people who have certain permissions
Like this:

#

Wouldn't I have to do a permission check?

amber fractal
#

Yes

lusty dew
#

and if so add that to the embed

amber fractal
#

Get a list of their perms, if they have the perm you want add it

lusty dew
#

Hm mk

#

so something like

if(message.member.hasPermission("ADMINISTRATOR"){
.addField("Admin commands:", "admin commands here")
}

if(!message.member.hasPermission("ADMINISTRATOR"){
.setFooter(`The Admin commands are not showing as you don't have permission `\`ADMINISTRAOR`\`\`)
}
#

Like that or smth

inner jewel
#

store the builder in a local variable

lusty dew
#

Hm?

#

the builder?

amber fractal
#

RichEmbed builder

lusty dew
#

Oh ok

#
 let embed = new RichEmbed({ title: "Help embed" });
                for (const [name, { conf }] of Object.entries(client.commands)) {
                    embed.setDescription(`Anything in [] are optional, anything in <> are required!`)
                    embed.addField(`${name.slice(0, 1).toUpperCase()}${name.slice(1, name.length)}`, `Description: ${conf.description || "N/A"}\nUsage: ${conf.usage || "N/A"}`);
                    embed.setColor("#fff")
                    embed.setTimestamp()
                    embed.setFooter(`Requested by: ${message.author.tag}`)
                }

I already have it setup like this

#

Hm I have an idea

#

Mk but why would I store the RichEmbed builder in a local variable?

#

What is the point of that? If I may ask

inner jewel
#

you already store it in one

#

let embed = ...

lusty dew
#

Oh yea you right LOL

empty owl
#

const resp = await db.startsWith('userBalance', { sort: '.data'});
resp.length = 5;
let finalOutput = '**Leaderboard**\n\n';
for (var i in resp) {
    finalOutput += `${bot.users.get(resp[i].ID.split("_")[2]).tag} -- ${resp[i].data} usagibux \n`;

}
message.channel.send(finalOutput)```
#

apparently I cant fetch the user

#

can someone help me

#

TAG ME

lusty dew
#
                let embed = new RichEmbed({ title: "Help embed" });
                for (const [name, { conf }] of Object.entries(client.commands)) {
                    embed.setAuthor(`Anything in [] are optional, anything in <> are required!`)
                    embed.addField(`${name.slice(0, 1).toUpperCase()}${name.slice(1, name.length)}`, `Description: ${conf.description || "N/A"}\nUsage: ${conf.usage || "N/A"}`);
                    embed.setColor("#fff")
                    embed.setTimestamp()
                    embed.setFooter(`Requested by: ${message.author.tag}`)
                }
                if (message.member.hasPermission("ADMINISTRATOR")) {
                    for (const [name, { admin }] of Object.entries(client.commands)) {
                        embed.addField(`${name.slice(0, 1).toUpperCase()}${name.slice(1, name.length)}`, `Description: ${admin.desc || "N/A"}\nUsage: ${admin.use || "N/A"}`);
                    }
                } else if (!message.member.hasPermission("ADMINISTRATOR")) {
                    embed.setDescription(`❎ Admin Commands are hidden for you`)
                }

Error:
TypeError: Cannot read property 'desc' of undefined at Object.run (C:\Users\Aj\Desktop\The Clinic\commands\help.js:20:132)

amber fractal
#

admin isnt defined

lusty dew
#

It should be though

#

let me check

amber fractal
#

Well thats what that means, it cant read the property desc of undefined, which would be admin

lusty dew
#

Well yea I know what it means I am just confused why I am getting it

#

when I have admin defined

#

the same way as conf

#

and conf works

#
  npm:
   { admin:
      { name: 'NPM',
        desc: 'Allows Admins to search up NPM packages',
        use: 't!npm <query> or @The Clinic npm <query>' },
     run: [AsyncFunction: run] },
#

It shows up in console

#

when I log client.commands

amber fractal
#

Can you log admin tho?

lusty dew
#

I will try

#
undefined
undefined
undefined
undefined
undefined
undefined
undefined
{ name: 'NPM',
  desc: 'Allows Admins to search up NPM packages',
  use: 't!npm <query> or @The Clinic npm <query>' }
undefined
undefined
undefined
undefined
#

It returned undefined for every cmd that didn't use admin until it got to the npm.js cmd that has admin

quartz kindle
#

you're using a for of loop

lusty dew
#

Yea

quartz kindle
#

it will iterate over all entries

lusty dew
#

Hm

#

How can I make it iterate over just the cmds that have admin

#

or is that not possible

quartz kindle
#

just skip iterations that dont have it

lusty dew
#

How could I do that?

quartz kindle
#

if(!admin) { continue; }

#

continue tells the loop to skip the current iteration and begin the next one

lusty dew
#

Hm

#

I kinda understand but I don't at the same time

#

I'd put that in the for loop right

amber fractal
#

Wait continue just skips that increment thatd be helpful to know mmLol

quartz kindle
#

yes, right at the beginning

#

and yup, continue skips an iteration, and break exits the loop

lusty dew
#

I new about break

#

didn't know about continue

#

undefined undefined undefined undefined undefined undefined undefined { name: 'NPM', desc: 'Allows Admins to search up NPM packages', use: 't!npm <query> or @The Clinic npm <query>' } undefined undefined undefined undefined It looks like it still iterates over all of them

#

Oh wait

#

Should I do the same thing to the other forloop?

#

if(!conf) {continue;}

quartz kindle
#

if not all commands have conf, then yes

modern sable
#

@loud salmon roleplayer is on rank 62 blobheart

loud salmon
#

ty

#

but y this channel thonk

modern sable
#

oh

loud salmon
#

lol

modern sable
#

i clicked on the second channel in the category, didnt realize i had it minimized PPepoWeirdSip

loud salmon
#

lmao

lusty dew
#

How do you embed a link into text again?

#

isn't it

#

[Texthere](`linkhere`)

quartz kindle
#

yeah, without the quotes

lusty dew
#

Ah

#

Ok

#

I thought it was with quotes

quartz kindle
#

clicked on second channel in the category so there is a hidden channel above genera eh :^)

lusty dew
#

You need the quotes...

#

I just removed them and it made things error

harsh nova
#

If you do text it does not embed in the message but if you delete the message it will be a clickable link text in the delete preview thing

quartz kindle
#

then you're doing something wrong

lusty dew
#

trying to do this

quartz kindle
#

well, show code?

lusty dew
quartz kindle
#

its a string...

amber fractal
#

^^

quartz kindle
#

not whatever the fk you're doing lmao

amber fractal
quartz kindle
#

^

lusty dew
#

Oh shit

#

LOL

amber fractal
lusty dew
#

Ahhhhh

#

Yeaaa

#

Fuck

#

Thanks for telling me

#

Rip

#

I forgot how to handle the object Object thing

amber fractal
#

You cant send the entire object, just values from it

lusty dew
#

Yea

amber fractal
#

And author has a url property

lusty dew
#

Ah ok

amber fractal
#

.versions['0.1.0'].maintainers is an array probably of maintainers. there may be an easier way to do this tho

lusty dew
#

Yea

#

Hm

#

doesn't npm have an api docs?

amber fractal
#

wait you could do

#

Wait

#

thats wrong

lusty dew
#

Doesn't npm have an API though?

amber fractal
lusty dew
#

No

#

I don't think so

#

Yea no it isn't

#

I was wondering if npm itself an an api and or api docs

amber fractal
#

I cant find anything on it

#

but I have the dumb. Soo

earnest phoenix
#

em

#

need help with alert

#

on ejs

sick cloud
#

@lusty dew whats your goal?

#

npm has an api sort of

lusty dew
#

I am trying to get info on other npm packages

amber fractal
#

Wait I was dumb mmLol

#

<Object>.maintainers is an array of objects mmLol for your purpose

#

You'd have to loop over the array and get the values of the names

sick cloud
amber fractal
#

If I went to the undefined package that he sent, its the same thing anyways

#

How are you getting the data right now tho?

earnest phoenix
#
<header class="masthead text-center text-white">
   <center><br><br><br><br><img style='border-radius: 50%;' src='https://discordapp.com/api/v6/users/<%=user.id%>/avatars/<%=user.avatar%>.jpg'>
<center><h1><%=user.username%></h1></center>
<form action='/panel' method="post">
    <div class="form-group col-md-6">
      <label>User ID</label>
      <input type="text" class="form-control" placeholder="User ID (E.G: 489545273106890743)" name='botsID' required>
    </div>
      <div class="form-group col-md-6">
      <label>Item</label>
      <input type="text" class="form-control" placeholder="-" name='db' required> 
    </div>
    <div class="form-group col-md-6">
      <div class="col-auto">
      <button type="submit" class="btn btn-primary mb-2">Add </button>
    </div>
  </form>
       </center>
    </header>
#

when i submit that

#

i want to have success

#

ive been trying

#

alerts

#

like 1h

#

;-;

lusty dew
#

@amber fractal By using an npm package called api-npm

sick cloud
#

if thats what you need

lusty dew
#

that is what I been using^

sick cloud
amber fractal
#

It seems like it does the same thing as the registry mmLol

lusty dew
#

lol

#

@amber fractal Kinda ig I think registry has more info though not sure

#

¯_(ツ)_/¯

#

Whatever works tbh

lusty dew
sick cloud
#

http GET request

lusty dew
#

I am using superagent

#

My thing is getting the data

#

from the latest version

#

of the npm package

#

I can't figure that part out

lusty dew
#

This is my command now

#

I know it is wrong lol I just can't figure out how to get info on the latest version

#

of the npm package they search up

quartz kindle
#

there is no version info in there

#

nvm

#

latest version should be ["dist-tags"].latest

lusty dew
#

MK

#

But don't new contributors pop up in different versions of the npm?

#

and many other different things from other npm package versions

quartz kindle
#

yeah but do you need all that?

lusty dew
#

Well it is an npm package lookup cmd

#

so yes and no

#

I mainly just want general info

#

like

quartz kindle
#

do this then

lusty dew
#

the dependencies, version, maintainers, license etc the important stuff

quartz kindle
#

body.versions[body["dist-tags"].latest]

#

that should give you the details of the latest version

lusty dew
#

K

#

it returned object Object

quartz kindle
#

yes, its the entire version info

#

now you need to get the data you need out of it

#

you can console.log it to see what it contains

lusty dew
#

Ok

#
{ name: 'undefined',
  id: 'undefined',
  version: '0.1.0',
  description: 'Just require undefined & everything gonna be defined!',
  author:
   { name: 'Irakli Gozalishvili',
     email: 'rfobic@gmail.com',
     url: 'http://jeditoolkit.com' },
  homepage: 'https://github.com/Gozala/undefined',
  keywords: [ 'undefined', 'JS', 'troll' ],
  repository:
   { type: 'git',
     url: 'https://github.com/Gozala/undefined.js',
     web: 'https://github.com/Gozala/undefined.js' },
  bugs: { url: 'https://github.com/Gozala/undefined.js/issues/' },
  _id: 'undefined@0.1.0',
  dist:
   { shasum: '9b706a4b32ad30c20ca4fe65ddcbbbdac32bded0',
     tarball: 'https://registry.npmjs.org/undefined/-/undefined-0.1.0.tgz' },
  _from: '.',
  _npmVersion: '1.2.25',
  _npmUser: { name: 'gozala', email: 'rfobic@gmail.com' },
  maintainers: [ { name: 'gozala', email: 'rfobic@gmail.com' } ],
  directories: {},
  deprecated: 'this package has been deprecated' }

Does it matter if it just showed package that doesn't exist?

quartz kindle
#

what do you mean?

lusty dew
#

When I console logged

#

body.versions[body["dist-tags"].latest]

#

it gave me that up there ^

#

but that npm package doesn't exist

quartz kindle
#

well, it clearly exists

lusty dew
#

Mk but next question

#

why did it return that and not the package I asked it to look up...

quartz kindle
#

you made it search for "undefined"

lusty dew
#

I made...

#

Oh shit

#

name must be undefined then

#

🤔

#

Or smth

quartz kindle
#

ye

lusty dew
#

cause I asked it to look up express

quartz kindle
#

if your args already removes the command itself

#

then it should be args[0] not args[1]

lusty dew
#

Ah ok

#

I didn't know my args removed the command itself

quartz kindle
#

well, i dont know either, im just saying thats what happens if it does

#

btw this is the "undefined" package

#

lmao

#

how the fuck does it get 5k downloads/week

lusty dew
#

Oof lol

quartz kindle
#

the package contents is literally jd module.exports = void 0;

#

lmfao

lusty dew
#

Lol

#

Wtf

#

What is the point of it?

#

I mean its deprecated now

#

So but still

#

What was the point of it when it could be used

quartz kindle
#

no point, it literally does nothing

#

its a joke package

lusty dew
#

Lol ok

quartz kindle
#
console.log(test) // undefined```
lusty dew
#

Lol

#

Mk, I hope I can remember how to get the stuff I need uwu

#

How could I loop through and get the contributors?

#

wouldn't I usea for loop?

quartz kindle
#

depends

#

how do you want to list them?

lusty dew
#

Hm

#

With | in between each one

#

So it would be like

Name 1 | Name 2 | Name 3 |
and so on

quartz kindle
#

so a concatenated string?

#

you can use a for loop yes, or you can use map then join

lusty dew
#

How could I do the map method?

quartz kindle
#

its an array of objects, so first you need to turn it into an array of names

#

assuming you dont need their email addresses, just the names

#

newarray = array.map(item => item.name)

lusty dew
#

Ye just their name

quartz kindle
#

this should give you a new array containing only the names, without the emails

#

then you can take the new array and do .join(" | ")

lusty dew
#
                .addField("Contributors:", body.versions[body["dist-tags"].latest].newArray.join(" | "))```
?
#

Like that?

#

oh wait

#

That wouldn't get me their names

#

or would it?

#

wouldn't I need to define I want the contributors names?

#

Oh wait

#

I get it oof

quartz kindle
#

lmao

lusty dew
#
let newArray = array.map(item => item.names)
.addField("Contributors:", body.versions[body["dist-tags"].latest].newArray.join(" | "))```
#

Something like that?

quartz kindle
#

that is wrong on so many levels

lusty dew
#

Oh

#

I guess I don't get it

#

XD

quartz kindle
#

array should be the array containing the contributors

#

that you get from the version object

#

also, when you use .something, the dot means its continuing from whatever it was before it

#

if you do .addField() there, it will be the same as doing .map().addField()

#

which doesnt exist, maps dont have an add field function

lusty dew
#

Hm true

#

I didn't think of that

#

Also I wasn't trying to do it right after the .map()

#

I have a let embed = new Discord.RichEmbed()

#

I was just putting it together to see if I was correct or wrong

quartz kindle
#

ah okay

lusty dew
#

Yea xd

#

So how would I get the contributors names then?

#

I would have to define I want the contributors name somehow

#

names*

quartz kindle
#

well, start from the beginning. where are they? they are in the version object. how do you access the version object?

lusty dew
#

body.versions

quartz kindle
#

the specific version you want to work on

lusty dew
#

body.versions[body["dist-tags"].latest]

quartz kindle
#

yes, now access the contributors array that is inside it

lusty dew
#

body.versions[body["dist-tags"].latest].contributors

quartz kindle
#

yes, now map it to a new array

lusty dew
#

body.versions[body["dist-tags"].latest].contributors.map(item => item.name)

#

I think

quartz kindle
#

yes

#

very good

#

now you can assign all of this to a variable

#

or just join it right there

lusty dew
#

let conArray = body.versions[body["dist-tags"].latest].contributors.map(item => item.name)

quartz kindle
#

yup

lusty dew
#

Might as well give it a name specificied to its use

#

Lol

quartz kindle
#

sure

lusty dew
#

nvm

lusty dew
#

RangeError: RichEmbeds may not exceed 25 fields.

#

How could I fix this?

amber fractal
#

Use a page system

#

You cant go above 25 fields

lusty dew
#

Hm

#

Well fook

#

Ok

#

Is there a way I could cut it down?

bright spear
#

just use less fields?

amber fractal
#

^

lusty dew
#

Hm

amber fractal
#

Then theres too many dependencies and it goes above 25

lusty dew
#

Ah ok

amber fractal
#

You can put all the dependencies in one field if you want tho

lusty dew
#

wdym?

amber fractal
#

Instead of adding a new field for each one, just put it into a string and make a new line for each one

lusty dew
#

how would I do that?

amber fractal
#

You see your for loop for dependencies?

lusty dew
#

Ye

amber fractal
#

Instead of adding a field each time, add the dependency to a string and a good '\n' or comma, whatever you choose.

#

then add the string to the embed

#

instead of a new field for each dependency

lusty dew
#

hm

#

I can't remember how I could add it to a string

#

wouldn't I define a new variable of an empty string and add the dependency to that?

amber fractal
#

let str = "" str += "test\n"

#

Define str outside of the loop

#

or whatever you use for your string

lusty dew
#

so I could do

#
str += `${dependencies}\n```
#

that?

amber fractal
#

if you add another ` to the end, it should work. If dependencies is what you want added

lusty dew
#

Ah ok thanks

#

@amber fractal how could I separate it with | instead of on a new line or would that fall into it exceeding 25 fields?

amber fractal
#

Instead of \n

#

just do |

lusty dew
#

| is a thing?

#

\|

amber fractal
#

What?

#

wait what are you trying to do

lusty dew
#

Oh wait

#

I am dumb

#

you mean

amber fractal
#

dependency | dependency

#

Thats how I took it

lusty dew
#
`${dependencies}|`

you meant that or

`${dependencies}\|`
amber fractal
#

the first one

#

What did you want?

lusty dew
#

Ok

#

I thought so

#

What you said

#

dependencies | dependencies

amber fractal
lusty dew
#

Ye

#

thats how i want it

#
                for (dependencies of Object.entries(body.versions[body["dist-tags"].latest].dependencies)) {
                    embed.addField(`❯ Dependencies\n`, str += `${dependencies} | ` || "Null", true)
                    console.log(dependencies)
                }
#

I have this

#

but it returned the same thing

#

25 limit thing

amber fractal
#

You are still adding the fields

#

Add it to the string then embed.addField(`Name`, str)

lusty dew
#

oooo

#

Makes sense

amber fractal
#

You'll need to slice off the end if you dont want a stray "|"

lusty dew
#

Ok

#

Thanks!

amber fractal
#

Hope you get it working :+1:

lusty dew
#

Thanks <3

amber fractal
#

btw, Objects.entries() returns an array

#

Oh wait

#

Im just dumb

#

Didnt know you could loop over an array with of like that

lusty dew
#

Yea

#

I can't figure out how to do this part

amber fractal
#

Show a bigger image of the embed

lusty dew
amber fractal
#

Is that in the title?

lusty dew
#

Yea

#

.setTitle

amber fractal
#

Titles have a url option

lusty dew
#

really....

amber fractal
#

my bad

#

its .setURL*

#

When you click the title it will bring you to the url

lusty dew
#

Huh?

#

I should use .setURL?

amber fractal
#

.setTitle("Title")
.setURL("URL")

lusty dew
#

Ooooo

#

Okie

amber fractal
#

If you want to kill your system, you could also make it link every dependency mmLol

#

Wait I guess it wouldnt kill it

#

actually it wouldnt really do much I was just being really dumb

#

Imma go to bed now

#

Oh but it exceeds the character limit pretty quickly

lusty dew
#

Huh?

amber fractal
#

Ignore that

lusty dew
#

Okie lol

amber fractal
#

It was just my train of thought at the time

lusty dew
#

Ah ok

#

I am trying to figure out how to get rid of the | and another thing

#

I forgot how the .slice() method workss

#

works*

amber fractal
lusty dew
#

how does
console.log(str.slice(-4))
work and it returns just dog?

amber fractal
#

Because the start index is 4 from the end of the string

#

i.e. "dog."

#

Look at examples

#

Theres one for slicing the end of the string

lusty dew
#

I am but they don't make much sense

amber fractal
lusty dew
#

Ah ok vm

#

nvm

#

it counts characters

#

and whitespaces are included

amber fractal
#

:+1:

lusty dew
#

positivenumbers makes it begin at the front negative makes it begin at the back

#

Correct?

amber fractal
#

Yes

lusty dew
#

Mk, that makes sense now lol

amber fractal
#

Dont confuse it with the startIndex and endIndex tho

#

Like in the example they use a negative start index and a positive end index

#

Wait

lusty dew
#

I will look at that later

amber fractal
#

Idk if they do that or not mmLol

#

Didnt actually look at them that close thpught I saw it while scrolling

#

Now i need to find it

#

Ah yes, they did

lusty dew
#

Well

#

str.slice(-1)

#

returns an error saying RichEmbed values may not be empty

amber fractal
#

Yes

#

Thats the start

lusty dew
#

Wait what?

amber fractal
#

Youd need (0, -1)

lusty dew
#

Oh shit

#

XD

#

Maybe I should have looked at the startIndex and endIndex

#

XD

amber fractal
#

Weird that it said it was empty tho

#

Unless theres a space

lusty dew
#

Yea

#

there is

#

UwU

#

I put a space between the dependency and the |

#

and

#

I think

#

Nah nvm it was the space I put between dependency and |

amber fractal
#

Either way, I'm gonna get to sleep, for real

lusty dew
#

Weird

#

It didn't remove the |

#

Also gn

fervent oyster
#
String.prototype.replace(/{your string here}/g, '') //g means global so it will remove all of the indicated string
amber fractal
#

They are just trying to remove the end

fervent oyster
#

ahh

lusty dew
#

Lel

amber fractal
#

They have an extra space

#

0, -2

#

Instead of 0, -1

#

That will cut the 2 characters "| " off

lusty dew
#

Did not think of that

amber fractal
#

Now I'm goingto bed

#

For reals

lusty dew
#

comes back on and helps

#

Jkjk gn

viral spade
#

heyo,
what would you guys say is the best solution if you need a database that every shard is accessing in parallel? What if the shards are on different servers?

keen drift
#

Any ACID compliant db should work

#

Most of the popular db are designed for parallel access

viral spade
#

okey i thought so. altough when i tried it once with mysql i received some strange "lock" errors

keen drift
#

yeah a table may be locked

#

If you get that error, something prob call to lock the table in your code/w/e

viral spade
#

i was firing writes from multiple shards to the same table "at the same time". so with a lot of shards they might block each other?

keen drift
#

It shouldn't unless they all lock the table when they are writing

viral spade
#

ok thank you very much

earnest phoenix
#

what's the newest ffmpeg version for discord.js

#

is it? 4.1

earnest phoenix
#

hi

#

how can i make the buttons like this?

#

on discord.js

idle mountain
#

[your text](www.somewebsite.com)

earnest phoenix
#

thx

idle mountain
#

npnp

zinc pawn
restive bough
#

damn

#

so many files

#

0_o

unreal junco
#
  message.channel.send(`${message.author}, ${args} is not a valid number`).then(msg => msg.delete(5000));
              message.channel.send("Auto Rolling! :game_die: ")
              setTimeout(function() {
                .then((msg) => {
                diceRoll = Math.floor(Math.random() * 6) + 1;
                msg.edit("Your dice landed on: " + diceroll);
              })
              }, 5000);```
#
                .then((msg) => {
                ^

SyntaxError: Unexpected token .
    at new Script (vm.js:84:7)
    at createScript (vm.js:264:10)
    at Object.runInThisContext (vm.js:312:10)
    at Module._compile (internal/modules/cjs/loader.js:684:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:22:18)```
earnest phoenix
#

well yeah

#

have you seen your code

#

you're calling then on nothing

quartz kindle
#

he calling then on { xD

earnest phoenix
#

Tim dm?

quartz kindle
#

i dont have time now

earnest phoenix
#

😦

spare glen
#

how do you make the logo in your DBL website to bounce

clever wave
#

Hello My Bot Is Still Waiting For Approval How Can I Confirm

earnest phoenix
#

If is waiting for approval you have to wait minimum few days

clever wave
#

But it was about 8 days

ruby dust
#

It was no more than 6 days

spare glen
#

how to have the logo bounce in our dbl website

ruby dust
#

CSS

#

If not with css then js

spare glen
#

ik that

#

but how

#

like i have my website in changing colors, but idk how to get the logo to bounce

ruby dust
#

I wish I knew, but if it's js then you just can't

spare glen
#

im using css

#

not js

knotty steeple
#

keyframes

#

use those

earnest phoenix
#

if you don't know how to do css animations use animista

quartz kindle
#

@spare glen google css keyframe animations and css transform

restive bough
#

duckduckgo*

earnest phoenix
#

is there is any website

#

that lists links for songs, like 1k music links on youtube

#

for autoplaylist

harsh nova
#

oof

#

does anyone know what the backround layer of dbl is called in html

mossy vine
#

@harsh nova you can just use inspect element

harsh nova
#

yeah but I cant find the element

mossy vine
#

Right click, inspect

harsh nova
#

oof I found it

#

I used preview mode before

#

I'll blame my lack of good boie points on that

spare glen
#

i have no clue on how to make the logo bounce

#

could someone join the DBL site and help me with it

dusky steeple
#

Just jump up and down and it will bounce 😛

harsh nova
#

they proboly have something

#

you could use slide with infinate and alternate-reverse on

spare glen
#

ok

#

ill try

harsh nova
#

good luck

earnest phoenix
#

Anyone good at ejs?

sick cloud
#

ask your question

earnest phoenix
#

I’m trying to hide an alert , until someone does submit

#

but I tried a lot of methods

#

none of them worked

dusky steeple
#

How are you trying to do it?

#

you using modals?

earnest phoenix
#

nope

dusky steeple
#

bootstrap?

spare glen
#

@harsh nova i have what u said

#

what now

#

i generate code then what

#

like how do i add the code to the logo

harsh nova
#

css

spare glen
#

yeah, but but but

#

how do i add it to the img

#

look, i have that

#

how do i add it to the logo in DBL

sick cloud
#

css

worldly obsidian
#

to get back the first mention we make

   let user1 = message.mentions.members.first ();

but for the second one how?

sick cloud
#

its a collection

#

read the docs on it and you'll work it out

#

you can also just make it an array and choose the 2nd element

spare glen
#

BRo, how the fuck do i get the logo from my DBL site so i can add code to it

worldly obsidian
#

I have to use the collection.on ?

sick cloud
#

what?

inner jewel
#

read the docs²

sick cloud
#

@spare glen inspect element, find the logo id, use css to add the animation to it

spare glen
#

which one

#

the bot-img is a class, do i use that

sick cloud
#

try it and see

spare glen
#

k

#

didnt work

#

@sick cloud

sick cloud
#

¯_(ツ)_/¯

spare glen
#

can i add a class in a class

#

like how does it work

#

wtf

sick cloud
spare glen
#

i did that

sick cloud
#

lmao

#

do you even know css

#

or are you just copy pasting tutorial code hoping itll work

spare glen
#

i just started

gray turret
#

So basically is it possible to get banned on Discord for your bot hitting the message limit constantly? Becuase i'm thinking of adding an optional global chat to my bot and just want to know before i release it. Btw my bot isn't that big its in 208 servers. Thanks!

inner jewel
#

if you spam the api you may get ip banned

#

your account is unlikely to get banned

#

but the bot may be ip banned and you'll get an email

earnest phoenix
#

use a library that handles ratelimits for you or develop your own ratelimit handler

inner jewel
#

staying inside the ratelimits doesn't mean it's not spam

earnest phoenix
#

that too

#

but if it's a chat link nobody will really care

inner jewel
gray turret
#

Hmm, ok thanks! I'm not going to release it.

earnest phoenix
#

nevermind what i said above, i thought it was game <-> discord chat link, global chat is a nono

gray turret
#

xD Thanks anyways, i'm not going to release it

spare glen
#

whats the class name here

#

is it just votebutton

#

or the whole name

#

cause i tought we couldnt have spaces

amber fractal
#

Its in quotes

spare glen
#

yes, is it the whole text

#

is it that

quartz kindle
#

spaces means multiple classes

#

votebutton is one class, btn is another class

spare glen
#

@quartz kindle does that mean i gotta do votebutton, btn, btn-orange, btn-2x { background-color: black; color: orange; }

#

nvm i did it

#

but can you have font-weight: bold in a <p></p>

topaz fjord
#

yes

quartz kindle
#

@spare glen you dont need to target all classes, you only need one

spare glen
#

k

quartz kindle
#

and you can assign css to a <p> tag by targeting it

#

you can target tags by the tag name, or by giving it a class or an id

tulip ledge
#

Is there anyone who hosts on vultr?

unique iron
#

I do glitch

tulip ledge
quartz kindle
#

you didnt create any password?

tender sandal
#

Hey

#

Can anyone help me code my first bot

opaque eagle
tender sandal
#

Oh Yeah it said not here

#

Sorry

bitter sundial
#

@tulip ledge you should get a root password in your email

#

unless you set up ssh keys I guess

#

in which case you should ssh into it

foggy violet
#

@tulip ledge go on the dashboard, you will see
IP
USER (root)
PASS

tulip ledge
#

I did not get any password

#

YEs I know

#

But in the password it contains numbers

#

(96) and when I put it in the console it show (^ and it sais its invalid

foggy violet
#

try with console app like putty or something?

earnest phoenix
#

How would i go about making my bot only send a message/picture if it is a NSFW channel? In JS

bitter sundial
#

do you have shift stuck or something

tulip ledge
#

No

earnest phoenix
#

can someoen send me link for the document about js how to make timer bot

#

🤔

#

Why do you guys pay $5/gb for a vos

#

vps*

#

For only hosting a discord bot

foggy violet
#

port 22 is open by default and root login is allowed

earnest phoenix
#

While I pay $3/gb/month

bitter sundial
#

/gb?

earnest phoenix
#

yes vultr = $5-> 1gb vps /month

foggy violet
#

he means ram @bitter sundial

bitter sundial
#

I dont think the price is /gb

#

you know there's other factors too lol

tulip ledge
#

Now I can't type in the password field D:

#

€5 for 20GB and 2048MB ram

bitter sundial
#

the password field doesn't show what you're typing for security

earnest phoenix
#

what

#

2gb ram?

#

tf

#

20gb storage

I just noticed we are in #development oh god my bad

bitter sundial
dusky steeple
#

@earnest phoenix if (!message.channel.nsfw) return after the return do your other stuff message or something

harsh nova
#

the fact that password does not show up confused me extremely when I started using ubuntu

foggy violet
#

5$ = 1GB ram, 1 CPU, 25 GB SSD, 1TB bw

earnest phoenix
#

Yea i got it figured out, i was just thinking over complicated but thanks anyways :)

tulip ledge
bitter sundial
#

yea

tulip ledge
#

Does anyone know how I install node on it

night imp
#
#

look it up for your distro

lusty dew
earnest phoenix
empty steppe
#

I am in need for some beta testing for a new bot. I'll gladly offer the same in return.

lusty dew
#

@earnest phoenix Yea, didn't think about that,I am used to using d.js xd

marble needle
#

@lusty dew

dusky steeple
#

how hard is it to convert from discord.js to eris?

#

I keep getting told to convert my bot to eris

marble needle
#

if your bot is decently sized you're better off rewriting it in eris

#

you get more features by default aswell so that's that

lusty dew
#

@marble needle Thanks, figured it out though, although I don't get why you have to go through the channel to get he id of the guild

dusky steeple
#

its not real big yet

marble needle
#

i mean you can rewrite it for shits and giggles, future proofing™ and for the experience/fun along the way. i've always been told eris does better performance wise when your bot reaches a fairly large size. But keep in mind that there aren't too many people out there throwing around eris based code you can use. You'll have to figure out most of it yourself

#

how hard the conversion ends up being depends on your programming knowledge and ability to use lib documentation thinknow

quartz kindle
#

eris doesnt have more features than djs

#

not afaik

#

some say eris is more efficient in terms of memory and cpu usage, but djs v12 should be equally good

spare glen
#

can i type php and it still will work

#

like i have html code right, but if i type php instead of html

inner jewel
#

if you don't run it through php, it won't lol

mossy vine
#

php.html will definitely wrok, yes

spare glen
#

so i can do index.php.html

inner jewel
#

you mean php tags?

spare glen
#

i wanna create a contact form

#

with php

#

do i need to change the name from index.html

#

to index.php

inner jewel
#

if you have something that runs .php files in a php interpreter

spare glen
#

but like, i wanna do a contact form with php in my index.html file. will it work

earnest phoenix
#

php is a programming language, html is a markup language and they aren't nowhere near the same

it's like asking if a png file will turn into ascii art if you change the extension from png to txt

spare glen
#

then how do i add a php contact form to my html file

earnest phoenix
#

beats me

dusky steeple
#

write it in html

earnest phoenix
#

google around

tulip ledge
#

Hey so I'm hosting on vultr and I just set up my mysql database but I can't get out of its shell how do I get out of it?

wide ruin
#

my discord.js bot isnt doing anything

#

n errors

#

no*

#

not online

tulip ledge
#

Did u log in using your token

#

Did u use the right token

wide ruin
#

yes

#

the wrong token gives an error

tulip ledge
#

Yeah but you could have the token of one of your other bots maybe

wide ruin
#
client.login(token);
console.log('On')```
#

ends like this

tulip ledge
#

Are you returning before client.login?

wide ruin
#

and its almost impossible to have anothertoken

tulip ledge
#

And you should put console.log in a ready event

#

Its not

wide ruin
#

there is a ready above

tulip ledge
#

You can have multiple bots in your developer page

#

Then I can't help you

quartz kindle
#

login is a promise

#

you should do js client.login('my token').then(console.log).catch(console.error);

#

so it logs the result of the login function, if the login succeeded or not

#

doing the way you did will always log "On" regardless if the login worked or not

slate kayak
#

@quartz kindle hello hope you have been well buddy 😃 i have a question how can i add pages to my radio command as i have 50 radio stations but its shows 1-25 and then 26-50 underneath it

earnest phoenix
wide ruin
#

No it's fine

ocean vine
#

i deleted the bot i uploaded because the post mentioned NSFW commands and now I tried to upload it again and it says "• Bot Already Added" but it doesn't appear in my profile, should I talk to a mod or admin?

earnest phoenix
#

@ocean vine See in #logs if @gilded plank Says you've added a bot then click the link and remove it... I think...

queen sentinel
#

You could have just edited your bot to remove the NSFW stuff

#

no need to have deleted it

ocean vine
#

yeah i did but then i thought, maybe i'll have to wait a week and they'll see the original post, not the updated one

#

@earnest phoenix it worked

#

thanks

desert hearth
#

What are easy features that i could add to my bot? Already has coinflip, info, mirror

wide ruin
#

8 ball

desert hearth
#

But, like pictures of certain dogs?

spare glen
#

whats this

desert hearth
#

Wrong URL

spare glen
#

i dont understand it

desert hearth
#

on what page

spare glen
#

on my page

#

i uploaded my website but it dowsnt work

desert hearth
#

What service?

spare glen
#

im talking about contact form

#

i just made a contact form

desert hearth
#

Oof

#

Idk why it does that

bright spear
#

@spare glen the page you went to doesnt exist obviously

spare glen
#

No shit

#

Why doesnt it work,

bright spear
#

wdym why doesnt it work

#

it just doesnt exist

spare glen
#

What doesnt exist

bright spear
#

the page

#

for the url that you went to

spare glen
#

What the fuck

#

I made a fucking contact form

#

I presses the submit button

#

And that happend

#

Wtf is the problem

#

What page is it suppose to create

bright spear
#

the action= url doesnt exist

#

or it doesnt work for the method

spare glen
#

What the fuck

#

I did the code in my html file, styled it in css file, and coded the php part in contact-form-handler.php file

#

And the action is directed to the php file

bright spear
#

wait are you trying to run php in netlify

spare glen
#

Yeah

bright spear
#

you cant do that BlobFacepalm

#

just use their forms thing

spare glen
#

Then what free webside host should i use

bright spear
#

dont use php

spare glen
#

But but

#

Is there any other web hoster

#

That supports my code

#

Free

bright spear
#

idk

keen drift
#

kek

#

free

#

👏🏾

rocky dagger
#

glitch

keen drift
#

glitch doesn't have php interpreter

spare glen
#

True

keen drift
#

000webhost supports php

spare glen
#

Oh

bright spear
#

glitch does have php

mossy vine
#

000webhost is a joke

spare glen
#

000webhost

mossy vine
#

down for 1 hour every day

bright spear
#

but not officially supported

#

oof

keen drift
#

it's free, but it's shit

#

👏🏾

rocky dagger
#

but still

keen drift
#

just like many free things

spare glen
#

000webhost, is it a thing

bright spear
#

yes

#

google it

spare glen
#

Free

#

?

bright spear
#

yes

#

duh

#

but it sucks

spare glen
#

Does 000webhost support php

keen drift
#

...

bright spear
#

netlfiy is good but you cant run php on it obviously

#

dude

keen drift
#

I literally said it

bright spear
#

google is a thing

keen drift
#

wtf

spare glen
#

Ok chill

#

Wow

#

Im not a pro mlg super star

bright spear
keen drift
spare glen
#

Salty

keen drift
#

h0w b8g should 8 make it

spare glen
#

Stop being so salty

#

Omfg

bright spear
#

??

spare glen
#

Just thank you and bye

bright spear
#

you're just being annoying

#

and we're trying to help you

spare glen
#

Wtf i said thank you

#

Whats your problem

keen drift
#

@bright spear man, get me back into cert chat

bright spear
#

lol i wish

rocky dagger
#

My bot adds the role but dosen't remove it. Does anyone know why?message.channel.send(`<@${wUser.id}> has been temporarily muted`); don't even go off.```js
if(warns[wUser.id].warns == 2){
let muterole = message.guild.roles.find(name, "muted");
if(!muterole) return message.reply("You should create a muted role. quick tip: do -tempmute @ranom guy 1s");

let mutetime = "10s";
await(wUser.addRole(muterole.id));
message.channel.send(`<@${wUser.id}> has been temporarily muted`);

setTimeout(function(){
  wUser.removeRole(muterole.id)
  message.reply(`<@${wUser.id}> has been unmuted.`)
}, ms(mutetime))

}```

bright spear
#

thats... not valid js

#

you dont await(something)

rocky dagger
#

so don't await?

bright spear
#

no

#

thats not how you use await

#

and what syntax highlighting did you use cuz u didnt use js

rocky dagger
#

I got no errors

#

plz ping me or msg me

bright spear
#

@rocky dagger dont "copy from yt"

#

actually learn javascript first

#

then discord.js

#

dont copy code cuz it wont work

#

also why tf are you using ```css when its not even css

#

do you even know what language that is

tulip ledge
rocky dagger
#

@tulip ledge What's the code?

tulip ledge
#

I fixed it

rocky dagger
#

great

desert arch
#

hello

keen drift
#

How volatile is running a stateful db in k8s container Thonk

tulip ledge
#

Does anyone know how to fix this weird glitch

#

So I have 100000 I do .toLocaleString('en-IN') and it gives 1,00,000

#

And it should give 100,000

shy rose
#

whats IN?

#

normally its US

#

what ever code IN is thats the format they use

rocky dagger
#

can someone help me with my code?

harsh nova
#

what language and library

rocky dagger
#

discord.js

harsh nova
#

aye, I could try

rocky dagger
#

So the problem is that the bot adds the role but dosn't remove it. ```js
if(warns[wUser.id].warns == 2){

let muterole = message.guild.roles.find(`name`, "muted");
if(!muterole) return message.reply("You should create a muted role. quick tip: do -tempmute @ranom guy 1s");

let mutetime = "10s";
await(wUser.addRole(muterole.id));
message.channel.send(`<@${wUser.id}> has been temporarily muted`);

setTimeout(function(){
  wUser.removeRole(muterole.id)
  message.reply(`<@${wUser.id}> has been unmuted.`)
}, ms(mutetime));```
harsh nova
#

any errors

rocky dagger
#

no

harsh nova
#

wait, why would you addrole by id

#

when you have the obj

#

im tired so im confused

#

I better just stay away from code

rocky dagger
#

This doesn't workjs setTimeout(function(){ wUser.removeRole(muterole.id) message.reply(`<@${wUser.id}> has been unmuted.`) }, ms(mutetime));

#

or thisjs message.channel.send(`<@${wUser.id}> has been temporarily muted`);

harsh nova
#

mutetime will not work

#

node.js is in miliseconds

#

so 10 seconds would be 10000

#

or 1000 * 10

#

oh wait

#

did not see the ms, sorry

quartz kindle
#

the temporarily muted message also doesnt work?

rocky dagger
#

no

quartz kindle
#

but the mute role works?

rocky dagger
#

only adding it

quartz kindle
#

that means something is breaking and interrupting the code there

#

can you try putting a catch block there?

#

like this

knotty steeple
#

"await(wUser.addRole(muterole.id));"

#

thats not how you find a muted role also

dusky steeple
#

wait shouldn't it just be (muterole)? without the .id

quartz kindle
#
try {
    await wUser.addRole(muterole.id);
    await message.channel.send(`<@${wUser.id}> has been temporarily muted`);
} catch(e) { console.log(e) }
knotty steeple
#

you should make customizable time

dusky steeple
#

this wouldn't be correct?

let mutetime = "10s";
    await(wUser.addRole(muterole));
    message.channel.send(`<@${wUser.id}> has been temporarily muted`);

    setTimeout(function(){
      wUser.removeRole(muterole)
      message.reply(`<@${wUser.id}> has been unmuted.`)
    }, ms(mutetime));
quartz kindle
#

both work. role functions accept a role object or a role id

dusky steeple
#

ah ok

knotty steeple
#

the await isnt correct

rocky dagger
#

What's correct then

knotty steeple
#

uh

rocky dagger
#

I have herd that before

knotty steeple
#

without the brackets

quartz kindle
#

natan dropped by yesterday and said its fine to use await like that

knotty steeple
#

tf

#

gay

rocky dagger
#

but they have never told me the correct way

#

lol

quartz kindle
#

anyway @rocky dagger have you tried what i told you?

dusky steeple
#

anyone use Travis CI on private repos?

rocky dagger
#
try {
    await wUser.addRole(muterole.id);
    await message.channel.send(`<@${wUser.id}> has been temporarily muted`);
} catch(e) { console.log(e) }```?
quartz kindle
#

yes

rocky dagger
#

it didn't work

quartz kindle
#

does anything come up in the console?

rocky dagger
#

nope

harsh nova
quartz kindle
#

yeah try this:

#
try {
    console.log(muterole.id)
    await wUser.addRole(muterole.id);
    console.log(muterole.id)
    await message.channel.send(`<@${wUser.id}> has been temporarily muted`);
    console.log(muterole.id)
} catch(e) { console.log(e) }```
rocky dagger
#

nope

harsh nova
#

does it log something?

rocky dagger
#

no

harsh nova
#

remove the time thing

#

just run that command

#

and see if it works

rocky dagger
#

want to see the wole code?

harsh nova
#

sure

#

i mean i've seen the guide your following before

rocky dagger
harsh nova
#

warn cmd?

knotty steeple
#

"copying from yt"

#

pls go learn javascript instead of copying outdated code

rocky dagger
#

i can something

#

it's my fist code ever

#

don' blame me plz

harsh nova
#

I learned the same way, but if i could go back i would learn the basics first

rocky dagger
#

where?

harsh nova
#

in the json file

#

that you are using as DB

rocky dagger
#

what ever that means

harsh nova
#

mate

#

"warnings.json"

#

there should be a obj lookinbg like this ```json
{
"id"{
warns: number
}
}

#

now this is probobly invalid json

#

but you get the point

rocky dagger
#

i get this in the console tho (node:19584) DeprecationWarning: Collection#find: pass a function instead (node:19584) DeprecationWarning: Collection#find: pass a function instead

harsh nova
#

yes

#

you are using a old function

#

not error but it will get depracated

#

dont worry about that rn

knotty steeple
#

no

#

you fix it

harsh nova
#

yeah

amber fractal
#

find("name", "test") became find(u => u.name == "test")

#

Not passing a function wont work in the future

rocky dagger
#

I feel like I just skip this whole thing lol

harsh nova
#

nah

#

but what does your warnings.json file look like

rocky dagger
#

{"<userid>":{"warns":2}}

harsh nova
#

"<userid>" or your id

amber fractal
#

When people do that it typically means it as a place holder.

rocky dagger
#

my id

amber fractal
#

I'd assume its an id

#

Yea

harsh nova
#

aight

rocky dagger
#

it is

harsh nova
#

if it is 2 it should work

amber fractal
#

Its valid

harsh nova
#

if you run the code now it will not run the code

#

since it would add another warn and it would be 3

#

and your code triggers on 2

rocky dagger
#

kick on 3 ban on 4

#

nothing on 5+

harsh nova
#

well you have commented out the rest

#

atleast on your github repo

#

wait nvm

#

so, it adds the role correct?

rocky dagger
#

Yeah

harsh nova
#

and before it adds it it console logs the id?

rocky dagger
#

It doesn’t log anything

harsh nova
#

well in your code it logs the id before adding the role

#
  console.log(muterole.id)
      await wUser.addRole(muterole.id);```
rocky dagger
#

it logged this543521259158372362

unique iron
#

How do i make a bot have multiple prefixes? 😅

rocky dagger
#

Multiple or custom?

harsh nova
#

DataBase