#development

1 messages ยท Page 675 of 1

earnest blade
#

I am not using a command handler ๐Ÿ˜…

grim aspen
#

like this: client.on("message", etc

#

well that explains much

#

the command won't work without a command handler

earnest blade
#

But this one does

grim aspen
#

and msg and message don't work together

earnest blade
#

i have both, and they both work

#

Itll work

#

But when i add in the custom emoji

#

it doesnt work

earnest phoenix
#
client.emojis.get("EMOJI ID");
#

@earnest blade whats not working about it? any errors?

earnest blade
#

The bot just doesnt respond

earnest phoenix
#

show your full code? remember to hide your token

grim aspen
#

@earnest phoenix he doesn't have a command handler at all

earnest blade
#

basicially, i have a custom emoji. when i send that custom emoji, i want the bot to send a message thats just that custom emoji

earnest phoenix
#

your bot needs to be in the same server as the emoji

earnest blade
#

it is

earnest phoenix
#

to be able to send it

#

the emoji id is not the guild id, did you obtain it by escaping the emoji or

earnest blade
#

Itll work if i do this

grim aspen
earnest blade
#

That works

#

But when i change "oof" to :GoldenCheese:

grim aspen
#

that's not how it works

earnest phoenix
#

every emoji has it's own id

grim aspen
#

msg and message don't work together

earnest blade
#

im trying to paste the Id @earnest phoenix

#

it wont let me

grim aspen
#

it has to be used with a command handler

earnest phoenix
#

obtain the format by escaping the emoji

#
const { Client } = require("discord.js");
const client = new Client();

client.on("ready", () => console.log("The bot has logged in successfully!"));

client.on("message", message => {
  const msg = message.content.toLowerCase();
  
  if (msg.startsWith("oof")) message.channel.send(client.emojis.get("602154064649912349")));
});

client.login("TOKEN");

@earnest blade you're welcome

grim aspen
earnest phoenix
grim aspen
#

same idea different emojis

earnest blade
#

@earnest phoenix Yea, i have the ID

grim aspen
#

oh that would explain why it works

earnest blade
#

Ok so basicially the first doesnt work

grim aspen
#

msg is defined

earnest blade
#

The second does

#

yes @grim aspen

#

In that link, the first command wont work

#

but the second does

#

How do i make it detect the custom emoji

#

@earnest phoenix ?

earnest phoenix
#

detect

#

as in

#

find in the message content?

earnest blade
#

yea

#

im using it's ID

#

As seen in the first command

earnest phoenix
#

you'll have to make a regex for it

#

ah wait

earnest blade
#

can you put that in begginer coder's language xD

earnest phoenix
#

you have specific emojis, you don't need regex for it at all

earnest blade
#

I just need it to find a custom emoji in the message content

earnest phoenix
#

startsWith returns whether the string starts with the string you specify

#

you're probably looking for includes

#

can you try this:

const emoji = client.emojis.get("602154064649912349");
if(msg.startsWith(emoji)) {
        message.channel.send(emoji);
}

i havent tested this so might not work

#

please stop

grim aspen
#

spoonfeeding again

earnest phoenix
#

you're looking for includes which checks if the message content includes a specified string @earnest blade

lusty dew
#

No spoon feeding

earnest blade
#

@earnest phoenix would it be msg.Includes?

earnest phoenix
#

you'd do it on the content property

#

msg itself is a Message object

#

wait no

#

i have no idea what your code looks like so i'm not sure what is msg exactly

earnest blade
#

but it would still work before with startsWith if i made it detect something else besides a custom emoji

#

let msg = message.content.toLowerCase()

earnest phoenix
#

ah yeah, you can then just use msg.includes(...)

#

startsWith checks if the string begins with something, includes checks if the string includes something

#

based on that, make a decision

earnest blade
#

But i wanted it to check if the emoji nwas at the beggining

#

so thats not the issue

#

the issue is that the bot wont detect the custom emoji

earnest phoenix
#

i see your issue, you're converting everything to lowercase

#

but you're checking for an emoji with an uppercase name

earnest blade
#

ooohhhhhh

maiden mauve
#

hmm

sick cloud
maiden mauve
#

what would be a good line to draw between a casual for(let a in b) loop, versus array.map?

earnest blade
#

thanks @earnest phoenix , that fixed it!

earnest phoenix
#

๐Ÿ‘

earnest blade
#

๐Ÿค

earnest phoenix
#

@sick cloud set the position to fixed and top to 0

#

if you want it sticky

sick cloud
#

set what to that though

#

the index or the webview inside

earnest phoenix
#

whicever element the bar is

#

whichever*

sick cloud
#

oh yeah the tab ok

#

@earnest phoenix now it's just gone

earnest phoenix
#

๐Ÿค”

sick cloud
#

stuck under there

#

welp

sick cloud
#

