#development

1 messages Ā· Page 573 of 1

earnest phoenix
#

both html and css aren't programming languages

#

they're markup languages

knotty steeple
#

html is a programming language

#

tf u on

quartz kindle
#

they are according to some

earnest phoenix
#

yes my b

copper wraith
#

XDD

quartz kindle
#

google imperative vs declarative programming

#

html is declarative

knotty steeple
#

whats that mean

#

i dont want to google

earnest phoenix
#

php yes is a programming code

quartz kindle
#

imperative = you're an emperor, a dictator, you must order your subjects to do everything you want them to

earnest phoenix
#

Hypertext
Markup
Language

im sorry but if you can't understand, not everyone should code and that's the T

knotty steeple
#

its a programming language

ruby dust
#

say that to the normies that make discord bots

knotty steeple
#

html

quartz kindle
#

declarative = you declare laws and people adapt their existing stuff to work around those laws

knotty steeple
#

programming language

#

by

#

google

earnest phoenix
#

i don't even look at generic bot developers

#

because they dont have a clue what they're doing

#

and have never heard of any other programming language other than js

quartz kindle
#

they code in english

earnest phoenix
#

yes

#

tall iq

quartz kindle
#

node.js operating system

knotty steeple
#

😩

#

thats real

earnest phoenix
#

im worried that someone who doesn't get sarcasm will take this seriously

grim aspen
#

got it to work with my main prefix

sick cloud
#

how would you do archives of a channel

#

like do you fetch 100x until theres no more then jam it in a file or what

quartz kindle
#

is that even allowed?

sick cloud
#

yes?

#

certified bots here do it even lol

quartz kindle
#

then i guess thats the only way

#

but like

#

there are channels with millions of messages

sick cloud
#

i'm making a ticket bot

#

they'll be newer channels in a way

#

basically on close the content is archived to a file

quartz kindle
#

you could keep track of the contents with a db

sick cloud
#

i'm not inserting every message into my db

#

like ik i can but honestly painful

quartz kindle
#

you need to record a lot of back and forth messages?

formal agate
#

ok i have to be really dumb to not get this. Why is my bot able to subtract but not add? ```js
let amount = args[0];
let bank = money[message.author.id].bank;
let cash = money[message.author.id].cash;

let newCash = Math.floor(cash - amount);
let newBank = Math.floor(amount + bank);```

last ferry
#

cash money

quartz kindle
#

minus resolves strings into numbers

#

plus doesnt

formal agate
#

...

quartz kindle
#

"5" - 5 = 0
"5" + 5 = 55

formal agate
#

anyway around?

quartz kindle
#

make sure you're using numbers and not strings

formal agate
#

they are numbers

quartz kindle
#

Number("5") = 5

#

amount comes from args

formal agate
#

"280815367662731266":{"cash":2397,"bank":211000}

quartz kindle
#

args is a string

formal agate
#

ik

#

thats the raw data

#

they are numbers

quartz kindle
#

amount is not

formal agate
#

yes

#

it is a string as you have said

quartz kindle
#

so

#

amount + bank

#

will be string + number

formal agate
#

is adding strings

#

yes

quartz kindle
#

which will result in a string

#

so convert amount into a number

grim aspen
#

friend still thinks he can use bot maker

#

now he says he gives up

formal agate
#

if you cannot use that

grim aspen
formal agate
#

then that is super sad

molten pewter
#

I'm literally willing to pay money for someone to help

quartz kindle
#

you're the owner of esmbot?

#

do you know which file causes it?

amber fractal
#

6 months for it not being able to read a property?

fervent oyster
#

seeing the full dump from the error would be helpful

quartz kindle
#

