#development

1 messages · Page 1280 of 1

slender thistle
#

Ads

compact oriole
#

yea

#

same

slender thistle
#

I shouldn't have my limited data wasted, again, for something I'm unaware of 🙃

misty sigil
#

Ads

earnest phoenix
#

This is dev section 🤔

dark axle
#

Hey can users vote using the bot or they still need to use the site?
Like a vote command that votes for the bot.

slender thistle
#

They still need to use the site

misty sigil
#

ads any fucking day

dark axle
#

@misty sigil You think you can answer that?

earnest phoenix
#

I literally 👏 cannot put 👏 ads on my website 👏 because 👏 Google Ads 👏 just doesn't wanna work for me

misty sigil
#

then don’t put shit on your site

slender thistle
#

Then don't do anything and stop being a scummy dev.

#

🙃

misty sigil
dark axle
#

Nah I mean the discord bot list site

compact oriole
#

just don't monetize ur site if you aren't capeable of it

dark axle
#

Not my site

misty sigil
#

Hey can users vote using the bot or they still need to use the site?
Like a vote command that votes for the bot.
@dark axle no

slender thistle
#

@dark axle see my messages

earnest phoenix
#

timertime to closed source the botum because i can't afford keeping it up without monetization but i can atleast earn from lawsuits from people copy pasting my copyrighted code

misty sigil
#

bot for money

slender thistle
#

Don't monetize anything if you aren't capable of applying common sense

compact oriole
#

^

misty sigil
#

how u gonna close source it if it’s on repl

dark axle
#

Ah Thanks

compact oriole
slender thistle
#

"copyrighted code"

compact oriole
#

el mayo

slender thistle
#

Do you really just slap a license on it and call it copyrighting it

compact oriole
#

yes

misty sigil
#

nobody gaf about copyrighted code anyways

compact oriole
#

but no-one cares

#

yea

#

exactly

slender thistle
#

Apart from really annoying people ig

misty sigil
#

just have a closed source bot trole

compact oriole
#

yea, I close source the good stuff

slender thistle
#

My shit is closed source anyway lmao

compact oriole
#

and open source the meh

misty sigil
#

and close source the shit

tight plinth
#

hi affax

compact oriole
#

yea

#

hello Lumap

slender thistle
#

I was going to rewrite my bot and put it on GitHub once my website is done

compact oriole
#

don't make it open source

misty sigil
#

Or I’ll steal it

slender thistle
#

It's Python

#

unless I'll rewrite it in C#

#

with Disqord

misty sigil
#

I wouldn’t open source my current bot cuz I don’t want people stealing it

compact oriole
#

bro

#

people already steal my pfp

slender thistle
#

Eh it's for transparency purposes for my team

compact oriole
#

imagine me open sourcing my bots/games

misty sigil
#

lmao

compact oriole
#

I work so much to make them good

pale vessel
#

lmao i remember about the pfp affax

compact oriole
#

bro

#

around 10-20+ people have stolen it

#

some of them have been permabanned from Discord

misty sigil
#

nobody can steal my pfp because my pfp is Jeremy Clarkson

tight plinth
#

10-20?

misty sigil
#

or I think that’s how it works

tight plinth
#

more like 100

compact oriole
#

true lul

#

and I made it in 30 mins

hazy sparrow
azure fable
#

length

#

not lenght

hazy sparrow
#

ohh

azure fable
#

happens lol

hazy sparrow
#

thanks OwO

azure fable
#

gotchu

earnest phoenix
hazy sparrow
earnest phoenix
#

@hazy sparrow whats your lanugae

hazy sparrow
#

js

earnest phoenix
#

not discord js?

hazy sparrow
#

yes d.js

azure fable
#

@hazy sparrow args is undefined

earnest phoenix
#

ah ok

#

mee to

azure fable
#

make sure its being assigned correctly

earnest phoenix
#

german

#

@azure fable pls help me bro

#

?

azure fable
#

looking now :)

earnest phoenix
#

why this error? my think everythink is true
@earnest phoenix

#

deutsch

hazy sparrow
#

uhh @azure fable

execute(message, args) {
//code
}
#

args is defined in the index.js

azure fable
#

@earnest phoenix What is this error from? are you attempting to login to an online service? Can you verify in your debugger that the variables that store the credentials that you are using actually have the correct values?

#

