#development

1 messages · Page 684 of 1

slim heart
#

Ye

barren crest
#

but its invalid form body

slim heart
#

Send the full error after you updated it with that

#

After update

barren crest
#
(node:20960) DeprecationWarning: Collection#filterArray: use Collection#filter instead
(node:20960) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
name: Could not interpret "{u'type': u'text', u'name': u'\U0001f30dglobal\U0001f4ac'}" as string.
    at item.request.gen.end (C:\Users\\Desktop\\Discord Bots\ChatHop\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15)
    at then (C:\Users\\Desktop\\Discord Bots\ChatHop\node_modules\snekfetch\src\index.js:215:21)
    at process._tickCallback (internal/process/next_tick.js:68:7)
(node:20960) 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)```
#

sexy

#

thats after update

slim heart
#

So what’s your new code

barren crest
#

That is it

#

old code wasnt obj

#

but was decap

slim heart
#

Send the actual code you have in there now

barren crest
#
message.guild.createChannel('global', {type: 'text'})```
#

in docs says to do like dat

#

but same err

slim heart
#

Try and do .create("global", "text")

barren crest
#

thats what i used to do

#

but decap warning

#

so trynna do the "NEW" way

slim heart
#

Have you updated djs?

#

Cuz it seems to be an issue that’s been fixed

barren crest
#

hm ill update again

slim heart
#

Ok

barren crest
#

mk all gud

#

😄

slim heart
#

It worked?

barren crest
#

yeah

slim heart
#

👍

barren crest
#

🙂

#

KAHOOT

frosty light
#

how do i put my bot in this server?

grim aspen
jolly notch
#

What does the other owners mean?

west spoke
#

other developers of the bot

jolly notch
#

So the website owner of the bot is the one who registers it?

#

website meaning the one who asked for it to be added toDBL

#

since I am being hired to make a personalised discord bot for a server

#

I don't want to own it incase I get banned or deleted

#

I want to co-own it but still be able to add it to sites

amber fractal
#

if your account is deleted all of your applications will cease to exist soon after

earnest phoenix
#

unless the bot is a teams app

earnest phoenix
#

@earnest phoenix won't the team get terminated too if the owner of the team is deleted?

carmine oracle
#

I need someone to make a fake Mod Bot

#

The goal of this Bot is to test out if a Mod will try and kick everyone out

#

So when they do the kick out command it seems like it works but really doesn't

uncut stirrup
#

Why would you even need that? if you have suspicions that someone will do that simply don't have them as mod.

west spoke
#

I'll do it if you pay me

#

we don't make bots for free

#

and you are gonna need to host it

carmine oracle
#

@uncut stirrup I banned the last mod that booted 95% of my members last qeek

uncut stirrup
#

mod's in my eyes should have confirmation with an admin before kicking someone so the admin actually does the kicking not the moderator.

carmine oracle
#

I'm just putting out the idea for a Fake Mod Bot

uncut stirrup
#

the moderator just moderates and helps keeps the peace in the discord server.

carmine oracle
#

If I where to pay for a bot I would have it do other stuff

uncut stirrup
#

Yeah but like @west spoke said you would need to host it and pay for it.

west spoke
#

^

carmine oracle
#

@uncut stirrup I'm just throwing out an idea

#

Also I came here just incase one of you knew of a bot that already does this

#

I know I fucked up how I worded it

#

I should have said anyone know of a bot

uncut stirrup
#

Technically any bot with moderation functionalities can do this. You just say the bot can kick and ban users but dont give the role the moderator has permission to execute those commands.

carmine oracle
#

Very true

#

I'll just tell the new mod group they can kick people but only give them the ability to mute

#

*Problem Resolved if they Kick they had Ill intentions

cosmic orchid
#

hello

#

how is everybody?

#

doing well today?

earnest phoenix
#

yes, you need help?

barren crest
#

For the bot page can we add custom meta tags?

west spoke
#

Yes

barren crest
#

ooh rly?

#

are we allowed to?

west spoke
#

Yes

barren crest
#

it can alter the advertising

twin kestrel
#

Hello everyone!

I am programming a command to give all the members of the server a role and I receive this error: "Error: Adding the role timed out.".

I'm using discord.js

barren crest
#

@loud salmon

west spoke
#

@twin kestrel api abooooose

#

wee wooo weee woooo

loud salmon
#

@twin kestrel not allowed. Please dont use that feature

twin kestrel
#

Hmm

loud salmon
#

@barren crest no you cannot alter the advertising in any way

barren crest
#

can i add meta tags thow?

#

idk if it alters a lot

west spoke
#

I thought you could

barren crest
#

just search results

west spoke
barren crest
#

for my page

#

it will alter

earnest phoenix
#

@twin kestrel hm that's normal, the ratelimits for adding role is 1/1s

cosmic orchid
#

why wont my bot commands work?

barren crest
#

ima take it as a No 😄

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

cosmic orchid
#

uh

#

nobody gonna help?

twin kestrel
#

Okay, I will cancel the command programming if they tell me it is an abuse of the API

west spoke
#

@cosmic orchid what lang

cosmic orchid
#

uh nvm

west spoke
#

be patient

earnest phoenix
#

So you can do a roleall command but you need to restrict the command, add 1 role per seconds basically a bot can add 5 role per second

cosmic orchid
#

ill try fix it

#

.py

west spoke
#

k, what version

slender thistle
#

Technically the ratelimit for role assignments is 10/10s

cosmic orchid
#

ill check

west spoke
#

async or current

earnest phoenix
#

yes so 1/1s

west spoke
#

No

slender thistle
#

Not really the same but eh

west spoke
#

you can do 10/s

cosmic orchid
#

3.6.5

west spoke
#

ight I have no idea

cosmic orchid
#

v3.6.5

west spoke
#

@slender thistle

slender thistle
#

What's the issue even

west spoke
#

idk rewrite

slender thistle
#

Discord unfuck yourself ty

west spoke
#

^

#

"why wont my bot commands work?"

cosmic orchid
#

oh no

#

bad news

west spoke
#

Have you done it correctly?

cosmic orchid
#

the only command that worked isnt working

west spoke
#

Wdym?

#

e.e

cosmic orchid
#