@molten pewter the problem should be here js const imageType = imageCheck(image); await client.wait(500); if (["jpg", "png", "webp"].includes(imageType.ext)) {

amber fractal
#

What file is that in

quartz kindle
#

i dont know what imageCheck does, but if you're arbitrarily waiting 500ms, i assume its an async function

#

instead of waiting a hardcoded value, you should await the function to complete. depending on the image size and download speed, or whatever else your code does, it can take longer than 500ms to complete

#

well, apparently its an npm package file-type and its not an async function, so waiting 500ms will do nothing

#

its returning null because it found no match, so either unsupported or broken file

#

just check for null and throw an error when that happens

sick cloud
#
  const link = req.query.link;
  const exp = new RegExp('https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)');
  
  const matches = link.match(exp);
                         
  return res.json({ matches });

so i made that
but i always get null

inner jewel
#

why are you using regex to parse an url

sick cloud
#

uhh

zealous veldt
#

Tony I believe the proper answer to zig's question is "yes"

meager lava
#

I keep seeing this big error at random in my logs and I don't know what it is. The error code is ECONNRESET if that helps

quartz kindle
#

that means your bot disconnected

#

could be network failure, bad/slow internet, or a billion other things

meager lava
#

Ok, so it's nothing that I should worry about in terms of the bot itself

quartz kindle
#

usually not, unless you're doing something weird

#

im not sure though

craggy fox
#

so i have a responsive navigation bar that changes depending on screen size
the problem is for mobile only
the first time i click on the three lines to open up the nav but it just pops up but when i close and re open again it does the animation i made but it doesnt work the first time i click on it for some reason
been trying for 30 mins now and no results
i can screenshare if needed

slim heart
#

how does GroupDMChannel actually work

amber fractal
#

I have no idea how a bot would ever message in a group dm

#

lmao

slim heart
#

i made a group DM channel and it even logs the proper object but when i do .then(dmchannel => dmchannel.send(etc... its missing access

#
0|CensorBo | JPBBerry#9659 ran command: eval
0|CensorBo | GroupDMChannel {
0|CensorBo |   type: 'group',
0|CensorBo |   deleted: false,
0|CensorBo |   id: '545094689989328897',
0|CensorBo |   name: 'Censor Bot',
0|CensorBo |   icon: '87d1e17bdca6c63bd8682bd0c01d1bca',
0|CensorBo |   ownerID: '394019914157129728',
0|CensorBo |   managed: true,
0|CensorBo |   applicationID: '394019914157129728',
0|CensorBo |   recipients:
0|CensorBo |    Collection [Map] {
0|CensorBo |      '142408079177285632' => User {
0|CensorBo |        id: '142408079177285632',
0|CensorBo |        username: 'JPBBerry',
0|CensorBo |        discriminator: '9659',
0|CensorBo |        avatar: 'fa56f5964f8de67e28b1a4a89928ce9d',
0|CensorBo |        bot: false,
0|CensorBo |        lastMessageID: '545094688781238272',
0|CensorBo |        lastMessage: [Message] } },
0|CensorBo |   lastMessageID: null,
0|CensorBo |   messages: Collection [Map] {},
0|CensorBo |   _typing: Map {} }
0|CensorBo | JPBBerry#9659 ran command: eval
0|CensorBo | (node:13872) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Access
0|CensorBo |     at item.request.gen.end (C:\Users\ninja\Desktop\bot\node_modules\discord.js\src\client\res
t\RequestHandlers\Sequential.js:79:15)
0|CensorBo |     at then (C:\Users\ninja\Desktop\bot\node_modules\snekfetch\src\index.js:215:21)
0|CensorBo |     at processTicksAndRejections (internal/process/next_tick.js:81:5)
0|CensorBo | (node:13872) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error origina
ted either by throwing inside of an async function without a catch block, or by rejecting a promise which w
as not handled with .catch(). (rejection id: 12)```
```js
client.user.createGroupDM([{user: '142408079177285632', accessToken: ACT}, {user: "339091840538247179", accessToken: ACT}]).then(a=>a.send('test'))```
visual zenith
#

@slim heart well first and last of all, you can not create a group dm with the bot

#

only singular dms

slim heart
#

@visual zenith yes u can

#
  • bots literally have an oauth scope for making a user join a group dm
#
  • it’s literally making the group DM as I showed above its made a GroupDMChannel Object
mossy vine
#

Uhm, im pretty surs the createGroupDM() only works on user accounts, exactly like <User>.addFriend()

#

Sure*

slim heart
#

That’s why you need the scope and accessToken

#

You need the accessToken instead of a friend request essentially

#

And also it’s not marked as user only, and again, it’s still making it.

#

It obviously CAN make it but I think I’m doing something wrong after making it

mossy vine
#

Huh? Im 99% sure it says on the discordapp docs that bot users cant create/participate in group dms

#

Let me check

slim heart
#

Look at the oauth tab on discord

#

It has the gdm.join scope

#

And also the piece of documentation above shows that you can

visual zenith
#

xD

#

i told u

#

u cant create groupDM using bot account

slim heart
#

Yes you can

#

fallen you didn’t even read what I said

visual zenith
#

lets see

mossy vine
#

You can not

slim heart
#

That doesn’t say it can’t make gdms

visual zenith
#

^^^

#

and it didnt work

mossy vine
#

It does!!!

slim heart
#

It just says it can’t be added to one

visual zenith
#

xD

hushed berry
#

creating one would mean adding yourself to it

visual zenith
#

and it shows missing access

slim heart
#

Clearly not because I LITERALLY made a GroupDMChannel

visual zenith
hushed berry
#

what are you trying to accomplish even mate?

slim heart
#

If you look at the console log above way up there it literally says GroupDMChannel { ...

hushed berry
#

what does it matter...?

visual zenith
#

?

slim heart
#

And even if that’s not enough it even says managed: true meaning it owns it obviously meaning it’s apart of it šŸ‘€

mossy vine
#

Missing Access

visual zenith
#

!djs ClientUser#createDM

#

no u

#

rip bots

mossy vine
#

It means the endpoint exists, but your bot cant use it

slim heart
visual zenith
#

^^^ i already tried that xD

#

but it shows missing access as the error

slim heart
#

Yea I’m probably doing something wrong

mossy vine
#

Yes, you are trying to use a function that only works on user accounts

visual zenith
#

ye

slim heart
#

It only says missing access when it try to send a message

visual zenith
#

no, it doesnt matter

#

it still didnt create the group

#

and did you even get the token?

slim heart
#

Yes I did

visual zenith
#

using the oauth?

slim heart
#

I’m not stupid

#

Yes

visual zenith
#

ok then.

slim heart
#

Wait wut I think I just got it to work

#

I was only using one user

#

W8w8w8

visual zenith
#

?

#

because when u use the oauth code, it only gets one user lmao

slim heart
#

That’s not what I’m saying

visual zenith
#

unless another user would to authorize it

slim heart
#

I have the act’s of the two different users

mossy vine
#

On the API DOCS it literally says that bots cant join or participate in group dms

visual zenith
#

ofc lmao

hushed berry
#

you understand what oauth is right

visual zenith
#

use user account

#

yes

#

i use it for my website

slim heart
#

W8

hushed berry
coral trellis
visual zenith
#

even better

hushed berry
#

oauth is just letting the bot execute actions for you

visual zenith
#

facepalm OOO I got an animated emoji for that

#

@hushed berry depends what u use oauth for

hushed berry
#

YOU made that group DM

slim heart
#

Nik I know what oauth is

visual zenith
spring ember
#

OAuth is magic ofc

visual zenith
#

oh boy

slim heart
#

No ok I’m confused cuz I just did that again using three separate account I got the notification on my phone FROM the bot and I can’t seem to find it now-

visual zenith
#

?

#

its not possible creating a dm using a bot

slim heart
#

I got a notification from a gdm but now I can’t find it

spring ember
#

Wow so much abuse right here

visual zenith
spring ember
#

You can't use a client for a bot account

visual zenith
#

well u can use client.whatver

slim heart
#

That made 0 sense

#

Lol

visual zenith
#

client.channels/client.users/client.guilds etc

slim heart
#

U mean duh discord application client but still

spring ember
#

Use a client like the discord app

visual zenith
#

xD

slim heart
#

How dat abuqse

visual zenith
#

u can use client on both user and bot -_-

spring ember
#

No

slim heart
#

Duhduh

#

Yes

visual zenith
#

Discord.Client() ???

slim heart
#

You shouldn’t

visual zenith
#

then it'll be called client

slim heart
#

But u can

spring ember
#

I mean A DISCORD CLIENT

mossy vine
#

Just because the endpoint and function exist doesnt mean that you can use it on a bot account. Examples of that include: creating/joining a group dm

visual zenith
#

-_-

spring ember
#

not a lib

slim heart
#

Dondish u make no sense

visual zenith
#

same

#

wtf so confused

spring ember
#

I MAKE LOTS OF SENSE

slim heart
#

Are u one of the idiots that use bot instead of client

visual zenith
mossy vine
#

@slim heart you make no sense, you are trying to use a user account only endpoint on A BOT ACCOUNT

visual zenith
#

^^^

slim heart
#

Ok well it just worked so

hushed berry
#

mate

visual zenith
#

i know for sure u cant create group dm using a bot

mossy vine
#

The docs are wrong, they should say thaz the endpoint is only available on user accounts

spring ember
#

You can't use a Discord client like the website app on a bot account

slim heart
#

For two seconds but it did

hushed berry
#

you didnt make the group DM on a bot account

#

you made it on your account

visual zenith
#

^^^

mossy vine
#

It didnt work because you got an api error

hushed berry
visual zenith
#

ofc

slim heart
#

You realize that’s in recipients right?

visual zenith
#

@slim heart are you using a bot?

slim heart
#

Yes

visual zenith
#

or user account

slim heart
#

Bot bot

#

It just doesn’t pop up on my DM list but I’m getting notifications from it

mossy vine
#

You realize that you are still trying to do the impossible

visual zenith
slim heart
#

It’s literally like half working don’t say it’s impossible smh

mossy vine
#

Half working

#

That half working is giving you api error

visual zenith
#

ye

slim heart
#

Yes it exists but doesn’t exist šŸ‘€

#

No I’m not getting the api error anymore

visual zenith
slim heart
#

It sends it and I get a notification on my phone but it’s like the gdm gets deleted instantly after

visual zenith
#

because its an error

slim heart
#

Obviously not

mossy vine
#

Obviously it is

keen drift
#

obv šŸ‘šŸ¾

slim heart
#

If it’s sending it then it’s not erroring on the bots end

visual zenith
#

lmao heres the best conversation xD

slim heart
#

Unless discord is just broken

jagged plume
#

unless discord doesnt let bots in group dms

slim heart
#

B u g H u n t e r

#

It just did thododjdjdj

earnest phoenix
#

šŸ‘€

visual zenith
#

discord DOESNT let bots in group dms

coral trellis
#

Just stop this isn't an argument of who's right or wrong, Currently it's stated by discord that bots cannot join/create group DM's

#

If you wanna test around with it do that in your own space

visual zenith
coral trellis
#

If you find a bug great, Tell Discord

slim heart
#

Yes I understand that I’m just saying it like just did work then deleted itself after it wasn’t an error in the bot it might be a bug then Āæ

visual zenith
#

wheres ur code and error?

slim heart
#

There’s no error and it’s the same code just with another user

mossy vine
#

User account?

visual zenith
#

no bot account lmao

slim heart
#

Another user as recipient but not it’s a bot account making the gdm

mossy vine
#

Did you read what Xig even said?

slim heart
#

It’s what I sent above I just put another recipient in the array and it made it

keen drift
#

switch to user account and see if it works šŸ‘šŸ¾

slim heart
#

holy shiiiiiit I’m not disagreeing with that I’m literally saying it’s still like working even tho it’s not supposed to

visual zenith
keen drift
#

šŸ‘šŸ¾

visual zenith
#

fishy u have nitro

#

use it

coral trellis
#

Like I said stop this

mossy vine
#

Its clearly notworking, youre getting errors

visual zenith
coral trellis
#

Stop,

slim heart
#

As I said three times I’m not getting errors anymore

visual zenith
#

ok srry

coral trellis
#

Final time I will say it

visual zenith
#

....

slim heart
#

Oh I thought u were talking about the emojis

#

Ok

#

Even tho it’s not even much of an argument šŸ‘€

coral trellis
#

Can you even comprehend

visual zenith
#

Fishy, use ur nitro emojis man

coral trellis
#

The fuckin words I speak

keen drift
#

no @ fal

slim heart
#

No not really

visual zenith
#

oh great

coral trellis
#

Then let me make it clear, This conversation about bot clients making group dm's is over

visual zenith
#

🤐

slim heart
#

šŸ™„

visual zenith
slim heart
#

margin-bottom?

#

@visual zenith try getting rid of margin-bottom

visual zenith
#

still the same thing

slim heart
#

Don’t @ me but I’m pretty sure it moves it down

visual zenith
#

depends

#

still the same

slim heart
#

Hold on just for testing get rid of the whole padding element

#

And see if that makes a difference in the position of the bar

visual zenith
#

no it doesnt

#

u can look at the website urself if u want to see it

slim heart
#

Yea I just did

visual zenith
#

and.. it didnt work

slim heart
#

Is that the only element the navbar is nestled under?

visual zenith
#

well theres more

#
            .navbar {
                overflow: hidden;
                background-color: #094990;
            }

            .navbar a {
                float: left;
                display: block;
                color: white;
                text-align: center;
                padding: 30px 40px;
                text-decoration: none;
            }

            .navbar a:hover {
                background-color: lightgray;
                color: #340329;
            }

            body {
                background-color: #36393E;
            }

            .header {
                text-align: center;
                color: white;
                font-size: 30px;
            }

            .content h3 {
                display: inline-block;
                margin-top: 150px;
                margin-left: 30px;
                color: white;
            }
            .image {
                border-radius: 50%;
                margin-top: 100px;
                margin-left: 50px;
                width: 10%;
                display: block;
                float: left;
            }
slim heart
#

Do you specify css for the things that contain navbarv

visual zenith
#

shouldve bin this but meh

#

wdym @slim heart

slim heart
#

One second I needa get on my laptop real quick to look at it

visual zenith
#

ok

slim heart
#

@visual zenith ok just add margin-top: -6px to align it to the top

#

Also what’s with the random div element in the style?

#

Idk where that’s being called but somethings happening with it

#

It’s the default css that the browser gives it I guess

#

@visual zenith I found it, in your body tag just put margin: 0; I’m pretty sure it’s cuz ur stylesheet isn’t being called from a separate file so chrome is using a it’s ā€œuser agent stylesheetā€ maybe not tho, but just add margin: 0 to body{}

visual zenith
#

thanks so much @slim heart

fiery nebula
#

is it impossible to use await in a async function?

visual zenith
#

no?

fiery nebula
#

and for me not

visual zenith
#

ur awaiting an awaiting reaction šŸ˜‚ i think?

fiery nebula
peak bloom
#

what is your question

#

are you getting an error?

#

if so, can you post it here

fiery nebula
visual zenith
#

ur missing a }

#

beside the {time} part

fiery nebula
#

oof

visual zenith
#

then retry

peak bloom
#

i don't believe he'd get that error, and i don't think that's his code anyhow

#

can you post the full code instead of just a screenshot of two lines lol

fiery nebula
#

ok

#

l

#

code too long lul

visual zenith
#

he already put async

peak bloom
#

how do you know

visual zenith
#

in the module.exports part

fiery nebula
#

yes

visual zenith
#

woah wait

#

the code that u sent

peak bloom
visual zenith
#

the gchannel.send

#

i dont see async being there for ^^

#

thats legit 2 different files

peak bloom
#

make sure the function immediately containing the await is marked async

#

more context would allow us to say for sure

#

instead of 2 lines

fiery nebula
#

gimme a sec

peak bloom
#

where's the await?

visual zenith
#

bin pls

fiery nebula
#

how to embed code again?

visual zenith
fiery nebula
visual zenith
peak bloom
#

see those lines aren't in that function tho

visual zenith
#

oh ur using switch xD

peak bloom
#

collector.on('collect', message => {

#

they're in that one

#

which isn't marked async

visual zenith
#

and case

fiery nebula
#

ik its notgood code

peak bloom
#

you've got the containing function, the exports.run, which is async, but in that function you define another function in collector.on('collect', message => { that gets called when it detects a message

fiery nebula
#

i just had to get an ideo how to make it...

peak bloom
#

mark that function async too

fiery nebula
#

ok

#

tbh idk where

peak bloom
#

message => { ... } defines a function

fiery nebula
#

yea

peak bloom
#

that's the one that isn't async

#

so
..
make it async

#

same as the other one

fiery nebula
#

yea ik but idk where to place the async at that function

peak bloom
#

??

#

async goes before the arguments

#

like how it's async (bot, message, args) => {

#

you've already got an async function right there just do the same thing lol

#

parentheses or not it doesn't matter

fiery nebula
peak bloom
#

no

#

collector.on(eventName, function) is what you have there

#

eventName is 'collect'

#

right

fiery nebula
#

yes

peak bloom
#

function is the whole message => { ... } bit

#

the function is what you mark async

#

not the whole thing

#

not sticking it in front of the arguments for calling .on()

fiery nebula
#

ok thx iam new to js and retarded

peak bloom
#

you're fine, we all start somewhere
i would strongly recommend making a serious effort to follow some javascript tutorials all the way through so you have a grasp on the basics, it makes botmaking severely easier

fiery nebula
#

ok you maybe recommend me a specific one?

peak bloom
#

sorry, i don't really know of any specific ones lol
the only one i've skimmed through is the one starting from this section: https://www.w3schools.com/js/js_syntax.asp which i think does a pretty good job though it's in context of browser js and not node.js

#

you can look around on google if you like tho

split hazel
#

Hey does anyone know any good image grabbing and saving module for node? I tried using jimp to grab the widget from dbl but I keep getting unsupported mime type

peak bloom
#

image grabbing and saving? do you need to do anything with the image or just save it?

split hazel
#

No just save it

#

Because discord won't embed the actual link

peak bloom
#

if you just want to save it, use any request module like got and just write file with it

#

you dont need an image module for that

split hazel
#

Ah ok thanks

fiery nebula
#

thx @peak bloom

split hazel
#

I streamed that image onto a file, it writes and appears normally when opening file but it won't send when i try attach it to an embed?

   .setTitle('Discord Bot List')
  .attachFiles(['./images/dblstats.svg'])
   .setImage('attachment://dblstats.svg')```
#

embed sends just image doesnt

peak bloom
#

some quick testing from random svg images found online

#

discord doesn't embed any of them

#

meaning you probably shouldn't try and make it put a svg into an embed, either

#

their caching service likely just ignores svgs

bright spear
#

Yeah discord doesn't embed svgs

peak bloom
#

gonna have to get your image to another file format

split hazel
#

i'll try jpg

#

png worked

peak bloom
#

if you dont need the image anymore

fiery nebula
bright spear
#

@fiery nebula always say what lib and version you are using

fiery nebula
#

discord.js

#

newest

peak bloom
#

there is no magic function called empty, you can't pull functions out of thin air

#

if rows is an array, what you want to do is check if the array has no elements, i.e. has no element 0 or the length is 0

fiery nebula
#

ok

#

if (rows.length == 0) return console.log("empty rows");

#

like this

peak bloom
#

yes

fiery nebula
#

ok thx

#

i just know empty and isset from php

marble needle
#

javascript isn't php though

fiery nebula
#

really?

peak bloom
#

if in doubt google it

#

"how to check if array is empty javascript"

#

javascript isn't php though - really? thonk thonk thonk

fiery nebula
#

ik its diffrent

marble needle
#

imagine having to implement your own functions, gets me every time smh

fiery nebula
#

still are some things similar

#

xd

peak bloom
#

some things are always similar, that's why learning new languages is way easier if you already know some

marble needle
#

really basic syntax is always somewhat similar if not even the same

fiery nebula
#

i hate when i try to use + in php to connect strings

mossy vine
#

so im very new to eris and im trying to rewrite my bot but have no idea how i would do
${message.member.nickname ? message.member.nickname : message.author.username}

peak bloom
#

? it's the same thing

#

just with nick

mossy vine
#

so message.author.nick?

peak bloom
#

authors dont have nicks

mossy vine
#

oh, right

peak bloom
#

authors are users, users are guild-independent

mossy vine
#

ohh i get it

#

thanks, didnt know where to look in the docs

peak bloom
#

always start with what you have (message) and click properties til you get where you want to be (nick)

mossy vine
#

thanks

viral spade
#

Hello,

  1. am i correct in saying that when sending a direct message to a user from a shard it will always go through shard 0 (the api?) - i do not have to care about if the user is in a guild on the shard?

  2. How about textchannels? can i only retrieve textchannels and send messages to a textchannel if the guild is on the shard i am executing the command on? 3. If yes, is the only way to handle this a broadcast eval or polling a database from every shard, or is there any other better way?

rocky dagger
#

Idk

bright meadow
#

You can only retrieve text channels if the channel is on the same shard you are using to retrieve it.
That's why you should use a shard manager

viral spade
#

i am using shard manager, otherwise why would i suggest broadcast eval as solution?

bright meadow
#

If you use the shard manager instance/object to retrieve a text channel, it shouldn't be a problem

#

It doesn't matter then at which shard the message got sent

peak bloom
#

why do you need to get channels across shards anyway

viral spade
#

i need to send a message to a textchannel of shard 1, from shard 0

peak bloom
#

if you have the id just do it, the rest api is separate from gateway

#

wait

#

discord.js right
nevermind i think they don't expose a way to send message via id do they

#

for.. some reason

viral spade
#

they do with users

#

i can send direct messaged from shard0 to a user that is only in a server of shard 1, but will this work for textchannels too?=

peak bloom
#

if you absolutely need a channel object to be able to send a message, then you need to get that code to run on shard 1

snow fulcrum
#

;o

viral spade
#

okey, again..
with users i do shard0's bot.users.fetch(id).send(text), while the user is not on a server of shard 0 --works accross shards

can i do something like:
shard0's bot.channels.fetch(id), while the channel is not a textchannel of a guild of shard 0? does it work accross shards?

heady zinc
#

the only issue with DMs and shards is that all the DMs the bot receives will be received on shard 0

#

also no it doesn't work accross shards if you don't use internal sharding

#

if you do use internal sharding, yes it does work

peak bloom
#

if fetch is fetching from the rest api then yes that will work across shards

#

because the rest api doesn't know what shard you're sending from, it can't

#

they're separate concepts lol

#

at least i assume by the fetch you're on djs master using userstores

heady zinc
#

actually nvm yeah fetch uses the rest api

viral spade
#

yes, thats exactly my question "if fetch is fetching from the rest api then yes that will work across shards" is it like that or not?

heady zinc
#

so it would work regardless of what kind of sharding you use

peak bloom
#

yes

#

if you are fetching it, it's fine

viral spade
#

also with textchannels?

peak bloom
#

try it and see

heady zinc
#

however you should make sure you don't overuse it because ratelimits ā„¢

peak bloom
#

it's an extra api request yeah

#

so avoid if possible

split hazel
#

What's the best image manipulation module for node?

grim aspen
#

javascript manipulation program

viral spade
#

okey so should i use a database or broadcasteval to not use the api and instead transfer the task to the according shard, so it can send the message without fetching?

peak bloom
#

how often do you need to do this exactly

viral spade
#

id say extreme upper limit would be with 10k servers about 100/min

peak bloom
#

tf

heady zinc
#

well ideally you should find a way to send a message without having access to the Channel

peak bloom
#

okay yeah go for eval

#

or db or w/e

#

idk how djs sharding goes

#

in eris id just send via id lol

viral spade
#

without using fetch, and to another shards guilds channel?

peak bloom
#

yea

#

bot.createMessage(knownChannelID, "blah blah")

#

im really not sure why djs hides that capability

#

but it is what it is

viral spade
#

another question: does broadcast eval deny my ability to scale horizontally?

#

i mean if i do every communication over database (of course its way slower and costly but besides that), then i could connect the bot from different servers to the same online database and all work like they run on the same machine

peak bloom
#

i'm not sure dumping your channel/guild/user caches to a database will do you many favors, but i could be entirely wrong on that

#

you'd also have to dick with internals to actually get djs objects out of that

viral spade
#

iam not dumping my cache

#

just what i would do with broadcast eval replace with database. i dont send my cache over broadcasteval either. you only send the information the other shard needs to execute its task.
in case of textchannel message you could let one shard write a database entry (textchannelid, text). meanwhile all shards poll the database every 10 minutes to check if theres a task with a textchannelid that is on that shard, and if yes, send the text and remove the database entry.

#

that works accross shards that are not even on the same server and is not much information

peak bloom
#

doesn't that mean tasks are delayed up to 10 minutes

#

that's not a very reactive design

viral spade
#

yes thats not a problem

peak bloom
#

is there no eval-on-shardID sort of function for djs?

#

would make it very straightforward

viral spade
#

you can create that easily with broadcasteval { if shardid == xx}

peak bloom
#

true but if performance is your concern that's a lot of unnecessary messages being sent to all the shards lol it's not a big deal though tbh computers are fast af

#

just do it that way and move to the fancy db solution if need arises, is my advice

quartz kindle
#

there are many databases with a publish/subscription capability

viral spade
#

that is viable for connection over http?

#

so bots can run on different pcs?

quartz kindle
#

yes

#

if you have a remote database, you can connect to it, and subscribe to a specific table/key/entry

inner jewel
#

just get a message broker eg rabbitmq

quartz kindle
#

whenever data is added there, you should receive an event from the database

inner jewel
#

then you can just send("shard-" + id + "-dostuff", stufftodo)

#

and if eg shard is dead the message will stay in the queue until it comes back

viral spade
#

this rabbitmq is like ipc?

molten pewter
#

Is there an async Node module for checking the magic number of a file?

zealous veldt
#

Magic number?

molten pewter
#

Yeah

#

I want to find the file type using the magic number of a file

#

Not just the extension

#

I know about the file-type module, but that's synchronous only

restive bough
#

šŸ‘€

mossy vine
#

"various checks"
if else
if else
if else
if else

steel heath
#

switch

marble needle
#

almost 1k switch cases šŸ‘€

mossy vine
#

holy shit is it actually

marble needle
#

lol

#

how many lines does that meme have

steel heath
#

not even using else if

earnest phoenix
#

using if in 2019

#

using else in 2019

#

using includes in 2019

#

Ok ill stop

grim aspen
#

when you realize prefix nees to be one symbol

#

fuck

mossy vine
#

Uh no

#

It doesnt?

smoky spire
#

it doesn't šŸ¤”

amber fractal
#

mine is 4 characters for this guild

grim aspen
#

for me

amber fractal
#

Do you not check the prefix length?

grim aspen
#

because of var prefix comman

mossy vine
#

???

#

If your code makes you need to use a 1 char prefix then ehh

earnest phoenix
#

Am I allowed to host multiple discord bots on one machine? I'm using Steam's Discord Bot Maker stuck_out_tongue:

marble needle
#

why wouldn't you be allowed to do so

sinful lotus
#

you can host multiple bots on one machine

marble needle
#

ps: the bot maker is garbage

sinful lotus
#

But thats just pointless if you would ask me

earnest phoenix
#

@marble needle im a child who knows nothing about making discord bots. the bot maker provides for an easy way for me to develop and experience this stuff. if you have any recommendations for something else, let me know! 😃

#

but ok cool thanks guys

queen sentinel
#

@earnest phoenix how old are you? Thonk

earnest phoenix
#

lol well im 19, but 🤷

#

i'd rather not start learning discord bots by making them all by hand lol

sinful lotus
#

well dbm is from a free library

amber fractal
#

Thats the best way to get experince

#

everything that dbm provides you can do for free

#

and more efficient

sinful lotus
#

you paid something that you can get for free for a little effort

marble needle
#

what does dbm even use, djs?

sinful lotus
#

I considered buying that in past but I stopped myself from doing so. And it was the right choice

earnest phoenix
#

oh no i didn't pay for it

amber fractal
#

Then you pirated it?

earnest phoenix
#

lol leaked version, but nonetheless.

sinful lotus
marble needle
#

using it to """develop""" bots is just as bad lmao

sinful lotus
#

dbm might even hinder learning

amber fractal
#

It's sad, it will disencourage people to learn by using it because it's easier

ruby dust
#

quoting my message from before:

dbm is actually an embarrassment to development in general, future people will think that they have to pay in order to make a bot
amber fractal
#

discourage*

sinful lotus
#

I highly recommend that you learn the programming language itself than using dbm.

languid dragon
#

In all fairness, getting into bot development with DBM isn't a bad idea

#

Xignotic did it and now he's learning JS because he wanted to go further

#

Starting out with DBM is fair and I think if they want to proceed to learning languages then by all means do so, but I wouldn't discourage people from starting somewhere easy

amber fractal
#

But most people probably wont have that idea

ruby dust
#

but dbm doesn't provide the same vibes as actually coding something

sinful lotus
#

for me I was able to try it, but it hindered my learning

#

as a result my bot crashed a lot

languid dragon
#

But what does it matter, it's just drag and drop isn't it?

#

You could make a bot in like a minute without setting up environments and downloading dependencies (i'm assuming)

amber fractal
#

I think it's drop down menus

ruby dust
#

dbm was made specifically to charge those that don't want to code, I don't think it actually has a purpose to "help" anyone with making a bot

languid dragon
#

That's contradictory
It help's users by skipping all the learning and getting right into the development right away

#

And in all fairness, people who just want to get straight to it and make a bot, its exactly what they want

amber fractal
#

skipping all the learning isnt helpful?

grim aspen
#

discord bot maker from steam is not useful

earnest phoenix
#

it gets the job done tho

languid dragon
#

But what if they don't want to learn? People just want the bot?

earnest phoenix
#

so how isn't it useful

amber fractal
#

It's inefficient from what I've heard

marble needle
#

may aswell just get a public bot that does the same thing but better, saves you the hosting aswell

languid dragon
#

That's like, building your own car because it helps you learn about engines so you can fix the car yourself instead of buying the car and just getting it fixed at a mechanic

earnest phoenix
#

exactly @languid dragon
If I learn something, I'd prefer it to be useful in the real world. I'm not gonna spend hours learning something that I'm only gonna be using for my hobbies n whatnot. šŸ˜›

sinful lotus
#

some users may have been helped by dbm, but it may vary from users, it didnt really help me by any chance. Thats what I experienced on it

languid dragon
#

You're not going to build a car from scratch if you just need to drive, but you'll do it for the fun of it

amber fractal
#

I code as a hobby

languid dragon
#

I also encourage coding as a learning utility to help you progress to more advanced things, but for something as simple as making a bot quickly, DBM should work fine and honestly it's a matter of each to their own

#

Bot making was just a gateway drug to better languages and a career for me

earnest phoenix
#

And yea, that's where u would say to learn coding discord bots from scratch
And that's why I would say I'd rather not @amber fractal lol
I feel like that's the main debate going on rn

languid dragon
#

But for others, its just for the fun and to get a bot of their own to do things they want it to do

sinful lotus
#

but I would credit dbm for simple bots fot private users

#

for* private purposes

#

for public, I wont

languid dragon
#

I wouldn't recommend it for public use but it works

sinful lotus
#

yes I agree with that, if you would develop a public bot, knowledge of programming lang is a must

languid dragon
#

or at least if you're designing the bot to be large

lofty hamlet
#

Hi

#

Who can help me ? :

#

I want :

#

Make a top of my json who content : {"Aqua":7,"Magma":111,"Rocket":25}

#

How can I do ?

marble needle
#

would you mind rephrasing your question, having a hard time understanding what you want to do

hexed cosmos
#

assuming notation? {{"Aqua",7}{"",111}{}}???

sly wyvern
#

Hey, what's the best way of implementing granular permissions for bot commands? I've seen some bots that require users of certain commands to have certain roles, but that only allows somewhat limited granularity since that's not really feasible for more than just one or two permissions.

#

But doing it through an internal permissions DB can also gets unwieldy since now you're trying to configure the potentially dozens of permissions through a bot command interface.

amber fractal
#

Have an array of ids of people who can use a specific command?

sly wyvern
#

That brings it back to the same problem though, since then you have to populate your array database with each user's ID and all the permissions you want to grant them, which is also unwieldy.

amber fractal
#

How else do you expect to do it?

sly wyvern
#

I don't know, that's why I was asking.

knotty steeple
#

permission system

#

either have a db or dont do it

#

or just use roles

#

idk

proper ember
#

For one of my bots, I had it store roles into the guilds. Commands were set to have permission levels themselves and would be checked against the role of the user in question based on the guild it originated from.

earnest phoenix
#

1/10 unoriginal

#

thanks

#

šŸ˜‚

proper ember
#

Oof

amber fractal
#

Well atleast it isnt a lie

red mountain
#

Any one got any bot starter code?

marble needle
#

most libs have a "get started" section in their documentation that provides the bare minimum to get it running

#

alternatively you could write it yourself

red mountain
#

thx

#

Im going to start up a bot running on my raspbeerry pi 3 using discord.js please dm some code or i will just start from beginning again

earnest phoenix
#

nobody will spoonfeed you code

#

we encourage "think with your brain" not "think with my brain"

red mountain
#

ok and gg on that quote :;

#

šŸ˜‰

earnest phoenix
#

learn how array indexing works

red mountain
#

ik

#

also if you want a discord.js bot i have a npm repo if you want it it is very basic

#

why is my name like this???

smoky spire
#

Because of the bracket in your name

earnest phoenix
#

^, it makes you appear on top of the member list making you hoist

red mountain
#

ill change the brackets

#

Can i have my name back to @red mountain please back to original

#

not hoister no hoisting but to Carreto

#

thx

earnest phoenix
#

ask a mod

earnest phoenix
#

provide your lib and language

#

discord.js

tawny crescent
#

For anyone using the DBL NPM package, what are they expecting in the webhookServer key for the options object

inner jewel
earnest phoenix
#

okay fixed āœ…

split hazel
#

I'm pretty new to html. Anyone know how to make it so when someone sends link, it sends a custom embed like one above?

sick cloud
#

thats ogdata

split hazel
#

Thanks

copper wraith
#

I need help

#

Does anyone know if you can make this message embed blue?

bright spear
#

@copper wraith always say what lib and version

drowsy rain
#

looks like async

copper wraith
#

Python

#

Does anyone know on how to add color to that embed?

peak bloom
#

does ,color=0xFF0000 or whatever else not work

#

what did you try

copper wraith
#

Yes

#

I tried it at end & after description

#

just gives me errors

opaque eagle
#

Does there happen to be a tool/method to add/remove sensitive information from Docker ENVs prior to commit?

peak bloom
#

oh it's colour @copper wraith

#

wait no color works too

#

what error do you get

copper wraith
#

where should I insert it in?

#

After " at description

peak bloom
#

no because the description doesnt end at "

#

the description is "...".format(...)

#

all one thing

copper wraith
#

So, where should I try inserting it in?

peak bloom
#

anywhere it's valid

#

again what error

copper wraith
peak bloom
#

..is that not outside of the bot.say() and the discord.Embed()

#

it's a part of the embed, put it in the embed

copper wraith
#

like that?

peak bloom
#

what?? that's not in the embed that's in the .say() and now you're no longer executing discord.Embed()

copper wraith
quartz kindle
#

i dont know d.py, but im pretty sure its embed=discord.Embed(title="etc",color="etc",description="etc")

copper wraith
#

For the color it's color=0xB40404

#

?

ruby dust
#

can you send the full code in code block, not as an image

copper wraith
#

Yep

#

temp = await bot.say(embed=discord.Embed(title="etc",color="0xB40404",description="etc")(title="Current time in Paris:",description="{0}:{1}:{2}".format(int(now.hour),now.minute,now.second)))

#

How do you make that code say like current time in paris in "RED"

lusty dew
ruby dust
#

oh god, there are multiple mistakes

lusty dew
#

I have done reaserch and I can't seem to figure out how to fix it

grim aspen
#

i see it too

hushed berry
#

did you add the mongodb repo? @lusty dew

ruby dust
#

first, you are using an outdated library, there are 2 versions of discord.py, the old one is async and the updated is rewrite

lusty dew
ruby dust
#

second, consider learning python first before doing a discord bot

copper wraith
#

Wait that not my orangal one

#

temp = await bot.say(embed=discord.Embed(title="Current time in Germany:",description="{0}:{1}:{2}".format(int(now.hour),now.minute,now.second)))

lusty dew
#

orangal?

copper wraith
#

Original

lusty dew
#

Also pretty sure that is still wrong

#

I don't know much python though

copper wraith
#

Works tho but not in color.

lusty dew
#

you didn't assign a color?

copper wraith
#

I tried, but gave errors & some didn’t which still didn’t work

lusty dew
#

@copper wraith Learn the language first :)

grim aspen
#

what language is he using?

lusty dew
#

python I think

ruby dust
#

literally all of your mistakes are just terrible syntaxes, which just makes me want to tell you to learn python first

lusty dew
#

Do it I dddid

#

did*

#

lol

#

Isn't he using async?

hushed berry
#

@lusty dew did you install the correct repo for your ubuntu ver?

ruby dust
#

yes

lusty dew
#

Yea

#

14.0.4

#

14.04*

ruby dust
#

bad python knowledge + outdated library

hushed berry
#

oh jeez šŸ¤” that seems old

ruby dust
#

nik isn't certified anymore?

hushed berry
#

yeah oliy decerted me šŸ˜Ž

lusty dew
#

Oh wait

#

I used the wrong repo fuck

grim aspen
#

yeah, please get a tutor to teach you python before you attempt at a bot

lusty dew
#

I read my release wrong

grim aspen
#

late message

lusty dew
hushed berry
#

which one are you actually using

#

16?

lusty dew
#
  1. something
hushed berry
#

yeep

lusty dew
#

Skirt

hushed berry
#

thatll do it

#

skrrt skrrt skrrt

lusty dew
#

Lol

#

Well shite

#

Still isn't working

#

Cough cough Nik

#

šŸ‘€

#

need help again

summer delta
#

My bot was muted and I've made changes to it, how do I request unmute?

amber fractal
#

You yeet a mention at an online moderator and give them your bot's id

summer delta
#

okay, ty

lusty dew
#

@hushed berry sorry for ping

#

But it still won't install mongodb-org

#

even with the proper repo

hushed berry
#

I'm not sure then, friend

lusty dew
#

Rip

#

Sigh

summer delta
#

Hello @coral trellis , I've made new change to my bot could you check to make sure if I'm able to have my bot unmuted now?
BotID: 403402614454353941

hushed berry
#

sorry im not a mod

summer delta
#

oh

#

Apologies I misread

sick cloud
#

nik was a mod

hushed berry
#

edited messages dont tag people

#

@summer delta

summer delta
#

oh

ruby dust
#

hey, don't mock people from the past

summer delta
#

xD

sick cloud
#

i was a mod too

summer delta
#

Hello @coral trellis , I've made new change to my bot could you check to make sure if I'm able to have my bot unmuted now?
BotID: 403402614454353941

coral trellis
#

One moment

#

Next time ask in #general please, Done šŸ‘

summer delta
#

Thank you

bright marsh
#
  const logs = message.guild.channels.find(channel => channel.name === "logs");
  if (message.guild.me.hasPermission('MANAGE_CHANNELS') && !logs) {
    message.guild.createChannel('logs', 'text');
  }
  if (!message.guild.me.hasPermission('MANAGE_CHANNELS') && !logs) { 
    console.log('The logs channel does not exist and tried to create the channel but I am lacking permissions')
  }  
  const entry = await message.guild.fetchAuditLogs({type: 'MESSAGE_DELETE'}).then(audit => audit.entries.first())
  let user = ""
    if (entry.extra.channel.id === message.channel.id
      && (entry.target.id === message.author.id)
      && (entry.createdTimestamp > (Date.now() - 5000))
      && (entry.extra.count >= 1)) {
    user = entry.executor.username
  } else { 
    user = message.author.username
  }
  logs.send(`A message was deleted in ${message.channel.name} by ${user}`);
})```
#

I add this logs feature to my bot but it's not working

#

I deleted a few text and nothing happened

#

every thing else works

peak bloom
#

audit logs take an indeterminable amount of time to generate after a message deletion

#

chances are the correct audit log isn't there when the event fires

#

you can add some console.logs to confirm

bright marsh
#

Thank you

#

Lol now I deleted something I shouldn't have

#

Welp now I AM ******

#

I'm really triggered rn

bright marsh
#

I tired adding a webhook feature to my bot but it's just not working

#

I give up on the web hook

upbeat maple
#

😦

bright marsh
#

Well I can make webhook bots but yeah

restive bough
#

why don't you do it then

bright marsh
#

I did

#

I just like to make the bot like have it so it can make copies of what I want onto other servers

#

so it's easy

bright marsh
#
 let tomute = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
  if(!tomute) return message.reply("Couldn't find user.");
  if(tomute.hasPermission("MANAGE_MESSAGES")) return message.reply("Can't mute them!");
  let muterole = message.guild.roles.find(`name`, "muted");
  if(!muterole){
    try{
      muterole = await message.guild.createRole({
        name: "muted",
        color: "#000000",
        permissions:[]
      })
      message.guild.channels.forEach(async (channel, id) => {
        await channel.overwritePermissions(muterole, {
          SEND_MESSAGES: false,
          ADD_REACTIONS: false
        });
      });
    }catch(e){
      console.log(e.stack);
    }
  }
  let mutetime = args[1];
  if(!mutetime) return message.reply("You didn't specify a time!");

  await(tomute.addRole(muterole.id));
  message.reply(`<@${tomute.id}> has been muted for ${ms(ms(mutetime))}`);

  setTimeout(function(){
    tomute.removeRole(muterole.id);
    message.channel.send(`<@${tomute.id}> has been unmuted!`);
  }, ms(mutetime));

}

module.exports.help = {
  name: "tempmute"
}```
#

I have this but the time for the mute isn't working

#

it just gives them the roles

#

and doesn't show the template

#

really doesn't even mute them

late hill
#

Your tomute var

#

Isn't what you want it to be

#

You put an expression

#

Which means it'll be true or false

bright marsh
#

so what do I have the change exactly @late hill sorry I haven't slept

#

in almost 24hrs

earnest phoenix
#

does it add the role?

#

@bright marsh

bright marsh
#

Yes

#

but that's all it does

#

*mute @ user reason

#

that works

#

wait

#

mute @ user time

#

that works

earnest phoenix
#

so what's the problem

bright marsh
#

it doesn't remove the role when the times up

mossy vine
#

any errors?

bright marsh
#

and they can still text and etc

#

nope

earnest phoenix
#

so you made this code but don't understand it yourself

#

hmm mmLol

bright marsh
#

well I watch tutorials

#

And tweak it here and there

restive bough
#

why do people use an ms function

#

šŸ™„

#

that's just stupid

earnest phoenix
#

ye..

restive bough
#

you should learn ms

#

it ain't even that hard

#

1000 ms = 1 second

earnest phoenix
#

hahaha

bright marsh
#

lol

restive bough
bright marsh
#

well it makes use feel smart

restive bough
#

how?

earnest phoenix
#

no it's not smart to not know how milliseconds work

mossy vine
#

using a function to convert time into ms

bright marsh
#

and some times it doesn't work like that

restive bough
#

use an E for 0

#

for example

#

1000 = 1E3

bright marsh
#

Exactly

#

I give up

earnest phoenix
#

no

#

u can just use a setTimeout

bright marsh
#

hmmmmm

#

that works but how

#

It's 3 am for me

#

I'm kinda learning on the way with this

grim aspen
#

i know node.js

#

first off it looks like eventFunc.run wasn't defined as a function, i am most likely wrong though

still rune
#

@grim aspen Do you want to take a look?

grim aspen
#

hold on, going to ask a friend

still rune
#

It seems right

fs.readdir("./eventos/", (err, files) => {
  if (err) return console.error("[ERRO] " + err);
  files.forEach(file => {
      let eventFunction = require(`./eventos/${file}`);
      let eventName = file.split(".")[0];
      kitsunemi.on(eventName, (...args) => eventFunction.run(kitsunemi, ...args));
  });
});```
earnest phoenix
#

mmm

still rune
#

help?

grim aspen
#

checking in my own application

earnest phoenix
#

i never use kitsunemi function

restive bough
#

change eventFunction.run() to eventFunction()

still rune
#

kitsunemi is my client

sick cloud
#

you should bind the event

still rune
#

ok

#

1m

sick cloud
#

<client>.on(eventName, event.bind(null, <client>))

sinful lotus
#

I never thought of that idea

opaque eagle
#

are u tryna bind an event to a function?

grim aspen
#

eventos is spanish

sick cloud
#

it's basically function.bind(null, client)

#

but it works more effectively

opaque eagle
#

Just do this: js client.on(eventName, (...args) => function(...args));

sick cloud
#

no

still rune
sick cloud
#

binding is better, and that doesn't guarantee it to work

lofty hamlet
#

Hi
Who can help me ? :
I want :
Make a top of my json who content : {"Aqua":7,"Magma":111,"Rocket":25}
How can I do ?

mossy vine
#

???

lofty hamlet
#

The command would trirai the number of points of each team and display them by order of clasement

mossy vine
#

uh

#

sorting algorithm?

lofty hamlet
#

Yep

mossy vine
#

i mean

#

use a sorting alogrithm

lofty hamlet
#

Just a for

mossy vine
#

yes

lofty hamlet
#

How i can do ?

mossy vine
#

use a sorting algorithm

lofty hamlet
#

I have a hole memory

#

Yep so ?

mossy vine
#

use. a. sorting. algorithm.

lofty hamlet
#

Yes i know this

#

But how i can do ?

mossy vine
#

you implement a sorting algorithm in your language

lofty hamlet
#

I know this 😢

mossy vine
#

then whats the problem?

lofty hamlet
#

So, thanks you like even

mossy vine
#

what language are you using

#

@lofty hamlet

lofty hamlet
#

js

mossy vine
lofty hamlet
#

bloblul thanks you šŸ˜‚

mossy vine
#

thats all you fucking had to do s my h

lofty hamlet
#

I know but it's because I had a problem but let's say it's good, thank you

clever wave
#

Hi Help Me

#

(node:152) DeprecationWarning: ClientUser#setGame: use ClientUser#setActivity instead

#

What's the problem?

harsh nova
#

It literally told you the problem

clever wave
#

Please Can You Help Me Out

grim aspen
#

put ClientUser#setActivity

#

🤦

dusky steeple
#

Can someone help me set this up so it will ignore spaces in server names. right now it throws and error because of the space in servername.

query("INSERT INTO server_settings (server_name, server_id, prefix, modlog_channel, mod_role, admin_role, welcome_channel, welcome_message, welcome_enabled, leave_channel, leave_message, leave_enabled, level_messages, invite_filter_enabled, invite_whitelist, swear_filter, swear_words, log_deletes, log_newmember, log_commanduse, donot_announce, send_help, enabled)" +```
earnest phoenix
#

sanitize your input

ruby dust
#

@dusky steeple if the column is defined as TEXT datatype, then the value can be inserted between 's, but make sure to escape them in strings

dusky steeple
#

its a varchar

ruby dust
#

I'm not familiar with that

dusky steeple
#

@ruby dust that way works with varchar also ty šŸ˜„

dull bobcat
#

@earnest phoenix What library you using?

earnest phoenix
#

Discord.Js @dull bobcat

slim heart
earnest phoenix
#

wot

amber fractal
#

Wait didnt you make a module called cancer?

#

lmao

dense dove
#
    let upvotes
    dbl.getBot(client.user.id).then(bot=>upvotes= bot.points)
#

Why does upvotes return undefined? lol

#

@amber fractal

amber fractal
#

its mostlikely logging poinst before the promise if fulfilled

#

points*

#

put the console.log(upvotes) inside of the .then maybe

dense dove
#

u were right, thanks @amber fractal

amber fractal
#

mhm

sly wyvern
#

Well, just finished submitting my bot. I probably should expand the admin commands to make fixing broken character sheets easier, but at least it's stable now.

#

Took a bit of work to figure out how to make a player's default character selection per-server rather than global, since originally I'd been using their user ID as my database primary key.

amber fractal
#

you can do guildid-userid

#

as a key

sly wyvern
#

Yeah that's what I ended up with.

#

I started writing the bot three days ago Monday, so honestly I'm just glad I was able to get it to work since I need it for a roleplaying session this Saturday

dense dove
amber fractal
#

Well

#

thats mobile

#

isnt it?

dense dove
#

they both are in mobile mode

amber fractal
#

You'll need to add something for mobile

#

because dbl isnt the best with it

dense dove
#

even with the website on pc, the colours and stuff dont come out right

amber fractal
#

Well probably because they are being overwritten

dense dove
#

i need to add a bunch of !important

amber fractal
#

Thats what I did