#development

1 messages · Page 568 of 1

formal agate
#

tried

#

to many combos

quartz kindle
#

wt

#

wtf

formal agate
#

need to account for everyone of these | 0 | None |
| 1 << 0 | Discord Employee |
| 1 << 1 | Discord Partner |
| 1 << 2 | HypeSquad Events |
| 1 << 3 | Bug Hunter |
| 1 << 6 | House Bravery |
| 1 << 7 | House Brilliance |
| 1 << 8 | House Balance |
| 1 << 9 | Early Supporter |

inner jewel
#

const house = houses[flags & HS_HOUSE_MASK]

quartz kindle
#

you dont understand how bitwise works... do you?

formal agate
#

nope

quartz kindle
#

so i did that insane function for nothing

inner jewel
#

| 1 << 6 | House Bravery |
| 1 << 7 | House Brilliance |
| 1 << 8 | House Balance |

formal agate
#

not really

earnest phoenix
#

mhm

quartz kindle
#

oh well, it was an interesting challenge

earnest phoenix
#

mhm

grim aspen
#

@quartz kindle server's back up for my bot

formal agate
#

ill still use it

#

idc about efficiency

quartz kindle
#

LOl

formal agate
#

its a small ass bot

earnest phoenix
#

hmmh

inner jewel
#
const houses = {
    [1 << 6]: "bravery",
    [1 << 7]: "brilliance",
    [1 << 8]: "balance"
}

const HS_HOUSE_MASK = (1 << 6) | (1 << 7) | (1 << 8)