^test^

#

^r

slender thistle
#

Send your code

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

@cosmic orchid show your code

west spoke
#

^^^^^

slender thistle
#

Are you sure the bot is running

earnest phoenix
#

Hide token if possible

#

If you have all in your index

cosmic orchid
#

wdym redo the bot?

#

recode it?

slender thistle
#

Just show your bot's code

west spoke
#

^

#

As a file

slender thistle
#

Not recommended

west spoke
#

eh

cosmic orchid
#

hm

west spoke
#

he likely cant send it as plaintext

cosmic orchid
#

oh wait

west spoke
#

as a message

earnest phoenix
#

You have all your code in your index? @cosmic orchid

cosmic orchid
#

how come the !help command works when i open it?

#

like

slender thistle
cosmic orchid
#

uh

#

when i run module

#

wdym

slender thistle
#

kilo please send bot code

west spoke
#

are you using cogs

cosmic orchid
#

wdym by that?

west spoke
#

just send it

earnest phoenix
#

we can't help you if you don't send your bot code

cosmic orchid
#

cogs and index?

west spoke
#

just send your bot's code

cosmic orchid
#

k

#

wait uh

#

dang it

#

my C+P wont work

#

nevermind

#

i will rewrite it

west spoke
#

just. Send. It.

#

reeeeee

#

you asked for help then didnt give us anything to help with

slender thistle
#

Kilo, how do you expect to get help when you don't help us help you?

west spoke
#

^

cosmic orchid
#

ill rewrite it tho

slender thistle
#

Meh whatever

#

You don't wanna get help, it's your call

west spoke
#

^

warm marsh
#

How can I use JDA without using eclipse or another ide?

loud salmon
#

@warm marsh uh, what do you mean by that

warm marsh
#

I'm new to Java so I might be a little brain-dead with the technicalities. I mean, How can I setup JDA without using an IDE.

#

I'm just using nano.

loud salmon
#

ah

#

never used java without any buildscript / dependency manager so I'm no help mmulu

#

any particular reason why you stick to nano?

warm marsh
#

VPS. I can't be bothered installing software just to edit a file.

loud salmon
#

