#development

1 messages · Page 1013 of 1

tulip ledge
#

Oh

#

I made like

#

5 files then

#

Lol

restive pebble
pure lion
#

Jaja niiiice

restive pebble
#

@low phoenix what is Command

low phoenix
restive pebble
#

ya

earnest phoenix
#

OmG CusToM NamE Is In ThiS SerVer

restive pebble
#

class needs constructor

still merlin
#

message.member.hasPermission(["")] should work @low phoenix

earnest phoenix
#

what the

#

thats confusing

#

(["")] its a puzzle

#

is that a thing?

slender thistle
#

It doesn't make sense at least

restive pebble
#

lol

low phoenix
#

@still merlin comes the same error.

slender thistle
#

neither to a human nor to a machine

earnest phoenix
#

mhm

restive pebble
#

u need to run it

#

or execute

#

and where is message

delicate shore
#

this keeps on loading

#

and never comes

#

no

#

my net is 100 mb/s

#

there is a problem

solemn latch
#

Down or up

restive pebble
#

its not code related then

solemn latch
#

🤔

restive pebble
#

its the site u using

solemn latch
#

Is the cdn up?

weary ridge
#

umm can someone help me?

restive pebble
#

ok

#

u should ask

weary ridge
#

i get this error Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "memes" is not found

delicate shore
#

its the site u using
@restive pebble tenor

weary ridge
restive pebble
#

sorry

weary ridge
#

even tho theres clearly a command