const house = houses[flags & HS_HOUSE_MASK]```
earnest phoenix
#

ima cat

quartz kindle
#

using a brute forcing method that involves thousands of iterations to find a bitwise value

#

ok

formal agate
#

yes

#

fun with code

quartz kindle
#

why? because we can

formal agate
#

yes

#

at first i was gonna do a var for each

quartz kindle
#

but seriously, pls learn bitwise

formal agate
#

i will

earnest phoenix
#

How do I find my path?

#

I'm having brain farts.

formal agate
#

hmmm

inner jewel
#

O(1)

formal agate
#

..

earnest phoenix
#

hm

#

?

quartz kindle
#

what path

earnest phoenix
#

For my file

quartz kindle
#

by knowing where you put it

#

ba dum tss

earnest phoenix
#

I'm having a deadass brainfarts.

grim aspen
#

and it goes back offline what the fuck

#

what

#

i saw your pm

earnest phoenix
#

Oh.

#

Just had a question.

grim aspen
#

it's fine

#

what's your question?

earnest phoenix
#

I'm having a brain fart...

#

I forget what a path is

quartz kindle
#

a path is a way to a file, the location of the file

#

for example C:/windows/system32

#

thats a path

earnest phoenix
#

how do i find it?

quartz kindle
#

by knowing where you put your file lol

#

where is your file located?

earnest phoenix
#

My desktop!

quartz kindle
#

which operating system?

earnest phoenix
#

node.js

quartz kindle
#

your computer's operating system....

#

ie: linux/windows/mac

earnest phoenix
#

dumb question, but how do I detect if someone votes on my bot so that it automatically gives the person 300 credits

quartz kindle
#

use dbl's webhooks

earnest phoenix
#

never used webhooks befofe

quartz kindle
#

you're using node.js?

earnest phoenix
#

yup

quartz kindle
#

if you install the dblapi

#

it creates a webserver for you on port 5000 or something

#

then in your bot's edit page, you put the url where your webserver can be accessed

#

for example, your bot's ip address on port 5000

#

or whatever works for your specific configuration/host

earnest phoenix
#

o

earnest phoenix
#

how do i download modules?

quartz kindle
#

thats too advanced for you

#

please have computer lessons

hybrid raptor
#

hm

grim aspen
sick cloud
#

are you logging in

grim aspen
#

trying

sick cloud
#

show the line where you connect, minus the token

quartz kindle
#

nice commands

#

also, not a good idea to create multiple event listeners for the same event

inner jewel
#

you leaked your token

grim aspen
#

token isn't there

quartz kindle
#

also, nice project name

grim aspen
quartz kindle
#

thats a syntax error

knotty steeple
#

i still have it tho mmLol

#

repl is public

#

also dont fucking use repl

grim aspen
#

private think

#

regenerated token

knotty steeple
#

still shit

#

big think

grim aspen
dawn orchid
#

How to count the servers that my bot is in

amber fractal
#

What lib?

knotty steeple
#

when you ask a question here you say the library

dawn orchid
#

Ok

#

How to count the servers that my bot is in

Library: discord.js

knotty steeple
#

client.guilds.size

#

client being what you defined your client

amber fractal
dawn orchid
#

But i totally var tifalbot = new Commando.Client(); not var client

knotty steeple
#

ohno

#

commando

amber fractal
#

I dont use commando

knotty steeple
#

well you replace client with tifalbot

#

same thing

dawn orchid
#

Commando.Client is the Commands client for discord.js

amber fractal
#

Still have no idea what that is

#

If your using discord.js the process should be the same tho, no?

knotty steeple
#

its a framework

#

made by the devs

amber fractal
#

Does it help with command making or something?

knotty steeple
#

yes

#

what frameworks do

amber fractal
#

It isnt better than module.exports is it?

knotty steeple
#

no

quartz kindle
#

it gives you a framework to work with, meaning it handles a lot of things for you that otherwise you would need to do by yourself

knotty steeple
#

actually it still is module exporting

#

aka module.exports

copper socket
#

I need some help...I don't think my commands are supposed to look like this...

knotty steeple
#

look like nothing

#

no they arent

copper socket
#

that's on the new logs.

#

those are all the commands it wanted me to add, 300 characters...

quartz kindle
#

wtf

copper socket
#

I just posted a link of the commands but I needed 300 characters.

opaque eagle
#

Very readable

amber fractal
#

Wait

opaque eagle
#

Looks like the nested ternary functions you find in my javascript code

knotty steeple
#

no ur not supposed to paste the help command bloblul

copper socket
opaque eagle
#

Talk about your bot instead of listing the same thing they can find in your bot's website or in a help command

knotty steeple
#

ur the one making yourself look like someone should facepalm at you

opaque eagle
#

^

copper socket
#

oh hey

opaque eagle
#

we should be the one making the facepalm

copper socket
#

stop being violent, geez fucking laweez.

#

calm your titties.

knotty steeple
#

whats "violent"

opaque eagle
copper socket
#

vi·o·lentDictionary result for violent
/ˈvī(ə)lənt/Submit
adjective
using or involving physical force intended to hurt, damage, or kill someone or something.

amber fractal
#

Well what you told us doesnt really help us solve your problem

knotty steeple
#

explain how its physical

copper socket
#

¯_(ツ)_/¯

quartz kindle
#

its fine to put a list of commands in the description, just please format it correctly lol

knotty steeple
#

and html

opaque eagle
#

^ yeah but isn't it lazy to do it tho

copper socket
#

The thing is, how am I supposed to do that, redo a whole 300+ commands?

#

and just type them out?

opaque eagle
#

I'd much rather wanna see basic info about the bot and the history behind it rather than a database of its commands

amber fractal
#

A bot with 300 commands?

#

Wait

copper socket
#

pretty much...

#

:/

opaque eagle
#

Do you happen to have it in json format?

copper socket
#

It's basically nadeko if you think about it.

knotty steeple
#

i know

amber fractal
#

Dont know or care what that is

copper socket
#

but I added more things to it.

opaque eagle
#

What language?

knotty steeple
#

do what dbl actually wants you to do with the long description

#

describe the bot

opaque eagle
#

^

copper socket
quartz kindle
#

"a bot with over 300 commands that are too long to write about and im also too lazy to do that so just use the help command instead"

amber fractal
#

Im pretty sure mine is just a table with the commands, where to find the support server and a more long brief description mmLol

opaque eagle
#

It's a description, not a list of commands

copper socket
#

it's not being lazy bruh, it's about typing a bot that has a lot of commands down, I don't know how you guys do it.

knotty steeple
#

"detailed description of your bot"

#

not "list of all commands unformatted"

opaque eagle
#

Don't write the commands @copper socket

copper socket
#

300 characters.

quartz kindle
#

i did a long ass description of my commands, documentation style

knotty steeple
#

300 characters is nothing

grim aspen
#

wouldn't it be possible to add a file with all those commands for that help command to pull?

opaque eagle
#

Talk about the bot

quartz kindle
#

because my commands are complicated

copper socket
#

what is this one for then?

opaque eagle
#

Yep, 300 characters is a hugely insignificant amount of characters

knotty steeple
#

you probably typed 300 characters in a message already

grim aspen
#

🤦

opaque eagle
#

It's clearly a brief description (think of it like a tagline or slogan) @copper socket

knotty steeple
#

it would be a decently long message but atleast its not an essay

quartz kindle
#

why dont you check random bot pages to inspire yourself?

opaque eagle
#

^

copper socket
opaque eagle
#

Just not the ones from the "New Bots" section

copper socket
#

this is why we can't have nice things lmaoo

quartz kindle
#

check a few certified bots

opaque eagle
#

Yeah like @quartz kindle's

knotty steeple
#

this is for my bot

opaque eagle
#

^

quartz kindle
#

10/10

knotty steeple
#

yes

#

10/10 ign

quartz kindle
#

5/7

knotty steeple
#

nO

amber fractal
#

Lets be honest, no one actually reads the long description, I have everything that they need there (and on its website) yet I still get the dumbest questions in my support server

quartz kindle
#

i do read

#

but yeah, most people dont

#

thats why im smart and they're dumb

#

:^)

amber fractal
#

Most of the time its just because the syntax of the commands is weird and they all come to me saying it doesnt work

#

but the help command tells them explicitly how to do those commands

#

With extra help on the "hard" ones

quartz kindle
#

same

#

my commands are complicated too

knotty steeple
amber fractal
#

Mine arent even complicated

quartz kindle
#

my commands have a shit ton of arguments xd

knotty steeple
#

mine dont

#

its just images and facts lmfao

amber fractal
#

Well yours is an astronomy bot or smth right?

quartz kindle
#

my commands can reach the message limit if people want to

knotty steeple
#

so 2k characters

quartz kindle
#

yup

knotty steeple
#

i wouldnt type that much

inner jewel
#

i try to keep my commands as idiot proof as possible

knotty steeple
amber fractal
#

Thats another thing tho, people splitting the same command into different parts instead of adding flags or something

inner jewel
#

half the stuff has defaults and checks for user dumbness

amber fractal
#

annoys me kinda

#

But I do that so

quartz kindle
#

yeah my commands check for dumbness too

knotty steeple
#

idea

#

every missing argument

#

give an example

quartz kindle
#

like when people mix up arguments for one command into another, it tells them which command those arguments are for

sick cloud
#
const filter = (response) => { return response.author.id == ctx.msg.author.id; };
const filterSettings = { limit: 1, time: 30000, errors: ['time'] };

const q1 = await channel.send(`What's the name of this project?`);
q1.channel.awaitMessages(filter, filterSettings) .then ... .catch ...