uh, the way me and a few other friends (which I assume is the best way to do it, natan correct me if i'm wrong), just develop on our computers at home, build a .jar file which contains all dependencies, and upload that

#

and run it with a process manager using java -jar bot.jar and such

#

I've never heard of anyone putting their uncompiled source files in java on a vps

warm marsh
#

Ah main reason was because don't have anything installed on this PC. Just using SSH.

loud salmon
#

oof

#

yea if you dont want to use an ide to build a jar thats gonna be a bit difficult

warm marsh
#

Welp, What do you recommend as an ide?

cosmic orchid
#

how do i code a bot that automatically bans people?

#

like an anti-cheat bot?

#

like if i do

#

!setup

#

and then it can setup the anticheat

#

so it bans peoplew ho break the ruels

warm marsh
#

Code one?

onyx summit
#

U Take any language you like, and code it

loud salmon
#

@warm marsh I personally love using intellij. Its a bit on the bloaty side but the convenience is good

onyx summit
#

if you need help with specific problems, come back and ask

cosmic orchid
#

uh

#

who asked u?

loud salmon
#

yikes kilo

#

be nice please

#

we dont spoon feed code here

onyx summit
#

You, you literally asked anyone in the channel

#

You addressed nobody

earnest phoenix
#

depends on what your definition of "break the rules" is

west spoke
#

^

cosmic orchid
#

i wish i could code a bot with html..

#

rip my wish lol

loud salmon
earnest phoenix
#

i can't differentiate whether this is trolling or a genuine statement

loud salmon
#

@earnest phoenix either way he isnt getting his bot mooseyLul

earnest phoenix
#

lol

west spoke
#

css

#

you can code a bot in css

earnest phoenix
#

write pure assembly

west spoke
#

oh god

lusty dew
#

Does anyone know how I can use express to implement oauth2? I’m trying to find the right thing in the docs on how to do it but I’m just not finding it.

earnest phoenix
#

express is irrelevant to oauth as oauth can be implemented on any webserver

lusty dew
#

Okay I keep getting told different things :/

#

I’m trying to implement discord oauth2 and I was told I could use express to do so.

sleek mantle
lusty dew
#

Didn’t know I had to use something separate

earnest phoenix
#

you don't

#

it's just a package that handles a lot of oauth flow for you as it's easy to mess up implementing oauth yourself and have huge security issues

lusty dew
#

Oh.

late hill
#

guild.memberCount @sleek mantle

warm marsh
#

Thanks! Spider.

sleek mantle
#

oh, i tried it with an ? at the end it didn't work, could have find the solution myself 😅 but thanks wesley ❤

idle basalt
#

... what?

topaz fjord
#

@earnest phoenix tbh I prefer passport since it has interchangable modules

earnest phoenix
#

not experienced in node

#

but from what i'm reading, passport seems very extensible

#

yeah it would probably be smarter to use it instead

lusty dew
#

Hm?

#

@earnest phoenix how would I get the access token url

earnest phoenix
#

uh what

lusty dew
#

Discord has a section for oauth2 urls and that was one of em

#

But it just said token url

earnest phoenix
#

it's for exchanging codes for access tokens

#

aswell as refreshing the token

lusty dew
#

Wait what

earnest phoenix
#

after the user has authorised your app they'll be redirected back to your redirect uri with a ?code= query string, and a state query string if you provided one in the authorization url (which you should!)

#

you can use that code to exchange for an access token which is the token you're going to use to make API requests

lusty dew
#

Uhm....okay

#

Thanks ig

earnest phoenix
#

Someone have a good Hosting site

#

Paid or free

onyx summit
#

I can recommend Contabo, especially if you are German.

#

But see the pinned messages, there are plenty of provider (You should get a vps, they are great for most things)

earnest phoenix
#

guys

hushed berry
#

you go to the website

#

and click "Add Bot"

earnest phoenix
#

should i have a website

#

to add it ._.

pale mango
#

no

earnest phoenix
#

for it?

pale mango
#

How would I use the api?

earnest phoenix
gray geyser
#

how make cooldown

#

?

#

help me

#

I had one but it doesn't work right

patent prism
#

Bit vague

#

Like what library are you using?

#

And I just realised that was 2 hours ago

west spoke
#

@gray geyser you would get the time command was used, store it, then check the time each time the command is used, and check if the difference is greater than or equal to your set value.

#

eg let's say my work command had a 300 second timer.

#

I would use that

earnest phoenix
#

if you're on js use timeout

amber fractal
#

Having that many timeouts

#

Not the best idea

#

I have an object with the time they will be able use the command again mapped to their id

#

And if the current time is less than that time give them an error

lusty dew
#

I just do some math

#
  1. Store timestamp when cmd is used
  2. add the timestamp + your cooldown time in ms - today’s timestamp
  3. Check if the result of that math is less then or = to 0 if it is proceed with cmd and write the new timestamp else send error they have to wait the remaining time
#

That’s how I do it at least

hushed berry
#

that does also mean that youre storing an ever-increasing map

west spoke
#

I just store as txt, and once the timer is done, it deletes the file.

#

And just store the timestamp in it

#

not worth adding and removing from a database

hushed berry
#

if i was doing it, id just use set the timestmap in redis with an auto expire or something :p

gritty bolt
#

Is there any reason my bot is going offline when ever it handles an error?

onyx summit
#

What language

gritty bolt
#

Javascript

#

discord.js

#

node

onyx summit
#

are you using libsodium or anything like that?

gritty bolt
#

no

onyx summit
#

or wait, what do you mean with going offline if it handles an error?

gritty bolt
#

yes

#

it just stops

#

goes offline for a few seconda

#

and pops back up like nothing happened

onyx summit
#

handle a error? Are you sure you are handling it? And what is the log output?

gritty bolt
#

let me pull it up

#

ive also been getting a spike in error 500s

#

idk why thats happening either though

#

heres an error, its the error 500

#

``` dblapi const err = new Error(${res.statusCode} ${res.statusMessage});
handled yes mechanism
generic

Error: 500 Internal Server Error```

earnest phoenix
#

as the error says, it's a server side error

#

chill and wait, cry and pout, or have a temper tantrum while it sorts itself out

lusty dew
#

@hushed berry no the timestamp just changes but it stays as one thing

hushed berry
#

what? @lusty dew

lusty dew
#

I’m not deleting the timestamp or whatever it just changes from the old timestamp to the new one

hushed berry
#

yeah but you never remove it

lusty dew
#

Yea I don’t see a reason to?

hushed berry
#

so every time a new unique user uses the bot, you store a new timestamp

lusty dew
#

For each user yes

#

I don’t see a reason to remove the timestamp

hushed berry
#

because its a memory leak? 🤔

lusty dew
#

How so?

amber fractal
#

it's just gonna go back in when they use it...

lusty dew
#

It just seems like one unneeded extra step but 🤷

#

I mean it just changes the timestamp to the new one in the better-sqlite3 database

#

I don’t see how that’s a memory leak

gritty bolt
#

@earnest phoenix but im having the same issue with api errors

#

the entire bot shuts down

#

and comes back up

#

making it really unstable

earnest phoenix
#

from discord or from dbl

gritty bolt
#

discord

#

permissions error

earnest phoenix
#

wot

lusty dew
#

Handle permissions then?

gritty bolt
#

the error is handled

earnest phoenix
#

didn't you just say you have the same issue - 500 errors

gritty bolt
#

yeah

#

the bot shuts down

#

on both

earnest phoenix
#

ah

#

you aren't handling your errors properly

gritty bolt
#
    console.log(err);
    let errorembed = new discord.RichEmbed()
    .setDescription("**Error**")
    .setColor("#FF0000")
    .addField("There was an error running the command. Most likely, the bot does not have the correct permissions to run this command.", "Please make sure the bot has the permissions listed when you invite the bot. To find these, go to our invite link, and edit the role titled 'ClockMaster' to contain these permissions.");    
message.channel.send(errorembed)
}``` is my catch code
earnest phoenix
#

more than likely

#

your catch code can still error

gritty bolt
#

then I do a try {} catch

earnest phoenix
#

it needs embed links and send messages permission to properly execute

gritty bolt
#

oh thats a good point

lusty dew
#

What’s the point of making your own catch function if there is already try and catch or .catch

gritty bolt
#

after the catch it runs the catcherror function

earnest phoenix
#

also - instead of try catching permissions errors, why not do permission checks first - that way you don't make a useless request and fill your bucket

gritty bolt
#
        catchError(err, message)
}```
#

im still trying to figure that out

#

something ive tried

lusty dew
#

Uh huh

#

Not that hard

earnest phoenix
#

side question, on which provider are you hosting your bot

gritty bolt
#

think i messed it up though

#

aws

#

ec2 on a ubuntu

earnest phoenix
#

their services seem stable

quartz kindle
#

how are you sending a message?

#

try/catch will only catch sync code, so all promises must be awaited

lusty dew
#

Is it better to use implicit grant or authorization code grant

gritty bolt
#

ive just been passing the message through my function to send it

#

can I just check permissions with an if() statement?

#

instead of all this try stuff would an if() statement suffice?

earnest phoenix
#

kawaiipandaToday at 1:51 AM
Is it better to use implicit grant or authorization code grant
implicit grant is less secure and once the token expires you can't renew it

lusty dew
#

So authorization code grant then?

earnest phoenix
#

i mean, it's up to you, but for me auth code is the way

lusty dew
#

Yea

hushed berry
#

@lusty dew implementing oauth2 yourself is pretty universally agreed upon to be a bad idea

lusty dew
#

Why’s that?

hushed berry
#

because there are a ton of plays to mess it up

earnest phoenix
#

you're bound to mess up somewhere

hushed berry
#

and you really dont wanna mess it up when you're dealing with user's access tokens

earnest phoenix
#

^

#

leads to huge security issues

lusty dew
#

Hm

#

So what would I use then

hushed berry
#

everyone, take this as a reminder to clear your oauth grants for sketchy applications

lusty dew
#

Okay so how would I implement oauth2 then if not myself

loud salmon
#

@earnest phoenix did you do this Belt

earnest phoenix
#

i use asp.net core which has built in middleware for secure oauth authing