delicate shore
#

   if(command === "gif"){
if(!args[1])
return msg.reply("**Kindly tell a keyword along with**")

let gifo = args.slice(1).join(" ");
    fetch(`https://api.tenor.com/v1/random?key=APIKEY&q=${gifo}&limit=1`)
      .then(res => res.json())
      .then(json => {
      
      let embed6 = new Discord.MessageEmbed()
                    .setTitle("Here is a gif of $args[1]")
                    .setImage(json.results[0].url)
                    .setFooter(`s!patreon | s!help`)
                msg.channel.send(embed6)
      
    });```
#

this is the code

restive pebble
#

i am node js guy

#

sorry

delicate shore
#

wait

weary ridge
#

oh

delicate shore
#

you python?

weary ridge
#

who me?

delicate shore
#

no

#

boeing

restive pebble
#

i suggest u to console.log that

weary ridge
#

he uses js

delicate shore
#

he said

#

i am not node.js guy

empty owl
#

what’s going on here

delicate shore
#

can u help me?

weary ridge
#

i am node js guy
@restive pebble

delicate shore
#

can we embed gif's ?

#

or is it not possible

restive pebble
#

i suggest u to console.log that
@restive pebble @delicate shore

empty owl
#

¯_(ツ)_/¯

restive pebble
#

its possible

earnest phoenix
#
 let color = member.roles.highest.hexColor
 if (color === '#000000') {
 '#232829'
 }
``` this dont wokr
solemn latch
#

You can

earnest phoenix
#

he;l[p[

#

help

empty owl
#

I’ve never tried embeding gifs

restive pebble
#

if its loading then its not visible to u

empty owl
#
 let color = member.roles.highest.hexColor
 if (color === '#000000') {
 '#232829'
 }
``` this dont wokr

@earnest phoenix

#

what are you trying to do

earnest phoenix
#

replace the defualt to that color

restive pebble
#

if(color.includes(hex))color.replace(hex,newhex)

delicate shore
#

@restive pebble logs empty

empty owl
#

why do you just have “#232829” in the middle of no where

earnest phoenix
#

ok

delicate shore
#

it shows nothing

restive pebble
#

so shrug

#

idk anything about node fetch

empty owl
#

if(color.includes(hex))color.replace(hex,newhex)
@restive pebble this is extra work lol

delicate shore
#

ohjhoohoh

restive pebble
#

i use request

#

and axios

#

yes lol

#

i love extra works

earnest phoenix
#

?

empty owl
#

@delicate shore is your APIKEY the actual api key

earnest phoenix
#

extra work?

#

what?

#

huh

restive pebble
#

and thats matching @earnest phoenix

#

learn what = means

earnest phoenix
#

k

empty owl
#

???????

earnest phoenix
#

( ͡👁 ͜ʖ ͡👁)

restive pebble
#

u want a link

#

?

empty owl
#

derku d.js v12 right

restive pebble
#

of what = means?

earnest phoenix
#

yeah

#

im v12

empty owl
#

@restive pebble he knows what = means

restive pebble
#

:(

earnest phoenix
#

dot work

#

crap

#

dont

restive pebble
#

u are not assigning

earnest phoenix
#

?

restive pebble
#

use only one =

#

color = newhex

earnest phoenix
#
 let color = member.roles.highest.hexColor
if(color.includes("#000000"))color.replace("#000000", "#232829")
``` code
empty owl
#

dude

#

Are you trying to set the color of the role

earnest phoenix
#

Ok

#

no

#

im changing color

empty owl
#

Oh

earnest phoenix
#

of my backround thing for uhh my profile mcd

pale vessel
#

replace doesn't modify the original string

empty owl
#

then color = “background color hex”

pale vessel
#

you have to reassign it

earnest phoenix
#

?

#

huh

empty owl
#

if (color === “”) color = “#jrhdnsjwjd”

#

@earnest phoenix do that

restive pebble
#

yes

#

thats better

earnest phoenix
#

no but like

#

i want

restive pebble
#

and easy

earnest phoenix
#

you know

#

wait

#

im dumb

#

wait im confused

empty owl
#

Do you want to change the color of the role or the variable color

#

@earnest phoenix

restive pebble
#
 if (color === '#000000') {
color = '#232829'
 }```
#

simply do this

empty owl
#

stop spoon feed

earnest phoenix
#

ok

#

thx

#

nice frweind

pale vessel
#

shamelessness

empty owl
#

idk if he was trying to change the color of th e role

#

or the variable

restive pebble
#

it was black

empty owl
#

oh well

restive pebble
#

so he was changing

#

well are colorless roles black?

empty owl
#

no need for brackets for one line code

#

And idk

restive pebble
#

ok

#

it returns 0

empty owl
#

ah

#

so the hex is 0

restive pebble
#

let me try first

#

lol

earnest phoenix
#

it worked

empty owl
#

anyone host on aws free tier?

#

or Microsoft azure student tier

earnest phoenix
restive pebble
#

u probably made a change

earnest phoenix
#

no

#

i didnt

restive pebble
#

compare changes

earnest phoenix
#

it doies that random

restive pebble
#

github has compare changes

pale vessel
#

no it doesn't

earnest phoenix
#

no it did it before

empty owl
#

Deku has large eyes

earnest phoenix
#

i did that thing

pale vessel
#

you did something wrong

restive pebble
#

flazepes more big

pale vessel
#

last time you used ' instead of `

earnest phoenix
#

no it fixed

empty owl
#

@earnest phoenix your sending the file and not attaching to embed?

earnest phoenix
#

( ͡👁️ ͜ʖ ͡👁️)

empty owl
#

dude ur image is so blurry

earnest phoenix
#

?

restive pebble
#

wut image

#

@empty owl

empty owl
#

The profile img

restive pebble
#

ok

empty owl
#

for his bot

#

‘S command

earnest phoenix
#

?

azure moth
#

for his bot
@empty owl whos bot

empty owl
#

not urs

azure moth
#

oh i need help with making mine

solemn latch
#

🤔

#

What with

empty owl
#

don’t ask just ask

azure moth
#

the code thing

empty owl
#

don’t ask to ask just ask*

azure moth
#

what

restive pebble
delicate shore
#

can anyone help me

#

with one thing

#
   if(command === "gif"){
if(!args[1])
return msg.reply("**Kindly tell a keyword along with**")
let bruhgg = msg.author
let gifo = args.slice(1).join(" ");
    fetch(`https://api.tenor.com/v1/random?key=EH35O4HY8VDJ&q=${gifo}&limit=1`)
      .then(res => res.json())
      .then(json => msg.channel.send(json.results[0].url)
            .then(msg.channel.send("**This Gif Was Requested by : &msg.author**"))
           )
            
            
             .catch(e => {
        msg.reply('Failed to find a gif that matched your query');
         console.error(e);
        return;
      });```
#

so bruhgg

#

it is not mentioning or even writing name

solemn latch
#

Your using "" and its ${} not &{}

delicate shore
#

ok

azure moth
#

whats the bot client id

delicate shore
#

Your using "" and its ${} not &{}
@solemn latch ' this should come?

solemn latch
#

`

azure moth
#

whats the bot client id someone help

restive pebble
#

`

delicate shore
#

@azure moth ?

#

explain your ques

restive pebble
#

whats the bot client id someone help
@azure moth its the id of bot

azure moth
#

@restive pebble how do i get the id

restive pebble
azure moth
#

and whats the invite url

restive pebble
#

oh

azure moth
restive pebble
#

u need to get url

#

and replace

#

id

#

@restive pebble is that it
@azure moth yes

azure moth
#

yeah how

quartz kindle
#

are you talking about adding a new bot to top.gg? in the website?

delicate shore
#

how to do like this

#

like

#

how to use GIPHY

#

can anyone link me to docs

azure moth
#

are you talking about adding a new bot to top.gg? in the website?
@quartz kindle yeah

restive pebble
#

webscrap

delicate shore
#

or something

pale vessel
#

no

#

they have an API

delicate shore
#

ok

quartz kindle
#

@azure moth everything you need is in your discord developers page

restive pebble
#

oh k

#

flazepe

azure moth
#

webscrap
@restive pebble that the url

pale vessel
#

webscrape should be the last resort

delicate shore
#

but liek any example or tuorial

restive pebble
#

i was not saying to u

#

i was saying to @delicate shore

delicate shore
#

boeing

#

help boi

azure moth
#

oh

restive pebble
#

@azure moth u can get invite url from discord developers site

#

he also said

#

it

azure moth
#

wheres that

restive pebble
#

tim help

#

him

quartz kindle
#

did you create a bot there?

azure moth
#

k

delicate shore
#

@restive pebble can you help me with giphy

azure moth
#

idk

restive pebble
#

no bro

#

use node fetch

#

and use api

quartz kindle
#

how do you not know, lol creating an application in the discord developers website is the first step towards creating a bot

#

you cannot add a bot anywhere if it doesnt exist

delicate shore
#

and use api
@restive pebble like what is link?

#

i mean

#

wtf am i saying

#

like

#

like that

solemn latch
#

Just Google it

restive pebble
#

just see guides on how to create bots @azure moth

delicate shore
#

what is the link

restive pebble
#

google lol

delicate shore
#
azure moth
#

whats a secret kkey

spare mirage
#

@delicate shore Dont ask everything here ;/
1st u ask the docs
after that u ask google
after that u ask us :P

solemn latch
#

^

spare mirage
#

youtube is final option becuz it sucks

restive pebble
#

@azure moth secret keys and its usage can be found at discord developers site

spare mirage
#

can someone join my test server to test my kick command?

delicate shore
#

@delicate shore Dont ask everything here ;/
1st u ask the docs
after that u ask google
after that u ask us :P
@spare mirage
ok so i first asked here when everyone said no so i asked is there any docs related to it everyone sais no
then I tried myself didn't worked
so i asked here and everyone said to google

#

so

#

.

quartz kindle
#

you dont need to use a secret key anywhere

spare mirage
#

just for the future

delicate shore
#

whats a secret kkey
@azure moth don't tell me you use Discord Bot Maker

quartz kindle
#

does dbm need your secret key?

restive pebble
#

so what lil

#

no no

delicate shore
#

does dbm need your secret key?
@quartz kindle nonono

quartz kindle
#

good lol

restive pebble
#

only token kek

delicate shore
#

lol

#

what fun command should i add next???????\

spare mirage
#

8ball

pale vessel
#

hentai

spare mirage
#

^

restive pebble
delicate shore
#

quality content

#

definitely not nsfw

pale vessel
#

at least it's allowed

delicate shore
#

it's not hentai

#

it's called adult anime

#

xD

restive pebble
#

u are underage

#

for that

#

lol

delicate shore
#

no

restive pebble
#

ok

delicate shore
#

i am 14.5

azure moth
#

who wants to help me

delicate shore
#

me

azure moth
#

ok

delicate shore
#

who wants to help me
@azure moth ques ?

restive pebble
#

idiots guide

solemn latch
#

You've yet to ask a question

azure moth
#

with my bot

restive pebble
#

an idiots guide

spare mirage
#
const Discord = require('discord.js')

  module.exports = {
    name: 'kick',
    description: "this is a kick command!",
    execute(Discord, bot, message, args){
        if (message.member.hasPermission("KICK_MEMBERS")) {
            if (message.mentions.members.first()) {
                try {
                    message.mentions.members.first().kick().then(message.channel.send("I just Kicked his ass" ));
                } catch {
                    message.reply("I do not have permissions to kick " + message.mentions.members.first());
                }
        }else {
            message.reply("You do not have permissions to kick " + message.mentions.members.first());
       


      
    }
}}}

why is my catch and my else not working

solemn latch
#

Isn't it finally, not else

azure moth
#

@delicate shore i sent you invite to test it if you want to test it

solemn latch
#

Oh its else for the if

restive pebble
#

if the error dosent occur there

#

it wont work

#

lol

quartz kindle
#

@spare mirage try/catch doesnt work on promises if you dont await them

solemn latch
#

Awh

#

I was typing that

azure moth
#

@restive pebble wanna test my bot

spare mirage
#

uhhh

restive pebble
#

async execute

#

no thx

spare mirage
#

so.. what do I do @quartz kindle

azure moth
#

oh ok

solemn latch
#

You can also .catch

delicate shore
#

what is this

solemn latch
#

@azure moth you can use alts for testing

#

Looks like an email

azure moth
#

whos alts

solemn latch
#

Your alt

quartz kindle
#

@spare mirage ```js
// this works
try {
await bla()
} catch(err) {
await bla2()
}

// this doesnt work
try {
bla()
} catch(err) {
bla2()
}

// this works
bla().then(whatever => {
// do something
}).catch(err => {
bla2()
})

azure moth
#

i dont know what that is

spare mirage
#

I have to require async right/

quartz kindle
#

you dont require async

#

you make your function async

spare mirage
#

uhh

quartz kindle
#

ie execute: async function(bla,bla,bla) => {

#

not sure if async execute(bla,bla,bla) { works inside objects

#

you can also try that

solemn latch
#

That doesn't load for me

delicate shore
solemn latch
#

That does

quartz kindle
#

@azure moth can you explain to me exactly what did you do so far? which steps did you take to create your bot, which guide did you read if any?

#

otherwise i have no idea what you need help with, how much experience/knowledge you have, and what's the next step you should take

spare mirage
azure moth
#

all ive done is the name bc i dont know what to do

#

and im as dumb as a brain dead dog

quartz kindle
#

@spare mirage why did you remove the rest lol

spare mirage
#

?

quartz kindle
#

you broke all your ifs

spare mirage
#

oh no

#

ctrl z

quartz kindle
#

@azure moth creating a discord bot is not a simple thing, it requires logical thinking and problem solving skills

spare mirage
quartz kindle
#

and preferably knowledge of programming concepts and a programming language

spare mirage
#

I gtg now though

misty sigil
#

wait a second

azure moth
#

i used to be really good but then i was kicked out of school in year 4 for telling my headteacher to get the f off me before i get him in a headlock

misty sigil
#

im dumb

quartz kindle
#

school has nothing to do with it, its simply your ability to think things through

azure moth
#

i go to a specie needs school now and im 13

misty sigil
#

the reason my mongodb was spitting errors out was because my ip wasn't whitelisted

#

aaaaaaaaaaaaa

azure moth
#

and i cant think about stuff because i get distracted

quartz kindle
#

do you have a discord server? if not you should create one, so you can test your bot in

misty sigil
#

definently, do make one

azure moth
#

i have 4

pale vessel
#

@misty sigil i feel you, seriously

#

did the same thing

misty sigil
#

i removed all my mongo code

#

BEFORE EVEN REMEMBERING MY INTERNET WENT OUT

quartz kindle
#

then head over to the discord.com delevopers website, and click on your application. on the left side menu, you will see some options, click on OAuth2

misty sigil
#

MAKING IT CHANGE IP

quartz kindle
#

in the OAuth2 page, you can create your bot's invite link

#

so you can invite it to your server

solemn latch
#

There was a really good getting started website

misty sigil
solemn latch
#

^ this one

#

Language independent

pale vessel
#

those are copied from anidiotsguide lol another site maybe

solemn latch
#

I never go to an idiots guide

#

Because I'm not an idiot christmasthink

#

Teehee

quartz kindle
#

looks like a nice guide

#

the problem is people dont read lul

misty sigil
#

can i just
host my own mongodb

solemn latch
#

Yeah

misty sigil
#

i need another serverboi

solemn latch
#

You can put multiple things on one VPS

quartz kindle
#

imagine making a mongodb bot

misty sigil
#

i dont use a vps

#

lol

quartz kindle
#

imagine your bot sends a message with a mongodb query, mongodbbot responds, and your bot reads the response message

#

lmfao

lusty quest
#

you can host mutiple MongoDB instances on the same machine.

misty sigil
#

how much cpu will that use tho

solemn latch
#

Lmao tim

lusty quest
#

i have a digitalocean 5$ droplet and with 1 mongoDB server running on it next to nothing

misty sigil
#

i wonder if i could host a db on heroku

solemn latch
#

Don't think so

#

🤔

lusty quest
quartz kindle
#

heroku wants you to use their own postgre api

#

how much ram is mongodb using there?

misty sigil
#

actually, if one prefix entry takes up, lets say 70 bytes

solemn latch
#

I'm working on getting bot statistics on prometheus, kinda fun to work with.

lusty quest
#

300mb is used

misty sigil
#

how much could i store in my 512 free thing

lusty quest
#

the rest is cached

quartz kindle
#

for the mongodb server alone?

lusty quest
#

the entire VPS (only docker and 1 MongoDB container)

misty sigil
#

can i integrate a top.gg api into my site?

#

hmm

quartz kindle
#

so mongodb by itself would use like 200mb i guess, excluding all containers and overhead

misty sigil
#

no seriously could i do that

#

wait a widget im dummkopf

lusty quest
#

its nothing. also i have 3 VPS with each running 1 MongoDB Container. All containers Run into 1 Replica set

delicate shore
#

how to make something like this

golden condor
#

ez

delicate shore
#

how

slender thistle
#

split by space, join with a clap emote

#

or split by an empty string

delicate shore
#

wait

#

don't tell

#

pls don't

#

lemme try myself first

#

i wanna learn myself

#

Can my bot use nitro emji's?

#

emoji's*

craggy token
#

||message.channel.send(args.join(" ").split("").join(":clap:"));||

#

Don’t open

delicate shore
#

no

craggy token
#

It’s the solution

delicate shore
#

😦

craggy token
#

But don’t

delicate shore
#

you did it to me

craggy token
#

But I spoiler ed it

#

So you wouldn’t see

boreal latch
#

lol that's included in dank memer's source code already
but you need to change some stuff @delicate shore

craggy token
#

Wait DM is open source?

boreal latch
#

uh

earnest phoenix
#

hello

boreal latch
#

they have an old source of theirs

#

just search up "dank memer source code"

delicate shore
#

||message.channel.send(args.join(" ").split("").join(":clap:"));||
@craggy token ok now help me

boreal latch
#

that's literally the code

#

help in what xd

delicate shore
#

that is it?

#

like

boreal latch
#

yeah

craggy token
#

Yep

boreal latch
#

lol

delicate shore
#

if(!args[1])
return msg.reply("What should i clap")

quartz kindle
#

you dont need to join and split again lol

#

just directly join

delicate shore
#

this ^^^^^^^^^^^^^^

craggy token
#

No if you want the clap to split the letters like DM does

boreal latch
#

yeah

earnest phoenix
#

+botinfo

#

+help

boreal latch
#

not here sir

golden condor
#

^

white drum
#

Does anyone know how I can get my bot to respond to @mentions . For example
Me: @bot#0008
Bot: responds with whatever I set it to.

delicate shore
#

if(command === "clap"){

if(!args[1])
return msg.reply("What should i clap")



message.channel.send(args.join(" ").split("").join(":clap:"));
}```
#

is this correct

golden condor
#

put in the actual emoji

#

\👏

quartz kindle
#

slap on every single character? why lol

boreal latch
#

he wants to do what DM did

golden condor
#

Does anyone know how I can get my bot to respond to @mentions . For example
Me: @bot#0008
Bot: responds with whatever I set it to.
@white drum regular expression

boreal latch
#

dank memer

white drum
#

@white drum regular expression
@golden condor
Wdym?

solemn latch
#

Aparently its what people consider funny these days

delicate shore
#

slap on every single character? why lol
@quartz kindle not character i need word

boreal latch
#

l 👏 i 👏 k 👏 e 👏 t 👏 h 👏 i 👏 s

golden condor
#

args.join("\👏")

delicate shore
#

no

#

like 👏 this 👏

boreal latch
#

oh right

#

sorry

golden condor
#

args.join(":clap:")

solemn latch
#

Split by space, join with clap

golden condor
#
args.join("👏")```
boreal latch
#

thats if the person has 2 arguments or morem

#

more*

quartz kindle
#

thats what i thought lol

golden condor
#

actually

boreal latch
#

you need to make an if statement if the author only did 1 argument

golden condor
#
args.slice(1).join("👏")```
white drum
#

Can anyone help me?

boreal latch
#

Can anyone help me?
@white drum cxllm already said it to u

#

"regular expression"

golden condor
#

A regular expression

empty owl
#

uh

golden condor
#

example

boreal latch
#

Regex

white drum
#

What does that mean tho

delicate shore
#
 

if(command === "clap"){

if(!args[1])
return msg.reply("What should i clap")

message.channel.send(args.slice(1).join(":clap:"));
};```
#

is this correct ?

empty owl
#

args.split(" ").join(emoji)

white drum
#

:clap:

golden condor
#

.join("\👏")

solemn latch
#

Regex is a complex subject, its best you google it @white drum

golden condor
#

or you could do

quartz kindle
#

you dont need regex, you can literally check for bot mention

white drum
#

👏

delicate shore
#

args.split(" ").join(emoji)
@empty owl wot

empty owl
#

slice1 gets rid of first argument in array

#

@empty owl wot
@delicate shore this code

golden condor
#

@empty owl his first arg is the command

empty owl
#

oh

golden condor
#

he did if(!args[1]) return

empty owl
#

Then args.slice(1).split(" ").join(emoji)

#

and I don’t think the command is supposed to be in the args array

solemn latch
#

Typically when you define args you do slice

#

Not in the middle of the code

quartz kindle
#

you cant split args again if its already an array

cobalt spruce
golden condor
#

you cant split args again
^^^^^^^^^^^

empty owl
#

Oh

quartz kindle
#

help with what

golden condor
#

do args.slice(1).join("\👏")

empty owl
#

Ye

cobalt spruce
#

@quartz kindle is it good?

golden condor
#

since u need to put the \

solemn latch
#

Lol

#

Run the code and find out

cobalt spruce
#

@solemn latch Meh i tryed

quartz kindle
solemn latch
#

And?

cobalt spruce
#

here u go

quartz kindle
#

there is no user.guild

solemn latch
#

^

cobalt spruce
#

what i do there

solemn latch
#

You already have guild defined, use it

quartz kindle
#

^

cobalt spruce
#

this

quartz kindle
#

yes

cobalt spruce
#

@quartz kindle

solemn latch
#

Save the file

cobalt spruce
#

am not that stupid

quartz kindle
#

are you sure the error is coming from there? whats bot.js line 42

cobalt spruce
#

@solemn latch there was problem in the embed

#

do worry

#

tim

quartz kindle
#

yes i do worry

cobalt spruce
#

hmmm

#

after i ban

#

this came out and no member

#

@solemn latch

quartz kindle
#

its user.username or user.tag

cobalt spruce
#

so user its a function for the name

#

?

quartz kindle
#

User is the User object

#

it contains all properties that belong to that specific user

#

profile pictures, usernames, discriminators, id etc

solemn latch
#

Check the docs to see what properties and methods exist for user

cobalt spruce
#

@solemn latch can u give me the docs for the reason

#

i need to add it

quartz kindle
#

to get the ban reason you need to fetchBan

cobalt spruce
#

@quartz kindle can i declare the guy who banned?

solemn latch
#

^

naive fulcrum
#

sorry to barge in, but can anyone help with FFmpegPCMAudio?

#

pretty new to discord bots

quartz kindle
#

@cobalt spruce not afaik. ban info contains only user that was banned, and reason

cobalt spruce
#

@quartz kindle ok

#

thanks

pure lion
#

Tim can i use express.js to interact with my db?

quartz kindle
#

does your db expose any kind of REST api?

#

or you mean receiving requests directed towards your db that you interact with locally

golden condor
#

Tim can i use express.js to interact with my db?
@pure lion what db do u use

pure lion
#

Quick

golden condor
#

o

pure lion
#

Would I need to switch

golden condor
#

yeah make an express server

#

with post requests

#

that checks for auth

pure lion
#

Can you run me through that

quartz kindle
#

if you want to make your database available to http requests from other applications, yes you can use express

pure lion
#

Can I write to it too?

quartz kindle
#

yes

pure lion
#

Ok epic

golden condor
pure lion
#

Just gonna learn full stack don't mind me

golden condor
#

html is fun

#

webpack is so good tho

#

it mixes backend with front-end

earnest phoenix
#

can ppl help me make a coin system?

golden condor
#

so is ejs

earnest phoenix
#

im using mongoDB and djs v12

quartz kindle
#

@pure lion it can be as simple as ```js
app.post("/write", (req,res) => {
let data = req.body // or whatever the body parser does
db.set(data.key,data.value)
res.send("data written")
})

pure lion
#

Ooooooooo

#

*put in pocket*

quartz kindle
#

webpack is hell

golden condor
#

@pure lion it can be as simple as ```js
app.post("/write", (req,res) => {
let data = req.body // or whatever the body parser does
db.set(data.key,data.value)
res.send("data written")
})

@pure lion check for auth too

#

webpack is hell
@quartz kindle actually now I look further into it yes it is hel

quartz kindle
#

took me like 3 days to get some basic setup working

golden condor
#

ejs is much better

quartz kindle
#

i dont like ejs either

#

im looking into handlebars, looks interesting

golden condor
#

ejs is pretty good imo

pure lion
#

Alrighttt that's my next goal

#

Thanks everyone, I'm gonna go develop my future career

lusty quest
#

i wish i had known about ejs a year ago. back then i wanted to make a API but forgot for what

quartz kindle
#

i wish i learned node.js earlier before i bought a xampp stack webhost for 3 years and wasted all of it writing bad php

lusty quest
#

rip

vale garden
#

hi

#

im using quick.db

#
const Discord = require("discord.js");
const Eco = require("quick.eco")
const eco = new Eco.Manager();
let db = require("quick.db");
//db.init("./economy");
let invalid = [0, -1, -0];
let invL = [-1, -0];
//const User = require("./User");

module.exports = {
    name: 'add',
    description: "adds money into someone's balance if you have perms",
    execute(message, args) {

      /*let userid = args[1];
      let amount = args[2];

        //if (!userid) throw new EcoError("User id was not provided.");
        //if (typeof userid !== "string") throw new EcoError("User id must be a string.");
        //if (!amount) throw new EcoError("Amount was not provided.");
        //if (isNaN(amount)) throw new EcoError("Amount must be a number.");
        //if (invalid.includes(Math.sign(amount))) throw new EcoError("Amount can't be negative or zero.");
        let oldbal = db.fetch(`money_${userid}`);
        this.db.add(`money_${userid}`, "+", amount);
        let newbal = db.fetch(`money_${userid}`);
        return { before: oldbal, after: newbal, user: new User(userid, undefined, this.db), amount: amount };*/

    /*if (!message.member.hasPermission('ADMINISTRATOR')) {
        return message.reply('You do not have enough permission to use this command.')
    }*/

    if (!args[0]) return message.reply('Please specify an amount to add.')
    if (!(isNaN(args[0]))) return message.reply('That was not a valid number!')

    let user = message.mentions.users.first() || message.author
    message.channel.send('Successfully added ' + args[1] + ' to ' + user.username)
    db.add(`money_${message.guild.id}_${message.author.id}`, args[1])


    }
    }

#

amount isnt getting added

#

whyyyyyyy

quartz kindle
#

you're checking args[0] but adding args[1] ?

vale garden
#

wat

#

oh wth

honest perch
#

@quartz kindle because they bigbrain

vale garden
#

yeet

pure lion
#

It's basic js

vale garden
#

lol

pure lion
#

:/

solemn latch
#

Amount is set to args[2]

delicate shore
#

ggg

#

gg

#

g

#

g

#

okokokokokokokok

#

k

vale garden
#

mistakeeeee

#

wat

#

thats something else

earnest phoenix
#

can ppl help me make a coin system?
im using mongoDB and djs v12

lusty quest
#

ive had some issues when i started with mongodb (tryed to store a userid as int but its to long and i didnt knew why, additional mongoose dont support bigint)

honest perch
#

just make it a string

lusty quest
#

@earnest phoenix litteraly the yt series i send you adds a coin system

honest perch
#

@earnest phoenix what exactly do you need help with

earnest phoenix
#

oh really?

lusty quest
#

@honest perch i know found it on stackoverflow

earnest phoenix
#
    const DBL = require('dblapi.js');
    const dbl = new DBL('CENSORED', { webhookPort: 25565, webhookAuth: 'CENSORED' });

    dbl.webhook.on('ready', hook => {
        console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
    });

    dbl.webhook.on('vote', vote => {
        console.log(`User with ID ${vote.user} just voted!`);
    });

I'm running this on ptero, when I visit the url provided it doesnt connect

lusty quest
#

is the port open?

earnest phoenix
#

lemme check

#

how shall i get a command author's name and avatar in the embed?

lusty quest
#

message.author.username

#

if you use djs

pure lion
#

Uh

#

Jzjzjzj

#

Oh chat died

solemn latch
#

I'm around

delicate shore
#
f(command === "clap"){

if(!args[1])
return msg.reply("What should i clap")

msg.channel.send(args.split("").join(":clap:"));
};```
#

it is not working]

pure lion
#

That's a nice f statement you got there

earnest phoenix
#

f

delicate shore
#

if

solemn latch
#

Looks like you already split if you have args[1]

delicate shore
#

but still not working

#

@solemn latch wot

solemn latch
#

Your splitting something that's already split

earnest phoenix
#

just do if args.length = 0 then do what should i clap

golden condor
#

^

#

It won't work for two reasons

delicate shore
#

wott

#

t

vale garden
#

hi

golden condor
#
  1. you need two = signs
  2. his first arg is the command
vale garden
#

like ```js
message.member.hasPermissions

#

is there a way

#

i mean

#

is there something like

#

message.member.hasID

solemn latch
#

Your looking for a user with an id?

vale garden
#

im trying to make a command

#

which can only be done

#

by one guy

#

one specific guy whos id i know

solemn latch
lusty quest
#

message.author also works

solemn latch
#

Or or
Nah jk thats all I got

golden condor
#

Or

#

You could overcomplicate it

#
function isUserThisUser(user1, user2){
if(user1 != user2) return false;
if(user2 => user1) return false;
if(user2 <= user1) return false;
if(user2 === user1) return true;
}```
solemn latch
#

I say create a website, that has an api with the id, and when the bot gets the command, it checks that api for the ID.

And then send the two IDs to another api that checks if they are equal.

And then if they are, run the command

#

🤔

quartz kindle
#

Lol

lusty quest
#

or train a AI to check the id and repond if the ID is correct

golden condor
#

yes

#

very yes

honest perch
#

@quartz kindle how would i show a server count on a website

warm marsh
#

Discord API or embed bot/create API in bot project.

lusty quest
#

if its the DBL side add a autoposter (add the client to the DBL client)

earnest phoenix
#

I made sure my port is open, and when testing nothing happens

#

Code: ```js
const DBL = require('dblapi.js');
const dbl = new DBL('CENSORED', { webhookPort: 25565, webhookAuth: 'CENSORED' });

dbl.webhook.on('ready', hook => {
    console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});

dbl.webhook.on('vote', vote => {
    console.log(`User with ID ${vote.user} just voted!`);
});
I'm running this on ptero, when I visit the url provided it doesnt connect
lusty quest
#

did you have a console.log if the bot connected to DBL?

earnest phoenix
#

console log what exactly

vale garden
#

hi

#

how do i make a bot

pure lion
#

*crying*

vale garden
#

send a certain message

#

in all the servers

#

its in

solemn latch
#

Thats api abuse

restive pebble
#

forEach

pure lion
#
  1. Don't
vale garden
#

wat

solemn latch
#

Don't do that

vale garden
#

oh

restive pebble
#

forEach loop

lusty quest
#
dbl.on('error', e => {
 console.log(`Oops! ${e}`);
})

``` maybe this will catch something
restive pebble
#

lol

warm marsh
#

forEach is slow.

pure lion
#

Sotp

restive furnace
#

for loop is gut

warm marsh
#

But you shouldn't post a message in all servers.

restive pebble
#

yes

#

ban

pure lion
#

Abn

golden condor
#

yeah

earnest phoenix
#

@lusty quest dbl.webhook.on you mean?

solemn latch
#

Nab

golden condor
#

you shouldn't

lusty quest
#

the event is from the docs

#

it will check if the DBL client fails

earnest phoenix
#

so no .webhook?

lusty quest
#

(if you use the offical one)

#

no its just to know if the client fails or not

earnest phoenix
#

kk

lusty quest
#

also did you added the correct URL on your Top.gg site?

earnest phoenix
#

yep

lusty quest
#

not 0.0.0.0:port it needs to be your serverip

earnest phoenix
#

I know.. i didn't put 0.0.0.0

#

i put the server's ip:port

lusty quest
#

did you use the offical dbl package or the non offical one?

earnest phoenix
#

official

lusty quest
#

so dblapi.js

earnest phoenix
#

should i remove /dblwebhook?

lusty quest
#

what did you use in your settings?

#

it needs to be the same

earnest phoenix
#

I'm in settings

lusty quest
#

in your bot

earnest phoenix
#

This is bot's settings

lusty quest
#

not on the webpage

earnest phoenix
#

from where then?

lusty quest
#
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
``` you get this print into your console right?
#

the path at the end is needed

calm saddle
#

hi superbrain8 we meet again

earnest phoenix
#

Webhook running at http://0.0.0.0:25565/dblwebhook only thing I did was replace 0.0.0.0 with the actual ip

lusty quest
#

thats correct

earnest phoenix
#

nothing in console though

lusty quest
#

did you added ```
dbl.webhook.on('vote', vote => {
console.log(User with ID ${vote.user} just voted!);
});

#

just for debugging its enought

earnest phoenix
#

yep

lusty quest
#

and if you use the test button on the website nothing happens?

earnest phoenix
#

exactly

lusty quest
#

hmm 404 says page not found

earnest phoenix
#

yea that should be fine

#

i dont have anything displayed there

#

I tried console logging the constructor dbl

#

threw an object at me, I don't see any errors seems fine

lusty quest
#

hmm

earnest phoenix
#

something just came in..

#

jesus that took a few minutes

lusty quest
#

ohh you didnt wait?

#

it can take up to 30 minutes

earnest phoenix
#

i did

#

didnt wait 30 mins tho

solemn latch
#

Api is pretty slow rn

earnest phoenix
#

30 mins? wtf

solemn latch
#

Has been for a few weeks

pure lion
#

Oh no

lusty quest
#

but trying to fix a non existing issue is painful

earnest phoenix
#

IKR

solemn latch
#

Honestly docs should say it can take time for votes to be sent

pure lion
#

""""time""""

earnest phoenix
#

days

solemn latch
#

I wish it took as long as the queue does

#

🤔

pure lion
#

""""""""""days"""""""""""

earnest phoenix
#

My bot just came out of queue lol 1 month

pure lion
#

Bruhhh

solemn latch
#

They are working on bots on the 13th or 14th now

#

Its only the second

lusty quest
#

i applied my 2nd bot a few days ago

solemn latch
#

Someone's bot did get skipped

#

Feels bad for that guy

lusty quest
#

also my first one reached 100 Guilds a few days ago

pure lion
#

Yooo niceee

earnest phoenix
#

what kind of bot is it

pure lion
#

I low key wish I would be allowed to send documents to discord so I can be verified :<

lusty quest
#

did you know the game Warframe?

pure lion
#

Who?

delicate shore
#

@pure lion you free now?

pure lion
#

Almost

delicate shore
#

ok

#

hey my clap command won't work

solemn latch
#

I think we listed the 3 reasons it didn't work @delicate shore did you fix them

delicate shore
#

I think we listed the 3 reasons it didn't work @delicate shore did you fix them
@solemn latch yes

fallen arch
#

math.floor and math.random is a way to get a random from an array

calm saddle
#

not here too my gowd

delicate shore
#

i```js
f(command === "clap"){

if(!args[1])
return msg.reply("What should i clap")

msg.channel.send(args.split("").join(":clap:"));
};```

#

this is the code

solemn latch
#

I dont see any changes

delicate shore
#

umm

#

there weren't any changes? @solemn latch

#

because if i do args 0

solemn latch
#

You just said you fixed the issues

delicate shore
#

then

solemn latch
#

that we listed earlier

delicate shore
#

you listed noothign

#

one person said do arge 0

#

other said that it won't worl

#

work

#

both were bot devloper

#

@restive pebble bru

calm saddle
#

dayum

solemn latch
fallen arch
#

show me how u defined args

calm saddle
#

yea

solemn latch
#

I clearly listed an issue

#

🤔

earnest phoenix
#
  bot.on("guildCreate",  message, guild => {
  bot.channels.cache.get("728260629466447892")
    .send(`Joined New Guild - ${guild.name} with ${guild.members.cache.size} members!`)
  })
``` will this work?
fallen arch
#

use args.join(" ") if args is already splitted

calm saddle
#

he is joining args with not spaces

#

with clap emoji

#

the prob with slice i think

solemn latch
#

Yeah, his args are already split

earnest phoenix
#

guys

#

wil my code work

#

will

delicate shore
#

why is this happening

solemn latch
#

Your args didn't remove the command

radiant skiff
fallen arch
#

why is this happening
@delicate shore because of .join("clap")

solemn latch
#

Slice it out

calm saddle
#

args.split("1")

delicate shore
#

@delicate shore because of .join("clap")
@fallen arch i mean why is s!slap there

fallen arch
#

args.split("1")
@calm saddle not a string

calm saddle
#

i used copy paste soo it was a MISTAKE

solemn latch
#

Ideally remove commans when you define args

#

Command

calm saddle
#

xDD

delicate shore
#

pls help 😢

fallen arch
#

we are trying

earnest phoenix
#

@delicate shore i know what can fix your problem ||read those fucking DMs||

solemn latch
#

Don't spoonfeed boys

fallen arch
#

yeah

delicate shore
#

@delicate shore i know what can fix your problem ||read those fucking DMs||
@earnest phoenix you never dmed me

earnest phoenix
#

bruh

#

u have 3 dms from ppl

#

my OCD is kicking in

solemn latch
#

Lol

delicate shore
fallen arch
#

lol

delicate shore
#

pls help

#

😢

#

and

solemn latch
#

You where told exactly what to do

delicate shore
#

no spoonfeed is there

calm saddle
#

emm gee

solemn latch
#

Copy and paste

#

🤔

delicate shore
#

?

fallen arch
#

no spoonfeed is there
@delicate shore use .split(1)

calm saddle
#

what i thought no spoonfeed

fallen arch
#

thats not spoon feeding

solemn latch
#

Spoonfeeding is giving a copy paste answer

fallen arch
#

yeah

earnest phoenix
#

-faq

fallen arch
#

its completing the code for them

earnest phoenix
#

-faq 1

#

-faq 1 -c

delicate shore
#

@delicate shore use .split(1)
@fallen arch not working

#

because i had already splitted it

solemn latch
#

Faq is mod command

fallen arch
#

@fallen arch not working
@delicate shore show me how you did it

delicate shore
#

const args = msg.content.split(" ");

calm saddle
#

the command as in !clap is args 0 use .slice(1) to slice that off

fallen arch
#

the command as in !clap is args 0 use .slice(1) to slice that off
@calm saddle args 1 i think

#

but the same thing yes

solemn latch
calm saddle
#

yea you have to slice of the !clap argument

#

const args = msg.content.split(" ");
@delicate shore ```js
const args = message.content
.slice(prefix.length)
.trim()
.split(/ +/g);

delicate shore
#

first of all

#

it's s!clap

calm saddle
#

doesnt matter

fallen arch
#

@delicate shore ```js
const args = message.content
.slice(prefix.length)
.trim()
.split(/ +/g);

@calm saddle spoon feed boi

delicate shore
#

i am not using that

#

my problem already solved

calm saddle
#

bruhhhhhh i was showin him how i use it ;-;

delicate shore
#

thanks

calm saddle
#

ur welcome

earnest phoenix
#

what was he trying to do anyway?

solemn latch
#

Remove the command from the args

fallen arch
#

slice of the command part

calm saddle
#

||it does matter if it is s!clap or !clap that is one argument||

solemn latch
#

^ plus we are not your dev team. You can't expect us to know your command prefix or command names

restive pebble
#

anyone need help?

solemn latch
#

Yes

#

I'm sad

fallen arch
#

lol

solemn latch
calm saddle
#

me too :>

#

so who else need help

restive pebble
earnest phoenix
#

yikes

solemn latch
#

So I'm working on adding metrics to prometheus.
I mostly have everything

fallen arch
#

Prometheus?

solemn latch
#

But I need to initialize the client with the metrics on startup

#

Its a time series database

calm saddle
#

😮

lusty quest
#

ahh yes a thing i want to figure out to is sending metrics to InfluxDB

solemn latch
lusty quest
#

nice there is a node-influx client

solemn latch
#

for example. these are the metrics on ping to servers

#

those ping spikes yikes

calm saddle
#

stocks

lusty quest
#

did someone know a way to get around the caching in d.js for the membercount and guildcount or a way for refreshing it?

solemn latch
#

Tim does

#

Made his own library based off discordjs, with his own caching system

lusty quest
#

not sure if client.users.fetch() is enought

#

would be nice if you could call a event for refreshing the cache

quartz kindle
#

there is no way to track memberCount without the GUILD_MEMBERS intent

#

the initial GUILD_CREATE packets contain an initial memberCount property, but then you need to rely on memberAdd and memberRemove to keep it updated

#

there is no way to obtain that number otherwise, aside from disconnecting and reconnecting to the gateway

lusty quest
#

ohh thanks for letting me know

delicate shore
#

Can my bot use Animated Emoji/

lusty quest
#

with the intent you can update the cache?

delicate shore
#

?

lusty quest
#

or did i get there something wrong? (without the events)

delicate shore
#

like :sike: is animated in my server

#

can he use that

#

without nitro

lusty quest
#

bots have nitro

tight plinth
#

Yes

quartz kindle
#

with the intent, you will receive memberAdd and memberRemove events

delicate shore
#

ok

quartz kindle
#

which you need to increment/decrement the memberCount property

lusty quest
#

what a stupid way to implemet this stuff

quartz kindle
#

agreed

lusty quest
#

i can understand they want to take load off the API but it would be nice if it would autoupdate every 10-30 minutes

quartz kindle
#

there is a of guild info that its only obtainable when logging in

calm saddle
#

hi tim

quartz kindle
#

they could at least allow you to request guild chunks

#

the same way you can request member chunks

lusty quest
#

or this

opal plank
#

cant you loop GET/guilds/id/members every so often to overlook that guild intents requirement?

quartz kindle
#

its stupidly expensive

opal plank
#

well, yeah

quartz kindle
#

you can request member chunks, which is way faster than going through the rest api, but still slow

#

i just tested this today actually

#

requesting member chunks took about 10-15 seconds to receive 120k members

cobalt spruce
quartz kindle
#

getting them from the rest api took 15 minutes

#

lmao

lusty quest
#

wtf?

opal plank
#

jesus christ

cobalt spruce
#

ok

quartz kindle
#

same with guilds

opal plank
#

@cobalt spruce args is not defined

cobalt spruce
quartz kindle
#

takes 20 seconds to connect 4 shards and receive 3.7k guilds
takes 1.5 minutes to get them from the rest api

opal plank
#

hmmm i see the problem

regal raven
#

Is the limit on the maximum values in a embed 25?

Because my bot is supposed to return more than that but it only returns 25

quartz kindle
#

yes 25 is the limit

#

for fields

spare mirage
#
 if (message.member.hasPermission("KICK_MEMBERS")) {
            if (message.mentions.members.first()) {
                try {
                    message.mentions.members.first().kick().then(message.channel.send("I just Kicked his" ));
                } catch {
                    message.reply("I do not have permissions to kick " + message.mentions.members.first());
                }
        }else {
            message.reply("You do not have permissions to kick " + message.mentions.members.first());
       


      
    }```
#

why does this not work?

quartz kindle
#

you're still stuck on that? lmao

spare mirage
#

nah I had to go

#

xD

quartz kindle
#

try/catch doesnt work on promises without await

tight plinth
#

^

spare mirage
#

soo..

lusty quest
#

run the kick function async

quartz kindle
#

turn everything into an async function and await them all