#development

1 messages · Page 1666 of 1

soft glade
#

do you know if there is one for python? bc the dank memer one is in nodejs

umbral zealot
#

where you do client.commands = ????

soft glade
#

oof ok then

opaque acorn
#

`client.commands = new Discord.Collection();

fs.readdir("./commands/", (_err, files) => {
files.forEach(file => {
if (!file.endsWith(".js")) return;
let props = require(./commands/${file});
let commandName = file.split(".")[0];
client.commands.set(commandName, props);
console.log(Comando cargado: ${commandName});
});
});
`

unreal estuary
#

and what are your command files called

umbral zealot
#

So, that should definitely log that your commands have loaded, does it do that?

#

like, is it saying Comando cargados: help or something, when you start the bot?

opaque acorn
#

wait

#

yes

#

$ node .
: ) evento cargado: message
: ) evento cargado: ready
Comando cargado: avatar
Comando cargado: invite
Estoy listo para ayudar a 191 en 4

umbral zealot
#

Ok, great. So you have 2 commands that are working, and you're saying, neither avatar nor invite run when you call them with the prefix?

opaque acorn
#

none works

umbral zealot
#

sounds to me like you have the wrong prefix then

opaque acorn
#

but when I put them with the vsc they work

unreal estuary
#
  if (message.author.bot) return;

  if (message.content.indexOf(client.config.Prefix) !== 0) return;

  const args = message.content
    .slice(client.config.Prefix.length)
    .trim()
    .split(/ + /g);
  const command = args.shift().toLowerCase();

  const cmd = client.commands.get(command);

  if (!cmd) return;

  cmd.run(client, message, args);
};``` you need to figure out where you are going wrong try like if there isnt a command make it log no command and make it log what "command" is to see fi thats correct too or if the prefix isnt the bots prefix
umbral zealot
#

Not that you should host on glitch - it's not appropriate to host a discord bot application.

unreal estuary
#

yeah glitch isnt that great

umbral zealot
#

I mean it was fine before they added the paid plan and told everyone "you're not allowed to host here anymore, fuck off", basically.

opaque acorn
#

idk

#

What I know is that the presence of the bot is shown

umbral zealot
opaque acorn
#

If it didn't work, it would be weird for it to show up, right?

unreal estuary
#

oops

umbral zealot
#

"it went online" doesn't mean it's properly working

#

the only reason it would work locally and not on glitch is that you messed up your file copy.

cinder iron
#
from discord.ext import commands
client = commands.Bot(command_prefix="prefix")

@client.event
async def on_ready():
@client.event 
async def on_message(message):
    if message.author.id == 712027036511633429:
        await message.delete()```
 
is the second client.event correct or no? if so can you help
earnest phoenix
#

The chop chop eggplant emoji, where is it? panda_crying

umbral zealot
knotty zodiac
#

does anyone know how i can make it so after my bot has joined a server, that person will get redircted to my website. I tried in the discord redirect and it didnt work 😦

quartz kindle
#

you need oauth2

knotty zodiac
#

wdym

quartz kindle
#

the user has to go to your website and "login with discord"

earnest phoenix
#
    at MessageStream.messageHandler (C:\Users\\Desktop\Stats\node_modules\mongodb\lib\cmap\connection.js:268:20)
    at MessageStream.emit (events.js:315:20)
    at processIncomingData (C:\Users\\Desktop\Stats\node_modules\mongodb\lib\cmap\message_stream.js:144:12)
    at MessageStream._write (C:\Users\\Desktop\Stats\node_modules\mongodb\lib\cmap\message_stream.js:42:5)
    at writeOrBuffer (internal/streams/writable.js:358:12)
    at MessageStream.Writable.write (internal/streams/writable.js:303:10)
    at TLSSocket.ondata (internal/streams/readable.js:719:22)
    at TLSSocket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:14812) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14812) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
knotty zodiac
#

ive seen it on other bots

quartz kindle
#

yes

#

the user needs to login with discord and authorize on your website

earnest phoenix
umbral zealot
umbral zealot
#

no need, I've given you the answer

#

You can't increment a string.

earnest phoenix
quartz kindle
#

Lol

earnest phoenix
#

Its a voice stats bot

umbral zealot
#

you... "bought this bot", as in, you paid for it?

earnest phoenix
#