#

which allows me just to configure how it works and everything else is handled for me

hushed berry
#

i mean....you linked a lib earlier and said you werent gonna use it

lusty dew
#

Cry linked it to me before but I don’t like how it works.

#

Is that c# @earnest phoenix

earnest phoenix
#

yup

lusty dew
#

Damn

#

I tried learning c#

#

I don’t get it kek

earnest phoenix
#

i love working with OOP languages

lusty dew
#

Where did you learn it from?

earnest phoenix
#

self taught

lusty dew
#

👀

earnest phoenix
#

i took a few courses on codecademy then went on to follow microsoft docs

lusty dew
#

I don’t get a lot of it.

abstract crow
#

Don't really know what I definitely want in the text but anyways what do you guys think so far? Any suggestions? https://vinniehat.is-inside.me/MZxU5F7v.png

Right now I just want to work on the home page until it is really done

lusty dew
#

Plus I never remember any of it when I do try to learn it

earnest phoenix
#

the color scheme is very off @abstract crow

#

the twitter and facebook things need more margin

abstract crow
#

The background and navbar colors were off of coolors

#

The rest were mine so yeah lol

hushed berry
#

the whole thing kinda feels odd

lusty dew
#

I’m focusing on making everything on my web dash responsive

earnest phoenix
abstract crow
#

Ok

hushed berry
#

Groovy's dash is close to its initial release 😎

earnest phoenix
#

is it SPA

hushed berry
#

yeah

earnest phoenix
#

ok i already love it

hushed berry
abstract crow
#

@hushed berry What are you using for that? EJS, React, etc

hushed berry
#

Nuxt

#

which is built on top of Vue

abstract crow
#

Oo gotcha

#

I just started learning React

hushed berry
#

react is pretty good

#

im not designing the frontend btw

#

im just a backend engie lol

abstract crow
#

Does it have stuff like req.session(EJS of cookies)

#

Ah gotcha

loud salmon
#

@hushed berry ugh that looks so fucking snazzy

abstract crow
#

^

loud salmon
#

😩 👌

hushed berry
#

i just broke it with a backend change

#

but its real close

tidal parrot
#

@hushed berry ugh you look so fucking snazzy

hushed berry
#

shut up 😡

lusty dew
#

Mine is gonna look so bad

earnest phoenix
#

im working on linking everything with a backend <-> frontend ws connection

#

so everything is updated real time

lusty dew
#

I don’t even have the color scheme

hushed berry
#

the whole ws thing is honestly a bit much

#

it adds a HUGE layer of complexity

earnest phoenix
#

for a music bot, yeah

hushed berry
#

i mean like

#

we'll use it for the player stuff

#

but getting there is gonna be a challenge

#

pending a complete rewrite of the bot

earnest phoenix
#

thankfully asp.net core offers SignalR

#

easy websockets 🙃

hushed berry
#

i mean

#

the websockets arent the hard part

earnest phoenix
#

state consistency is

hushed berry
#

yeah

#

making it scale

#

etc

quartz kindle
#

is it a stupid idea to make a bot run on a decentralized system? lul

#

its nice to be able to run it with pm2 clusters, but no access to broadcastEval nor shardmanager

#

maybe using a message broker hmm

hushed berry
#

@quartz kindle i mean

#

i do it rn

#

the best solution is just to remove the need for intershard comms

earnest phoenix
#

i made it realtime + it reuses user data from cache so getting data on them from just an id doesn't take long

lusty dew
#

It no loading lol

#

Lmao the bot name @earnest phoenix

earnest phoenix
#

hey, quality

lusty dew
#

"Pussy grabber"

earnest phoenix
#

i made my api work completely in compliance with OOP

#

e.g this, everything is returned in objects and displayed in json

lusty dew
#

Hmm

abstract crow
#

@earnest phoenix Are you using any js framework or library? That is something I want to do in the future but oauth2 with react I haven't done yet

opaque eagle
abstract crow
#

Rip me

earnest phoenix
#

Code : js .addField("![join](https://cdn.discordapp.com/emojis/616197720956338176.webp?size=128 "join") `welcomeChannel` :", `But : Permet d'envoyer un message dans un salon spécifique quand un utilisateur rejoind ou quitte le serveur.\nStatus : \`${welcomeChannelStatus}\``)

but i see this in the embed

#

how to remove this think3d

opaque eagle
#

Huh weird lol

#

Did you have two of them there before and then remove it?

earnest phoenix
#

yes ^^

opaque eagle
#

Did you re-start your bot code after making that change

#

Like stop the bot and then run the start script again

earnest phoenix
#

Still yesterday there was the same code but I did not see his

#

Yes, I restart it at least 10 times

twilit rapids
#

Did you actually save the file

earnest phoenix
#

yes

opaque eagle
#

This is a community hangout for programmers who make Discord bots, we don’t provide any help or support for end users. @plucky pelican

plucky pelican
#

ouh sry

serene cobalt
#

ask the dev

opaque eagle
#

I’d search on our site and see if Spotify Bot has a support server, they can probably help you.

earnest phoenix
#

how to start

#

help

wheat jolt
#

what do you mean

earnest phoenix
#

i mean, how to do bot

#

is there any tutorials?

wheat jolt
earnest phoenix
#

i read

trail dagger
slender thistle
#

It's literally just a newline

trail dagger
winged thorn
#

\n does work

trail dagger
#
`None`\n`{str(getprefix(ctx.guild))}setautorole <RoleID>`
earnest phoenix
winged thorn
#

\n definitely works for me

earnest phoenix
#

wyf

winged thorn
#

the error clearly says what's wrong

trail dagger
#

\n doesnt work for me, hm

winged thorn
earnest phoenix
#

lol, file is exist

#

wtf

slender thistle
winged thorn
#

\n definitely works

trail dagger
#

must be something in my code then

winged thorn
#

Worked for me too

trail dagger
#

Yea i saw

slender thistle
#

@late hill Mind contributing to this?

late hill
trail dagger
#

This is the thing```
None\nYo

#

Without the ` on yo it works

#

but with Yo it doesnt

quartz kindle
#

\n is supposed to be part of the string

#

not separate

opaque eagle
#