i'm using this to await messages, and i only want 1 message to pass then the .then ... will fire. instead, its waiting the full 30 seconds, then firing the .catch with the message sent. how do i fix this?

amber fractal
#

Could it be the return in the filter?

slim heart
#

limit isnt a part of collectors i dont believe

amber fractal
#

Limit 1

sick cloud
#

then what is it?

amber fractal
#

Its there for awaitMessages

sick cloud
#

i need to limit it to 1

slim heart
#

o i see

#

ok well i was gonna say use createMessageCollector

keen drift
#

try max: 1

#

instead of limit

sick cloud
#

okay

#

that worked yay

#

thanks fishy

keen drift
#

kek

amber fractal
#

Weird

#

Oh wait no im just an idiot

sick cloud
#

i keep getting Error: SQLITE_ERROR: no such table: projects, how do i actually make a table?

#

there's no documentation on it

sturdy delta
#

Hey

pale marsh
#

Literally google "create table sqlite"

#
CREATE TABLE guru99 (
  Id Int,
  Name Varchar
);
sick cloud
#

yeah but how do i do that within node Thinkeng

pale marsh
#
const sqlite3 = require('sqlite3').verbose();
let db = new sqlite3.Database('../db/sample.db');
db.run('CREATE TABLE langs(name text)');
db.close();
sick cloud
#

alright

wide ruin
#

How do I stop getting spammed with unhandled promise rejection warning?

#

Discord.js

sick cloud
#

catch your errors

wide ruin
#

How?

sick cloud
#