Can you please help me before I cry :((

knotty zodiac
#

is it one of these for login?

umbral zealot
#

So you paid for it. Well, talk to the person that programmed it and tell them to fix it

knotty zodiac
#

on websoite

umbral zealot
#

it's not up to us to fix someone else's shoddy craftmanship

umbral zealot
#

That's great! It means you would have had time to learn programming since you bought it and you could fix it yourself. I'm guessing you didn't do that, but there's not much we can do. We're not here to fix other people's broken code, only to guide them.

earnest phoenix
#

Yeah you should learn to code and how everything works and you'll have a better understanding!

umbral zealot
#

If you know absolutely no programming, your best bet is to go pay someone on fiverr or freelancer to fix it for you for cheap.

quartz kindle
# knotty zodiac is it one of these for login?

you need to implement the OAuth2 flow, its not as simple as switching something on. you need to code your website to redirect the user to discord for authorization, then receive the authorization code

umbral zealot
earnest phoenix
#

Like said, your asking for us to just fix someone else's broken work

umbral zealot
#

You're going to keep waiting if your entire conversation is "Fix it for me"

quartz kindle
#

you can easily fix that yourself if you learn some basic programming

#

for example, google "what is a string"

earnest phoenix
#

Can you give me some tips? then do my best

unreal estuary
#

can someone send a guide of embeds with python

umbral zealot
opaque acorn
#

you won't believe me

#

what a big nonsense

unreal estuary
#

lol

opaque acorn
#

it was literally the command that was poorly structured

#

xddddddd

#

no matter, thanks for the support you have given me people

umbral zealot
opaque acorn
#

see u later guys

cinder iron
eager lance
#

yo

unreal estuary
#

what

eager lance
#

i have a dev helper but he had to go i think im finishing off but idk if i should ask someone to help

unreal estuary
#

what do u need help with?

umbral zealot
#

You can certainly ask for help but we can't guarantee we can help you until we've heard your question

eager lance
#

im a beginner so i think last dude was trying to get the bot online

unreal estuary
#
embed.set_author(name='requested by {0}'.format(msg.author.name),
        icon_url=msg.author.avatar_url_as(size=128))
``` why does the size not work? it shows a different size for different people
#

oh wait

#

i did it as author lol

#

not image

#

im dumb

eager lance
#

all i have is an error in the terminal that says invalid syntax

boreal iron
#

Maybe because there are 2 )

eager lance
#

ill try remove end 1 idk

boreal iron
#

Oh nvm

eager lance
#

ok

boreal iron
#

Nope my bad

#

Just hard to see on mobile

umbral zealot
#

Declan, we can't really help with syntax errors. You need to know programming before you can code bots, and doing simple syntax is pretty much a basic thing you need to be able to do on your own.

boreal iron
#

Nope I’m actually right

umbral zealot
#

Start by learning javascript a programming language, it might help.

eager lance
#

im using python rn

#

by some helper

umbral zealot
#

Ok great, well, maybe you should wait for that helper to guide you then.

eager lance
#

he only gives me like 10 mins per day lol

umbral zealot
#

You get what you pay for.

boreal iron
#

lol

unreal estuary
#

can someone help me with something

modest maple
#

CoffeeSip I think you might want to consider learning python in general in between what he teaches you

unreal estuary
#

what is discord.ext.commands?

eager lance
#

i guess im getting no help BYE then

modest maple
modest maple
unreal estuary
#

can u send a tutorial on how to use it

#

rn ive done my commands like this

#
        if len(args) == 1:
            await msg.channel.send('missing message')
        else:
            text = ' '.join(map(str, args[1:]))
            embed = discord.Embed(description=text,colour=0xE5E242)
            embed.set_author(name='{0} says'.format(msg.author.name),
            icon_url=msg.author.avatar_url)
            await msg.channel.send(embed=embed)

    if command == 'avatar':
        member = None
        if len(msg.mentions) == 0: member = msg.author
        else: member = msg.mentions[0]
        embed = discord.Embed(color=discord.Color.dark_teal())
        embed.set_author(name='requested by {0}'.format(msg.author.name),
        icon_url=msg.author.avatar_url)
        embed.set_image(url=member.avatar_url_as(size=128))
        await msg.channel.send(embed=embed)```
unreal estuary
#

thanks

boreal iron
modest maple
#

that's not really gonna solve his issue with the language syntax itself

#

shrug Not that we even know what he did cuz he never shared the code

boreal iron
#

ffs discord mobile and edge oof

eager lance
#

forget it u guys are confusing bye

umbral zealot
#

Programming is, indeed, confusing.

modest maple
#

pithink If you think what we're saying is confusing you're gonna really struggle with async python

umbral zealot
#

Especially for those that don't want to take the time to learn

boreal iron
#

Alright we’re the ones being confusing

unreal estuary
#

i name my variables as really weird stuff when im bored

modest maple
#

real bad idea

unreal estuary
#

yeah

#

c:

modest maple
#

clear names thinksmart

eager lance
#

I might just quit soon lol bye

unreal estuary
#

quit what

modest maple
unreal estuary
eager lance
vivid fulcrum
unreal estuary
#

it isnt that hard

umbral zealot
#

Great, you go do that, we don't need the drama 😛

unreal estuary
#

just start with simple stuff first

#

if u wanna code then do it c:

eager lance
#

na bye

umbral zealot
#

ok baiiiiii!

unreal estuary
earnest phoenix
#

Theres somebody that know hot to create a invite to a guild? I have the id of the guild

winged linden
#

Little question how can i check how many voice connections my bot has? "Client.voiceConnections.size" doesnt work

earnest phoenix
winged linden
#

doesnt work

earnest phoenix
#

In the ChannelManager class, there is a property .cache that returns a collection of channels, so I suppose you can loop through the collection and count every channel that is a voice channel, every Channel object has a property .type which returns a string.

winged linden
#

okay thanks

unreal estuary
#

how would i go about

#

making the bot send an error message if they didnt give any arguments

#

like

#
@bot.command()
async def say(ctx, *, args):
    await ctx.send('{0} says: {1}'.format(ctx.author, args))```
marble juniper
#

is there some way of creating subdomains in express.js

unreal estuary
#

wdym by subdomain

marble juniper
#

lile

blissful coral
#

What are you using for setting the port of the server?

#

for the domain

marble juniper
#

*like

blissful coral
#

apache or nginx

unreal estuary
marble juniper
#

I would use nginx

#

I think

marble juniper
unreal estuary
#

idk if there is

blissful coral
#

Just add a subdomain on your DNS Provider and then set it in your default file

marble juniper
marble juniper
#

and those subdomains get managed by the same code

#

lol

#

by the same Webserver

blissful coral
#

Idk how you could do that..

unreal estuary
#

yeah

blissful coral
#

that's how I do mine

#

Using port forwarding

boreal iron
#

Do you host the DNS server yourself?

marble juniper
#

uh idk

#

lol

#

like

blissful coral
#

oh

marble juniper
#

making subdomains and stuff

blissful coral
#

I have one of those lul

marble juniper
#

you know

blissful coral
#

I don't remember how doe

#

it is millions

boreal iron
#

You said you wanna add subdomains

marble juniper
#

yeah

#

using code

boreal iron
#

That means you have to edit a DNS zone file

blissful coral
#

^

boreal iron
#

Some providers have APIs for this

marble juniper
#

I use namecheap

#

lol

blissful coral
#

Don't remember if cf does

boreal iron
#

Or you have to host the DNS server yourself

marble juniper
#

atm it uses netlify dns

#

idk maybe netlify has something for this

boreal iron
#

We dunno either

blissful coral
#

Just depends on your dns

boreal iron
#

No matter the OS, each DNS Server can be edited via command prompt

long copper
#

hello i have an error in my event handler

Client.on(event_name, event.bind(null, Client, Discord))
TypeError: event.bind is not a function
boreal iron
#

If there’s no API by your provider you can actually create a backend doing it for you

#

Only if you can access the name server or zone file of course

unreal estuary
#

can someone help me with a command

marble juniper
#

seems like netlify does have an api

#

and you can update a site

#

using that

long copper
#

wait i send all the event handler code

unreal estuary
#
@bot.command()
async def avatar(ctx, *, user: discord.User):
    embed = discord.Embed(color=col)
    embed.set_author(name=f'requested by {ctx.author.name}',
    icon_url=ctx.author.avatar_url)
    embed.set_image(url=user.avatar_url_as(size=128))
    await ctx.send(embed=embed)

@avatar.error
async def avatar_error(ctx, error):
    if isinstance(error, commands.BadArgument):
        await ctx.send('You didnt mention a user!')``` when they don't mention a user the error message doesnt send any ideas what i did wrong
blissful coral
#

If I knew py maybe I would be able to help

boreal iron
#

If you wanna deal with the DNS in general make sure to read docs before using it

blissful coral
#

yeah

#

can get really ugly really fast

boreal iron
#

Especially speaking about creating or changing subdomains you should have a look at the TTL and the size of your provider

unreal estuary
#

ah i figured out my mistake

#

commands.MissingRequiredArgument

blissful coral
#

Actually

#

@marble juniper

marble juniper
#

?

blissful coral
#

You can set the DNS Route for your domain to be *.domain.com and check the URL in the body request that is sent

#

in the req

#

and split it before the .

blissful coral
#

Like I said in your DNS where you set the domain and the IP it points to do *.domain.com

#

And when there is a GET on your express, in the headers it should send you the URL the page is

marble juniper
#

so basically a wildcard sudomain

blissful coral
#

then you can parse that

boreal iron
#

The wildcard as entry will point to all non-existing hostnames (subdomains)

blissful coral
#

Yeah and just search a db for the ones that = a name

marble juniper
#

yeah I can get the url and stuff

blissful coral
#

yea

marble juniper
#

if the subdomain doesn't exist in the list

#

just respond with

#

nothing

blissful coral
#

exactly!

marble juniper
#

lol

blissful coral
#

big brain

marble juniper
#

just cancel the request

blissful coral
#

instead of fucking with your dns for each new one

marble juniper
#

yeah imma try that

#

a wildcard subdomain

blissful coral
#

big brain plays

boreal iron
#

lmao

marble juniper
#

thanks for the help

#

uwu

#

I will give u invite code for my image host as return

blissful coral
#

np

marble juniper
#

once its done

blissful coral
#

ayo pog

marble juniper
#

btw

blissful coral
#

Nah I am making my own already lul

#

Just gotta buy a new domain

marble juniper
#

thats the domain

#

i just got

#

lol

boreal iron
#

Oh god

marble juniper
#

its a pretty nice domain

boreal iron
#

That name

marble juniper
#

lol

#

that name isn't bsd

#

*bad

#

smh

blissful coral
#

what was the cost

marble juniper
#

lol

marble juniper
#

cuz

blissful coral
#

oh

#

.me is free?

marble juniper
#

github student

blissful coral
#

ohhh

marble juniper
#

I github student

#

lol

#

I applied as github student and got accepted

#

they give you a free .me domain

blissful coral
#

I need extreme-is.me

marble juniper
#

if you have github student privileges

blissful coral
#

How do I get that

#

I am in highschool idk if it counts

marble juniper
#

it does

#

any school counts

#

as long as you can verify ur part of the school

#

aka

#

student id

blissful coral
#

can you link it

marble juniper
#

and so on

blissful coral
#

I have a school ID

#

pog

marble juniper
#

nice

#

btw

#

if you do have a school issued email the process is faster

#

but its not required

blissful coral
#

I do

#

POGGERS

#

How long did it take?

marble juniper
#

for md

#

since I had a gmail

#

like idk

#

some weeks

#

for you it should take a few days

#

lol

#

which is pretty fast

blissful coral
#

lets see

marble juniper
#

this should be it

#

just apply there

#

you should be able to find ur way through the site without much help

#

from me

#

lol

#

as a github student you get a lot of shit

#

namecheap .me domain

blissful coral
#

Yeah I see

marble juniper
#

even a jetbrains license

#

for many ide's

#

like

#

Intellij IDEA Ultimate

#

lol

#

or pycharm professional

#

crazy ik

blissful coral
#

shit I have a github account with my school adress

#

delete

marble juniper
#

also github pro too

#

for free

#

ofc

#

also azure 100$ credit

#

and you can make an azure account without having a credit card as a github student

#

for free

#

pretty cool ik

#

lots of cool stuff you get for free

#

I got accepted first try

blissful coral
#

I am looking into it rn

marble juniper
#

it basically feels like getting the adobe sweet for free

#

kekw

#

oh digital ocean credit too

blissful coral
#

POG

marble juniper
#

for new accounts only

#

also boostrap studio

#

which lets you make Websites

unreal estuary
#

how do i set a category for a command with discord.ext.commands

marble juniper
#

what language do you use

#

programming language

unreal estuary
#

me?

marble juniper
#

not human language

#

yeah

#

you

unreal estuary
#

python

marble juniper
#

sorry

blissful coral
#

Got it

marble juniper
#

can't help idk python

blissful coral
#

Gotta apply

unreal estuary
#

ah

marble juniper
#

like website etc

#

lol

blissful coral
marble juniper
#

but otherwise the process isn't really hard

#

you just give them an image

#

fill out some fields

#

and ur done

#

it makes it easy to claim ur uh

#

goodies

blissful coral
marble juniper
#

lol

#

also you need that site I sent you in order to claim ur namecheap domain

#

so make sure to save that site for later use

#

uwu

blissful coral
#

ight

#

So I could actually get it tonight LOL

marble juniper
# blissful coral ight

the site I sent is also where you get all the redeem codes for stuff like namecheap or digital ocean

#

lol

#

so remember it

blissful coral
#

ok

marble juniper
#

sadly

#

digital ocean requires a 5$ payment

#

to setup an account

blissful coral
#

Yeah prob won't use it lul

marble juniper
#

same

blissful coral
#

I have a galaxygate vps already

marble juniper
#

at least azure is free

#

lol

#

and doesn't cost anything to use

#

also you will have access to stuff like educative

blissful coral
#

yeah

#

ez

marble juniper
#

which does have courses for stuff

blissful coral
#

time to check my email

marble juniper
#

so you even get free learning material

blissful coral
#

imagine it happened already lulw

marble juniper
#

lol

#

I wanna try github campus experts

blissful coral
#

OOOOOOO do we get a jetbrains sub?

marble juniper
#

yes

#

jetbrains license

#

with intellij ultimate

blissful coral
#

LETS GO

marble juniper
#

pycharm webstorm and so on

blissful coral
#

I have been wanting to use a paid IDE

marble juniper
#

many many ides

blissful coral
#

Just to see how it is

marble juniper
#

all for free

#

ofc

#

btw

blissful coral
#

ew

marble juniper
#

ur github student status lasts for a year or so

#

you have to verify again next year I think

#

lol

#

and you still have to be in a school too

#

ofc

blissful coral
#

im a sophmore so

marble juniper
#

oh

blissful coral
#

lul

marble juniper
#

and you get a data dog Premium too

#

it says

Pro Account, including 10 servers. Free for 2 years.
blissful coral
#

yeah this is pog

#

I didn't know it worked for highschoolers I thought it was college only

marble juniper
#

Kinda crazy what you get all for free as a github student isn't it

#

kekw

marble juniper
#

of any kind

#

as far as I know

blissful coral
#

yea

marble juniper
#

I mean how else would they have accepted my school

#

the only thing you need to be is 13+ years old

#

kekw

unreal estuary
#

what does

blissful coral
#

github students

unreal estuary
#

am i a student lol

marble juniper
#

github student gives you free stuff

#

if you are a student of a school

unreal estuary
#

15

blissful coral
#

depends on your age and if you are enrolled in a school

marble juniper
#

you just apply

unreal estuary
#

high schools?

blissful coral
#

yes

unreal estuary
#

ok

marble juniper
#

any kind of school

#

as long as it is a school

#

lol

unreal estuary
#

where do i apply

blissful coral
unreal estuary
#

thx

marble juniper
blissful coral
#

slow

unreal estuary
blissful coral
#

kekw

marble juniper
#

I had to find link

#

smh

blissful coral
#

kek

marble juniper
#

anyways

#

github student pog

#

also github pro for free

#

uwu

unreal estuary
#

does it notify my school or something

marble juniper
#

you litterally get jetbrain ide's for free

marble juniper
blissful coral
#

no way it does lmfao

#

the school would get too many emails

unreal estuary
#

ok cuz dont want them snooping on my business

blissful coral
#

they can't

#

lol

unreal estuary
marble juniper
#

you just have to provide info about ur school and you have to give them an image of a student card or simmilar that verifies ur part of the school

#

thats it

unreal estuary
#

or school email

marble juniper
#

if you have a school issued email that you can use just use that

blissful coral
#

lmao all I did was add my school account to my email list on github and verified it and ez

marble juniper
#

if not just use ur normal email Account

#

that works too

unreal estuary
#

wat does github pro give ya

marble juniper
#

not much tbh

#

just more storage for github packages

#

(whoever uses that)

#

and more workflow stuff

#

and extra features

unreal estuary
blissful coral
#

just more private repo stuff

#

basically

marble juniper
#

yeah

#

more stuff for Private repos

#

like code owners

#

and other things

blissful coral
#

It doesn't matter unless you have over 4 contributors on a private repo

unreal estuary
#

not much

marble juniper
#

pro just gives in general

unreal estuary
#

yeah

marble juniper
#

more features

#

thats how to describe pro in 2 words

#

it is kinda cool doe

#

considering its free as a github student

#

I will take any free shit they throw at me

#

azure 100$ credit? hell yeah

#

some developer tool that I never heard of? sure I will take jt

unreal estuary
#

lmao

marble juniper
#

the coolest thing

#

in my opinion

#

is the fact they also have courses for github students

#

educative for example gives github students access to 60 courses

#

about many programming languages and topics

#

which is pretty cool

#

the github student pack is mainly intended for programming stuff anyways

blissful coral
#

Github student is probably the craziest thing a developer can apply for

marble juniper
#

github students is not just "here have some free shit"

#

its meant for you to learn with real world tools

#

shouldn't just be seen as a Marketplace

#

lol

#

yes

#

things that actual devs use in jobs that you can use too

#

uwu

#

I like that a lot

#

how github supports junior devs

#

how they give you so many Tools worth hundreds of dollars for free

#

kinda crazy

#

to think about

#

that they give it for free

#

not even requesting a payment for applying

#

or something

#

github best thing to exist ngl

#

I should be writing a love letter by now for github lol

vivid fulcrum
#

a lot of it is thanks to microsoft

marble juniper
#

lol

vivid fulcrum
#

i remember when ms first bought it, everyone though github was going to shit

#

so they went to gitlab

#

then ms made github the perfect platform

marble juniper
#

no they made github great

#

they made github perfect

#

they made github how it is now used by pretty much every dev that exists

#

litterally every dev has heard about github at least once

blissful coral
#

yeah lmfao

marble juniper
#

but like

#

kinda crazy how they give you all this stuff for free

#

kinda epic

blissful coral
#

Github is the best resource for anybody making packages, wrappers, anythinfg

#

want open sourcing sites easy issues or suggestions and pull requests

marble juniper
#

and all of this for the purpose of learning

#

lol

vivid fulcrum
#

microsoft loves open source

blissful coral
#

literally has everything a dev needs for any project

marble juniper
vivid fulcrum
#

well

#

some parts of it are

blissful coral
#

imagine windows open source

vivid fulcrum
#

like the calculator app mmLol

marble juniper
#

yeah

#

but

#

not all of if

#

sadly

vivid fulcrum
#

but microsoft does indeed love open source, they open sourced the whole .net environment

#

.net 5 is one of the most powerful frameworks right now

#

thanks to it being open source

#

and various devs being able to contribute

marble juniper
#

they also use Linux for azure

#

lol

#

probably because not a single big company would ever run a windows server in production

vivid fulcrum
#

this tbh

blissful coral
#

yeah no

#

lmfao

marble juniper
#

like

#

96% of servers running use Linux

#

lol

#

and no thats not over exeggeration

vivid fulcrum
#

there's literally not a single reason to use winserver except a) you're a linux virgin or b) your app is running on .net framework which requires windows

marble juniper
#

or you never used linux before and only know how to open a word document

vivid fulcrum
#

my mom

marble juniper
#

this

#

anyone getting into it should know linux

#

it is almost a requirement these days

blissful coral
#

yeah lol

marble juniper
#

since like almost all servers run Linux

blissful coral
#

wsl for example

#

use linux with iut

marble juniper
#

and Linux is cool in general

#

kekw

blissful coral
#

windows ubuntu + wsl is the best way to test on a windows system

vivid fulcrum
#

and the fact that sooooo many distros are extremely modular

marble juniper
#

anyone in it should have at least touched a distro like Ubuntu or simmilar before

vivid fulcrum
#

install only what you need

marble juniper
#

or debian

marble juniper
vivid fulcrum
#

this

marble juniper
#

only Update when you want to

#

something windows users can only dream of

vivid fulcrum
#

i got used to linux so much that i stopped navigating my main pc (running on windows) with file explorer and instead started navigating with powershell lol

marble juniper
#

kekw

#

I mean

#

technically you don't need a gui

#

or any visual shit

#

in linux you can do pretty much everything in the command line

vivid fulcrum
#

that + rendering takes time sometimes

blissful coral
#

yeah

#

its so pog

marble juniper
#

installing software?

sudo apt install nodejs

you wanna edit a file?

nano index.js
blissful coral
#

having a problem with your mongo db?

marble juniper
#

the power to install Software with a command is amazing

boreal iron
blissful coral
#
sudo service mongo restart```
marble juniper
blissful coral
#
sudo apt uninstall mysql```
marble juniper
#

sudo rm -rf /

#

😳

blissful coral
#
sudo apt uninstall nodejs
#

How to fix life mistakes

#

No more errors

marble juniper
#

ez fix

blissful coral
#

I am

#

lmao

marble juniper
#

lol

#

I forgot what I wanted to say

#

fuck

#

😩

#

oh yeah

#

whats yall favorite linux distro

#

I have 2 actually

#

nah wait

#

its actually only 1

#

kali linux

#

I like how it has many hacking tools pre installed

blissful coral
#

arch

marble juniper
blissful coral
#

arc arch

marble juniper
blissful coral
#

~yes

#

yes

lyric mountain
#

else it's a secret minecraft base in singleplayer

blissful coral
#

Honestly kinda wanna setup a modded minecraft server but nobody will play prob

#

sad

winged linden
#

Is it possible to show total amount of users " not total cached users"??

blissful coral
#

uh

#

hm

winged linden
#

😬

#

Is it possible or no?

blissful coral
#

If I remembered the methology yes

winged linden
#

Okay i will search it up! Thanks

boreal iron
#

Tip search for a property called memberCount

blissful coral
#

oh yea

#

lmao

#

@winged linden

winged linden
#

Found it,thanks!!

boreal iron
#

Alright somebody being able to search

#

That’s actually a good start

winged linden
#

Lol

blissful coral
#

fr fr

#

stackoverflow™️

winged linden
#

Well yeah i only asked if its possible i can do my own research and do it my self😂

winged linden
boreal iron
blissful coral
#

lul

boreal iron
winged linden
#

True

summer yoke
#

Guys
How to make like when someone vote my bot
I see who voted him and hos many times he voted like the pic

earnest phoenix
#

anyone know why your bot would become unresponsive when it's on a server after a few days

blissful coral
#

Webhooks

blissful coral
earnest phoenix
#

really?

blissful coral
#

What are you using

#

@summer yoke I responded to you already

earnest phoenix
#

i am using a thing to make it run forever called pm2

earnest phoenix
#

and my hosting service is vultr which i got for free

blissful coral
#

Thats prob why

#

its a free service

earnest phoenix
#

why

blissful coral
#

prob goes down a bunch

earnest phoenix
#

oh

blissful coral
earnest phoenix
#

dang

#

ok thanks

summer yoke
#

K

earnest phoenix
#

the bot shows online though it just dont respond

#

after a few days of inactivity and i have to restart manuallty

summer yoke
#

Use repl it..

blissful coral
#

then your bot may be timing out?

#

@summer yoke Do not recommend that

earnest phoenix
#

maybe

blissful coral
#

Because using repl is actually against there terms

summer yoke
blissful coral
#
  1. its free 2. its not good 3. its against there terms
summer yoke
#

what terms

earnest phoenix
#

i need to hop on the replit train

blissful coral
summer yoke
#

i have 1 year hacker plan

earnest phoenix
#

seems popular

summer yoke
#

And i code on it

earnest phoenix
#

time to look into this

#

well

#

after i complete this sockets assignment

blissful coral
#

Just buy a vps

earnest phoenix
#

vps

#

well i got it for free for a trial

blissful coral
#

yes

earnest phoenix
#

but i dont think i will continue using this service if it keeps going down like dis -.-

#

whats a good vps

blissful coral
#

DO

#

GG

earnest phoenix
#

doo gg

#

hm

blissful coral
#
earnest phoenix
#

i dont wanna pay if i dont gotta tho

#

ill look in my student github for more free trials

#
const db = require('quick.db');
const config = require("../config.json");
exports.run = (client, message, args) => {
    if(message.author.id === "517495640020746250") {
        db.set(`USER_BANNED_SUGGESTIONS_${args[0]}`, { id: `${args[0]}` })
        message.channel.send(`:white_check_mark: Banned userid: ${args[0]} `)
        client.channels.cache.get(config.devlogchannel).send(`UserID: ${args[0]} was banned from suggestions by ${message.author.username}`)
    }else{
        return;
    }
}```
#

Some quickdb work I did today, works well, any suggestions on improvement?

blissful coral
#

well

#

first off

#

Use Mongo™️

earnest phoenix
#

But migration™️

blissful coral
#

Migration is ez tho

#

and ew discord.js KEKW

earnest phoenix
#

mongo?

#

DJS is really good for certain things

#

is python the best

blissful coral
#

discord-rose is better

#

no python is not best KEKW

shut nimbus
earnest phoenix
#

why

#

sql is ez tho

shut nimbus
earnest phoenix
#

o

#

ok

#

discord rose?

shut nimbus
lost mauve
#

I'm seeing some python slander and i'm not liking it

soft glade
#

what would i have to change to this to make it idle

@client.event
async def on_ready():await client.change_presence(status=discord.Status.online, activity=discord.Game("status goes here"))
print('{0.user}  Is Online And Ready To Go'.format(client))
thin merlin
#
@client.event
async def on_ready():
    await client.change_presence(status=discord.Status.idle, activity=discord.Game("status goes here"))
    print(f'{client.user} Is Online And Ready To Go')

just change the discord.Status to .idle

soft glade
#

oh thank you

thin merlin
#

guys, can i set the embed color to the bot's top role color?
i'm using discord.py btw...

#

ok i'll try it, thanks.

viscid gale
#

ah.. finally did something that is extremely possible
Share Objects Online with the power of websockets
as in someone can serve and clients can connect and it would be one shared object
different authTokens you can give with different authLevels so like one token can mean someone can view only and stuff

boreal iron
#

oh oh he’s back 👀

soft glade
#

what

opal plank
#

did someone say detritus?

boreal iron
#

lmao... and Erwins wallet is growing again

opal plank
#

yo legit my dude

#

i just put voice for detritus

#

holy shit

#

5h trying to figure out how it works

#

not that hard

#

mainly me being a bork

#

they removed the notable role

#

like, the role itself

#

nobody has notable anymore

boreal iron
#

Even if you may be a poor sheep KEKW

opal plank
#

erwin is the special kid of the class

#

but topgg's equivalent

boreal iron
#

haha lmao

opal plank
#

but for real tho

#

voice is a lot more complicated than i thought

boreal iron
#

Well gtg, need to get at least 2h of sleep

opal plank
#

gn

sudden geyser
#

tadano sweat

earnest phoenix
#

for my bot I host it on heroku and i have per server prefixes and I am not using any databases for my prefixes.json so heroku keeps resetting the prefixes every time I launch the bot, could anyone tell me how to create a database using heroku postgresql for my per server prefixes

#

I have no clue about databases at all

#

alright

fervent lark
#

Pls help lol

carmine summit
#

auctions = auctions.reduce((acc, cur) => ((acc = {auctioneer: cur.auctioneer,item_name: cur.item_name,price: cur.starting_bid,category: cur.category,id: cur.uuid,rarity: cur.tier}),acc),[]);
it only applies to the first object in the array. and the rest of the array gets deleted

#

im stupid nvm

#

I need to use .push()

latent heron
#

@misty sigil pog

$resp = match(200) {
  200, 300  => "Poggers",
  400       => "Not found",
  500       => "Internal Sever Error"
};
die($resp);
Poggers
[Finished in 0.054s]
#

i already like this new match method

soft glade
#

this is my status on my bot rn
await client.change_presence(status=discord.Status.idle, activity=discord.Game(name=f"on {len(client.guilds)} Servers | d/help"))
atm and it love it but i want it to say "watching" instead of "playing" bc it would sound better
what would i change to make it say "watching" this is discord.py btw

covert vault
#

@soft glade

#
from discord import Activity, ActivityType
await client.change_presence(activity=Activity(name=f"on {len(client.guilds)} Servers | d/help", type=ActivityType.watching))
#

Try that

soft glade
#

Ok

#

Oh it worked thank you so much is there any way I can vouch for you

covert vault
#

I don't think so

#

Could you enable people from sending you texts? I'd like to add something and I don't think I should spam here

soft glade
#

Ok

west agate
#

is there a way to make reaction roles work after a bot restarts

dusky sundial
#

You would need to store the message IDs, reactions, roles etc. in a database and load them whenever your bot starts

west agate
#

oh alr

vast garnet
#
Code: "lol (lul)",
}```
#

This is a correct?

long crow
#

Yes

#

Can do module.exports ={ lol(lol)} too

#

Oh wait, you mean function or variables?

twilit geode
#

where does my slash command http code need to go? bit confused

#

js btw

opal plank
#

@twilit geode js what? using raw http or you got a lib going?

#

discord.js? eris.js? detritus.js?

#

axios? fetch? got?

lyric mountain
#

White? Blue? Nachos? Coconut?

opal plank
#

hotel?

lyric mountain
#

Raid?

opal plank
#

you were suppose to answer Trivago

lyric mountain
#

Your ads were overlaid with other ads

opal plank
#

but i never mentioned detritus

lyric mountain
#

I meant trivago

opal plank
#

but my ads arent trivago

lyric mountain
#

Which is sponsored by Raid: Shadow Legends™️

opal plank
#

i dont get paid to ad trivago

lyric mountain
#

doggowave pat

carmine summit
#

how do I make multiple api requests at a time?

#

like if an api is 500ms average, and I need to make 5 requests, I will need to wait average 2.5seconds

#

how do I make them run simultaneously to save time?

earnest phoenix
#

Smaule

#

Hi

#

where can i get my dbl token from?

carmine summit
#

I have an array, the array is full of objects, and inside the object is a boolean, either true or false. I want to separate them. What is the most efficient way to do it?

[{"bin": true, "id": 1},{"bin": true, "id": 2},{"bin": false, "id": 3},{"bin": true, "id": 4},{"bin": false, "id": 5},{"bin": true, "id": 6}]
[{"bin": true, "id": 1}, {"bin": true, "id": 2}, {"bin": true, "id": 4}, {"bin": true, "id": 6}]
[{"bin": false, "id": 3}, {"bin": false, "id": 5}]

I have a solution, is to use filter() two times. But that is very inefficient

boreal iron
#

What means separating them?
Removing the value of the key bin entirely?

#

Maybe I’m blind but I don’t see a difference between your examples except a space

carmine summit
#

separating the "bin": true from "bin": false

boreal iron
#

Loop through the array and check if array[index] Object.key == bin, if true Object.value = !Object.value

#

Should work

carmine summit
#

wdym?

boreal iron
#

oof I’m driving hold on

#

for(i = 0; i < array.length; i++)
if(Object.keys(array[i] == "bin") Object.values(array[i]) = ! Object.values(array[i]);

#

If the array is larger than what your example was add an else continue;

#

value = !value should negate the boolean

carmine summit
#

so youre basically moving the object by deleting it then moving it to the new array?

boreal iron
#

Should work in JS too

#

What tf nope

#

Im just editing the Object in the Array

#

Not creating a new array

carmine summit
#

its not what I meant

boreal iron
#

If you need a new array then copy it then run the code on the copy as I wrote

#

If you wanna get be as specific as possible what you want

#

let array2 = array
Then work with array2

cinder patio
#

So you want to sort them basically, the first elements in the obj should be with bin: true, the rest with bin: false?

#

oh different arrays

boreal iron
#

Wtf

#

Sorting != separating

#

Why is it so difficult for people to actually tell exactly what they want okeh

cinder patio
#

Nah they want to separate them

#

I just thought the result was a single array

boreal iron
#

Moving all true‘s to a new array maybe?

#

And let false‘s in the array?

#

That’s even more easier

cinder patio
#

Here's what I would do:

entries.reduce((res, current) => {
   res[Number(current.bin)].push(current);
   return res;
}, [[], []]);
#

You can also use a normal loop ofc

boreal iron
#

If think the default loop is faster and more efficient for this example

#

Since he said he’s doing 2x filter and looks for a more efficient way

#

But yeah we still don’t even know if that’s what he want

#

Maybe he just wants to sort the array which would mean to loop through and insert each object value which is true at the beginning of the array

cinder patio
#
[{"bin": true, "id": 1}, {"bin": true, "id": 2}, {"bin": true, "id": 4}, {"bin": true, "id": 6}]
[{"bin": false, "id": 3}, {"bin": false, "id": 5}]

He wants 2 different arrays

boreal iron
#

All these mentioned methods are easy but yeah no glue what he wants

#

Oh okay I see

#

oof I’m driving hold on

#

That may be the issue

#

Well then looping through and adding the objects to a new array is faster then reduce firing a callback on each items I guess

cinder patio
#

probs

boreal iron
#

But that’s micro optimization I guess

#

Didn’t fucking see it’s two arrays on mobile

#

Code blocks are horrible on mobile

#

Like embeds

#

just as an excuse for not reading carefully enough lmao

pale vessel
#

yeah we know, you used that driving excuse countless times already

boreal iron
#

lol

cinder patio
#

I just find it cleaner

const [notBinned, binned] = entries.reduce((res, cur) => res[+cur.bin].push(cur) && res, [[], []]);
boreal iron
#

But who cares

rich bronze
#

p

#

I want bots for PC

cinder patio
#

what does that mean

boreal iron
#

There we go again

cinder patio
#

That's straight up nonsense though bloblul

boreal iron
#

Aye

carmine summit
#

[+cur.bin] what does this do?

cinder patio
#

turns the bool to a number

carmine summit
#

why would you turn it into a number

cinder patio
#

So we can put it in it's respective array

carmine summit
#

ohh I kinda get it

#

if it is false

#

it is 0

#

and will get directed to notBinned

#

but if it is true

cinder patio
#

yup

carmine summit
#

it will do the exact opposite

#

&& res, [[], []] what does this do?

cinder patio
#

&& res makes the callback return the array

#

[[], []] is your starting accumulator

carmine summit
#

why does it have to be &&

cinder patio
#

because that's how the operator works

#

you can also use return but then the function will take up more space

carmine summit
#

so I could use .push(), return res, [[], []]??

cinder patio
#

no, you would have to put the code in the callback in curly brackets

#

But using && is better

carmine summit
#

so if I wanted to use return I would have to make a function inside the reduce function

#

but if I use && it will just like substitute return

cinder patio
#
const [notBinned, binned] = entries.reduce((res, cur) => { res[+cur.bin].push(cur); return res }, [[], []]);

Same function with return

#

&& res is cleaner

carmine summit
#

[notBinned, binned] = entries.reduce((acc, cur) => (res[+cur.bin].push(cur), acc),[[], []]);

cinder patio
#

you also don't create a new scope

carmine summit
#

why does this work aswell

cinder patio
#

That doesn't separate them

#

Oh you're talking about the (...)

carmine summit
#

yeah

cinder patio
#

no clue tbh but if use it if it works ig

carmine summit
#

only booleans work on +??

cinder patio
#

strings too

carmine summit
#

ohh

#

whats the difference of () => {} to () => ()

cinder patio
#

in the first one you're creating a new scope

#

in the second one you just group expressions

carmine summit
#

so its possible to create functions with multiple expressions without having to scope them ?

cinder patio
#

mhm

slow junco
#

hi

cinder patio
#

And apparently the last expression is also returned, didn't know that

carmine summit
#

why doesnt if () () work

slow junco
#

ok

cinder patio
#

¯_(ツ)_/¯

carmine summit
#

it only works on functions. ok

cinder patio
#

It owrks for me

#

works*

carmine summit
#

you learn something new everyday

#

wait no way

cinder patio
opal plank
#

is there a way to get folders only from fs?

slow junco
#

wow Discord Bot

carmine summit
#

holy cow it works

#

alright thanks

slow junco
#

wow wow

#

Good bye

carmine summit
#

how do I make multiple api requests at a time?
like if an api is 500ms average, and I need to make 5 requests, I will need to wait average 2.5seconds
how do I make them run simultaneously to save time?

cinder patio
#

Don't await the api call

#

@carmine summit

opal plank
#

never again

#

this is the total amount of time that i took to fully implement voice on detritus

twilit rapids
opal plank
#

opus is out of the table

#

fuck that

twilit rapids
#

What is this detritus btw

opal plank
#

best discord library for javascript/typescript

twilit rapids
#

I mean you can use lavalink I suppose

long copper
#

Hello i have an error in my event handler, can someone help me ? :

const fs = require('fs');

module.exports = (Client, Discord) => {
  const load_dir = dirs => {
    const event_files = fs.readdirSync(`./events/${dirs}`).filter(file => file.endsWith('.js') );

    for (const file of event_files) {
      const event = require(`../events/${dirs}/${file}`);
      const  event_name = file.split('.')[0];
      Client.on(event_name, event.bind(null, Client, Discord))
    }
  }

  ["client", "guild"].forEach(e => load_dir(e))
}

The error code is :

Client.on(event_name, event.bind(null, Client, Discord))

TypeError: event.bind is not a function
opal plank
#

indeed

#

but it took a huge ass time

twilit rapids
#

Or do you mean coding voice support for the lib

opal plank
#

nono, i used lavalink

#

i started with opus and manual connections

twilit rapids
#

Ah oki

opal plank
#

but quickly scratched that

#

the issue is that im making this scalable

twilit rapids
#

9 hours though? Basic usage or a full music system

opal plank
#

so i had to write semi-pristine code

#

mid way

#

im working on it in a radio-type of deal

#

so i got a master serving all connections simulaneously

twilit rapids
#

Do you have IPv6 though

opal plank
#

i dont need it

#

not using api's so i dont need to rotate ip's

twilit rapids
#

I see

opal plank
#

not dealing with ratelimiting

#

fuck that shit

#

youtube quotas

#

spotify ratelimits and quotas

#

fuck all that garbage

twilit rapids
#

Well I don't use YouTube quotas

#

That's why there's IPv6

opal plank
#

thats what i meant with scalable

#

i do have some ipv6 blocks

#

but not planning on using api's for the music bit of my bot

#

so theres not really much need

twilit rapids
#

And Spotify's ratelimiting is pretty big, I haven't hit a single 429 the past few months

opal plank
#

how many servers?

twilit rapids
#

Well with lavalink you don't use apis

#

155k

opal plank
#

hmmm

#

ngl, im a bit reluctant from using apis

#

for now i'll keep every cached locally

twilit rapids
#

I cache almost every request I make

#

I've got 3M+ queries cached atm