Why do u have backticks between the new line

quartz kindle
#

"None\nYo"

opaque eagle
#

^

late hill
#

If you put 2 inline code blocks in one message

#

It becomes retarded now

#

??

slender thistle
trail dagger
#

The thing is, that worked yesterday

slender thistle
#

backticks don't matter

opaque eagle
#

Oh

late hill
#

Discord changed something

#

Because all my formatting with inline code blocks

#

is fucked now

opaque eagle
#

first and second

late hill
opaque eagle
#

Two inline code blocks right there

late hill
#

try multiple lines

valid frigate
#

`bruhmoment

#

oh shit hes right

opaque eagle
#

first
second

#

What like that?

valid frigate
#

manually create a new line i guess

late hill
#

`firstsecond

trail dagger
#

Discord must have done something

valid frigate
#
`bruh`
`moment`
opaque eagle
#

Mine works fine

trail dagger
#

no it didnt

late hill
trail dagger
#

u ended up with a ` at the end of ur last try

opaque eagle
valid frigate
#

they must have messed up their regex parser :hyperlul:

late hill
#

I mean

opaque eagle
#

It looks fine to me

late hill
#

It's just something they messed up

#

Should I even try to fix it then

#

If it's not rly on my side

opaque eagle
#

Idk what you guys are confused about

#

Can someone fill me in

#

I sent a screenshot above

#

It looks fine

late hill
#

Look at my screenshot

quartz kindle
#

here it looks like this

trail dagger
#

ur on mobile

late hill
trail dagger
#

ur on mobile lol

opaque eagle
#

Oh that may be it @trail dagger

trail dagger
#

yea

slender thistle
#

It looks fine on phone

#

So yeah

trail dagger
#

So pc version i fucked up

quartz kindle
#

maybe phone is outdated

opaque eagle
#

What doesn’t Discord use React Native tho

#

So most of the codebase should remain the same, since they work with the same langs

valid frigate
#

you can use inspect element so id assume react native

opaque eagle
#

Not on desktop, I’m talking about mobile

#

Electron on Desktop and React Native on Mobile, iirc

#

Why don’t they make a native app, that’s so much better

quartz kindle
#

because they'd need to learn a different lang and they dont feel like it?

#

lul jk

valid frigate
#

what is discord mainly coded in

opaque eagle
#

Web technologies, HTML/CSS/JS @valid frigate

#

I’d try talking to those people about the code blocks

late hill
#

So I tested a bunch of stuff

#

It breaks when you chain them

#

If there's a character inbetween

#

It won't break

#

a, b

#

a,
b

#

Just wondering if this is how it's gonna be now

#

Or if it's just a bug

trail dagger
#

Hope it is just a bug

craggy gate
#

alcala

abstract musk
#

How do I get my bot up whit put have to create those files on my laptop then opening command prompt and all that

late hill
#

update: It also breaks if it's chained with a different form of markdown

abstract musk
quartz kindle
#

@abstract musk you need to program it and run the program

patent prism
earnest phoenix
#

Just wondering, when did you guys start getting traffic in your support server ?

#

@abstract musk wht you use host

#

i use Hosting glitch

#

so ezz

abstract musk
#

wdym @earnest phoenix

earnest phoenix
#

try use glitch @abstract musk

mossy vine
#

glitch wont help a lot if they dont even know how to code omegalul

earnest phoenix
#

@abstract crow react (hooks) for frontend, asp.net core for backend

#

lel

#

.

#
const superagent = require("superagent");

exports.run = async (client, message, args, ops) => {
  
  
  let {body} = await superagent
  .get(`http://random.cat/meow`)
  
  
  let dogembed = new Discord.RichEmbed()
  .setColor('#FAE1DB')
  .setTitle('***Cute Cats :33 :sparkling_heart:***')
  .setFooter('Made by heavenless ☾#5000')
  .setImage(body.file);
  
  message.channel.send(dogembed);
  
}```
#

guys

#

?

#

i tried making cat command

#

it doesnt work

#

idk

mossy vine
#

any errors?

earnest phoenix
#

(node:6948) UnhandledPromiseRejectionWarning: Error: Bad Request at Request.callback (/rbd/pnpm-volume/b143163b-c7b2-4f12-a93f-9a962c8e3ce1/node_modules/.registry.npmjs.org/superagent/5.1.0/node_modules/superagent/lib/node/index.js:857:15) at /rbd/pnpm-volume/b143163b-c7b2-4f12-a93f-9a962c8e3ce1/node_modules/.registry.npmjs.org/superagent/5.1.0/node_modules/superagent/lib/node/index.js:1100:20 at IncomingMessage.<anonymous> (/rbd/pnpm-volume/b143163b-c7b2-4f12-a93f-9a962c8e3ce1/node_modules/.registry.npmjs.org/superagent/5.1.0/node_modules/superagent/lib/node/parsers/json.js:22:7) at emitNone (events.js:111:20) at IncomingMessage.emit (events.js:208:7) at endReadableNT (_stream_readable.js:1064:12) at _combinedTickCallback (internal/process/next_tick.js:139:11) at process._tickCallback (internal/process/next_tick.js:181:9) (node:6948) 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: 6)

mossy vine
#

send the request to http://aws.random.cat/meow instead

earnest phoenix
#

Does it work for discord.js v12 because when I'm in a vocal channel, he tells me that nojs const voiceChannel = message.member.voiceChannel;

twilit rapids
#

voiceChannel has become voice.channel in v12

earnest phoenix
#

ok thx u

magic smelt
#

How can i repair this?
Error:Unhandled Rejection TypeError: Cannot read property 'animated' of undefine d at new Emoji (./node_modules/discord.js/src/structures/Emoji.js:18:27) at new ReactionEmoji (./node_modules/discord.js/src/structures/Reactio nEmoji.js:14:5) at new MessageReaction (./node_modules/discord.js/src/structures/Messa geReaction.js:42:19) at module.exports.run (./events/raw.js:35:15) at runMicrotasks (<anonymous>) at processTicksAndRejections (internal/process/task_queues.js:85:5)
Code:```const { d: data } = event;
const user = client.users.get(data.user_id);
const channel = client.channels.get(data.channel_id) || await user.createDM();

	if (channel.messages.has(data.message_id)) return;
	
	const message = await channel.messages.fetch(data.message_id);
	
	const emojiKey = (data.emoji.id) ? `${data.emoji.name}:${data.emoji.id}` : data.emoji.name;
	
	const reaction = message.reactions.get(emojiKey);
	
	if (!reaction) {
		// Create an object that can be passed through the event like normal
		const emoji = new Discord.Emoji(client.guilds.get(data.guild_id), data.emoji);
		reaction = new Discord.MessageReaction(message, emoji, 1, data.user_id === client.user.id);
	}```
sharp lotus
#

I have no idea I work with Python

mossy vine
#

if you cant help dont respond

sharp lotus
#

lol

#

Im just saying I want to help

lusty dew
#

Hm

#

Yay it doesn’t crash now kek

tall mist
#

how can i change this ```js
const serverQueue = queue.get(msg.guild.id);