(they're spans in a div)

west spoke
#

inline in css

sick cloud
#

doesn't work

#

they just squish

west spoke
#

Make them different divs perhaps.

Idk

abstract crow
#

I made a game in C++ and Python lol

amber fractal
#

Whats with the 2 blurred private ones mmulu

abstract crow
#

One is a bot that I am hosting for someone

#

The other is bot a guy and I are working on, not sure if they want me to show it

amber fractal
#

I have 24 repos

abstract crow
#

Dang

amber fractal
#

Nearly all private

abstract crow
#

lol

#

Well I wish I could keep a repo public and then privatize certain branches

#

Like dev should be private, but master can be public

#

Or I can make it private, but users can still access to put issues in type of thing

amber fractal
#

Thats why you dev locally

#

Then commit to master

abstract crow
#

Yeah but what about when I want a repo to be public so people could submit issues, but I have my code public then so

amber fractal
#

Yeah, thats what I mean, the dev branch could just be on your local device

#

Master could be on git

abstract crow
#

Right, but what about repos where I don't want any code

#

I just want them to see the timeline and submit issues

amber fractal
#

Dont commit code mmulu

abstract crow
#

Well that sucks

inner jewel
#

or just create two repositories

abstract crow
#

Yeah but like come on Github

#

They should allow that

inner jewel
#

github is meant to share code

#

ยฏ_(ใƒ„)_/ยฏ

amber fractal
earnest phoenix
#

if you use github just for issue tracking just use

#

trello or jira

#

i've also seen a few irl friends use nTask

opaque eagle
#

GitLab lets you hide certain parts of a repo with permissions, which is neat

#

You can let anyone see the issues and stuff of a repo but lock down the code to just contributors

#

Lots of permissions config

earnest phoenix
#

so in my script

<script>
    window.onload = () => {
        const fragment = new URLSearchParams(window.location.hash.slice(1));

        if (fragment.has("access_token")) {
            const accessToken = fragment.get("access_token");
            const tokenType = fragment.get("token_type");

            fetch('https://discordapp.com/api/users/@me', {
                headers: {
                    authorization: `${tokenType} ${accessToken}`
                }
            }).then(res => res.json())
            .then(response => {
                const { username, discriminator, id } = response;
                alert(`Hello, ${username}#${discriminator} (${id})!`);
            }).catch(console.error);
        } else {
            window.location.href = "https://discordapp.com/api/oauth2/authorize?client_id=585149040035889187&redirect_uri=https%3A%2F%2Fpibot.pw%2Fdashboard&response_type=token&scope=identify";
        }
    } 
</script>

How would I go about accessing my Discord.Client()?

#

you don't

topaz fjord
#

You can't

#

And you don't

earnest phoenix
#

stop exposing sensitive information to the frontend

topaz fjord
#

Your supposed to have a back end that handles the oauth

#

never do it all in the front end

#

Unless you want to get into trouble with users/discord

#

@earnest phoenix ^^^^^^

earnest phoenix
#

i mean, i do have a backend, but idk how i would go about like for example, saving stuff to a database, or using client for things.

the only thing I can think of is using a function on the front end which runs a backend file and returns the result, but idk how I'd get the client in that backend file since it wasnt passed from the front end, if you get what i mean

topaz fjord
#

what are you trying to do

earnest phoenix
#

make an api

topaz fjord
#

^

earnest phoenix
#

you have no need for a database for oauth

#

what you have right now is literally asking for web vulnerability

prime cliff
#

Doing some nice features for my bot for 20k guilds how does this look also i need to add volume and shuffle icons probably at the bottom center

zealous veldt
#

That's sexy @prime cliff

#

It has big sex time appeal

prime cliff
#

blobthumbsup thx i have been getting into some nice image gen stuff that is just the template but it's easy enough for me to dynamically edit the text and pics

topaz fjord
#

@prime cliff is this for ur website

sonic frost
#

noice

prime cliff
#

Nope it will be the nowplay command

topaz fjord
#

oh

prime cliff
#

And maybe the play command

#

Hmm

topaz fjord
#

I was gonna do something like that for my website

earnest phoenix
#

whats the point of showing controls if you can't use them

prime cliff
#

That's to show if the music is paused

#

And the bottom bar is just to look nice

high lava
#

Also, it works for checking status as well

#

You can have them highlighted for shuffle and repeat etc

prime cliff
#

Yup

topaz fjord
#

I was gonna send all the data from my bot via a websocket

#

Which would be like 356 requests per song but meh

#

On average

slender thistle
#

Jay, are you sure you're in the right channel?

earnest phoenix
#

@topaz fjord i used to have a little experimental system like that

topaz fjord
#

used to

earnest phoenix
#

yes

high lava
#

Oh woops

earnest phoenix
#

i abandoned the project

topaz fjord
#

oh

earnest phoenix
#

i had a separate audio server that acted like a websocket server aswell, it was basically glorified and faster lavalink

prime cliff
#

I don't really have repeat for my bot because that would just waste resources sitting in a vc with noone, yes i can check for no users in vc but that's would be bad for users that just update Discord or crash

topaz fjord
#

wait then this means the react component will have to update an average of 356 times a song

earnest phoenix
#

well

#

no

#

well

#

yes

#

but no

topaz fjord
prime cliff
earnest phoenix
#

you don't need to send ws data on the song being elapsed every second, you just need to provide the current playing state, current time of the song and the length of the song

#

you can then have a calculated progress bar

earnest phoenix
#
var arr = [โ€œappleโ€, โ€œorangeโ€, โ€œswordโ€, โ€œbagโ€];
``` Can someone tell me how do I remove orange from the array?
amber fractal
#

splice should do the trick

earnest phoenix
#

example?

amber fractal
#

If you dont include the 3rd argument, it simply deletes it.

earnest phoenix
#

ok thanks

amber fractal
#

You can also use indexOf to get the index of a specific item in an array

valid frigate
#

lol who uses indexOf

stone dust
#

whats your preference friend

amber fractal
#

@valid frigate is there another way you can get the index of an item in an array if you dont already know it's index?

valid frigate
#

probably not

amber fractal
#

Essentially that would simplify to

arr.splice(arr.indexOf(someInput), 1)
quiet flame
#

Yo trying to auto react with my bot..
How do I make it react to images only

client.on('message', message => {
if (Attachment) {
message.react('heart');
}
});

copper cradle
#

This has to be asynchronous

let image = message.attachments.size > 0 ? await message.attachments.array()[0].url : ' ';
if (image) message.react('the emoji')
#

and also spoonfeed

#

@quiet flame here you go

quiet flame
#

What's happening here

quartz kindle
#

attachments doesnt return a promise afaik

modest pendant
#

Oof

quartz kindle
#

no need for await

modest pendant
quartz kindle
#

@quiet flame do you know what is a ternary operator?

quiet flame
#

No sir

modest pendant
#

Im your king

quiet flame
#

quick google and now i know

#

@quartz kindle

modest pendant
#

@quiet flame im your king

#

Listen to daddy

quartz kindle
#

so snails showed you a ternary operator way of checking if the message contains an attachment, and if it does, to check for the attachment's url if it exists

#

thats basically whats happening

quiet flame
#

I didnt get why we need the url

quartz kindle
#

the attachment might not be an image

#

might be a file uploaded from the computer for example

quiet flame
#

oh yes

quartz kindle
#

although a better way would be to check for its width, not its url

#

also .array()[0] can be replaced with .first()

quiet flame
#

I was thinking on similar lines..width or height

quartz kindle
#

yes

earnest phoenix
quartz kindle
#

many of us do

#

if you have a question, post it here

pallid zinc
#

Nah

#

He want someone who can make his web for free

earnest phoenix
#

is it just an accepted fact that every bot has the same help command ? and you will be spammed by a wall every time you want help with a specific bot ?

unique nimbus
#

I mean I make my bot have a pingable prefix so no other bot responds

earnest phoenix
#

oh true i guess

#

as of now i just use the "!" prefix and hope my command names are unique enough

unique nimbus
#

no dont use "!"

#

thats the most popular

earnest phoenix
#

that's the thing though, it's only the admins that read your command description when they invite the bot

#

how the users supposed to know ?

unique nimbus
#

Well they don't unless they want to test your bot

earnest phoenix
#

that's why i thought using the most popular prefix would help them "guess the correct commands"

unique nimbus
#

normally we get spammers who do "!help" 500 times

earnest phoenix
#

lol

mossy vine
#

so why not just have a list of commands, and when you run it without arguments it will give more information about the command

earnest phoenix
#

like without the prefix ?

mossy vine
#

..no

#

is your problem the prefix or that bots respond with a wall of text, describing what every command does including the smallest things

#

i dont understand lol

earnest phoenix
#

is it just an accepted fact that every bot has the same help command ?

#

then it developed into using different prefixes

mossy vine
#

what do you mean by "same help command"

earnest phoenix
#

"!help"

lusty dew
#

Why not just have customizable prefixes per server

earnest phoenix
#

i guess that would work

lusty dew
#

A lot of bots do it

earnest phoenix
#

hmm wonder how intuitive it is to get command info by pinging the bot

mossy vine
#

just add "ping me for help" in the status

earnest phoenix
#

oh

#

or even just " use <specific cmd> for help"

mossy vine
#

yea

earnest phoenix
#

that's a good idea

#

think i'll go with that

#

btw, on the website, do you have to enable anything to show how many servers your bot is in ?

#

i know mine is in a couple just from reading the logs, but the website still says N/A

#

do you have to reach a threshold?

unique nimbus
earnest phoenix
#

background, tags color.

abstract crow
#

CSS

#

Different than bot's color btw

earnest phoenix
#

where?

abstract crow
#

Learn it

earnest phoenix
#

where im edit on css?

abstract crow
#

That I don't know

#

check the api maybe

limber star
#

do u understand what eco is saying

abstract crow
#

yeah

#

The website

limber star
#

i dont

abstract crow
#

Getting a design on the website

mossy vine
#

@abstract crow it has nothing to do with the api

#

simply write your css between style tags in your long description

abstract crow
#

Ah gotcha. I didn't know lul

earnest phoenix
#

Can I add JavaScript code into my website?

#

Like document.write(10)?

#

or Math.floor(Math.random() * 10)

opaque eagle
#

yes

earnest phoenix
#

I figured it out

opaque eagle
#
<script>js here</script>```
earnest phoenix
#

I know

opaque eagle
#

ok

earnest phoenix
#

Anyways

#

Thanks

opaque eagle
#

If there's too much Js there, you can import from a file

#
<script src="path/to/file.js"></script>```
earnest phoenix
#

Ok

#

How about links?

opaque eagle
#

Also just as an FYI, no javascript in your bot's long description (on DBL) unless your bot is certified

mossy vine
#
<a href="https://example.com">clickable hyperlink</a>```
#

bruh what

opaque eagle
#

lol

earnest phoenix
#

Rip

mossy vine
#

discord really fucked that one up

earnest phoenix
#

Ok

opaque eagle
#
<a href="http://example.com">Lorem Ipsum</a>```
mossy vine
earnest phoenix
#

Can someone verify my bot?

opaque eagle
earnest phoenix
#

Ok

opaque eagle
#

If it hasn't been a week, don't ask unless you like getting muted

earnest phoenix
#

I might not be able to make it

mossy vine
#

make what

earnest phoenix
#

I am mostly going to leave my bot to the dust

#

I have other projects

opaque eagle
#

lol

mossy vine
#

as long as its online and commands are working, it should be verified

opaque eagle
#

^

earnest phoenix
#

Ok

#

So literally I can have cmd prompt on with my bot online?

opaque eagle
#

I'd put it on your VPS

earnest phoenix
#

VPS?

opaque eagle
#

A paid server where you host code

earnest phoenix
#

Ok

#

I don't have money though.

opaque eagle
#

If you don't have one already, check pins in this channel

#

Idk how to help

earnest phoenix
#

Thanks

#

I cant seem to have up 115px in my margin

#

Rip

#

@opaque eagle I have a problem

#

My detailed description is gone

#

How Do I make attachments

#

With a persons avater

#

like @fair grail

dusky mist
#

With HTML

earnest phoenix
#

WHAAAAAAAAAAAAAAAAAAAAAAT

#

Oh wait

mossy vine
#

what?

earnest phoenix
#

What?

#

I still dont understand

dusky mist
#

What the heck is happening xD

mossy vine
#

im asking you

earnest phoenix
#

Let me get some cheetos

mossy vine
#

@earnest phoenix attachment as in, the bot sends the authors avatar?

earnest phoenix
#

Yea

dusky mist
#

Oh

#

Srry

earnest phoenix
#

Just like @fair grail

mossy vine
#

what library are you using

earnest phoenix
#

JavaScript

mossy vine
#

wrong cyber, and bots dont work here

grim aspen
#

bruh

earnest phoenix
#

Discord.js

dusky mist
#

So

#

.avatarURL

earnest phoenix
#

Discord.js

#

.avatarURL

grim aspen
earnest phoenix
#
msg.reply(msg.author.avatarURL)
#

Like that one

dusky mist
#

For example: message.author.avatarURL

mossy vine
#

so why not just send the avatar url back

earnest phoenix
#

I want it to be in a custom scenario

#

Or back ground

#

I will show you

mossy vine
#

then you need to use a library that can do image editing

grim aspen
#

image editor via li-

#

yeah

earnest phoenix
#

Ok

#

Can Discord.js do it?

mossy vine
#

@grim aspen with what? you probably know more about image manipulation than i do

#

by itself it cannot

grim aspen
#

i was going to say same thing

#

actually it's an image manipulator

earnest phoenix
#

How about HTML?

grim aspen
dusky mist
#

Nono

broken shale
#

use canvas

earnest phoenix
#

oK

dusky mist
#

HTML is for another thing xD

earnest phoenix
#

Lmao

#

Also

#

Any one have a good place to host a web site?

broken shale
#

Html is just a markup lang, doesn't have anything to do with image manipulation

earnest phoenix
#

Git hub is really confusing

mossy vine
#

github pages

broken shale
#

git pages*

mossy vine
#

thats about as simple as it can get really

#

git by itself doesnt offer web hosting lol. github does

earnest phoenix
#

Ok

#

Lmao

broken shale
#

Oh then I have bad memory :(

mossy vine
#

really, that is as simple as website hosting can get

broken shale
#

Kek gonna make my own instead

#

Or if I get lazy oliysmug

earnest phoenix
#

I just want a really simple one

mossy vine
#

make a repo, upload your files, enable github pages, done

earnest phoenix
#

oK

broken shale
#

@mossy vine Uh sry for ping but what lang do u use

mossy vine
#

mainly javascript, why?

earnest phoenix
#

Me too

broken shale
#

Oh okay I was wondering how to enlarge emojis given the user provides one

earnest phoenix
#

In discord?

mossy vine
#

what lib

broken shale
#

d.js

mossy vine
#

example

earnest phoenix
#

Oh my

broken shale
#

oh LMAO

broken shale
#

I was gonna modify url size

#

dumb me ig ยฏ_(ใƒ„)_/ยฏ

earnest phoenix
#

Anyone knows how to program in Roblox Studio

#

Mainly lua.

#

Oh my

#

That is really long

broken shale
#

@mossy vine It works for custom emojis, but how would I do it for default discord ones

stray garnet
#

i gotta out it in pastebin

broken shale
#

lemme see smthing

mossy vine
#

@broken shale i dont think you can. its unicode displayed as twemoji

stray garnet
broken shale
#

yeah RIP unless I make a dictionary of all deafult ones enlarged

#

Aint nobody gonna spend that much time on a dic

mossy vine
#

@stray garnet lines 10-13

slender thistle
#

Doesn't djs provide separate classes for unicode and custom emojis

broken shale
#

Sadly

stray garnet
#

@mossy vine Yea whats with that

mossy vine
#

do i have to explain? you are creating an embed telling you to mention the user and then sending it, not caring about the rest of the command

stray garnet
#

oh

earnest phoenix
#

How do I make a link into text in a embed?

#

use markdown hyperlinking

mossy vine
earnest phoenix
#

yeah

#

lol

mossy vine
earnest phoenix
#

Anyone one here

#

Who has big brain

#

Knowledge of CSS

#

I only know HTML5 lmao

mossy vine
#
earnest phoenix
#

Omg

grim aspen
earnest phoenix
#

omg

dense cairn
#

!serverinfo

dusky mist
stray garnet
#

@dense cairn reeee

opal summit
#

How I can have a vote webhook?

opaque eagle
#

You mean count votes through webhooks or send votes to a discord webhook?

opal summit
#

count votes

slender thistle
#

Webhook, save the user ID on vote, on command fetch the database

weary swan
#

Hello, my doggies

#

I need some help with porting my bot to discordbots

#

Where am I supposed to put my token?

unique nimbus
#

discordbots is a website to list your bot to get more servers, they dont host your bot for you

#

use a VPS

#

to host or just run it on your computer

weary swan
#

i feel stupid now

jade parcel
#

when someone votes this comes up:

at /home/ubuntu/node_modules/discord.js/src/client/rest/RequestHandlers/Sequ                                                                                        ential.js:85:15
    at /home/ubuntu/node_modules/snekfetch/src/index.js:215:21
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
(node:28837) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This                                                                                         error originated either by throwing inside of an async function without a catch                                                                                         block, or by rejecting a promise which was not handled with .catch(). (rejectio                                                                                        n id: 25)
(node:28837) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissi                                                                                        ons
#

how do i give the correct permission in the webhook?

west spoke
#

That's something for channels

#

It cant send to that channel

abstract crow
#

What is the CPU usage for a bot like Dank Member, Pokecord, etc?

#

Like how much do they need to run that shit

mossy vine
#

probably around 80-90%

abstract crow
#

What do the need in terms of specs?

mossy vine
#

ask devs?

abstract crow
#

Well that is kinda why I asked in development

mossy vine
#

the bots devs

scarlet phoenix
#

It has some resource usages in there

#

They use approx 150gb of ram and a maybe around 100vcpus total (guesstimate from article and dashboard)

#

Given this was back in July of 18

quartz kindle
#

discord destroying people's vps's since 2014

prisma bobcat
#

i didn't know bots had CEOs

#

ima put CEO on my resume now

opaque eagle
#

Oliy is the CEO of every bot

#

when u list on dbl u sign away ur bot's rights to oliy

stray garnet
#

How to take all roles from a Person, and give it them back with one command?

opaque eagle
#

I smell API abuse

stray garnet
#

Noooo

#

nono

#

It should be for a Mute Command

opaque eagle
#

Even if it's for the most noble of reasons, API abuse is API abuse

stray garnet
#

Bruh

#

But then is a Muted Command useless

opaque eagle
#

oh wait nvm

#

i thought u said remove a role from every person

stray garnet
#

xD

opaque eagle
#

not remove every role from a person

#

my bad

stray garnet
#

np

#

im using D.js

prisma bobcat
#

wouldn't it be easier to just have a muted role that supersedes the rest and add/remove that

opaque eagle
#

yeah ur fine

#

^

#

that's what bots normally do

#

they use a muted role

stray garnet
#

ik

prisma bobcat
#

yea also how we do it on another server i'm in, and have a channel only they can see

#

so they get quarantined basically

stray garnet
#

but when they have other roles with SENR_MESSAGES perms they still can write

#

@prisma bobcat hmm thats a good idea

prisma bobcat
#

idk a lot about how roles work they're kinda confusing tbh, but wouldn't a mute role at the top of the list with no send permissions overrule any role under it with send permissions?

stray garnet
#

already tried it

#

dont works

prisma bobcat
#

otherwise for the og idea, just get all the role id from member.roles, then iterate them to remove them an store them somewhere, and on unmute add them back

stray garnet
#

hmmm

opaque eagle
#

you can remove multiple roles with a single api request

#

don't iterate through them

#

that's called api abuse

prisma bobcat
#

o neat, didn't know that

#

my bot doesn't mess w/ any roles really so haven't had to mess with em

#

how do you promote/advertise/whatever your bot to get people to use it? besides just sticking it on bot list

opaque eagle
#
message.member.removeRoles() // stable d.js``````js
message.member.roles.remove() // master d.js``````js
client.editGuildMember() // Eris```
#

get ur friends to add them i guess

#

im friends with the owners of some medium-to-large servers... i ask them to add, they add, others in the server see, they add too

#

word of mouth is gr8

prisma bobcat
#

i'm mod on a decent-sized server (3k something members) ima add it to, but that's about it

opaque eagle
#

yeah that should be enough tbh

stray garnet
#

message.member.removeRoles() Take all Roles?

opaque eagle
#

check docs

prisma bobcat
#

and i gotta test it out a bit more on smaller servers first cause this bot came from hacked-together version made for that server, so gotta make sure feature/stability parity so i don't screw em lol

opaque eagle
#

Collection<Snowflake, Role> | Array<RoleResolvable>

#

that's all it takes

stray garnet
#

wait how to give them back?

opaque eagle
#

message.member.addRoles()

#

read docs plox

topaz fjord
prisma bobcat
#

they got some good docs

opaque eagle
#

lol

#

d.js docs r ok

#

some projects have bad docs

#

like sequelize

topaz fjord
#

doesn't seem that bad

opaque eagle
#

sequelize docs r confusing af

#

typeorm is so much better for js stuff but whatever

hollow fulcrum
#

who here knows how to use wavelink

#

and knows how to wait until the current player is finished playing a song

earnest phoenix
#

why do you want to wait

kindred epoch
#

hey guys whats the best database for a discord bot

#

I saw rethinkdb is pretty clean and fast, is that good?

amber fractal
#

There is no "best database"

#

It depends on multiple things

#

How big the app is, how fast it will need to read and write data, how many requests will it need to handle/second and more

kindred epoch
#

Well just an easy-to-use one, doesnt really need to be that fast and I guess it shouldnt corrupt easily (json) and can store many items without breaking :p

scarlet phoenix
#

Well if its small, and you want simplicity you could do something like mongo. Although I would reccomend MySQL or Postgres since they are relational and allow you to define Key constraints. Which IMO is super useful

#

I use MySQL over postgres but have heard many good things about postgres

kindred epoch
#

@scarlet phoenix I heard mysql has some dodgy syntax though

scarlet phoenix
#

Its just your standard SQL

#

Some people dont care for SQL but personally I dont have any issues with it

slender thistle
#

It comes to preferences

earnest phoenix
#

my advice; sqlite for small scale bots, postgresql for large scale bots

gray epoch
#

i need some help.
i created a ban command in my bot.. and when someone use the command to ban a member who has a highter role than the bot i wanna the bot reply with a message that say the error.. and the question is how to use role.position here

#

it always says position of undefined

late hill
#

ok so, in Java
I have a base class and a bunch of other classes which all extend said class.
I have some objects of those classes stored in a Map where I map the name to the base class (Map<String, MyBaseClass>)
(As all the objects are at least of that form)
Now the thing is I have a method in said base class that I override in most of the extended classes, when I grab one of the objects from the map and call that method I'll simply get the method specified in the base class, this isn't what I want and I'm wondering on how to fix that? Does me putting them in a Map as the base class make Java "forget" what "bigger" class they were? Can I simply change them back in to the extended class? Is my approach wrong here?

#

Would me using an interface that requires the method and then mapping them using the interface work with the overrides?

#

java makes me wanna rm -rf tbh

inner jewel
#

then it's not overriding properly

#
jshell> class Base { void method() { println("Inside Base"); } }
|  created class Base

jshell> class Sub1 extends Base { void method() { println("Inside Sub1"); } }
|  created class Sub1

jshell> class Sub2 extends Base { void mehtod /*notice the typo*/() { println("Inside Sub2"); } }
|  created class Sub2

jshell> var map = Map.<String, Base>of("a", new Sub1(), "b", new Base(), "c", new Sub2());
map ==> {c=Sub2@6433a2, a=Sub1@5910e440, b=Base@6267c3bb}

jshell> map.get("a").method()
Inside Sub1

jshell> map.get("b").method()
Inside Base

jshell> map.get("c").method()
Inside Base```
abstract crow
#

What does this error mean?

pam_unix(sudo:auth): authentication failure; logname=vinniehat uid=1001 euid=0 tty=/dev/pts/0 ruser=vinniehat rhost=  user=vinniehat
Aug 14 04:32:26 vinniehat.tk sudo[6802]: pam_unix(sudo:auth): conversation failed
Aug 14 04:32:26 vinniehat.tk sudo[6802]: pam_unix(sudo:auth): auth could not identify password for [vinniehat]
Aug 14 04:38:28 vinniehat.tk sudo[6843]: pam_unix(sudo:auth): authentication failure; logname=vinniehat uid=1001 euid=0 tty=/dev/pts/0 ruser=vinniehat rhost=  user=vinniehat

I tried everything online, and this happens when starting nginx

lusty dew
#

Smh YouTube stopped my play cmd cause of too many requests

hollow saddle
#

Smh comes to dbl to advertise an account for a shit game

abstract crow
#

So lemme ask you guys this. What hosting service do you guys all use? Also, is Digital Ocean considered expensive? If so, what are some other hosts besides OVH. I use Vultr rn, wanted to switch to GG, but too many issues, again.

earnest phoenix
#

DO is fairly cheap

#

i used scaleway for my old discord bot

#

currently using google cloud

abstract crow
#

Droplets are just your servers

#

But like Kubernetes? And why host a DB for more money, when u could just host it with the VPS?

amber fractal
#

Having the db on the same machine can cause the app to run slower

abstract crow
#

Yeah but don't companies just have a dedi for the DB or somethin

earnest phoenix
#

DO's databases are managed

#

they come presetup

abstract crow
#

So your just paying for another server that runs a prebuilt DB for you to customize

#

I mean I am fine with setting up the server myself. Its just right now, is it safe to run both on one VPS? And what do bigger companies use, inhouse hosting or companies like DO

earnest phoenix
#

if you're not worried about resource management, it is

#

also, it depends

#

some companies prefer to host everything on their servers while companies like discord are hosted on google cloud

scarlet phoenix
#

The main thing is that a dedicated database vps usually have really nice built in features not usually needed on a normal vps

abstract crow
#

Ok. Cuz right now like I am 14 and don't have things that require gazillions of gbs. So having a big server isn't necessary for me, but I want something that I can roll into the future with

scarlet phoenix
#

Typically around security and snapshot backups

abstract crow
#

Hm

scarlet phoenix
#

At work (Med sized fintech company) We work with ~70 different db instances

abstract crow
#

Also with Vultr I had issues with Ubuntu 19.x, DO offers that too, I see more use 18.04, should I go 19 or 18?

scarlet phoenix
#

Having recovery if something goes wrong is really nice to have

#

Id say 18.04LTS

abstract crow
#

Ok

#

lol

scarlet phoenix
#

Yeah, I always the most current LTS build

earnest phoenix
#

managed databases also offer things like metrics, which is actually really useful

abstract crow
scarlet phoenix
#

They are different metrics

abstract crow
#

@earnest phoenix Yeah. Too many issues.

#

Contacted support

scarlet phoenix
#

The db instances will be specific to that, disk IO latency, DB pool sizes, IO and stuff

abstract crow
#

Plus about 6 months ago when I had GG, before I switched to Vultr, I had issues too. Just GG and their OS I have issues with

#

Maybe they don't install something, but all these x isn't installed, can't run y, can't do z function

scarlet phoenix
#

If you dont use docker stuff Skysilk is pretty good and cheap

#

But their VPS's run on LXC so no container stuff unfortunatly

#

They are working on KVM stuff tho

abstract crow
#

I don't even know what docker is. Shocker there, pun intended

earnest phoenix
#

you should really get into learning docker

scarlet phoenix
#

Docker is super useful

earnest phoenix
#

it's amazing

abstract crow
#

So droplets are VPS's, Kubernetes are what?

scarlet phoenix
#

Docker + Docker-compose + K8s is super nice

abstract crow
#

I will have to look that up, what does Docker do?

scarlet phoenix
#

Kubernetes = k8s

#

Its a way to orchestrate a ton of docker containers

abstract crow
#

Has anyone used a load balancer

#

Aw u delted it

scarlet phoenix
#

I do at work, but for my discord bot I just have traffic routed to the k8s pod with that shard

earnest phoenix
#

sentry + docker is a must combo for me right now, those two in a combo make my life so much easier

abstract crow
#

Ok so for someone like me, basic developer, hosting bots and websites, with like 0 traffic, Droplet with LTS Ubuntu, and then run my PSQL DB on there?

#

Sentry I โค

scarlet phoenix
#

We used to use sentry at work, we switched off it for a homebrew solution

#

Was nice for the couple monthes I used it

#

I have a server for my bot with different channels for logging and error reporting and it works out well to alert me

abstract crow
#

I hate to ask this

#

There is so much

#

What does selecting cPanel and WHM do?

scarlet phoenix
#

Hey I know some of those lol

abstract crow
#

Oo Plesk ๐Ÿ˜

earnest phoenix
#

those are just preinstalled software etc

#

just go with a simple empty ubuntu image

#

then install what you need on it

abstract crow
#

Yeah Plesk is

scarlet phoenix
#

Cpanel is for a gui for hosting a site https://cpanel.net/

cPanel

With its world-class support and rich feature set, cPanel & WHM have been the industry leading web hosting platform for over 20 years. Trusted world-wide by our technology partners Wordpress, CloudLinux, Lighstpeed, and more.

#

^^

abstract crow
#

Yeah I really don't

scarlet phoenix
#

its worth it to get the experience

abstract crow
#

I have NGINX setup somehow

#

I don't know how

#

Reverse proxy shit

#

vime ๐Ÿ™‚

#

WTF

#

Well just had to make 2 payments for it to register.

#

@earnest phoenix Would you happen to know how I can forward my VPS IP to my URL?

#

I have DNS options

quiet flame
#

`client.on('message', message => {

if (message.attachments.height != 0){
  message.react(':heart:');
}

});`

#

Trying to make the bot auto react to an image

abstract crow
#

Use code blocks ๐Ÿ™‚

quiet flame
#

but this make it react to plain text too

abstract crow
#

Also, console.log a lot.

#

console.log(message.attachments.height)

#

Try reacting with the ID

earnest phoenix
#

attachments is a collection

abstract crow
#

\โค

earnest phoenix
#

@abstract crow you can do that with nginx

abstract crow
#

So forward my VPS IP, to My Domain, which forwards back to my VPS?

#

I have it setup with CloudFlare

earnest phoenix
#

well, it should return to your domain

#

which should then contact your internal app

abstract crow
#

Ah gotcha

earnest phoenix
abstract crow
#

I'll check it out

broken shale
#

Is that DO I see ๐Ÿ‘€

abstract crow
#

Yeeee

#

I thought it was confusing, but I love it so far

broken shale
#

I would use apache

#

but DO's console looks well...Ugly

abstract crow
#

I mean I just rock the normal Putty

broken shale
#

Yeee

#

Btw

#

New windows update coming out for terminal........possibly supporting remote access to other servers zoomeyes

abstract crow
#

Yeah

#

Me excited

broken shale
#

Me2

abstract crow
#

I used to use Putty, but now use Moba

broken shale
#

๐Ÿ‘€

#

What is Moba

#

โ“

abstract crow
#

MobaXTerm

#

SSH and SFTP built in

#

And cool console games lol

broken shale
#

xd

abstract crow
broken shale
#

lmao

abstract crow
#

I didn't even take a look at that yet lol

warm marsh
#

Windows CMD better.

#

๐Ÿ˜‚

broken shale
#

No remote access though

#

Well not for now

warm marsh
#

It does in the Windows Insider.

#

So the next stable update I guess.

fervent pilot
#

When I create a new .js file called commands then code commands in that file it doesnโ€™t work

warm marsh
#

Yikes.

#

Make a message handler

#

then call functions within that file or make external files for each and store them inside a map/collection.

fervent pilot
#

Thank you

quiet flame
#

@quartz kindle Bro size worked slonk

#

`client.on('message', message => {

if (message.attachments.size > 0){
  message.react('โค');
  
}

});`

abstract crow
#

Ok so I need some sql peoples

#

I am trying to grant all privs on a user on ALL databases

#

I can only find on 1 db, not all

earnest phoenix
#

Huh

#

That made no sense to my head your trying to do what? @abstract crow

abstract crow
#

I am trying to grant all privileges to a user in SQL

#

But not just in a single database

earnest phoenix
#

You canโ€™t do it in multiple databases I donโ€™t think you would have to run them a couple of times to get what your doing..

#

Unless your thinking of tables,

abstract crow
#

I basically want a second root account

#

But root in terms of psql root

earnest phoenix
#

Hmm I donโ€™t use SQL in websites still donโ€™t think you can access multiple tables and databases at a time

#

I forgot how to make scroll bars in HTML5

#

Anyone know how?

earnest phoenix
#

I need help

#

My detailed description is gone

valid frigate
#

though if you read the page it's non standard

#

only works on chrome, meaning if you want to hide the scollbar youll need to make fallbacks for safari, edge, etc

sterile quarry
#

this is my error pmessage in visual code

#

PS C:\Users\User\Desktop\cmder\mybot> node index.js
(node:5912) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.
at WebSocketConnection.<anonymous> (C:\Users\User\Desktop\cmder\mybot\node_modules\discord.js\src\client\ClientManager.js:48:41)
at Object.onceWrapper (events.js:291:20)
at WebSocketConnection.emit (events.js:203:13)
at WebSocketConnection.onClose (C:\Users\User\Desktop\cmder\mybot\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:390:10)
at WebSocket.onClose (C:\Users\User\Desktop\cmder\mybot\node_modules\ws\lib\event-target.js:124:16)
at WebSocket.emit (events.js:203:13)
at WebSocket.emitClose (C:\Users\User\Desktop\cmder\mybot\node_modules\ws\lib\websocket.js:191:10)
at TLSSocket.socketOnClose (C:\Users\User\Desktop\cmder\mybot\node_modules\ws\lib\websocket.js:850:15)
at TLSSocket.emit (events.js:208:15)
at net.js:588:12
(node:5912) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:5912) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
PS C:\Users\User\Desktop\cmder\mybot>

cursive dagger
#

@sterile quarry code? And have you recently installed/updated d.js

sterile quarry
#

node.js

#

?

earnest phoenix
#

Oof

sterile quarry
#

i have them both updated

#

d.js and node

#

i just installed them yesterday

cursive dagger
#

Hmmm can you try to use bot <token> in your login method?

sterile quarry
#

wym

#

like in the index

earnest phoenix
#

Yea

#

bot.login('Token');

cursive dagger
#

Replace that with bot.login("bot Token")

sterile quarry
#

what part

#

want me to send u the script i put for it

earnest phoenix
#

bot.login

sterile quarry
#

so change client.login(token) to bot.login(token)?

earnest phoenix
#

Depends on your const/var/let name

#

@sterile quarry

sterile quarry
#

want me to send u the java script

earnest phoenix
#

Sure

opal summit
#

How I can do a line break in my bot detailed description?

valid frigate
#

use \n

#

oh wait

cursive dagger
#

No...

valid frigate
#

is this for dbl

opal summit
#

Yes

cursive dagger
#

<br/>

opal summit
#

Ok thx

earnest phoenix
#

<br/>

cursive dagger
#

@sterile quarry no, add bot then a space to your token

#

To the start of it

earnest phoenix
#

No

#

@cursive dagger

#

He doesnt have token

#

Defined

#

The const token is undefined

#

So the login is invalied

cursive dagger
#

Snuwy it's a recent api change.

earnest phoenix
#

Ok

#

Wait

#

Jade I dont understand

#

@cursive dagger

cursive dagger
#

Discord recently forced their api to have not infront of their token, but discord.js didnt have it at the time

earnest phoenix
#

Ok

#

Ello

opal summit
#

I have try to put all the link and only the ID

earnest phoenix
#

Show me the problem

#

Take a pic

opal summit
#

I have try only with the ID but it's same

earnest phoenix
#

Just the id

cursive dagger
#

Hm can you copy paste the server format you are using with the Id only

opal summit
#

608024790434840635

#

Same as link

cursive dagger
#

Hm and your bot is in this server with dsl in it

opal summit
#

Yes it's the support server ๐Ÿ˜…

cursive dagger
#

And the server is on the website

#

Hmmm

opal summit
#

Yep

cursive dagger
#

You should DM oliy about this

opal summit
#

Ok

opal summit
#

I think my html doesn't work the <br></br> do nothing

cursive dagger
#

just use one br/ tag

#

and it should work

peak quail
#

why i always get 0 when i do

 message.channel.send(`${message.guild.members.filter(o => !o.presence.status === 'offline').size}`)```
#

:(

quartz kindle
#

Because you are doing it wrong

#

!variable attempts to convert it to boolean and invert it

#

So then youre checking if false === offline

#

Which will always fail

#

You want the not equal operator, which is variable !== offline

pine edge
#

Hey guys, you having method to work on bot discord and use prod branch and dev branch without create two app ?

wet void
#

Technically you could log in twice concurrently. If the code that's running is the same, everything would be duplicated. Eg running your help command, you'd get two replies. You could do something with process.env.MODE or .DEV or .PREFIX, up to you, to decide which bot reacts to what prefix or in what channels, but I think it'd just be a better idea to have two tokens. Each in a different .env file. @pine edge

pine edge
#

@wet void thanks actually run my bot on my vps with pm2 and if i run it on localy is no same ?

wet void
#

Each message would get processed twice, one on each of the two running apps. Same token used to log in twice at the same time, so just your one bot online.

pine edge
#

Ok thanks for this information @wet void

midnight lantern
#

Hi, I need help. This command should do me leave a voice channel, but it doesnt work:

let messageArray = message.content.split(" ");
let cmd = messageArray[0];
if(cmd==='!humo')
{
    let iduserafk = message.author.id;
    let Canalvoz = message.guild.member(iduserafk).voiceChannel;
    if(!Canalvoz)
    {
            message.channel.send('You are not in a channel.');
    }
    else
    {
            message.guild.member(iduserafk).setVoiceChannel(null);
    }
}
pine edge
#

@midnight lantern What the error ?

midnight lantern
#

I dont leave the channel

pine edge
#

No error in terminal or whatever ?

midnight lantern
#

no

pine edge
#

And bot have permission to move ?

#

try this
else
{
member(iduserafk).setVoiceChannel(null);
}

earnest phoenix
mossy vine
#

@midnight lantern does the bot have permission to kick you

midnight lantern
#

yes, but i found the problem. I had not updated the libraries

#

thanks

opaque eagle
#

Why is it undefined?ts // ~/Routes/some_file.ts import { ScrabbleValues as results } from "../"; console.log(results); // undefined``````ts // ~/index.ts export * from "./Modules/Assets/";``````ts // ~/Modules/Assets/index.ts export { default as ScrabbleValues } from "./scrabble.json";

#

(TypeScript)

lusty dew
#
db.prepare("CREATE TABLE IF NOT EXISTS guilds (id TEXT, prefix TEXT, log_toggle FALSE, log_channel TEXT, guild_premium FALSE, case_counter 0")
#

I also want to add in individual toggles for each event there is like, guildMemberAdd, guildMemberRemove, messageUpdate, roleUpdate, etc

#

But that seems to be a bit messy so I wanted to know if there was a better way to do it

opaque eagle
#

Would that log ~ or ~/foo/?js // ~/foo/index.js export class Foo { constructor() { console.log(__dirname) } }``````js // ~/index.js import { Foo } from './foo/' new Foo()

#

(I'm writing a node module and I need to write files and make dirs from where my module's class is initialized)

wheat carbon
#

How do you make the colored text?

opaque eagle
#

```lang
code
```

wheat carbon
#

Ok thanks

#
console.log('Test');
#
export class Foo {
   constructor() {
      console.log(__dirname)
   }
}
#

?

#

Ohhh

#
export class Foo {
   constructor() {
      console.log(__dirname)
   }
}
#

There thanks

opaque eagle
#

replace lang with the language the code is in, so smth like this:

```js
// js for javascript
console.log("foo")
```

#

@wheat carbon

wheat carbon
#

Yes thanks

#
bot.on('message', message => {

    let args = message.content.substring(PREFIX.length).split(" ");

    switch (args[0]) {
        case 'ping':
            message.channel.sendMessage('Pong!')
            break;
modern sable
#

Does someone know why discord.js seems to occasionally send two identical presence updates?

#

I should be getting two (as I share two servers with the bot) but I'm ocassionally getting three

gray geyser
#

alguรฉm aqui fala portuguรชs

dusky mist
#

No

gray geyser
#

;-;

dusky mist
#

ninguรฉm

gray geyser
#

ninguรฉm

#

kkk

dusky mist
#

XD

gray geyser
#

eu mudei o nome do meu bot mas ele continua com o nome antigo

#

olha o logs

earnest phoenix
#

does anyone know how long it takes the website to update how many servers your bot is in ?

amber fractal
#

Did you post?

earnest phoenix
#

yes

opaque eagle
#

Are u sure it was successful

earnest phoenix
#

i updated the bot token it post the servers of

opaque eagle
#

you should have gotten an empty object in return

#

{}

earnest phoenix
#

i know it works because, i started posting the server count of a test bot

#

and the website showed 3

#

now i changed the bot it should post server count of

#

but it still shows 3, not sure if it's delay or just unsuccessful

opaque eagle
#

how did u get a "test bot" approved through dbl

earnest phoenix
#

it's not a bot on the site

#

just my personal

#

generating a new apikey for dbl might work

amber fractal
#

@opaque eagle you just need the token to post

opaque eagle
#

oh

earnest phoenix
#

but i guess it's not optimal to able to post the server count of a different bot on the site

#

update, i got it working

#

the issue was i had several bots with the same bot token running

tall mist
#
DiscordAPIError: Unknown Message


/rbd/pnpm-volume/c9c66428-0d5d-43ea-8c41-f58f44451698/node_modules/.registry.npmjs.org/opusscript/0.0.7/node_modules/opusscript/build/opusscript_native_wasm.js:8

var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMEN

abort(DiscordAPIError: Unknown Message). Build with -s ASSERTIONS=1 for more info.

lusty dew
#
db.prepare("CREATE TABLE IF NOT EXISTS guilds (id TEXT, prefix TEXT, log_toggle FALSE, log_channel TEXT, guild_premium FALSE, case_counter 0")

I also want to add in individual toggles for each event there is like, guildMemberAdd, guildMemberRemove, messageUpdate, roleUpdate, etc, but that seems to be a bit messy so I wanted to know if there was a better way to do it

#

And better-sqlite3 doesnโ€™t support array data types so I canโ€™t do the events like that

amber fractal
#

@tall mist you tried to fetch a message that either no longer exists or never has existed

tall mist
#

?

#

mean ?

lusty dew
#

Meaning you fetched a message that no longer exists or never has

#

I donโ€™t see how that doesnโ€™t make sense

amber fractal
#

Or, my mistake, you deleted your message in code and tried to use it again

#

Like message.delete()

#

Then you tried to do something with it

tall mist
#

@amber fractal thx you

#

i did

#

but

#

i have other err

#
TypeError: Cannot read property 'send' of undefined


/rbd/pnpm-volume/c9c66428-0d5d-43ea-8c41-f58f44451698/node_modules/.registry.npmjs.org/opusscript/0.0.7/node_modules/opusscript/build/opusscript_native_wasm.js:8

var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module["arguments"]=[];Module["thisProgram"]="./this.program";Module["quit"]=function(status,toThrow){throw toThrow};Module["preRun"]=[];Module["postRun"]=[];var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMEN

abort(TypeError: Cannot read property 'send' of undefined). Build with -s ASSERTIONS=1 for more info.
stray garnet
#

@tall mist send is undefined.

tall mist
#

?

stray garnet
#

That Error.

tall mist
#

what can i do

stray garnet
#

Code?

inner jewel
#

you can learn js and how to debug

#

instead of asking how to fix every error without even providing code

naive gull
#

hi, anyone know what this json error means and how to fix pls
error: json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 2 column 2 (char 3)
code:

{
    {"type": 2, "name": "PewDiePie"},
    {"type": 1,"name": "jeff xd"}
}
sick cloud
#

you can't put objects in objects

amber fractal
#

?

naive gull
#

what is what?

sick cloud
#

your trying to list objects in an object

#

thats not how json works

#

you need to give them a name

naive gull
#

ooh

sick cloud
#
{
    "name": { "values": "here" }
}

or

[
    { value: "here" }
]
naive gull
#

ahh ty!

#

[] works

lusty dew
#
db.prepare("CREATE TABLE IF NOT EXISTS guilds (id TEXT, prefix TEXT, log_toggle FALSE, log_channel TEXT, guild_premium FALSE, case_counter 0")

I also want to add in individual toggles for each event there is like, guildMemberAdd, guildMemberRemove, messageUpdate, roleUpdate, etc, but that seems to be a bit messy so I wanted to know if there was a better way to do it

#

And better-sqlite3 doesnโ€™t support array data types so canโ€™t do the events like that

kindred epoch
#

idk use a nosql database then?

alpine lark
#

Can some one help me real quick

#

There is no line 32

quartz kindle
#

That means there is a wrongly closed bracket

alpine lark
#

Oh thatโ€™s not good

quartz kindle
#

Double check all your brackets

alpine lark
#

A } bracket or )?

quartz kindle
#

Any of them

alpine lark
#

Okay

#

I donโ€™t see any

quartz kindle
#

Is Node.isOnline inside an exported function?

alpine lark
quartz kindle
#

You properly closed Node.isOnline, but you didnt close exports.run after it

alpine lark
#

The one right before exports.help

quartz kindle
#

Yes, from what i can see, exports.help is inside exports.run, and exports.run is never closed

earnest phoenix
#

Remove the ,

#

Line 30

alpine lark
#

Let me try to close it

#

Just a }?

earnest phoenix
#

Just remove the , line 30 @alpine lark

#

And it should be work

alpine lark
#

Still have same error

quartz kindle
#

You need to close exports.run before you begin exports.help

#

Check how you opened it, and close it the same way

alpine lark
#

It worked lol

#

Thank you!

hollow saddle
#

Removing the comma will do nothing

#

Itโ€™s a trailing comma

#

It can be there or not, it doesnโ€™t matter

mossy vine
#

surprised it doesnt cause an error

quartz kindle
#

Js ignores trailing commas in objects because its smart, but json is not as forgiving

#

A trailing comma in json will cause an error

abstract crow
#

Would it be good to just transfer stats and bot information via a database and then pull it using PHP instead of using a WS server, that I can't use online

manic geode
#

How would I make a command that adds a new channel with a certain name? I am trying to make an essentials bot that has moderation, utilities, and normal uses. This command will be like a ticket creator. I've looked in the documentation but couldn't find a function that creates a channel.

quartz kindle
#

Which lib?

#

@abstract crowi dont see why not

manic geode
#

Main library.

quartz kindle
#

Which main lib?

manic geode
#

"View docs for | Main Library | stable"

amber fractal
#

what

manic geode
#

Thats what it says.

amber fractal
#

what library are you using

#

discord.js

mossy vine
#

discord.js?

manic geode
#

Discord.js

amber fractal
quartz kindle
#

What is the name of the library lol

#

Ok discordjs stable or master?

manic geode
#

Stable.

quartz kindle
#

Look at the documentation for guild

mossy vine
#

took less than 5 seconds to find lol

manic geode
#

Oof.

#

How would I have the name?

#

Of the channel customized.

#

Wait./

#

Ig ot it.

quartz kindle
#

Check the createChannel options

manic geode
#

I see it.

#

I'm blind.

abstract crow
#

First time coding in PHP! Yeet

#

Maybe its a good thing to actually learn the language instead of just making queries...

quartz kindle
#

You're trying to get status of something that doesnt exist

alpine lark
#

Oof

earnest phoenix
#

So, how do you make bots.

quartz kindle
#

You program them

alpine lark
#

Lol

grim aspen
sterile quarry
#

anyone that can halp me again

earnest phoenix
#

yes @sterile quarry

#

just ask your question

drowsy sentinel
#

Give them a few seconds, I asked them to put the error in here.

sterile quarry
#

one sec lemme copy it

#

ReferenceError: like is not defined
at Object.<anonymous> (C:\Users\User\Desktop\Lifelessbot\index.js:1:1)
 at Module._compile (internal/modules/cjs/loader.js:868:30)
 at Object.Module._extensions..js (internal/modules/cjs/loader.js:879:10)
 at Module.load (internal/modules/cjs/loader.js:731:32)
 at Function.Module._load (internal/modules/cjs/loader.js:644:12)
 at Function.Module.runMain (internal/modules/cjs/loader.js:931:10)
 at internal/main/run_main_module.js:17:11#

#

i think its a error or something

abstract crow
#

Use code blocks and we also need code

earnest phoenix
#

The error come from index i think

sterile quarry
#

yes it is

drowsy sentinel
#

Something defined as 'like' is undefined in index.js

sterile quarry
#

lemme check