in promises, either add a .catch(console.error) to promises (usually after the .then if there is anyor wrap your code intry { ... } catch (err} { console.error(err); }` if it's async

wide ruin
#

Thanks

#

Gives an error when I run now

#

Same thing

#

Every async has a catch

ember fulcrum
#

can i get someones help? trying to make my first bot, a really simple one but im very lost

restive bough
#

what language?

#

and where do you need help with

ember fulcrum
#

uh, thats the thing, i havent learned one yet

#

i want a bot that can keep track of points that are distributed via command to keep track of money in a RPG server im running. i couldnt find one that fit the need, so i was gonna make my own, but thats proving difficult as well

slender thistle
#

Let's not get into Discord bots without learning any programmimg language first, aight mate? thinkright

ember fulcrum
#

ugh

#

anyone know why my computer cant read a damn json file?

quartz kindle
#

wdym

ember fulcrum
#

one sec

restive bough
#

lol

#

y0 computer can't read jSoN

ember fulcrum
quartz kindle
#

right click > open with > notepad/wordpad

restive bough
#

show your json file

quartz kindle
#

also, you probably want an an actual code editor, take a look ate notepad++, sublime text, visual studio code, brackets, etc...

restive bough
#

@ember fulcrum

quartz kindle
#

thats a terribly outdated library

#

whatever guide you're following is bad

restive bough
#

do not recommend n++

#

n++ is pure shit

quartz kindle
#

nah,

#

its good

#

i've used it for a long time

restive bough
#

lol

ember fulcrum
#

ugh why is this so haaaaard

restive bough
#

show your files?

ember fulcrum
#

i just wanted to make a bean counter bot

quartz kindle
#

you need basic knowledge of programming to even attempt a bot

#

a bot is a program

restive bough
#

i can't help you if you don't show your code

ember fulcrum
#

one sec

restive bough
#

bruh

#

don't show your tokens

ember fulcrum
#

it isnt working anyway

surreal peak
#

@ember fulcrum please reset your token

ember fulcrum
#

its a practice, so i dont mind what happens to it

#

oon it

surreal peak
#

You will mind when your discord account gets banned for API abuse

ember fulcrum
#

done

#

screw the whole damn thing, huge waste of time, im deleting it

quartz kindle
#

yes, delete everything and use a proper library, such as discord.js

surreal peak
#

depends on the language you wanna learn

restive bough
#

🤔

quartz kindle
#

or phpcord

#

:^)

restive bough
#

wtf

#

no

#

not phpcord

#

is that even a thing

quartz kindle
#

it is

#

but its rest only, no websocket

#

its good to retrieve information and built a page with it

restive bough
quartz kindle
#

i got the name wrong

#

its called restcord

restive bough
#

oof

#

don't use that shit

#

why would anyone even use that

quartz kindle
#

dont call it shit :( the devs probably spent many months developing it

restive bough
#

LOOL

#

nope

#

more like 1 day

#

you shouldn't even use an lib for this

quartz kindle
#

everything has its uses, restcord can be used to create a bot/website interface

surreal peak
#

^

earnest phoenix
#

ay boiz for some reason heroku used to run but now it dosent .

amber fractal
#

Theres a 500 hour free limit per month

#

Could be that

earnest phoenix
#

i didnt even

#

pass that :d

restive bough
#

heroku

earnest phoenix
#

:d

#

yp

dusky steeple
#

that's why I took my bot off heroku.

restive bough
#

use do

#

or vultr

dusky steeple
#

or vps

restive bough
#

hmm

#

or vps

quartz kindle
#

lol

earnest phoenix
#

@restive bough is vultr Linux only?

restive bough
#

nope

#

it has windows too

earnest phoenix
#

Daaaammm

restive bough
#

you can upload your own iso's

earnest phoenix
#

Oof

#

Wow

grim aspen
#

would pycharm be ok for discord bot via python?

knotty steeple
#

yes

grim aspen
#

because i'm going to use that instead of repl.it

earnest phoenix
#

Can anyone help with my bot code

#

I broke something

grim aspen
#

what is it

earnest phoenix
#

Those 2

#

Can someone help me with it?

restive bough
#

maybe close your function body mmLol

earnest phoenix
#

? In english

knotty steeple
#

congrats i have 1/3 of your token

#

but thats easy to get anyway so

grim aspen
#

i was going to say

#

keep your token private

#

regen it

restive bough
#

"bot developer"

knotty steeple
#

the first part of a token is base64

#

of owner/bot id

#

idk which one

restive bough
#

you never closed this function

earnest phoenix
#

I'll regen now

restive bough
knotty steeple
#

it'll stay the same

earnest phoenix
#

?

knotty steeple
#

and yea close your function

#

} at the end

earnest phoenix
#

HOW

knotty steeple
#

just add it

#

jesus christ

restive bough
#

bro

knotty steeple
#

is

#

god

restive bough
#

are you stoopid?

#

did you make the bot?

earnest phoenix
#

Did not work

knotty steeple
#

hes using glitch

#

what do you expect @restive bough

earnest phoenix
#

Yesh

grim aspen
restive bough
#

lol

earnest phoenix
#

Glitch is stoopid

knotty steeple
#

the

#

first

#

part of

#

a token

#

is the only part a person can actually get

restive bough
#

don't blame glitch for shitty code?

earnest phoenix
#

It's regened btw

knotty steeple
#

without the token itself

earnest phoenix
#

Gtg I'll fix it my self -_-

restive bough
#

bruh

#

i told you

knotty steeple
#

just add a fucking curly brace

restive bough
#

ikr]

#

this dude is trolling

#

he can't be serious

earnest phoenix
#

Lol

slender thistle
#

Nah mate

#

This is like 70% of modern bot devs

#

Edit button on your bot page -> scroll down

earnest phoenix
#

thanks

#

how do I get the vote.user id?

slender thistle
#

Isn't it already a user ID? Thonkang

#

Are you using JS?

earnest phoenix
#

idk

#

yeah

slender thistle
earnest phoenix
#

what

#

im making a reward system

#

and i need the user token

slender thistle
#

ID, you mean? Are you using webhook?

earnest phoenix
#

yes

#

id

slender thistle
#

Oh, it is vote.user, correct

earnest phoenix
#

ok

sick cloud
#

vote.user provides the id

earnest phoenix
#

thanks

#

uh oh

quartz kindle
#

hentaicion lmao

sick cloud
#

light theme brings some memories back

#

back when i was a 12 yr old memeing on youtube

#

we didnt have dark theme back then

earnest phoenix
#

Who ever can help with my bot (javascript) dm me i will reward idk how so dblSmile

sick cloud
#

it was all light

#

and now bots suck on it

queen sentinel
#

look, mom I'm famous

sick cloud
#

@earnest phoenix probably the worst place to ask

earnest phoenix
#

why

sick cloud
#

it'll be lost in this channel

earnest phoenix
#

xd

quartz kindle
#

whats the problem with your code?

earnest phoenix
#

Dm me ill show

quartz kindle
#

no, show it here

quartz kindle
#

you're missing a )

earnest phoenix
#

where

quartz kindle
#

here }});

earnest phoenix
#

k

#

lets see

slender thistle
#

I'm not quite sure if they are just trolling

earnest phoenix
#

im not

#

what about this

#

@quartz kindle

slender thistle
#

;? thonkku

earnest phoenix
#

nope

#

tried

mossy vine
#

my best bet is that line 173 isnt closed properly

earnest phoenix
#

how do i close?

slender thistle
#

Do you even know basic JS

quartz kindle
#

i dont see anything wrong in that part

earnest phoenix
#

nop im dum in the head

mossy vine
#

please learn proper js then

quartz kindle
#

does the token have a comma at the end?

mossy vine
#

that error is most likely because, again, you msised a comma

earnest phoenix
#

lemme check

#

got a comma

inner jewel
#

send the whole file

#

but replace token with ""

earnest phoenix
#

boi

#

did

#

i have a token there

#

just dont trust

inner jewel
#

send the file without the token

quartz kindle
#

delete the token and post the code

earnest phoenix
#

k

quartz kindle
#

then do ctrl+z to get it back

inner jewel
#

copy paste it

#

and put into a code block

earnest phoenix
#

{
"token": "",
"prefix": "-"

}

#
    "token": "",
    "prefix": "-"

}```
mossy vine
#
{
    "token": "",
    "prefix": "-"

}```
earnest phoenix
#

gr

dusky steeple
#

its missing a ; after the closing } isnt it?

mossy vine
#

what is the error anyways?

earnest phoenix
#

no clue ^

mossy vine
#

@dusky steeple its a json file

earnest phoenix
#

^ yep

dusky steeple
#

ah nm

mossy vine
#

you can hover over the red circle and it will show the error

quartz kindle
#

it looks fine

mossy vine
#

screenshot that

earnest phoenix
#

k

#

Parasing error : Unexpeted token :

latent oasis
#

{"token": "","prefix": "-"}

#

do like this

earnest phoenix
#

shall i guys?

mossy vine
#

thats what he did

quartz kindle
#

is the file set as something else in your editor? like its a json file but the program thinks its something else

latent oasis
#

i cought the same err and it helped me

earnest phoenix
#

?

#

no its json

#

@quartz kindle

quartz kindle
#

delete everything and write it again

earnest phoenix
#

okay

latent oasis
#

@earnest phoenix
{"token": "","prefix": "-"}
do like this
i had this err in every bot and it helps me

earnest phoenix
#

@quartz kindle ^

#

dont work

latent oasis
#

my version dont work?

earnest phoenix
#

nop

sick cloud
#

your literally just putting it on one line

#

why would it work

earnest phoenix
#

yes ^

#

i did not even put cus i new it wont work

#

lool

restive bough
#

what is the error

sick cloud
#

my config is literally 27 lines long and works fine

quartz kindle
#

the json is perfectly valid, it passes json linters. the problem is with your code editor

sick cloud
#

@quartz kindle its glitch

#

glitch always has problems

inner jewel
#

you could say it has a... glitch 😏

sick cloud
#

10/10

earnest phoenix
#

boi not helping takes your jokes somewhere else

restive bough
#

lol

earnest phoenix
#

@quartz kindle So tim

#

what do i do

latent oasis
#

in ma first i catch it

{"token":"","clientid":"521776946149851157","prefix":"ш!","ownerID":"282504799897780225"}
```@earnest phoenix
earnest phoenix
#

?

latent oasis
#

do like i explain u

#

its ma first bot

restive bough
#

why did you put the clientid in the config doe

earnest phoenix
#

wat

sick cloud
#

@restive bough some bots need it

latent oasis
#

@restive bough for invite link

sick cloud
#

or that

earnest phoenix
#

@latent oasis ill tell you now it wont work

#

ITS IN ONE LINE

latent oasis
#

and? i tryed it on heroku, glitch, own PC host, termux host

sick cloud
#

putting code in one line is no different to having it spread out

latent oasis
#

AND EVERYWHERE IT WORKIN

sick cloud
#

it wont make a single difference

earnest phoenix
#

ight bet

#

lets see

#

lol

#

did not work

#

lol

latent oasis
#

but it fixed my probleb
Unexpected token :

sick cloud
#

your problem != others problems

earnest phoenix
#

I JUST WANT HELP FFS

inner jewel
#

nothing anyone can do

#

your json is valid

earnest phoenix
#

But why dont it work

inner jewel
#

whatever thing you're using is stupid and doesn't recognize it

#

¯_(ツ)_/¯

earnest phoenix
#

its glitch

quartz kindle
#

delete the file

#

create a new json file

#

and write the code again

#

if it still doesnt work, open a support ticket

sick cloud
#

or get a real code editor

earnest phoenix
#

k

#

like

#

@sick cloud

quartz kindle
#

like notepad

#

:^)