lusty dew
#

Wdym by change

#

If you are trying to give the variable a new value use let const can’t be redefined

earnest phoenix
#

just a quick question: is there an way to move a member from a voice channel to another with the help of a command?

#

i just want to know if it's possible

lusty dew
#

I think so not too sure though

#

What lib?

mossy vine
#

yes, it is possible

lusty dew
#

Hm I honestly didn’t know that kek

earnest phoenix
#

me neither

#

well thanks fellas

lusty dew
#

Np

earnest phoenix
#

have a great day

stray garnet
sharp lotus
#

have any ideas how to run my bot 24/7 without a RaspBerry Pi

#

or heroku

#

or anything like that

opaque eagle
#

This applies to both you and whoever posted the previous screenshot: get a VPS.
Here are some suggestions:

#

@sharp lotus @stray garnet @earnest phoenix

stray garnet
#

i dont wanna pay reee

earnest phoenix
#

XDD

#

thx

#

wheres that message sent?

opaque eagle
#

Then have fun troubleshooting that error lol, I’m sure that problem won’t exist if you try it out another computer. @stray garnet

#

It’s in the pins for this channel @earnest phoenix

quartz kindle
#

@stray garnet how did you install node-opus?

#

I believe in glitch you have to install packages from their "add package" button

#

Installing with npm wont work

#

Idk if glitch even supports audio lul

mossy vine
#

nice ads

#

what

stray garnet
#

@quartz kindle console

#

@quartz kindle npm works in console reee

mossy vine
#

glitch does support audio

stray garnet
#

yea

#

as soon i do !play it joins the channel and then this error

#

and an Link got provided

sharp lotus
#

@opaque eagle so I meant a free way

#

cause

#

yeah

#

maybe I can turn my PC 24/7 on

#

u guess

#

but

#

im not rly allowed :/

stray garnet
sharp lotus
#

oh

stray garnet
#

Its not the best but it works

sharp lotus
#

but

#

then

#

they copy my code

#

and steal it

#

and then they do as if it's there bot

stray garnet
#

@sharp lotus they wont

sharp lotus
#

ok

quartz kindle
#

LOL

sharp lotus
#

is an account forced

stray garnet
#

@sharp lotus it works good for me... ok just because i use uptimerobot

sharp lotus
#

but

#

how do I upload my script now

quartz kindle
#

If a hosting company uses your files, thats a major privacy breach and even criminal behavior

#

Of course they cant do that

stray garnet
#

@sharp lotus and why u think so?

sharp lotus
#

im worried XD

stray garnet
#

Ok, basicly.... Use Heroku. or Glitch.

earnest phoenix
#

use local hosting

stray garnet
#

@quartz kindle btw whats with my error

earnest phoenix
#

Always better than free hosting

sharp lotus
#

I'd rather buy a RaspBerry Pi

quartz kindle
#

Did you try installing with their add package button?

stray garnet
#

@quartz kindle yes

#

i installed it with console and button

quartz kindle
#

Try uninstalling from console

#

Install only from button

stray garnet
#

How?

#

to delete it

quartz kindle
#

npm uninstall node-opus -s

stray garnet
#

kk

#

i installed opusscript aswell

#

delete that too?

opaque eagle
#

Replace “Raspberry Pi” with “a regular PC” and you’ve got yourself a pretty ok solution @sharp lotus

sharp lotus
#

no

#

Raspberry Pi is cheap

opaque eagle
#

Exactly, that’s why it’s a bad solution

sharp lotus
#

no

opaque eagle
#

Same with Glitch and Heroku

sharp lotus
#

if I only use it for a bot

#

its ok

opaque eagle
#

Do you have an RPi?

sharp lotus
#

no

opaque eagle
#

Ok

mossy vine
#

cheap isnt always a bad solution

sharp lotus
#

ikr

mossy vine
#

free is more often than not the bad solution tho

opaque eagle
#

Yeah but in this scenario cheap is either RPi/Glitch/Heroku

#

All three of which happen to be sub-par hosting solutions

sharp lotus
#

if im not allowed to use those websites or even a PC turned on 24/7

#

RaspBerry Pi is my only way

opaque eagle
#

I guess, but again you’ll run into some limitations

#

For starters no music bots

sharp lotus
#

nope

opaque eagle
#

And I’m not sure how well it scales

sharp lotus
#

if I take the best version of RaspBerry Pi 4

stray garnet
#

@quartz kindle Missing Perms even tho it has admin

#

reee

opaque eagle
#

Have you tried it? @sharp lotus

sharp lotus
#

no

opaque eagle
#

I’ve tried it with my RPi 3 Model B+ and it didn’t work

sharp lotus
#

btw im waiting like an hour rn for my bot XD

opaque eagle
#

I mean it worked, but the audio wasn’t clear

sharp lotus
#

btw I cant even make my bot a music bot

#

when I make it a music bot, it say I need PyNaCl module

#

if I install it

#

and I import it

#

it says I dont have it installed

uncut stirrup
#

If you want cheap you can always use a £3.59/month vps from OVH.

sharp lotus
opaque eagle
#

They are stubborn about getting a free solution @uncut stirrup

uncut stirrup
#

Host it locally then.

opaque eagle
#

^

earnest phoenix
#

^
^

mossy vine
opaque eagle
#