@hazy sparrow What is this method for? are you 100% sure that args is being supplied when the method is called? (perhaps step through the execution of the function call in your debugger?

hazy sparrow
#

alr what if i defined args in the new8ball.js? will it work then?

azure fable
#

I'm not entirely sure what you mean, I don't know what your project structure looks like. Do you have your code in a repo somewhere that I can look at? (or can you put the relevant code in a gist?)

earnest phoenix
#

@earnest phoenix What is this error from? are you attempting to login to an online service? Can you verify in your debugger that the variables that store the credentials that you are using actually have the correct values?
@azure fable sorry for late. i need translate. token is always changing discord team. reason: 1000 loging. but my bot is true. if changing my token, my bot shutdown and opening 2-3 days

hazy sparrow
#

you mean the index.js code?

#

ah nevermind

earnest phoenix
#

@azure fable thx for help

sterile parcel
azure fable
#

do you prefer to code in JavaScript or Python? That one.

#

:P

sterile parcel
#

I use js (JavaScript)

azure fable
#

then use discord.js

#

@earnest phoenix I am having trouble understanding what you said.
My recommendation is to make sure that your discord token is correct.

if changing my token, my bot shutdown and opening 2-3 days
Are you saying that when you update your token, the bot breaks?

earnest phoenix
#

tr

#

ytkili acil

hazy sparrow
azure fable
#

answer is undefined

hazy sparrow
#

lemme show code brb

azure fable
#

okok

hazy sparrow
azure fable
#

change (line 51)

const answer = answers[Math.floor(Math.random() * answers.lenght)]

to

const answer = answers[Math.floor(Math.random() * answers.length)]
#

misspelled length again :P

hazy sparrow
#

fuck

#

im a dumbass

azure fable
#

I actually used make exactly this mistake a lot lmfao

hazy sparrow
#

lmao

#

uh

#

how do i remove the commas again?

azure fable
#

question, what is happening here?

const prefix = "bow".toLowerCase
hazy sparrow
#

fk me

azure fable
#

not sure if that is remotely connected to the issue you just mentioned

#

but I think prefix should be a method with this assignment

#

which I don't think is what you want

hazy sparrow
#

but I think prefix should be a method with this assignment
@azure fable eh?

green kestrel
#

today's new feature, now the moderators who help run the bot can reconnect individual shards if they are having problems 🙂

azure fable
#

maybe just

const prefix = "bow"
#

I say that its a method, because you do "bow".toLowerCase, not "bow".toLowerCase()

#

so you're not actually calling the method

hazy sparrow
#

yeah lemme try just "bow"

earnest phoenix
#
const prefix = "bow".toLowerCase

toLowerCase is not an argument, it's a method

azure fable
#

yeah I think that is more along the lines of what you want

earnest phoenix
#

to call a method you have to add () at the end

#

"bow".toLowerCase() in this case

hazy sparrow
#

yeah i had forgot

earnest phoenix
#

hmm

#

in js

hazy sparrow
#

yea

earnest phoenix
#

you can just replace the commas with blank spaces

hazy sparrow
#

oh so .replace() will do?

earnest phoenix
#

yes

azure fable
#

Why the .split at the end?

const args = message.content.toLowerCase().slice(prefix.length).trim().split(/ +/);
hazy sparrow
#

thanks

earnest phoenix
#

for example

#
let str = "dasd,asd,asd,as,da,sd,as,d"
str = str.replace(",", " ")
azure fable
#

@hazy sparrow Why do you split apart the string they give as a message? That is why you have the commas

hazy sparrow
#

it was coming as new8ballheeeee thats why

#

or new8ballwillthiswork

azure fable
#

oh?

#

thats

#

odd

earnest phoenix
#

shouldn't happen

hazy sparrow
#

hmm

azure fable
#

can you try just

const args = message.content.toLowerCase().slice(prefix.length).trim()

and show us the outpue

earnest phoenix
#

ohhh

azure fable
#

(you have to disable your length check tho)

earnest phoenix
#

he used trim

#

i think trim is what causes this

hazy sparrow
#

ok lemme try that

azure fable
#

That should just cut off leading and trailing whitespace, I believe

earnest phoenix
#

oh right

#

but that's literally the only thing that could've caused this

hazy sparrow
#

works that you so much guys

earnest phoenix
#

what works?

azure fable
#

happy to help o7

earnest phoenix
#

without the .split()?

hazy sparrow
#

it doesent show the comma anymore

#

yeah

#

somehow

earnest phoenix
#

wtf

#

but

azure fable
#

I can explain

earnest phoenix
#

but earlier it output without spaces

hazy sparrow
#

¯_(ツ)_/¯

azure fable
#

Yeah, I imagine that was caused by something else

#

that he'd since fixed, and probably forgot about, idk

#

lol

hazy sparrow
#

is .remove() a proper ting in js?

#

like

azure fable
#

what are you calling it on

#

Class.remove()

#

what is Class

hazy sparrow
#

.remove(args[0])

azure fable
#

you mean like removing an element from a list?

hazy sparrow
#

yeah

#

becuz its showing the new8ball as an arg too

azure fable
#

I think they use pop

#

so listVariable.pop(index)

hazy sparrow
azure fable
#

and that will remove the element from the array and return it

hazy sparrow
#

ah ok

#

thanks again <3

azure fable
#

Happy to help o7

green kestrel
#

would you rather have ads or your bandwith being used to serve data as a cdn?
@compact oriole oh god, not that thing that turns your browser into a bittorrent client to serve cdn is it

#

i wouldnt trust that thing as far as i could spit, and they usually pay you in credit for using their cdn yourself to host your own content, so its like some reciprocal bs

#

cloudflare is better. period

#

😄

hazy sparrow
#

it still answers even tho i told it to not if the arguments is less or equal to 2?

earnest phoenix
#

it thinks your question is 8ball

#

you're slicing at the wrong position

#

you could've also concluded that yourself if you had just read the output

whole crater
#

bow 8ball should I kill windows

#

BRUH

#

im mad

azure fable
#

bow pro the args variable is a string, not a list

whole crater
#

55555555555555555555555555b

azure fable
#

@hazy sparrow

whole crater
#

hELO

#

Help

azure fable
#

Hi

#

What do you need help with

whole crater
#

BEST antivirus

#

lol

azure fable
#

Windows defender

earnest phoenix
#

not the channel for that

azure fable
#

lol

earnest phoenix
hazy sparrow
#

it thinks your question is 8ball
@earnest phoenix but still i code it to see if theres 2 arguments not 1

earnest phoenix
#

yes

#

that's not what i said though

#

share your code

hazy sparrow
#

i just turned off my pc -__-

#

Brb lemme turn it back on

earnest phoenix
#

lol

#

@hazy sparrow if you want to check if there are 2 arguments, then you have to turn the string into a list. to do that you have to .split() the entire message content string, remove the first element of the list (which is the command) and then check the length of the created list

#
let message = "command arg1 arg2";

let args = message.split();
args.shift();

if (args.length >= 2) {
  lorem ipsum
}
hazy sparrow
#

Fuck slow internet

#

@hazy sparrow if you want to check if there are 2 arguments, then you have to turn the string into a list. to do that you have to .split() the entire message content string, remove the first element of the list (which is the command) and then check the length of the created list
@earnest phoenix ah

#

I get it now

unique patio
#
YourStringHere.substr(1).split(/\s+/);

substr(1) can be adjusted to your prefix length, few adjustemnts. /\s+/ is for newlines, spaces and all that defines as such. 😄

earnest phoenix
#

or that yes

hazy sparrow
#

Kk

earnest phoenix
#

that's kind of why i don't like d.js and prefer d.py, you have to make commands manually where as in d.py there's an inbuilt decorator that allows you to do it much more efficiently

unique patio
#

You'd call it as such, result[0] where 0 (can be as many inputs as you want to detect up to.

#

^ Worded that wrong but it should make sense.

hazy sparrow
#

Yeah it does

#

Thanks!

earnest phoenix
#

@earnest phoenix What you cant write a simple file loader? 😂

#

i just don't like the way you do it in js

#

that's all

#

i'm not saying it's complicated but i don't like it

#

Seems like you dont know how to do it efficiently

#

because i never made a bot in discord.js

#

i just watch here how people do it

#

js commands take a command-per-file style while py ones have a module style

#

is that a thing

slender thistle
#

Well unless...

earnest phoenix
#

you can accomplish modules with js but

#

yes

#

wtf

slender thistle
#

You can accompish the same with Python via bot.add_command

earnest phoenix
#

i had no idea, i saw all the people here do it in a message event and then split the string into arguments

#

but in that case wtf

#

most people are lazy to build a proper command handler

#

...which means you can easily break it too

#

your arguments are supposed to be parsed, not extracted from, for example, a mentions collection

#

wooow that changed my whole perspective on d.js

#

@earnest phoenix I am having trouble understanding what you said.
My recommendation is to make sure that your discord token is correct.
Are you saying that when you update your token, the bot breaks?
@azure fable yes

azure fable
#

@earnest phoenix Oh, are you hitting the 1000 logins per day limit?

#

If yes, why do you have to login that many times?

earnest phoenix
#

Cuz logins are cool

azure fable
#

Make sure that you aren't calling client.login(<token>) inside of any loops or events

#

that should just happen once when you start up your bot

silver lintel
#

message.guild.members.get(args[0]); TypeError: message.guild.members.get is not a function, i think i need to add cache somewher

azure fable
#

message.guild.members is a list

#

lists in python don't have a 'get' method afaik

silver lintel
#

its js

azure fable
#

o

#

oo

#

ok

#

sec

#

and has no get method

tight plinth
#

but the cache property of it has

#

@silver lintel use .cache

silver lintel
#

message.guild.members.cahce?

tight plinth
#

yes

azure fable
#

don't spell it like that

#

:P

silver lintel
#

:|

tight plinth
#

so I wanna make my own lib for a bot in js, does anyone has any recommendation, tip or smth on how to do one? I don't wanna use the dhit that discord.js is

silver lintel
#

Collection [Map] { '453103897012338688' => GuildMember {....
how do i make it so it is just
GuildMember { guild: Guild {......

faint prism
#

Get comfortable with making api calls

pure sapphire
#

so I wanna make my own lib for a bot in js, does anyone has any recommendation, tip or smth on how to do one? I don't wanna use the dhit that discord.js is
@tight plinth discord.js is great with amazing documentation. If you want to make your own, you will need to establish a web socket connection with discord and make loads of API calls

#

Discord.js makes it all easier

tight plinth
#

discord.js caching cough

pure sapphire
#

Just cache it yourself

faint prism
#

Yeah, you'll want to implement that too

pure sapphire
#

O yeah

tight plinth
#

If you want to make your own, you will need to establish a web socket connection with discord and make loads of API calls
@pure sapphire mk

pure sapphire
#

And rate limits and API errors are a thing, so you'd have to make handlers for that

tight plinth
#

not a problem

earnest phoenix
#

the gateway flow is a pain in the ass

tight plinth
#

but yeah discord api is not the best

faint prism
#

Haven't had an issue with it yet for small bots

earnest phoenix
pure sapphire
#

Discord.js documentation? Great. Discord API documentation? Took me 3 hours to set up oauth for the first time because it confused me

tight plinth
#

just try to shard

#

@earnest phoenix ok then I'll not do vc support

earnest phoenix
#

oauth isn't a concept that's exclusive to discord

#

you can take oauth docs from any site and apply it to discord

tight plinth
#

yea

pure sapphire
#

But discords documentation on it isn't great

earnest phoenix
#

what isn't great

tight plinth
#

it's just that you don't know how to read it properly

#

lol

earnest phoenix
#

i understood everything from oauth docs

#

it took me 10 minutes to bootstrap a basic login page

pure sapphire
#

Yes I understand it now but when I was first doing it forever ago it confused me

earnest phoenix
#

probably because you were working with oauth in general for the first time

pure sapphire
#

I ended up reading a guide to oauth

fluid basin
#

@tight plinth discord.js isn't the only library available for NodeJS/Javascript. You have many other choices such as Eris and other smaller/less well known libraries to interact with discord's api

tight plinth
#

@fluid basin ik

fluid basin
#

though some might be unmaintained and you will need update/maintain it yourself

#

and doing that all by yourself isn't a great idea unfortunately

tight plinth
#

well time to try to find one of these small and unknown libs

fluid basin
#

means also you need to implement new discord apis yourself

#

I can try to find some for you

slender thistle
#

Copy websocket handling and make your own API call methods ftw

tight plinth
#

hmm

#

I can't find any that doesn't had its last update 2 years ago

#

help

fluid basin
#

any language constraints?

tight plinth
#

js if possible

fluid basin
#

vanilla JS/ES6 typescript?

#

ok

regal crypt
#

Wut

fluid basin
#

how recent do you want it to be? within the past year? @tight plinth

tight plinth
#

the more recent, the better

fluid basin
#
GitHub

A node.js wrapper for the Discord API. Contribute to nodecord/nodecord development by creating an account on GitHub.

#

you can search for older ones

tight plinth
#

embeds plz

#

hmm

fluid basin
#

lol imagine not being able to remove embeds on mobile sad

#

cant tell you how much of the api they cover, could figure that out yourself

#

also these might not be very stable

#

nodecord seems to be maintained by @sick cloud

#

and wumpcord is by @vital lark iirc

vital lark
#

hi

#

yes

#

dumb project that people want apparently

tight plinth
#

hmmm

fluid basin
#

hacktoberfest™️?

vital lark
#

?

earnest phoenix
#

anyone have any idea why i get discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body In embed.image.url: Not a well formed URL. when trying to add an image to an embed

sick cloud
#

o/

vital lark
#

URL is possibly malformed

#

check the url

earnest phoenix
#

and urls without the file extension

tight plinth
#

does embed.image.url even exists? I'm not sure

earnest phoenix
#

it used to work a few months ago

vital lark
#

does embed.image.url even exists? I'm not sure
@tight plinth it does

tight plinth
#

oh

#

forgot

fast trench
#

does anyone know if you can code a bot to post in an announcement channel and then have it share it?

#

I gotta go but ping me with options

vital lark
#

api request

#

messages endpoint has a POST /crosspost method iirc

#

/channels/:id/messages/crosspost

tight plinth
#

can bots even publish announcement's

slender thistle
#

Yeah

silent cloud
#

Guys, I finished the music bot, everything worked perfectly, but after I added the DBL module(This is what would display the number of servers on the site of this server), I started writing error 429, after reading I realized what it means, I'm already waiting for the fourth day, how long can I wait? can this be fixed somehow

earnest phoenix
#

deutsch

#

?

silent cloud
#

Nope

#

Sry

faint prism
zenith terrace
#

Auger is typing

#

auger.startTyping();

#

auger.stopTyping();

faint prism
#

Guys, I finished the music bot, everything worked perfectly, but after I added the DBL module(This is what would display the number of servers on the site of this server), I started writing error 429, after reading I realized what it means, I'm already waiting for the fourth day, how long can I wait? can this be fixed somehow
@silent cloud have you tried making a postman request directly to the dbl api to ensure it's just one request?

#

429 makes me think you've got it in a loop or something

tight plinth
#

the dbl module has nothing to do with youtube's 429s @silent cloud

silent cloud
#

Lol

#

Thats not youtube 429

#

Thats HTTP 429

faint prism
#

I didn't say youtube

tight plinth
#

are the 429 from the dbl module?

silent cloud
#

@silent cloud have you tried making a postman request directly to the dbl api to ensure it's just one request?
@faint prism yep, tried

tight plinth
#

can I show us the error plz

silent cloud
#

are the 429 from the dbl module?
@tight plinth from HTTP

#

can I show us the error plz
@tight plinth hi

tight plinth
#

show error

silent cloud
#

Error: status code: 429

#

THATS ALL

#

I got it from .catch

faint prism
#

But it's from a call to DBL, yeah?

#

Not another request?

silent cloud
#

...

faint prism
#

can you send the code

silent cloud
#

the reason was DBL module, but now it causes everything

#

That not code problem 100%

#

120%

#

it worked, but after DBL stopped

faint prism
#

sounds like a code change

#

can you show your code?

fluid basin
#

yup it would be hard to help without any information

#

such as more detailed errors or code

quartz kindle
#

@silent cloud can you show your code?

silent cloud
#

Wtf, bro, thats not code problem

#

And code is so HUGE

quartz kindle
#

show only the dbl part

silent cloud
#

Thats happening when i try to use *play command

#

show only the dbl part
@quartz kindle i deleted it...

quartz kindle
#

and the problem persists?

silent cloud
#

Yep

quartz kindle
#

wait so the problem is actually the play command, not dbl?

#

so its a youtube problem

silent cloud
#

the reason was DBL module, but now it causes everything

#

Broked by DBL

quartz kindle
#

dbl was not the reason

silent cloud
#

It is

#

It sends so many http requests

#

And it blocks me

quartz kindle
#

429 are rate limit errors, and are unique to whatever service you're connecting to. dbl does not have anything to do with youtube

#

http requests are not global, they are per service

silent cloud
#

Thats not youtube

#

...

quartz kindle
#

you are being limited by a specific thing, not by everything

silent cloud
#

Error

#

It http error

quartz kindle
#

http is not global

#

there is one specific website that is limiting you

#

if it happens in the play command, 99% chance its youtube

#

show your .catch() lines in your play command

faint prism
#

damn Tim getting right to the point

silent cloud
#

Khm

#

Im here

delicate shore
#

How to get my mongoose link

#

it starts with mongodb://

#

but i can't figure it out

faint prism
#

are you using atlas or hosting your own

silent cloud
delicate shore
#

Atlas

faint prism
#

@silent cloud send code around line 150 in index.js

silent cloud
#

It module

#

Not my code

faint prism
#

what

#

send anyways

silent cloud
#

let err = Error('Status code: ' + res.statusCode);

faint prism
#

around line

#

That's not enough information

delicate shore
#

@faint prism I use atlas

silent cloud
#
                    stream.emit('redirect', url);
                }
                return;
                // Check for rate limiting.
            }
            else if (retryStatusCodes.has(res.statusCode)) {
                if (!retryRequest({ retryAfter: parseInt(res.headers['retry-after'], 10) })) {
                    let err = Error('Status code: ' + res.statusCode);
                    stream.emit('error', err);
                }
                return;
            }
            else if (res.statusCode < 200 || 400 <= res.statusCode) {
                let err = Error('Status code: ' + res.statusCode);
                if (res.statusCode >= 500) {
                    onRequestError(err, res.statusCode);
                }
                else {```
#

Bro that line just catching an error

quartz kindle
#

is this from your code or is this from the module?

silent cloud
#

From module

quartz kindle
#

the problem is not here

#

you need to show your code

silent cloud
#

Why my wtf

pale vessel
#

aren't they just rate limited?

quartz kindle
#

they are

pale vessel
#

so what's the problem

silent cloud
#

It write at /node_modules/...

faint prism
#

@faint prism I use atlas
@delicate shore Log into it and do this

delicate shore
#

Yes I did that

quartz kindle
#

your error handling code is eating the error message @silent cloud thats why you dont know whats going on

faint prism
#

that is the connection string

quartz kindle
#

you need to fix your error handling to see actually useful errors

silent cloud
#

so what's the problem
@pale vessel Guys, I finished the music bot, everything worked perfectly, but after I added the DBL module(This is what would display the number of servers on the site of this server), I started writing error 429, after reading I realized what it means, I'm already waiting for the fourth day, how long can I wait? can this be fixed somehow

delicate shore
#

But it says +srv

#

The npm package doesn't

pale vessel
#

the dbl module has nothing to do with this

silent cloud
#

the dbl module has nothing to do with this
@pale vessel that happened after installing of this

glacial void
#

Hi everyone one Im new making bots and my first test doest not work

#

haha

pale vessel
#

just a coincidence

delicate shore
#

K

glacial void
#

Someone knows why?

faint prism
#

But it says +srv
@delicate shore that's just the protocol. Use the part after it. Kinda like how HTTP:// is the protocol

pale vessel
#

what do you mean by "does not work"?

silent cloud
#

just a coincidence
@pale vessel hmmm? Why

#

Rly?

#

But wtf, so what i need to do ._.

#

Api working, google log 0 error 21 working commands

quartz kindle
#

@silent cloud your error handling code is swallowing the error, so you are seeing useless/incomplete error messages

#

show your catch() lines in your play command

silent cloud
#

Thats not my error handling BRO

#

that module .catch

#

I cant so anything with this

faint prism
#

||write your own code||

quartz kindle
#

show your play command

obtuse niche
#

Someone knows why?
@glacial void we really cant help you if you are not giving any information

silent cloud
#

...

#

Ok gl to find anything

quartz kindle
#

we cant help if you refuse to be helped

slender thistle
#

Ah another day another case like this

compact oriole
#

yea... it's sad

#

also there are some people whose bot is 90% made by this server because they ask everything here

faint prism
#

So many Devs willing to help, but so many skids beginners not wanting to share their code for the debug process

slender thistle
#

Different people learn differently

compact oriole
#

A lot of people also don't get that practice makes you better

#

aka you need to make your own stuff

#

and you need to code yourself

obtuse niche
#

Well true u cant learn alot if ur getting spoonfeeded

silent cloud
#

we cant help if you refuse to be helped
@quartz kindle hi , im just say gl wtf

slender thistle
#

Hell, so far half of my website backend I made with Timo is just him giving me directions and judging my preferences

compact oriole
#

juts a small thing, why are there so many empty lines?

#

like it becomes quickly super annoying

silent cloud
#

Thats bcs im copied now from phone

#

In my server it good

compact oriole
#

but that shouldn't affect it :P

silent cloud
quartz kindle
#

does your bot reply the error to the chat?

wild yacht
#

how do i see if i get in or not

#

my bot

quartz kindle
#

get in where

faint prism
#

Luca will DM you on bot approval

compact oriole
#

so you should allow dms from people in same guild

#

usually there is no reason not to

#

if you scan messages for scams

#

I just like living on the edge :P

silent cloud
#

does your bot reply the error to the chat?
@quartz kindle yes

quartz kindle
#

which one does it reply?

#

which message

silent cloud
#

All

#

Ohhh

#

At error?

#

Only *play URL

quartz kindle
#

this? return message.reply(error.message).catch(console.error);

silent cloud
delicate shore
#

hey @faint prism can u help me further

#

if you don't mind can we take this to dm's please

faint prism
#

I'd prefer to keep it here

delicate shore
#

Ok so i am getting an error saying invalid Mongo DB link

quartz kindle
#

so the problem is ytdl.getInfo

#

where is your bot hosted?

faint prism
#

Ok so i am getting an error saying invalid Mongo DB link
@delicate shore Did you copy it directly from the box and paste into the code?

silent cloud
#

fatcat.bike

#

My hosting

delicate shore
#

no as u said

#

I removed

#

nvm

slender thistle
#

Is that Russian I see?

delicate shore
#

Yes Auger

#

I copied exact

silent cloud
#

Is that Russian I see?
@slender thistle yep hi

faint prism
#

You need to replace some parts with your login creds

quartz kindle
#

@silent cloud have you tried running your bot in your own pc?

delicate shore
#

ohh

silent cloud
#

@silent cloud have you tried running your bot in your own pc?
@quartz kindle yes, same

faint prism
#

Like the <password> part

quartz kindle
#

same error?

silent cloud
#

OH STOP

#

Not

#

I tried but

#

It works

#

before that, it also worked on hosting

delicate shore
#

there was no <password>

#

mongo "mongodb+srv://IHIDETHIS/<dbname>" --username IHIDETHIS

#

this is the one i pasted

quartz kindle
#

then theres your answer, you are being limited by youtube

silent cloud
#

Not

#

Api says nothing

quartz kindle
#

what api

faint prism
#

mongo "mongodb+srv://IHIDETHIS/<dbname>" --username IHIDETHIS
@delicate shore mongodb+srv://<username>:<password>@IHIDETHIS/<dbname>?retryWrites=true&w=majority

silent cloud
#

Google youtube apis...

quartz kindle
#

ytdl does not use youtube api key

#

it uses web scrapping

#

you are being limited by IP

silent cloud
#

YES IT IS

#

You readed 429 error code?

delicate shore
#

mongodb+srv://<username>:<password>@IHIDETHIS/<dbname>?retryWrites=true&w=majority

my username is with spaces so i enter that?
And what is @IHIDETHIS is that ip adress

slender thistle
#

Well pizdec

silent cloud
#

Lol

quartz kindle
#

dude...

#

what are you not understanding?

silent cloud
#

What i need to so

#

To do

#

Just waiting?

quartz kindle
#

you cant do anything

delicate shore
#

yes

quartz kindle
#

wait or change IP address, use proxy, etc

delicate shore
#

unless u change ur ip

quartz kindle
#

you are using ytdl-core
ytdl-core does not use your api key

#

so it doesnt show up in your youtube api

silent cloud
#

K ty.

faint prism
#

And what is @IHIDETHIS is that ip adress
@delicate shore I thought you did that lol. It's the cluster's domain "cluster2.kxh2a.mongodb.net" for example. dont copy that, you'll need yours from the connection string in atlas

delicate shore
#

i got it auger

#

Thanks

drifting wedge
#

I have a Cpanel sub account, how do I make the .tech GitHub domain thing link to it?

pale vessel
#

set the correct nameservers in your registrar panel and add the domain under addon domains in cP

delicate shore
#

@faint prism Hey there
Sorry :(
But i wanted to ask my DB's Name is BLAC SHEEP
So first is it case sensitive
second do i need to add a _ joining them as it's a url

faint prism
#

hmm. Not sure, I've never considered putting a space in a database name

delicate shore
#

oh

#

can we change the name tho?

faint prism
#

You can try these three options:
BLAC%20SHEEP BLAC SHEEP BLAC\ SHEEP BLAC_SHEEP

delicate shore
#

oh wait

pale vessel
#

you have to encode them

delicate shore
#

Auger

#

It's my Organization name

pale vessel
#

yes

delicate shore
#

so it's the same?

#

I am gonna change it anyways

faint prism
#

DB naming convention is ALL_CAPS_AND_UNDERSCORES for MySQL

compact oriole
#

depends on db

faint prism
#

Well typically from what I've seen

compact oriole
#

well depends on db type

#

like Mongodb it is totally different

faint prism
#

So, MySQL

#

Oh yeah, right

compact oriole
#

and I guess Redis is different too

#

¯_(ツ)_/¯

#

but for these "traditional" databases it is all caps

restive furnace
#

redis is recommended for caching tho, not storing data on the disk.

faint prism
compact oriole
#

lmaoo

delicate shore
#

@faint prism OMG it worked Thank you so much PoggersHype

#

Can I also shift sqlite to mongo DB so that I can later establish dashboard on my website

earnest phoenix
#

does MySQL work on repl.it PHP Web Server repls

#

Can I also shift sqlite to mongo DB so that I can later establish dashboard on my website
@delicate shore use Callum's abc.db

strange tree
#

Can Anyone Guide Me On How To Post The Server Countn_sed

earnest phoenix
#

Can Anyone Guide Me On How To Post The Server Count 8379_Sad_Boi_Hours
@strange tree that's spoonfeeding also #topgg-api

slender thistle
#

Literally says "guide me"

faint prism
#

It's not spoonfeeding unless we share an entire solution

slender thistle
#

"that's spoonfeeding"

earnest phoenix
#

do i look like i care

slender thistle
#

🙃

faint prism
#

You should if you're attempting to mini-mod ||incorrectly||

slender thistle
#

So mind shutting up if you don't care

earnest cloak
#

so im trying to setup modmail for my bot and everything is working good except the initial first message the user send to the bot isnt being sent so the user would have to message the bot a second time for the message to be sent to the modmail channel. im new to this so im kinda of confused on why its not working.

if isinstance(message.channel, DMChannel): 
        if message.author != client.user: 
            channel = discord.utils.get(guild.channels, name=f"{message.author.id}") 
            if channel is None: 
                await message.channel.send("Welcome to Modmail!") 
                await category.create_text_channel(name=f"{message.author.id}", overwrites=overwrites) 
            elif channel is not None: 
                await channel.send(f"Message recieved from {message.author.name}#{message.author.discriminator}, content: {message.content}") 
faint prism
#

Can Anyone Guide Me On How To Post The Server Count:n_sed:
@strange tree the #topgg-api part is right though. They will be pretty helpful there 🙂

strange tree
#

Sent The Same Message Yesterday

slender thistle
#

What's category in that snippet

faint prism
glacial void
#

@glacial void we really cant help you if you are not giving any information
@obtuse niche ok only wait please

obtuse niche
#

👍

drifting wedge
#

@slender thistle is being a mod fun?

#

Ik it’s tiering

#

But is it like fun-Ish?

slender thistle
#

Sometimes

earnest phoenix
#

How can i use name cheap domains in repl.it

slender thistle
earnest phoenix
#

where do i add the record?

slender thistle
#

namecheap should have DNS records tab

earnest phoenix
#

ok

slender thistle
#

We don't have access to send messages in bot hell anymore

soft flare
#

Lol

pale vessel
#

who does?

slender thistle
#

So modlog and mod chat only

soft flare
#

You don't know that ?

slender thistle
#

who does?
@pale vessel admins only

earnest phoenix
#

@slender thistle uhh i accidentally selected CNAME earlier am i fucked

marble geode
#

ohh my bot need 10 server again to verify

slender thistle
#

Delete it and create an A record

earnest phoenix
#

ok

#

Delete it and create an A record
@slender thistle when i select it it asks for a host and an answer
do i put the special long string repl.it gives?

pale vessel
#

yes

#

it's the answer

slender thistle
#

Yeah

pale vessel
#

the host should be your root domain i guess

#

and www maybe if you need it

drifting wedge
#

Yeah
@slender thistle I’m using the GitHub student get tech

slender thistle
#

iirc @ works for the host

earnest phoenix
#

@slender thistle repl.it said add it to the CNAME record not A onewaitWhatSpin

slender thistle
#

Oops

#

Yeah

earnest phoenix
#

yay it works tada

#

except that the custom domain doesn't support HTTPS but that's fine for now I'll add encryption before deploying

pale vessel
#

it will

earnest phoenix
#

I'm in need of assistance by someone if possible please.
I'm working on an ExpressJS Webserver to handle database requests, but for some reason, it's not wanting to send data to the endpoint.

Server.js

//Webserver Handler
const express = require('express');
const bodyParser = require("body-parser");
const app = express();
var jsonParser = bodyParser.json();
var router = express.Router();
const sql = require("sqlite3").verbose();

let database = new sql.Database('./user-data.db', sql.OPEN_READWRITE || sql.OPEN_CREATE);
database.run(`CREATE TABLE IF NOT EXISTS user(discord_id TEXT, prefix TEXT, isPremium TEXT, token TEXT)`);

router.use(function(req, res, next) {
    if(!req.headers.authorization) return res.json({ code: 401, response: "You must provide an authorization key" });
    if(req.headers.authorization !== config.credentials.server_auth) return res.json({ code: 401, response: "Incorrect authorization key" });
    console.log(`[Server][${req.route.path}] A request has been made to the service.`); 
    next;
})

app.get('/get-user', [router, jsonParser], (req, res) => { res.send("OK"); require("./Endpoints/get-user.js")(req, res, database, unirest) });

app.listen(3000, console.log(`[Server] Server running on port 3000`));

test.js This is ran to send a test request

const unirest = require("unirest");

unirest.get(`http://localhost:3000/get-user`)
.header("Authorization", "ABC123")
.end(function(result) {
  console.log(result.body);
})
#

It passes through the router, as it logs the "A request has been made to the service."

#

does MySQL work on repl.it PHP Web Server repls
I get the error Undefined function mysqli_connect() when trying to do smth

pale vessel
#

try using pdo

earnest phoenix
#

Me or him? @pale vessel

pale vessel
#

code

quartz kindle
#

repl.it' php doesnt seem to come with the mysqli extension

obtuse niche
#

Maybe u can try PDO

narrow cloak
#

hey how can i restrict my discord server to send messages in certain text channel

quartz kindle
#

it does have PDO yes, so use it

#

PDO is better than mysqli anyway

obtuse niche
#

Yep

compact oriole
#

pdo?

earnest phoenix
#

Wait you can install modules for PHP poggertrain

quartz kindle
#

The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP

earnest phoenix
#

so I can install mysql through the CLI?

faint prism
narrow cloak
#

hey how can i restrict my discord server to send messages in certain text channel
@narrow cloak any help please

compact oriole
#

The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP
ohhh, cool :)

pale vessel
#

don't you need composer for those

quartz kindle
#

php extensions are not like node modules

#

they need to be included at compile time, or dynamically linked from a php config file

#

its something repl.it itself should do, or give you access to

#

its not something the end user does

faint prism
#

I like how that is listed under "Common questions"

quartz kindle
#

php does have something called "composer" tho, which is like npm in node, lets you install user-created libraries written in php

earnest phoenix
#

@quartz kindle so MySQL needs to be installed by repl.it themselves?

quartz kindle
#

but mysqli is a php extension, not a composer library

silent cloud
#

Hm

quartz kindle
#

@earnest phoenix just use PDO

earnest phoenix
#

ok

#

lemme read the docs

silent cloud
#

Tim, how i can change IP or use proxy on hosting...

faint prism
#

Why would you want to do that

silent cloud
#

wait or change IP address, use proxy, etc
@quartz kindle .

quartz kindle
#

because hes rate limited by youtube

#

you cant change your IP address, unless you buy a new server, you can however use proxies

faint prism
#

You can use a proxy/vpn

quartz kindle
#

i believe ytdl itself has a guide on proxies

faint prism
#

However, the network speed will be dramatically reduced

quartz kindle
earnest phoenix
#

and YouTube will bean you if you do weirdass shit

pale vessel
#

why didn't php just update their old mysql instead of creating a new one called mysqli

#

jeez

faint prism
#

because they think they are better

earnest phoenix
#

Anyone know a place where i can hire a dev

faint prism
#

not here

earnest phoenix
#

...
what kind of auto-correct changes shit to fuck

pale vessel
#

like fiverr or freelancer

#

...
what kind of auto-correct changes shit to fuck
@earnest phoenix it knows you're usually salty i guess

earnest phoenix
#

Ah freelancer good idea

quartz kindle
#

why didn't php just update their old mysql instead of creating a new one called mysqli
too many breaking changes i guess

pale vessel
#

php has arrow functions now

#

which is convenient

#

seriously

quartz kindle
#

since when?

pale vessel
#

php8 i think

faint prism
#

everyone needs lambda

quartz kindle
#

oh cool

pale vessel
#

7.4

quartz kindle
#

last one i used was 7.2

pale vessel
#

same

quartz kindle
#

anyway fuck php

pale vessel
#

haha

earnest phoenix
#

php is basically javascript but like...different but syntax is super same...idk I'm not an experienced web developer

pale vessel
#

i use php sometimes since it's just easy to use

quartz kindle
#

i use php because i still have a regular webhosting server with all the usual crap

#

i want to move out of it tho

faint prism
#

(u => { print "no $u"})

pale vessel
#

hmm

opal plank
#

come to the dark side tim

quartz kindle
#

how dark

faint prism
#

My favorite language is pseudocode

opal plank
#

hmmm

#

pretty dark

quartz kindle
#

like C dark?

pale vessel
#

@faint prism so python :)

faint prism
#

Pretty much

opal plank
#

like koa/ts dark

faint prism
#

C isn't dark ;/

quartz kindle
#

too sugary for me

opal plank
#

wdym too sugary

#

you like sugar

quartz kindle
#

koa is weird af

opal plank
quartz kindle
#

i looked at the docs

opal plank
#

its express-js

quartz kindle
#

didnt like what i saw

faint prism
#

Fortran is too dark for me

#

If I read the context correctly

compact oriole
#

php is just...

opal plank
#

express legit a staple in server

quartz kindle
#

my next nodejs server will probably run on something like low+0http

pale vessel
#

come on it's not that bad

#

at least for me

#

am i a masochist for saying that

opal plank
#

ive used php for the other dashboard

#

but fuck that crap

#

80% of the time i had no idea what i was doing

quartz kindle
#

xD

opal plank
#

luckily it looks similar to js

#

so i could get by

pale vessel
#

true

#

i know php before js

#

that helped

#

but made me always use semicolons lol

#

i like semicolons anyway

opal plank
#

koa looks hella promising but im still learning how all of it works

compact oriole
#

yo Tim

#

0http looks dope

opal plank
#

the problem is that there arent many typescript stuffies

#

which is what im doing rn

quartz kindle
#

i use semis because of php as well haha

compact oriole
#

thanks for informing me of its existance

opal plank
#

it comes shipped with all the interfaces needed

#

now its just logic on my part

#

still trying to figure out how cookies work tbh

quartz kindle
#

np affax xd

opal plank
#

cuz front end is not my area

#

Hmmm

#

got an idea

#

brb

earnest phoenix
#

You could also just get_user(bot.owner_id)
@slender thistle I am looking to display the bot owner username on a embedded message for my bot's owner info command. Do I use:
async def owner(ctx): owner=await get_user(bot.owner_id) await ctx.send(f"{owner.username}")?
(Plus, indentation is wrong on purpose)

#

@earnest phoenix pinging us won't make us help you
@earnest phoenix So, if I didn't ping you, then you wouldn't see my message as it would of been overrided by several other messages as you didn't get notified about it cuz I didn't ping you.

faint prism
#

That logic reminds me of Randy from My Name Is Earl lol

earnest phoenix
#

applicationinfo has an owner property
@slender thistle But does it have an username attribute for the owner property?

slender thistle
#

owner property is a User object

#

and that has name, discriminator, etc.

mint hamlet
#

In jsv12 if we have to restrict a command to a specific perms group we use member.hasPermission('Perms')
But what will be the line of code if I want to restrict a command to a role??

vital lark
#

check if the member has the role?

mint hamlet
#

yes

earnest phoenix
#

and that has name, discriminator, etc.
@slender thistle Proof?

mint hamlet
#

I was making the ban command and its my private bot I want only people with the Staff role to use it

vital lark
#

Proof?
@earnest phoenix you know there is documentation, right?

earnest phoenix
#

In jsv12 if we have to restrict a command to a specific perms group we use member.hasPermission('Perms')
But what will be the line of code if I want to restrict a command to a role??
@mint hamlet @commands.has_roles()

#

@earnest phoenix you know there is documentation, right?
@vital lark Proof?

mint hamlet
#

@earnest phoenix Thanks

vital lark
#

t-that's python

slender thistle
#

Alright

#

Let me get my eval back

earnest phoenix
#

I'm joking guys
You have to get the IDs or names first, lol

slender thistle
#

sec

rocky hearth
#

when doing dispatcher.end(), can I stop triggering the finish event?

vital lark
#

use the once function in dispatcher

#

it'll call it once and delete it from the emitters list

earnest phoenix
#

when doing dispatcher.end(), can I stop triggering the finish event?
@rocky hearth Stop running the program and it will stop.

pale vessel
#

proof?

earnest phoenix
#

Proof?

earnest phoenix
#

Jk

pale vessel
earnest phoenix
#

I'm doing bot.owner

pale vessel
#

but

slender thistle
pale vessel
#

so yeah

slender thistle
#

Yeah members are subclasses of User

earnest phoenix
#

I'm doing bot.owner

slender thistle
#

it's beautiful

pale vessel
#

like how you can use message stuff on context

slender thistle
#

See my screenshot @earnest phoenix

earnest phoenix
#

Suck my bum

pale vessel
#

interesting

earnest phoenix
#

Thx

slender thistle
#

¯\_(ツ)_/¯

#

You're the one fucking around for no valid reason, I gave you what you needed to achieve what you asked for.

rocky hearth
#

it'll call it once and delete it from the emitters list
@vital lark But still it would trigger the finish event atleast once. I just only want to trigger the finish event when the song is finished playing.
Not when I end it manually

slender thistle
#

I'll get back to my gaming session, bye

pure lion
#

@pale vessel what do you use for aeon dns?

pale vessel
#

node has a featue

#

hold on

pure lion
#

Called dns

#

I presume

pale vessel
#

mhmm

#

BUT

#

i have a but

pure lion
#

I thought you were using Google public dns API but there's no way to get the JSON for some weird reason

pale vessel
#

i use google's public dns

pure lion
#

Howum the fuckum

pale vessel
#

got that right

pure lion
#

How can I get the json

#

Using fetch?

pale vessel
#

it's /resolve

#

hold on x2

pure lion
#

Ok I'm holding I'm holding

#

Oh so I just get the res body

pale vessel
#

mhmm

pure lion
#

Thanks flaze, I knew there was a Google public dns thingy but didn't know what exactly

#

Ily :3

pale vessel
#

ily too no homo

pure lion
#

Full homo /s

compact oriole
#

Full homo /not s

leaden rover
#

How do I make it so I can change my bot's prefix in discord.py?

pure lion
#

Use a database

leaden rover
#

Ok, which database is recommended?

pure lion
#

Well I use mongodb

leaden rover
#

Ok, I'll use mongodb

pure lion
#

I think the py wrapper is pymongo

earnest phoenix
#

Is it possible to use only a .JSON file as a database?

leaden rover
#

Ok

quartz kindle
#

yes its possible

pure lion
#

Never ever

earnest phoenix
#

Why?

#

TELL ME

pale vessel
#

Is it possible to use only a .JSON file as a database?
@earnest phoenix yes, with atomic file writing but i wouldn't recommend it

pure lion
#

It corrupts

#

And is poo

earnest phoenix
#

Proof?

quartz kindle
#

Lol

compact oriole
#

Lol

pale vessel
pure lion
#

Mine corrupted in 3 days

placid iron
#

I used to have one

compact oriole
#

json database is just shit

placid iron
#

Would corrupt in less than 1m 😩

quartz kindle
#

you can use a json as a database, but its not recommended for many reasons

compact oriole
#

definitely is good and reliable

digital ibex
#

the problem is with fs lol, not json

compact oriole
quartz kindle
#

the problem is not fs lol

compact oriole
#

lol

digital ibex
#

storing with fs

placid iron
#

If it was FS then all my things would be moar_krabs

digital ibex
#

is the problem, mongodb stores using json

pale vessel
#

what

#

no?

quartz kindle
#

fs is just an interface for the system's own fopen and similar io functions, all databases use it

compact oriole
#

yea exactly

earnest phoenix
#

How do I make my own database?

compact oriole
#

do not make your own

#

use an existing one

earnest phoenix
#

Is it possible to use a python file as a database?

compact oriole
quartz kindle
#

lmao

#

i mean

#

possible, yes

earnest phoenix
#

Wtfff

quartz kindle
#

but just because its possible doesnt mean you should

compact oriole
#

well you can use any file as db

#

.peepeepoopoo

placid iron
#

Wtg

compact oriole
#

file endings basically mean nothing

earnest phoenix
#

So I could even use a .txt file as a database or even a .PNG file????

quartz kindle
#

yes

#

all files are the same, its just binary data. the only difference is how you read it and how you structure the data in it

placid iron
#

You could use a .get_shwifty

earnest phoenix
#

Ok

opal plank
#

@quartz kindle

#

quick hand here pls?

quartz kindle
#

again?

#

lmao

vital lark
#

i see ur man of culture

#

using ts

opal plank
#

the heck is up with reactions class?

#

when returning a message?

#

reaction.message

vital lark
#

wait

opal plank
#

cant even blame me for this one cuz the declarations are from d.js

vital lark
#

what did you type-cast msg as

opal plank
#

cuz it IS message

compact oriole
#

pog Erwin uses ts

vital lark
#

I'm talking about this

opal plank
#

im aware

#

i cast it cuz i was making sure it was accepting it as type Message

vital lark
#

oh

narrow cloak
#

<client>.user.setActivity('<activity>', { type: 'WATCHING' });

vital lark
#

huh weird

opal plank
narrow cloak
#

is it correct

vital lark
#

it could be the type for shitboard but idk

opal plank
#

it aint

#

i removed my interfaces too

quartz kindle
#

why do you need to cast it tho?

opal plank
#

i dont

#

i was just confirming

narrow cloak
#

<client>.user.setActivity('<activity>', { type: 'WATCHING' }); please

vital lark
#

what about it

opal plank
#

no casting

#

legit same error

quartz kindle
#

wait

opal plank
#

i was casting to check if it was type error

quartz kindle
#

string is not assignable to type never

#

its shitboard that is never

opal plank
#

OH

#

fuck

vital lark
#

lmao

opal plank
#

im an idiot

quartz kindle
#

you shitboard

opal plank
#

ty tim

quartz kindle
#

lmao

opal plank
#

looks its early in the morning

#

im still sleepy

#

ty though

honest perch
#

is the problem, mongodb stores using json
@digital ibex they use bson actually

earnest cloak
#

how do i put a timestamp into an embed in discord.py

narrow cloak
#

please help help

honest perch
#

With?

narrow cloak
#

<client>.user.setActivity('<activity>', { type: 'WATCHING' });
<client>.user.setActivity('<activity>', { type: 'LISTENING' });

#

this code is having error