earnest phoenix
#

Boi

restive bough
#

no

#

not notepad

#

notepad is for indians

quartz kindle
#

thats racist

restive bough
#

with shitty mics

#

doing youtube tutorials

#

not racist

#

true

knotty steeple
#

its still fucking racist

#

but you can use vscode or atom

earnest phoenix
#

CAN SOMEONE JUST HELP 😭

#

ffs

restive bough
#

hmm

#

we can't help

#

it's an bug

#

an glitch 😉

earnest phoenix
#

blows up

quartz kindle
#

a* glitch

#

xD

earnest phoenix
#

how do i fix then

restive bough
#

not

earnest phoenix
#

@quartz kindle can i add you to my glitch and you try fix it?

restive bough
#

buy an vps

quartz kindle
#

lol ok

earnest phoenix
#

Dm me

#

i ani't sending here

quartz kindle
#

you dm me lol

earnest phoenix
#

did

restive bough
#

@earnest phoenix just buy an vps lol

knotty steeple
#

how to fix it

#

dont use glitch

daring trellis
#

Error:
jsTypeError: Cannot read property 'title' of undefined

#

How to fix it?

knotty steeple
#

yea no im not downloading that

#

upload it to hastebin

quartz kindle
#

@earnest phoenix your problem had nothing to do with config

daring trellis
#

Ok

earnest phoenix
#

a

#

what is it

quartz kindle
#

the error was in your bot.js

#

missing proper closures

#

missing brackets

earnest phoenix
#

is it okay now?

quartz kindle
#

yes

earnest phoenix
#

lets see

#

yay thx

quartz kindle
#

you had this ```js
const log = message => {
console.log([${moment().format("HH:mm:ss")}] ${message})

#

missing the closing }

earnest phoenix
#

oof

quartz kindle
#

also this

#
const updatePresence = (client) => {
  client.user.setPresence({
      game: {
          name: `Streaming my code to  - ${client.guilds.size} Servers | ${config.prefix}help`,
          type: "STREAMING",
          url: "https://www.twitch.tv/piggyplex"
      }
  });
#

missing the closing }

earnest phoenix
#

oh okay now i know

#

thx

#

@quartz kindle how do i remove you

quartz kindle
#

make your project private

earnest phoenix
#

k

#

done?

#

can you leave the progect

quartz kindle
#

i just closed the tab

earnest phoenix
#

k

#

thx

daring trellis
inner jewel
#

results[0] is undefined

mossy vine
#

best nsfw detection ever

daring trellis
#

)

earnest phoenix
#

@mossy vine yes lol

#
const google = require('google-it');

module.exports.run = async (client,message,args) => {
 if (!message.content.startsWith("m!")) return;
 if (message.author.bot) return;
 if (!message.guild) return;
  const input = args.join(' ');
if(input.includes("porn"))return message.reply("No you pervert");
if(input.includes("hentai"))return message.reply("No you pervert");
)
google({ query: input, disableConsole: true }).then(results => {
let gbed = new Discord.RichEmbed()
.setTitle(`Results for ${input}:`)
.setDescription(`${results[0].title}`, `_ _`, true)
.setColor(`${message.member.displayHexColor}`)
.addField('**Link:**', `${results[0].link}`, `_ _`, true)
.addField('**Description:**', `${results[0].snippet}`, `_ _`, true)
 message.channel.send({embed: gbed});
}).catch(error => {
    if(error)return message.channel.send('``Error:``\n```js'+ error +'```');
});
}
)
module.exports.help = {
    name: "google"
}```
daring trellis
#