Preferably with something other than an RPi

#

I’m not saying that because I’m hating on cheap solutions... I’m not. I’ve done it before with my RPi, and I didn’t really like it, so imo it’s not really a feasible option.

#

Also if you have the GitHub Student Developer Pack you can host your bot for like a year and a half

uncut stirrup
#

If you have a debit card or any other bank card you can always sign up to google's console and get £250 free for an entire year. I use that currently for their API system and 1 instance which hosts my bot 24/7 without issues.

opaque eagle
#

Google Cloud Platform has a free forever plan

#

As long as you verify with a card

#

Never tested it before myself, however.

uncut stirrup
#

You can always try Vultr or Digital Ocean. Use one of their codes for free money basically. You can also use AWS but wasn't a fan.

opaque eagle
#

Also about what I said earlier, GitHub Student Dev Pack has free tie-ups with several hosting solutions

#

And the student dev pack is free to get

uncut stirrup
#

I'm currently using a google server but it's like £40/month i'm still using the free credit and it runs my bot with almost 1000 guilds over 150 command 24/7 without an issue. https://img.cakebot.net/7fd0z8v.png

opaque eagle
#

That’s surprising

#

Considering how bad Google is as a cloud provider lol

#

Lots of Discord’s outages mention Google as part of the problem

earnest phoenix
#

in galaxygate the windows server option its a remote desktop server?

#

and whats a root password and hostname

quartz kindle
#

40 a month in google? Wtf

#

My bot was in the google free plan, with only charges for bandwidth above 1gb

#

I was paying like 1$ a month

#

With 1500 guilds

earnest phoenix
#

xd

#

could someone help me with what i wrote above?

quartz kindle
#

Dont get a windows server

#

Unless youre using windows langs

#

Like .NET or C#

earnest phoenix
#

i have a windows server now and i thought just to go with something i know

quartz kindle
#

Hostname is the server name whatever you want

earnest phoenix
#

cuz i think a vps its hard to setup and everything

quartz kindle
#

Root password is the admin password

#

For the admin account

earnest phoenix
#

and i need a mysql db too and i dont think on u get it on every site

#

oh thx

quartz kindle
#

Linux can do all of that

#

And its quite easy to set up

earnest phoenix
#

but i never done this

quartz kindle
#

Neither did i, until i did it

#

Now i know, and my server is nice

#

xD

earnest phoenix
#

ok

quartz kindle
#

A linux vps is a great learning experiencr

earnest phoenix
#

i think ill go with ovh cuz its the cheapest i see

#

i had a remote desktop linux server

#

but with cmd and shit i dont think its that easy

quartz kindle
#

Why do you need remote desktop?

earnest phoenix
#

idk

quartz kindle
#

I mean

late hill
#

Would a server's firewall affect it from connecting to itself in any way

earnest phoenix
#

so just to go with linux server?

#

i think ill go with ovh's server then

quartz kindle
#

Working on linux from a command line is not as hard as it looks, and makes your server much more efficient, its just a matrer of learning and getting used to it

earnest phoenix
#

ok

#

thx

quartz kindle
#

If youre interested in using hosting services and learning to operate them, learning cmd linux is a good thing to invest your time in

earnest phoenix
#

ovh is the cheapest? cuz im not earning at all from my bot atm and i dont know if i want to spend that much money on host that dont worth it

#

ill go with linux then thx

quartz kindle
#

Google vps is the cheapest for starting

#

Free for 1 year, then they only charge for bandwidth if you go with the free forever plan (600mb ram)

#

The most i ever paid on google was like 2$

earnest phoenix
#

but my bot has music commands, and recaptcha verification thats why i need the site to work on nodejs

#

its enough 600mb ram for all that?

quartz kindle
#

It is if you know what you're doing, there are ways of optimising discord.js. but if youre worried then go with ovh

earnest phoenix
#

ok

#

have any cmd linux tutorial to send me? lol

quartz kindle
#

My bot has image generation, and i nevrr had problems with it, bjt idk about audio, i never used audio

#

I mean, linux has a huge ass comunity, you can find information and tutorials everywhere

earnest phoenix
#

ok

#

thx

#

u helped me so much

quartz kindle
#

If you need help with using cmd linux, yoi can always ask here as well

earnest phoenix
#

ok

#

thx

#

ur sure that i can setup a mysql db on linux?

quartz kindle
#

Yes

earnest phoenix
#

ok

quartz kindle
#

As long as its mysql and not mssql

earnest phoenix
#

its mysql

quartz kindle
#

So yes, mysql is cross platform

earnest phoenix
quartz kindle
#

It works basically everywhere

#

Im using ubuntu 18

earnest phoenix
#

ok

#

thx

opaque eagle
#

And if you ever have any Linux troubles you can ask here lol

#

Loads of us are familiar with it

mossy vine
#

arch

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

mossy vine
sage bobcat
#

One message removed from a suspended account.

warm marsh
#

In Java is there an equivalent to .shift from other languages?

earnest phoenix
#

how much time it takes till the server is ready in ovh?

#

when i launch my bot and login via ssh again i can see the console?

opaque eagle
#

it'll be a new session

#

If it's a JavaScript bot, you can use a process manager like pm2

earnest phoenix
#

ok

opaque eagle
#

if its not in js then docker might be ur best bet

earnest phoenix
#

its js

mossy vine
#

pm2 can run literally anything, not just js

warm marsh
#

Nvm, Figured it out.

opaque eagle
#

What's the best resource to learn Java? I wanna self-study for AP Comp Sci, but I don't want to take a separate class for it b/c the programming theory/concepts are the same from other langs, so i just need to know the syntax.

inner jewel
#

i'd recommend systemd (or whatever service manager your distro has) to manage stuff outside docker

#

and docker for (duh) docker containers

opaque eagle
#

lmao

earnest phoenix
#

why cant i see the password in putty im copying and i dont see nothing and i even write it and it sais access denied

opaque eagle
#

What's putty

earnest phoenix
#

ssh software

#

u have something else

#

?

opaque eagle
#

yeah isn't there supposed to be a built-in ssh command in all consoles

#

there's an ssh command in my bash terminal

earnest phoenix
#

idk

#

ill try

opaque eagle
#

p sure zsh fish and all the others have it too

earnest phoenix
#

i cant see the password and i write it or copy it and i cant log in

#

in the cmd too

opaque eagle
#

If it's a programming related question, ask here

#

This is a community hangout for programmers who create Discord bots. I don't see how we can help you with some random bot on the internet.

#

I'd go ask in their support server.

#

We can't help you with other Discord bots.

#

It's like asking a plumber to fix your car.

#

Again, we can't help you with CouchBot.

#

Go there

#

I answered that question before you even asked it, were you paying attention?

stable sleet
#

am i in the wrong place

#

?

opaque eagle
#

Yes, yes you are, like I've told you many times already.

stable sleet
#

oh im really sorry for disturbing you here

opaque eagle
stable sleet
#

yes sir, thank you so much

inner jewel
#

p sure zsh fish and all the others have it too
ssh isn't a shell feature

#

it's just a program

opaque eagle
#

ok

#

why doesn't his shell have it then

#

well idk if his does

#

but some ppl online apparently don't have it by default

#

like how bad of a company/org do u have to be to not include ssh by default

west spoke
#

windows below vista

topaz fjord
#

@opaque eagle you sometimes need to install it

opaque eagle
#

oh

#

where do u install ssh from

topaz fjord
#

You can use the package openssh-client

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

invald format

fiery birch
#

show what you put in

sage bobcat
#

One message removed from a suspended account.

fiery birch
#

the text you wrote

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

fiery birch
#

pff all you mmulu

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

oho

#

thanks

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

mossy vine
#

you do need comma

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

still invalid format

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

fiery birch
#

lmao idk how FeelsKekMan

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

:/

fiery birch
#

comma and a space prolly

sage bobcat
#

One message removed from a suspended account.

fiery birch
#

@earnest phoenix did you try a comma with a space?

earnest phoenix
#

done

#

thanks

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

fiery birch
#

sick

earnest phoenix
#

thanks

#

sage bobcat
#

One message removed from a suspended account.

fiery birch
#

np mmulu

stuck ravine
mossy vine
#

yeah

#

it means you are trying to get the property of an undefined object

stuck ravine
#

Yes, but the bot is still able to read it, but it's just that it puts this error

opaque eagle
#

Show code

tight forum
#

hi.

opaque eagle
#

Hi.

tight forum
#

my bot does some strange thing, I need a bit of help.

opaque eagle
#

Explain in more detail

tight forum
#

firstly there is no code for that;
when anyone types there, bot tries to execute addrole function

mossy vine
#

no code, cant help

opaque eagle
#

Is your bot on GitHub?

tight forum
#

that's the issue, there is no code for that to happen

#

no promise

opaque eagle
#

Well if you didn’t code it, then it shouldn’t happen.

#

So, you clearly wrote the code for it.

tight forum
#

i did check everything, nothing seems to be suspicious about that

opaque eagle
#

Well maybe you missed a spot

#

There’s no way we can help without code, sorry.

tight forum
#

which code I should show then?

opaque eagle
#

All of it, to be sure

#

Except tokens obv

copper cradle
#

the code where te error is MegaThonk

mossy vine
#

command handler perhaps

copper cradle
#

but please

#

for the sake of our lord an savior luigi use code blocks

opaque eagle
#

Amen

mossy vine
#

amen

copper cradle
#

b r u h

#

we don't even know what the issue is

#

he just said, "my bot does some strange thing"

mossy vine
opaque eagle
#

His addrole command is executed when someone says there

copper cradle
#

ah

#

there is no code for that

tight forum
#
bot.on("message", async message => {
	let botconfig = require("./botconfig.json");
    const prefix = await bot.prefixes.get(message.guild.id) || botconfig.prefix;
	
    if (message.author.bot || message.channel.type === 'dm') return undefined;
    const args = message.content.slice(prefix.length).split(' ');
    const command = args.shift().toLowerCase();
    const commandfile = bot.commands.get(command);
    if (commandfile) commandfile.run(bot, message, args);
});

is that what you wanted to see^?

copper cradle
#

no

#

go to your commands folder

#

and send the code for the addrole command

#

also you don't need to return undefined

#

just do return; and you're good to go

mossy vine
#

^

tight forum
#

ok

#
const Discord = require("discord.js");
const errors = require("../utils/errors.js");

exports.run = async (bot, message, args) => {

  if (!message.member.hasPermission("MANAGE_ROLES")) return errors.noPerms(message, "MANAGE_ROLES");
  if (args[0] == "yardım") {
    message.reply("Kullanım: ld.re <kullanıcı> <rol>" + "\nBelirtilen kullanıcıya, belirtilen rolü ekler.");
    return;
  }

  let rol = message.mentions.roles.first()  
  let kullanici = message.mentions.members.first() 

  if (!kullanici) return message.reply('Rolü vermek istediğin kullanıcıyı belirt.').catch(console.error);
  if (!rol) return message.reply('Vermek istediğin rolü belirt.');
kullanici.addRole(rol);
return message.channel.send(kullanici + ' adlı kullanıcıya ' + rol + ' rolü verildi.');
};

exports.help = {
  name: "re"
}
mossy vine
#

name: "re"

tight forum
#

but the prefix is ld.

#

prefix is broken then, no?

mossy vine
#

yeah youre not checking if it actually starts with the prefix

#

you just slice that length away

#

so it responds to any 3 letter prefix

#

and the is a 3 letter word

#

so it triggers on there

tight forum
#

oh, thx

opaque eagle
#

This is why we like to double check what you say is correct... we would’ve never solved this problem if we assumed the code was alright

foggy vigil
#

Good day, so does it matter if closed tickets never get deleted.

#

bc i am having issue were i close open tickets and they stay in the open category

valid frigate
#

read the errors

#

it means your code is using "g" somewhere but it's not defined

#

oh actually it's because you're running evals lmao, don't worry about it

earnest phoenix
#

but when i run this if statement it returns false

#

this is the channel id log

cinder patio
#

where do you log them? Any chance it's before the ids are pushed to the array?

#

the if statement is before*

earnest phoenix
cinder patio
#

log it above before you log "ch id"

earnest phoenix
#

okay brb