I send m!google Yahoo and get error

knotty steeple
#

whatever ur using title on is undefined

quartz kindle
#

@daring trellis results[0] is undefined, which means there were no results

knotty steeple
#

so results[0]

#

actually

#

he didnt define results

#

or

#

wait

#

ok so no results

restive bough
#

💩

sick cloud
#

results is []

quartz kindle
#

it looks like the library is broken

#

all queries return an empty array

knotty steeple
#

well

quartz kindle
#

im testing it on runkit

knotty steeple
#

its a google module

sick cloud
#

there's a better api anyways

knotty steeple
#

google doesnt have an api

#

so the scraping probably fucked up

sick cloud
quartz kindle
#

who tf came up with the name "serpapi"

sick cloud
#

dont question it

#

just use it

#

its free and hasnt ever failed me

quartz kindle
#

ik but...

#

what a shitty name lmao

sick cloud
#

yeah lol

knotty steeple
#

unofficial

quartz kindle
#

i mean, in portuguese/spanish/etc

#

"ser papi" kinda means "to be daddy"

sick cloud
#

to be daddy api UwU

dusky steeple
#

Could someone help me fix this by chance.
https://hastebin.com/arafayivan.xml
the cards are stacking on top of each other and want them side by side 3 wide. Can not figure out wth I am doing wrong.

pale marsh
#

Is that bootstrap?

dusky steeple
#

yes

#

v4

quartz kindle
#

is the html being generated correctly? if so, its a css problem, not html

earnest phoenix
#

most code ive seen in my life

#

im stupid af

#

in everyway

#

cant even fix a lock command ting

#

all i had to do

#

was

knotty steeple
#

ok

earnest phoenix
#

}

knotty steeple
#

congrats no one cares

earnest phoenix
#

Stfu

#

i dont even know how tf you got your bot verifed for toxicity

dusky steeple
#

Yes the page shows like its supposed to somewhat. It just stacks the cards instead of putting them in line

quartz kindle
#

check the css for card-block

dusky steeple
pale marsh
#

Is that on mobile?

dusky steeple
#

I don't think it's a css thing

#

no

quartz kindle
#

does it have display:inline-block?

earnest phoenix
#

you guys smart af

dusky steeple
#

cause I have another page running the exact card setup and it puts them 3 wide ;/

quartz kindle
#

are the classes the same?

dusky steeple
#

just won't for this page for some reason

#

hmm. let me check.

pale marsh
#

You're iterating on card-columns

#

Iterate inside it

#

You're basically creating a new card-columns div for each guild

dusky steeple
#

so put the <div class="card-columns"> before the %>?

pale marsh
#

Move this after it:

<% bot.guilds.forEach(guild => {
%>
#

And the closing brackets at the bottom move them as well

dusky steeple
#

woot perfect. Thank you

pale marsh
#

Anytime

dusky steeple
#

I had a feeling it was something simple I was over looking lol

daring trellis
#

I fix my code

earnest phoenix
#

well done!

dawn orchid
earnest phoenix
#

...

#

im 2 stupoid to help

mossy vine
#

obviously, tifalbot is not defined

dawn orchid
#

The code for the info command is

``const discord = require('discord.js');
const commando = require('discord.js-commando');

class InfoCommand extends commando.Command
{
constructor(client)
{
super(client,{
name: 'info',
group: 'misc',
memberName: 'info',
description: 'Info about the bot'
});
}

async run(message,args)
{
var myInfo = new discord.RichEmbed()
.addField("Name", "NormanBot", true)
.addField("Created by", "Norman Anthony Anderson and his team", true)
.setColor("3FA227")

      message.channel.send(myInfo);

}
}

module.exports = InfoCommand``

mossy vine
#

commando is shit tbh

dawn orchid
#

I use discord.js and discord.js commando

#

And how am i supposed to make multiple commands without discord.js commando

mossy vine
#

write your own command handler

dawn orchid
#

I can't. So hard

wicked pasture
#

that's what she said

dawn orchid
#

I'm a male

#

And writing my own command handler is so hard

knotty steeple
#

no

#

it really isnt

marble needle
knotty steeple
#

no i do not

violet jetty
#

Emoji coding 🤢 🤢

dawn orchid
#

Writing my own command handler is hard for me

spare glen
#

how do i make those buttons transparent

knotty steeple
#

idk

#
element {
color: transparent;
}```
spare glen
#

but whats element

amber fractal
#

Just inspect element

marble needle
#

Use your browsers dev tool and find out lol

amber fractal
#

^

spare glen
#

you guys are to real help

knotty steeple
#

what

#

the element of the button

marble needle
#

You asked a question we answered your question this isn’t a spoonfeed festival. Gotta put some work and research into it yourself

knotty steeple
#

this

marble needle
#

Look into css and how to use it if you want to customize things on a website

spare glen
#

aye rye

marble needle
#

HTML to create elements, js to modify their behavior and css to modify their appearance

covert tartan
#

does anyone know why my bot oauth url might be taking people to an old redirect url instead of the new one i added? the old one isnt in the URLor anything

marble needle
#

When did you add the new one? Old one might still be cached

fleet mason
#

Why is it giving me the wrong emojis ?

        for (var y = 0; y < array.length; y++) {
            let DB = Items.findOne({name: array[y]});
            let em = "";
            if(typeof DB !== 'undefined' && typeof DB.id !== 'undefined'){
                em = DB.id;
            } else {
                em = "477180041361620992";
            }
            emojisss = "<:a:" + em + ">";
            if (emojisss === undefined) {
                emojisss = bot.emojis.get("477180041361620992")
            }
            emojiss += emojisss;
        }```

https://gyazo.com/8aa29242230f78ef4f4bfedaa20f7dc7 

Theres a missing emoji in the top message but it dosent seem to output "477180041361620992" or i dont understand XD
covert tartan
#

probably 1hr ago or less

dusky steeple
#

What am I doing wrong here?
Server ID: <%= guild.id %> | <%= `${guild.size}` %>
and outputs this:

fleet mason
#

what kind of size do you want ? @dusky steeple

dusky steeple
#

I tried it without the ${} stuff also

spare glen
#

bot.guilds.size

earnest phoenix
#

hello

fleet mason
#

guild.members.size

spare glen
#

or guilds.size

#

s at the end

knotty steeple
#

a guild doesnt have the size property

#

what are you trying to get

dusky steeple
#

count of members in the guild

fleet mason
#

@dusky steeple guild.members.size

knotty steeple
#

memberCount*

dusky steeple
#

Cannot read property 'size' of undefined

marble needle
#

Which lib are you even using

dusky steeple
#

discord.js express

knotty steeple
#

this is why i said

#

use memberCount

dusky steeple
#

guild.memberCount returns nothing

knotty steeple
daring trellis
#

How to fix error on heroku: Your account has reached its concurrent builds limit?

knotty steeple
#

dont use heroku

#

thats how

daring trellis
#

)

marble needle
#

the error tells you what's wrong in plain english, don't have more concurrent builds than you're allowed to have

spare glen
#

how do poeple have boucing icons in their site

dusky steeple
#

bouncing icons?

earnest phoenix
#

...

quartz kindle
#

css keyframe animations

amber fractal
#

Wait you can do that in css?

#

I thought it was js

#

Web Publishing never taught me anything useful

marble needle
#

you can use either

quartz kindle
#

css can do animations, but its limited to either transitions or loops

#

and if you combine css animations with svg, you can pretty much achieve animated vector graphics

mossy vine
#

can someone tell me why i cant console.log a Map properly?

var cache = new Map()

//code that adds a bunch of stuff to cache


console.log(require('util').inspect(cache, {depth: 2}))```
quartz kindle
#

whats the output you get?

inner jewel
#

works for me

#
> map = new Map()
Map {}
> map.set("a", 1)
Map { 'a' => 1 }
> map.set("b", map)
Map { 'a' => 1, 'b' => [Circular] }
> console.log(require("util").inspect(map, {depth: 10000}))
Map { 'a' => 1, 'b' => [Circular] }```
mossy vine
#

its just Map {} even though i add a bunch of stuff to it

inner jewel
#

then it's a different map

#

or you clear it

languid dragon
#

show the code you used to add items

mossy vine
#
fs.readdir('./src/commands', (err, f) => {
    f.forEach(e => {
        let cmd = e.split('.')[0]
        let tmp = require(`./src/commands/${e}`)

        //the default 
        cache.set(cmd, tmp)

        //the aliases
        for(let i = 0; i <= tmp.config.aliases.length-1; i++){
            cache.set(tmp.config.aliases[i], tmp)
        }
    })
})```
#

f, cmd and tmp are all working as intented

quartz kindle
#

check if f is empty

mossy vine
#

its not

#

it all seems to work perfectly until i add stuff to the cache

inner jewel
#

use a debugger

quartz kindle
#

did you await for fs.readdir to complete before you console.log?

#

readdir is async

mossy vine
#

ohh it is?

quartz kindle
#

so your console.log should be at the end of the forEach block

inner jewel
#

that's why it takes a callback

mossy vine
#

so correct way to do this would be to put the log in a .then() after it or?

quartz kindle
#

you can just put it after the foreach

mossy vine
#

so

fs.readdir(){
...
}.then(console.log(...))```?
quartz kindle
#

no

mossy vine
#

oh

quartz kindle
#

unless you use promisify

mossy vine
#

uhh no i dont think im using it

quartz kindle
#

just do js f.forEach(....) console.log

mossy vine
#

and then it should work, right?

quartz kindle
#

yes

mossy vine
#

but how can i make it so that stuff comes after the readdir is complete?

quartz kindle
#

either write them inside the readdir callback, or create a promise

#

or use readdirsync

mossy vine
#

readdirsync does a promise?

quartz kindle
#

no, readdirsync is sync

#

it will block the code until its complete

mossy vine
#

OHHH

#

that makes sense

#

and other than that it works just like readdir?

quartz kindle
#

yes, just without a callback

#

so basically let f = readdirSync();

mossy vine
#

ah it returns them

#

okay that makes a lot more sense

#

thanks

quartz kindle
#

👍

oak adder
#

Hey, so I'm trying to get voice connection size. I read the documentation for discord.js since it's what I'm using to write my bot in, and it shows; <Client>.broadcasts which returns as an array of connections. I'm unsure if I need to use .length or .size to get the voice connections as an integer.

quartz kindle
#

if it returns an array, then it should be .length

#

.size is for collections

oak adder
#

Oh, alright. Thank you very much, sorry if I ask basic questions, I'm not good at trying to get integers from stuff like that. (:

earnest phoenix
#

any good website devs to help me?

#

TypeError: Cannot read property 'id' of undefined

#

on website

#

i tried to link currency to the website

#
app.get('/', function(req, res) {
cookie.fetchCookies(`globalCredits_${req.author.id}`).then(pb => {

                                                         
  res.render(__dirname+'/views/index.ejs', {
  


  

     status: (req.isAuthenticated() ? ` ${req.user.username} | ${pb.value} ` : "Login"),
      client: client.user,
      user: req.user,
      login: (req.isAuthenticated() ? "yes" : 'no'),
});
})
});```
sick cloud
#

did you attach the author property to req?

#

because i can tell you that req doesnt have an author

earnest phoenix
#

i dont think i did

sick cloud
#

then thats your issue

#

also, just use res.render('index'

#

it'll get the path itself

earnest phoenix
#

alright

#

so how will i attach author to req?

#

what i usally use on embed text not website

#

user iis defiend to message.author

sick cloud
#

this is a web request

#

not a message event

#

you dont have a discord user attached

earnest phoenix
#

for example

#

req.user.username

#

works

#

so how would i attach it

sick cloud
#

user.username is from oauth2

earnest phoenix
#

so how would i attach it

sick cloud
#

do you have the user's id somewhere?

#

because you cant attach non existent things

earnest phoenix
#

no

#

i do not

sick cloud
#

then you can't attach it

earnest phoenix
#

this works

#

for message

#

to discord

#

😐

sick cloud
#

yeah

earnest phoenix
#

i cant

#

tho

#

it says

#

ID

amber fractal
#

Why not just req.user.toString() for mentioning tho Thonk

earnest phoenix
#

hi

sick cloud
#

@amber fractal because it isnt discord.js

earnest phoenix
#

TypeError: Cannot read property 'id' of undefined

#

Oof a webhook

sick cloud
#

toString would do nothing

earnest phoenix
#

when i put to

#

the fetch balance

amber fractal
#

What is the language?

earnest phoenix
#
cookie.fetchCookies(`globalCredits_${req.user.id}`).then(pb => {```
#

what i have

#

that gives error

#

Everyone loves WebHooks...

#

nvm fixed

#

ty

#

@sick cloud

#

anyways

#

forgot

#

about CheckAuth

#

😂

sick cloud
#

👏

earnest phoenix
#

have one more problem i need help with

#

like disable a page

#

for everyone

#

upset for me

#

like a admin panel

quartz kindle
#

there are many ways to do that

dusky steeple
#

you need to make the page check for ownerID

earnest phoenix
#

in dashboard.js

night imp
#

send request using an authorization header with the session

earnest phoenix
#

or index.ejs

night imp
#

Verify session on the server

#

then send file

earnest phoenix
dusky steeple
#

you have your ownerID in your config file?

earnest phoenix
#

yea

dusky steeple
#

make it read that. If the id matches show the link or page

#

<% if(user.id === bot.config.ownerID) { %> for instance how I do my admin page on my dashboard

earnest phoenix
#

i have a dropdown

#

page

#

u put in in dashboard.js

#

or index.ejs

dusky steeple
#

neither

#

you need to send it through a header

earnest phoenix
#

hm

#

i dont have that

#

header

#

thing

quartz kindle
#

are you already using oauth2?

earnest phoenix
#

yes

#

all i have is dashboard.js , index.ejs and admin.ejs

#

as files

quartz kindle
#

so you can just check if the logged in user is the same id as the bot owner

earnest phoenix
#

<a class="dropdown-item" href="/">Dashboard</a>
<a class="dropdown-item" href="/logout">Sign Out</a>
<a class="dropdown-item" href="/admin">Admin</a>

#

it just shows up white

#

tho

quartz kindle
#

you can made the admin item appear only if the logged in user is the same as the owner

#

if they are not appearing, check your ejs tag

earnest phoenix
quartz kindle
#

ejs has two tags, <%= and <%-

earnest phoenix
#

ah

quartz kindle
#

<% doesnt return anything

dusky steeple
#

it does on my dashboard

quartz kindle
#

to output html, you need to use <%-

earnest phoenix
dusky steeple
#
<% if(user.id === bot.config.ownerID) { %>
                                        <a class="dropdown-item" href="/admin"><i class="far fa-user-secret"></i> Admin</a>
                                        <% } %>``` this is how mine is set up and works 🤔
earnest phoenix
#

hm

quartz kindle
#

because you're writing the raw html, not outputting it

dusky steeple
#

ah yea duh lol

quartz kindle
#

@earnest phoenix you only need <%- for the actual output, not the if

#

only in the line that returns the admin item

#

or you can put it all in one line

earnest phoenix
#

SyntaxError: Unexpected token catch in /app/website/views/index.ejs while compiling ejs

#

tf

#

xD

#

so

sick cloud
#

how do you just add to a permission overwrites array on a text channel without deleting others

#

i tried edit but it just wipes them all

quartz kindle
#
<%-  if(user.id === bot.config.ownerID) { '<a class="dropdown-item" href="/admin">Admin</a>' } %>``` try this
earnest phoenix
#

where do i paste it

#

tho

quartz kindle
#

you dont need the - at theed

#

only at the beginnig

earnest phoenix
#

begining of code?

#

<div class="dropdown show">
<a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Options
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
<a class="dropdown-item" href="/">Dashboard</a>
<a class="dropdown-item" href="/logout">Sign Out</a>
<a class="dropdown-item" href="/admin">Admin</a>

quartz kindle
#

@sick cloud have you tried using .overwritePermissions()

sick cloud
#

uhh no

earnest phoenix
#

i justwanna myself use panel

sick cloud
#

is that in master?

quartz kindle
#

no, in stable

sick cloud
#

whats its master equiv then think

quartz kindle
#

let me check

sick cloud
#

createOverwrite?

earnest phoenix
#

not working

sick cloud
earnest phoenix
#

SyntaxError: Unexpected token if in /app/website/views/index.ejs while compiling ejs

harsh nova
#

The error explains it to you

quartz kindle
sick cloud
#

cool

#

and is there some kind of remove too?

quartz kindle
#

iirc to remove just set it as null

sick cloud
#

oh okay

quartz kindle