#development

1 messages · Page 1051 of 1

earnest phoenix
#

how do i use that

unkempt marsh
#

Just figure it out how it works.

#

Do a research.

earnest phoenix
#

dude

#

if you know it why dont just help me

solemn latch
#

its a google search away

unkempt marsh
#

😔

solemn latch
#

because the rules say not to

#

🤔

earnest phoenix
#

why do you guys want me to struggle to get a line of code if you guys can help then just help

pale vessel
#

i don't care about the rules, i just won't spoon-feed

solemn latch
#

because research skills are critical for development work

unkempt marsh
#

Everyone struggling from the beginning.

haughty mirage
cinder patio
#

Because you will never learn that way

earnest phoenix
#

this is not my beginning

solemn latch
#

you would have an example already if you googled it

pale vessel
#

it clearly is

earnest phoenix
#

i said I CCAME BACK AFTER A LONG BREAK ...

pale vessel
#

wake up

haughty mirage
#

😂

earnest phoenix
#

ill do it myself

unkempt marsh
#

setInterval isn't hard to understand.

digital ibex
haughty mirage
#

Woot, look someone googled it for you

pale vessel
#

lmgtfy moment

tulip ledge
pale vessel
#

poor chickendev, sorry, i can't help even though you sent that twice already

sudden geyser
#

why do you guys want me to struggle to get a line of code if you guys can help then just help
@earnest phoenix if you struggle and learn how to overcome it by doing some research, you'll know how to solve future issues. If we give you the answer right here (which often comes with no explanation), you won't understand it. There's a simple saying for this: "Give a man a fish, and you've fed him for a day. Teach a man to fish, and you've fed him for a lifetime."

#

more like three times

earnest phoenix
#

ill learn better if you guys can just hand mme over the line of code

sudden geyser
#

trust me you won't

earnest phoenix
#

what if i dont get it by the end of the day.. i will get demotivated and fucking leave coding and my fucking bot.

pale vessel
#

then you're not worthy

unkempt marsh
#

Bruh.

tulip ledge
#

True

earnest phoenix
#

HUH?

tulip ledge
#

I've been working on this thing for 3 months and I'm not giving up untill I get this god damn dungeon feature to work

pale vessel
#

if you can't do a simple Google search, how are you going to code a discord bot? [@earnest phoenix]

earnest phoenix
#

i have already coded it

tulip ledge
#

Google doesn't give up anything about it @pale vessel

unkempt marsh
#

True.

earnest phoenix
#

if i dont know something its better to help me

#

you guys know how to make it work

tulip ledge
#

It sais to order by and I tried it but you can't do it with strings

earnest phoenix
#

then just hhelp me man

pale vessel
#

sorry, not you (chickendev)

digital ibex
#

help = help
give code = spoonfeed

earnest phoenix
#

atleast hhelp me

tulip ledge
#

I'm sure Tim knows the solution

#

Damnit last time I said that Tim knows the solution he showed up and gave me the solution

digital ibex
#

one minute you're asking for help then code 😓

tulip ledge
#

Rip

earnest phoenix
sudden geyser
#

intervalFunc is not defined

tulip ledge
#

I have a feeling it's impossible with mysql

earnest phoenix
#

pls help me wtih the coe

#

code

#

):

sudden geyser
tulip ledge
#

Omg what if I just saved the user's id from the row?

#

That could work

#

Right?

#

😮

digital ibex
#

what even is ur issue, chicken dev?

#

i didn't read it because it was all together and hard to read

unkempt marsh
#

I use mongoDB instead of mysql.

earnest phoenix
#

@unkempt marsh can you pls give me the code>

#

i tried b ut i got error on 2 different attempts

tulip ledge
#

Omg it worked

#

Well it's hard to explain too

unkempt marsh
tulip ledge
#

The issue was that the query would always return the rows in the same order meaning if a user accepts before me even though I accepted later my stats would be returned first and assigned to the user who accepted first

#

But I fixed it

earnest phoenix
#

so you guys are not gonna give me the code?

tulip ledge
#

No

unkempt marsh
#

Spoon feeding isn't allowed here.

tulip ledge
#

It's against the rules

earnest phoenix
#

im not asking y ou guys for the whole bot code. im just asking for a line of code .

tulip ledge
#

WOO

solemn latch
#

if you want a teacher, hiring one might be a good option

tulip ledge
#

I NEED U

#

DM me 2 lines for your boss please

earnest phoenix
#

you guys can just help me by saying where to add what

unkempt marsh
#

You don't need to memorize it, you only need to know how it works and better understanding. @earnest phoenix

tulip ledge
#

2 lines he sais before the boss battle starts

solemn latch
#

oo

#

okay

#

hmm

earnest phoenix
#

if you guys tel me the line of codde THEN IT WILL BE BETTER FOR ME TO learn it

#

you guys are gonna make me cry

digital ibex
#

@earnest phoenix rule 7b lol

solemn latch
#

thats not how it works @earnest phoenix

#

🤔

digital ibex
#

lmaoooo

unkempt marsh
#

😔

solemn latch
#

programming is largly a self learning process

dawn night
#

-botinfo

gilded plankBOT
#

tickNo Please include a bot mention or ID

digital ibex
#

wrong channel

earnest phoenix
#

BUT IF YOU GUYS CAN HELP MME WITH SOMETHIJNG THEN WWHY DO YOU GUYS WANT MME TO WORK SO HARD FOR IT

tulip ledge
#

@earnest phoenix Trust me reading the docs and trying it out yourself is much better to learn then people giving it to you

earnest phoenix
#

just help me

#

and il learn it

solemn latch
#

lol

pale vessel
#

no and please, relax

tulip ledge
#

Woo if you know 2 lines DM me

#

I'll be working on the boss battle rn

digital ibex
#

its getting annoying now pls stop

solemn latch
#

oo

earnest phoenix
#

this is such a fucked up s erver dude

digital ibex
#

lol

earnest phoenix
#

you guys just cant help me with 1 line of code?

pale vessel
#

lol

earnest phoenix
#

like

#

BRUH

hidden lynx
#

lol

pale vessel
#

is it now

unkempt marsh
#

😔
🙏

pale vessel
#

you can always leave instead of complaining

earnest phoenix
#

so apparently giving me 1 line of code is called SPOONFEEDING?

tulip ledge
#

Yes

digital ibex
#

guild.leave()

earnest phoenix
#

@tulip ledge you are asking for the same thing

tulip ledge
#

No I wasn't

sudden geyser
#

can someone please end this convo

pale vessel
#

lost spoonfeed

tulip ledge
#

I was asking for a sloution

#

I never asked for any code

hidden lynx
#

The server is awesome. If you are friendly and grateful for answers people will help you within a few minutes

lusty quest
#

its also possible that noone wants to help bcs you are going ballistic

digital ibex
#

yeah, that code is best code

restive willow
#

would it be API abuse to store each server's emojis in a database when the bot joins

earnest phoenix
#

i wasnt going at first i just asked for it and nobody was helping me while they could just give me a line of code and i could hapilly continue coding

digital ibex
#

no

pale vessel
#

i mean it's cached so no

digital ibex
#

unless

unkempt marsh
#

would it be API abuse to store each server's emojis in a database when the bot joins
@restive willow It depends.

pale vessel
#

okay, it depends, care to explain?

#

lol

lusty quest
#

you can cache all the Emojis on start

solemn latch
#

setInterval(function, time to delay in ms)

#

🤔

lusty quest
#

so i guess there is no point into saving them

unkempt marsh
#

Some of databases has update request limitation, so it depends.

earnest phoenix
#

this is just frastrating me you guys arent understanding me holy SHI T

solemn latch
#

we understand you

earnest phoenix
#

CAN I JUST NOT GET 1 LINE OF CODE FROM HERE?

unkempt marsh
#

Bruh.

earnest phoenix
#

pls dude

#

wtf is wrong

solemn latch
#

its not our job

#

🤔

pale vessel
#

why are you bringing this up again bruh

digital ibex
#

theres no point saving it in your db, you can just get the emojis from the cache

earnest phoenix
#

because im still looking for the line of code

digital ibex
#

what u looking to do, @earnest phoenix

lusty quest
#

@earnest phoenix what is your issue?

solemn latch
#

two examples where given already

restive willow
#

really? how do I go about storing them in the cache? or is it done automatically

#

using py btw

earnest phoenix
#

im trying to loop a code

pale vessel
#

it should be done automatically

lusty quest
#

more infos?

digital ibex
#

loop a code?

#

wdym

earnest phoenix
lusty quest
#

use a interval

pale vessel
#

i'm not sure with python but it's probably stored somewhere in the guild object

hidden lynx
#

setInterval

earnest phoenix
#

set interval is not woring

#

its giving me error

lusty quest
#

you need to use a function to get it running

pale vessel
#

client could have it too

earnest phoenix
#

how do i use that function

lusty quest
#

and define a time in miliseconds

digital ibex
#
setInterval(() => { 
guild.leave();
}, 1000);```
restive willow
#

yea, guild.emojis is a thing, but I want an easy way to be able to search for emojis with a certain name

digital ibex
#

ha

hidden lynx
#

Google how to use the functiona properly

sudden geyser
#

the first argument should be a function, and the second argument should be how long in milliseconds

earnest phoenix
solemn latch
#

you know, VSC gives you the formatting for setInterval

lusty quest
pale vessel
#

aren't there utilities for that?

earnest phoenix
#

im trying to learn it from this wevsite

#

but i cant learn it

hidden lynx
#

Exactly

pale vessel
#

there's probably a function for it

restive willow
#

maybe, but i havent heard of such a thing

pale vessel
#

like name=test, could've sworn i saw it somewhere in docs

earnest phoenix
#

that on e dude here knows it but he isnt helping...

digital ibex
#

ruby, what r u trying to do?

earnest phoenix
#

spoonfeeding probs..

restive willow
#

i mean searching across all emojis, not just ones in a specific guild

digital ibex
#

yeah

pale vessel
#

you can group them up

lusty quest
#

it litterally is written on the page how to do it

pale vessel
#

and then search afterwards

restive willow
#

ruby, what r u trying to do?
@digital ibex store a fuck load of emojis from thousands of different servers and be able to search all of them by name

pale vessel
#

if your discord client have an object with cached emojis, it would be easier

digital ibex
#
guild = <Client>.get_guild(guild id)
#

oh

pale vessel
#

try looking in the docs

lusty quest
#

idk does d.py got gateway intends? bcs there is one for caching emojis

pale vessel
#

if not, get all emojis from a guild using loops and search

lusty quest
#

atleast for d.js

digital ibex
#

idk if dpy has a client.emojis thing, but use that

restive willow
#

idk, haven't looked into that

#

client.emojis? aight ill have a look

pale vessel
#

yeah you should

restive willow
#

idk if dpy has a client.emojis thing, but use that
@digital ibex would that contain emojis from all shards or just the one the command comes from

digital ibex
#

all shards

restive willow
#

lovely

digital ibex
#

as its: client = all shards

restive willow
#

right, I'll look into that, thanks for the help

restive willow
#
query = "pepe"
print(query_emojis := [emoji for emoji in bot.emojis if query in emoji.name])
print(len(query_emojis))
#

seems good

#

thanks for the help

digital ibex
#

hey guys

#

quick question

golden condor
#

Yeah

digital ibex
#

i have for inputs css: width: 100px; but nothing changes, any ideas?

#
   .button, input {
      margin: 10px;
      display: inline-block;
   }
   input {
      width: 100px;
   }```
#

oh wait, i need to push the changes

#

1 sec

golden condor
#

try input[type=text]

#

oh nvm

digital ibex
#

okay, i've pushed the changes, it should show now

earnest phoenix
#

Anyone willing to make me webhooks?

autumn aspen
#

Oops

digital ibex
#

2 things:

  1. put quotes around it
  2. wtf is package-kick.json
autumn aspen
#

I did

pale vessel
#

package kick bruh

autumn aspen
#

also not ur buiesness

earnest phoenix
#

my bot isnt starting

digital ibex
#

use a different port

#

whatever ur running that on, im assuming a vps or something, is already using port 3000

earnest phoenix
#

glitch xd

digital ibex
#

2 different processes can't run on the same port

earnest phoenix
#

oh i tried to start my bot again

digital ibex
#

send the error stack

#

im not sure if that would help but 🤷

earnest phoenix
#

Remix your project

#

ok

#

Remix your project
@earnest phoenix thanks it worked

#

i want to use visual studio code but

#

i cant install quick.db

digital ibex
#

visual studio code has nothing to do with quick.db

earnest phoenix
#

yeah,you need to install it by manuel

#

@earnest phoenix You need to install the modules.

#

ik

#

by running npm i --save

#

ik

#

ik

digital ibex
#

btw, you dont need the --save

solemn latch
#

i actually have no idea what --save does

#

its in so many guides tho

digital ibex
#

doesn't do anything

solemn latch
#

but not in others

hidden lynx
#

It's saves the module in that folder

solemn latch
#

🤔

hidden lynx
#

Not globally on your pc

solemn latch
#

ah

digital ibex
#

it used to do something before 2015 i believe, now it doesn't do anything

#

no behomoth

hidden lynx
#

No?

digital ibex
#

i dont remember the exact date

#

no it doesn't do anythinig

hidden lynx
#

I was pretty sure it was that

#

Or used to

digital ibex
#

probably from before 2015

#

not now

iron steeple
#

I'm getting 400 Bad Request are some discord servers down?

digital ibex
#

no

#

you wont be getting a 400 request if it had anything to do with discord

iron steeple
#

oof alright

solemn latch
#

well, probably, its discord. but thats not the cause

hidden lynx
#

OfficiallyLost you were right

#

--save is no longer needed

digital ibex
#

:^)

earnest phoenix
#

i need 7/24 hosting free

#

free

hidden lynx
#

It was because of the old npm. Where you had to install and then add things to the project. --save did those things in one take

digital ibex
#

i recommend using loc, a free good host

#

i think thats the url

unique nimbus
#

Nothing is fully free

digital ibex
#

yes

unique nimbus
#

how would they make money

digital ibex
#

how the internet works?

#

ads

unique nimbus
#

adblocker

sudden geyser
#

subscriptions™️

unique nimbus
#

most people has adblocker

digital ibex
#

they still make money off of ads, they've got patrons u can donate money and stuff

unique nimbus
#

they will require more money

#

when more people uses it

#

not everyone will give them money

#

when they can use Galaxygate

#

or Contabo

#

which is a much better service

digital ibex
#

well

#

for a temp service / a small project, i recommend using them instead of paying for something

unique nimbus
#

I mean

#

I host many projects

#

website

#

and other crap

earnest phoenix
unique nimbus
#

okay

digital ibex
#

i host my website too

iron steeple
#

alright then wtf is going on with my bot its now saying object TextChannel can't be used in 'await' expression

vital flax
#

Fully free hosting

iron steeple
#

its been a while but im sure channel.send is right tho?

earnest phoenix
#

only me cant spend money to internet ;-;

digital ibex
#

thats fine

#

use something free for now then

earnest phoenix
#

lol

#

site not works for me

digital ibex
#

works for me

vital flax
#

@earnest phoenix You must have an Invite code. . .

earnest phoenix
#

ühat

#

i cant sign up

vital flax
#

Like many private vps on internet

#

You must have invite code

earnest phoenix
#

hm idk

vital flax
#

@earnest phoenix Do you know the @cyan python bot?

earnest phoenix
#

no

vital flax
#

The owner of the bot said that he couldn't afford the vps, had to host the bot in an old computer stored in a closet.

#

And now it has become one of the largest Discord bots.

earnest phoenix
#

What about the electricity bill?

vital flax
#

So you can host your bot on your computer 24/7.

earnest phoenix
#

i have an old laptop but not works without charging

vital flax
#

A computer doesn't use too much power.

earnest phoenix
#

i saw a invite ? lol

#

again

misty sigil
#

Stop advertising

vital flax
earnest phoenix
#

i can use that old laptop

vital flax
#

@earnest phoenix host a bot on old laptop

#

24/7/365

earnest phoenix
#

365 woah

vital flax
#

👍 🎉

earnest phoenix
#

this laptop has 512 mb gpu

misty sigil
#

dont mater

earnest phoenix
#

hm

vital flax
#

@earnest phoenix Provided your laptop does not burn on a random day.

#

Lol

earnest phoenix
#

the only problem is quick.db

vital flax
#

@earnest phoenix programming language?

earnest phoenix
#

discord.js

vital flax
#

Try nodejs

#

Hmm

earnest phoenix
#

Node js is discord js

vital flax
#

@earnest phoenix yes i know

earnest phoenix
#

Node js is discord js
@earnest phoenix ik

#

Why did you say > Try nodejs
Then

vital flax
#

@earnest phoenix This guy is going to host the bot with virtual code studio

earnest phoenix
#

It wont work

#

It cant work

vital flax
#

You should know the story.

#

Yes i know

earnest phoenix
#

I know the story

vital flax
#

@earnest phoenix you dont know

earnest phoenix
#

I didnt before

#

Now i know

vital flax
#

Then install nodejs and quick.db

#

Done

#

@earnest phoenix and nodejs ≠ discordjs

earnest phoenix
#

Npm js doesnt have to be installed seperately

vital flax
earnest phoenix
#

Just download node

#

And it will wor

#

For me it worked like that

digital ibex
#

assuming you've downloaded it in the correct dir ^^

earnest phoenix
#

quick.db?

digital ibex
#

no, nodejs

earnest phoenix
#

Are you on linux

#

i am always getting errors when i install quick.db

#

no windows

vital flax
#

Hmm

earnest phoenix
#

wendaws tne

#

.db on windows waitWhat

#

hm

#

i can install virtual box but

#

it can be very slow

#

You have installed it for the wrong operating sysmtem

#

Im pretty sure its available for windows

stark abyss
#

how would i use functions that is needed in mupltiple module exports files? should i made a different file with that function and load in the function before module exports in that file

vital flax
earnest phoenix
stark abyss
#

tf

#

i have no clue

#

where does that take u?

earnest phoenix
#

Are you using betterdiacord?

#

google chrome

#

Betterdiscord*

solemn latch
#

reported, client mods

stark abyss
#

lmao

earnest phoenix
#

its a bug

#

xd

#

Db is for linux

#

which linux

stark abyss
#

help

earnest phoenix
#

@stark abyss what do you need

stark abyss
#

how would i use functions that is needed in mupltiple module exports files? should i made a different file with that function and load in the function before module exports in that file

earnest phoenix
#

lol can i host my bot from phone?

stark abyss
#

lmk if that's not readable

earnest phoenix
#

i have 4 gb ram on my phone .__.

solemn latch
#

probably should host from a VPS

#

if possible

earnest phoenix
#

what is vps

#

idk what is vps ._.

stark abyss
solemn latch
#

virtual private server

vital flax
#

@earnest phoenix Have you installed nodejs?

earnest phoenix
#

@earnest phoenix Have you installed nodejs?
@vital flax no

vital flax
#

@earnest phoenix install it

earnest phoenix
#

@stark abyss

#

where is download button lol

autumn aspen
earnest phoenix
#

Gotta go

#

Bye

autumn aspen
#

Why is it so when I respond anything?

stark abyss
#

dam ok

earnest phoenix
#

dont spam please

autumn aspen
#

Ok

#

Help please

earnest phoenix
#

hm

vital flax
#

@autumn aspen Do you have permission to manage the channel?

autumn aspen
#

Yes

#

Its my alt

#

And whenever I type like ''hid''

#

It reacts like that

earnest phoenix
#

You are telling it to say that if the user "has "the pernissuons

autumn aspen
#

Oh

earnest phoenix
#

@autumn aspen glad i helped

#

🙂

#

@vital flax i am registered to npm

#

now?

#

@autumn aspen you're checking for permissions outside of the command which will trigger everytime somebody uses anything

#

Im*99

vital flax
earnest phoenix
#

@earnest phoenix caktirma

#

when my bot gets verified on top gg

#

stop shitposting

#

oh

#

i forget

#

sry

#

@earnest phoenix when did you submit your bot

sinful belfry
earnest phoenix
#

@earnest phoenix 13-14 days

#

wait wha

#

That would be the time they review it or it will be just delayed a little longer @earnest phoenix

vital flax
#

Verification at top.gg is still faster than the discord.

autumn aspen
#

wait wha
@earnest phoenix I fixed it

#

Anyways

earnest phoenix
solemn latch
#

13 days

#

queue is 3-4 weeks rn

earnest phoenix
#

oh

#

@vital flax installed node js

solemn latch
#

you should submit bots after your develop them

#

not before

#

🤔

earnest phoenix
#

i am created my bot but

#

its on glitch

#

my bot not 7/24

honest perch
#

ew

solemn latch
#

glitch is activly removing bots from their platform

earnest phoenix
#

i have an old laptop i can use this old laptop for 7/24

solemn latch
#

expect your bot to be taken down

#

🤔

#

o ok

earnest phoenix
#

Self hosting or glitch/heroku is bad for bot hosting

queen needle
#

Yeah

earnest phoenix
#

Vps is the best way to go if you wondered

queen needle
#

Or like a rpi

earnest phoenix
#

my parents doesnt let me spend my money on internet ;-;

vital flax
#

I waited 6 weeks to get declined. And 1 month for the another declined :)

earnest phoenix
#

lol why

#

gotta love 7 hour hosting over 24 days

queen needle
#

Ikr

earnest phoenix
#

Lol

#

@earnest phoenix any idea about my question

#

uhh can you link me to it

#

nvm found it

vital flax
#

Because my bot's name is Hentaivn. @earnest phoenix

earnest phoenix
#

qeqweqweqweqweqwe

#

lmao

#

ok

#

my bot name is Axtray ._.

scenic kelp
earnest phoenix
#

@vital flax i am installed node js

#

now?

#

should just be able to jobj.dist_tags no? that json structure is weiird

vital flax
#

@earnest phoenix then install nodejs, quick.db

earnest phoenix
#

@earnest phoenix lemme try idk

#

me:
i am instealled node js
ndbiaw:
then install nodejs ._.

#

and then if you want the latest, chain .latest on the property call

#

@earnest phoenix you're really not funny

#

@earnest phoenix nope didn't work

#

hm

#

where is that json coming from

#
embed.set_footer(text=f"Executed by {ctx.author}", url="https://cdn.discordapp.com/attachments/731731046651133952/731940826258604122/clipart-rocket-spaceship-15.png")```
#

is this not valid?

#

How do we do footer icon

#

A response from https://registry.npmjs.org/<package name> converted into json @earnest phoenix

#

via JSON.parse ?

#

No, response.json() or idk if this just gets the json of the response or whatever

#

oh my god im stupid

#

did you try accessing with dist_tags or dist-tags

#

Tried both, none worked

#

that json is cursed

#

Truly

ember lodge
#

Why it says 27k users when I put client.users.size but this server haves more than 100k

next escarp
#

If my bot hits 30 servers, i will host

solemn latch
#

well

next escarp
#

cuz, if you host then your bot isnt popular.

#

then you wasted money

solemn latch
#

pretty sure most bots on top gg get 30 servers in a few days

next escarp
#

ooo

earnest phoenix
#

Why it says 27k users when I put client.users.size but this server haves more than 100k
@ember lodge those are only the users you have in cache

#

for an accurate count use guild's memberCount property

#

or download all members in all guilds

#

which will eat more ram than chrome with 3 tabs

#

@ember lodge you gotta fetch them all to show the correct one which can be done by using fetchAllMembers option set to true in your client options but this should be avoided if possible cuz eats a lot of memory

ember lodge
#

Lol thxs

alpine thicket
#

Hello 👀

earnest phoenix
#

@earnest phoenix This json is expecting me to access object inside an object but the objects inside this object are named with versions, wtf

alpine thicket
#

Can somone help me

#

It's not a bot thing

solemn latch
#

🤷‍♂️

#

i wouldnt know if i can help you

earnest phoenix
#

.

alpine thicket
#

It's when I stream others can't hear

dreamy topaz
#

.

earnest phoenix
#

@earnest phoenix bruh i just realized to access properties that the property names are strings we need <json/object>[<property name>] truly a wtf

#

@gleaming glen kardeşim botlara baksana aloo

solemn latch
#

@alpine thicket whatever streaming platform and program you use likely has a way to get support

alpine thicket
#

🤔

solemn latch
#

wrong place to ask

alpine thicket
#

Where should I ask

solemn latch
#

the support of the program you use

alpine thicket
#

Ty

glossy elk
#

is quick.db good

autumn aspen
#

''0xff0000'' guys this is a red embed color for ur bor right? WHats the white then?

#

lmao

#

Pls gimmie

glossy elk
#

is quick.db good <<

autumn aspen
#

nahhhhhh

#

idk

glossy elk
#

please

#

dont say nah

pale vessel
#

white is 0xffffff

glossy elk
#

if you dont know

digital ibex
#

not really

glossy elk
#

wdym not really

digital ibex
#

im not sure about the speed and stuff, but you should use a proper db

glossy elk
#

such as

digital ibex
#

uhh

#

mongodb

glossy elk
#

dont say mongodb

#

OML

digital ibex
#

why

glossy elk
#

i just

#

dont want to use it

digital ibex
#

use mysql

autumn aspen
#

white is 0xffffff
@pale vessel thx dude

earnest phoenix
#

Why it says 27k users when I put client.users.size but this server haves more than 100k
@ember lodge probably because that's only the cached users

#

oh just noticed someone else explained

ember lodge
autumn aspen
#

Guys I know what the welcome message command is can someone pls give me the goodbye message

#

Thats just my last command and I dont find it anywhere :/

#

Thx

#

Guys this is a user.mention right? ${member}. Than whats the server?

#

Mention

#

Please really need that little command

#

Whaaaaaa

#

Ok then thx

hot comet
#

im coding in discord.py but I got this error in my terminal:

    client = commands.Bot(command_prefix = get_prefix())
TypeError: get_prefix() missing 2 required positional arguments: 'client' and 'message2'
```What do I do to fix that?
autumn aspen
#

guildMemberRemove event.
@earnest phoenix Thx dude it worked!

sudden geyser
#

don't call get_prefix

hot comet
#

my code greats get_prefix before hand

autumn aspen
#

lmao

gray zealot
#

any ideas why this doesnt work?

const fs = require("fs");
const money = require("./money.json");

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

    if(!args[0]) {
        var user = message.author;
    } else {
        var user = message.mentions.user.first() || bot.users.cache.get(args[0]);
    }

    if(!money[user.id]) {
        money[user.id] = {
            name: bot.users.cache.get(user.id).tag,
            money: 0
        }
        fs.writeFile("./money.json", JSON.stringify(money), (err) => {
            if(err) console.log(err);
        });
    }
    message.channel.send(`${bot.users.cache.get(user.id).username} has $${money[user.id].money}.`)

}

    

module.exports.help = {
    name: "balance",
    aliases: ["bal", "money"]
}
``` it supposed to send what your money is... is just comes out with a huge error, let me get it 🙂
#

its too big 😄

autumn aspen
#

Anyone knows what the embed servericon is?

#

command

gray zealot
#

embeds the server icon?

queen needle
#

so im trying to create a custom command command with mongo db this is the code https://sourceb.in/6e7c2a6ad9 the only problem is the viewing part it always says pages not found even after i create a custom command it still says no pages found

autumn aspen
#

That shows u the bot icon

#

pfp

sudden geyser
#

my code greats get_prefix before hand
@hot comet what

autumn aspen
#

bot.user.displayAvatarURL()
@earnest phoenix No like when the bot sends a embed thing the bot pfp is on the right side

hot comet
#

oh i mean my code calls it before hand

autumn aspen
#

thanks

hot comet
#

Wait, is it meant to be a function there or no. My code is:

def get_prefix(client, message):
    with open("prefixes.json", "r") as f:
        prefixes = json.load(f)

        return prefixes[str(message.guild.id)]

client = commands.Bot(command_prefix = get_prefix())```
sudden geyser
#

I don't think you should be opening the file every time the function is called (can't you save it to some variable once). I'm not a python nerd, but that doesn't sound like good practice.

hot comet
#

Oh thats why it wasn't working. Im kinda dumb

misty sigil
#

money.json

#

json db?

gray zealot
#

yes

#

wait...

#

its a json file

misty sigil
#

uhh no. just no.

gray zealot
#

?

#

😄

misty sigil
#

json will corrupt

gray zealot
#

😬

sonic lodge
#

use some kind of relational database

#

like mysql

gray zealot
#

mongo?

#

lol

sonic lodge
#

yeah

misty sigil
#

use mongo yes please do

gray zealot
#

*sigh* Idk how to 😂

sonic lodge
#

i don't think it's relational lol

gray zealot
#

hmm

autumn aspen
#

Guys I also wondered how do u make a cooldown on a command?

#

discord.js

#

v12

left lake
#

google 😐

gray zealot
#

nu-uh

left lake
#

anywho is anyone here familiar with sequelize, im using it for my bots database systems and everytime i want to add a new column to it (if its already made) it throws an error (i.e [column] not found on [database])
i read somewhere you have to 'migrate' it and use some weird migration.js whatever...is this the way to go?
does anyone know how to go about this?

sudden geyser
#

@autumn aspen Making cooldowns is simple but takes a bit of code. You'll need to keep track of who's rate limited either through an array, set, map, etc. I recommend a map so you can tell the user how much time is left.

When the user runs a command, check if they're in the cooldown map. If they are, tell them they're being rate limited and don't proceed. If they aren't, you should add them to the cooldown map (if you're using a map, the key should be the user ID and the value can be the timestamp when they ran it). You can them use setTimeout to schedule to then remove them from the cooldown map.

Here's an example: ```js
bot.cooldowns = new Map();

// ... message received and variable command represents a command ...
if (bot.cooldowns.includes(message author id)) {
// You are being rate limited!
return;
}

bot.cooldowns.set(message author id, Date.now())```

misty sigil
#

can i host a site on a vps?

left lake
#

(the only other fix i know to this is on glitch to remix the project..although i dont think that'd work for my vps)

marble juniper
#

@misty sigil yes

misty sigil
#

ty will do

marble juniper
#

with js you can use express

misty sigil
#

ooh then i can use oAuth

marble juniper
#

and then you visit the ip of the vps

#

and the port

#

and yeah

misty sigil
#

and i dont need my freehost anymore keklol

marble juniper
#

if you have a domain you can go to the dns settings and make an A record for the vps ip

gray zealot
#

use mongo yes please do
@misty sigil but how...

tulip ledge
#

Is there a way to let code wait on a method in a class?

digital ibex
#

wot

#

let code wait?

tulip ledge
#

Yes like await

digital ibex
#

wdym?

#

normally, you wouldnt await a class no

tulip ledge
#
undefined
282
50
1000
353

This is being logged I'll tell you the order:
282 and 50 are asked for first
Then undefined is a return from a class
353 is asked then and then 1000

#

And that's the issue

#

As 353 takes longer then 1000 but 353 has to go first

#

Before 1000

#

if u get what I mean

digital ibex
#

what exactly are you logging and what do you want it to log?

tulip ledge
#

So

#

What I have is a method in a class
This method is move (the user does a move)
Inside of that method I ask a SQL query etc... I then set the boss's health and also log the boss's new health (this is the 353) after I run the method I console.log the boss.health but as you can see up there the boss health gets logged before the method is finished

digital ibex
#

whats a 'boss'?

tulip ledge
#

A class

#

But the method doesn't exist in the boss class it exists in the player class

digital ibex
#

have you added the method in the boss class?

tulip ledge
#

No

#

I told u

#

The method exists in the player class

#

I just overwrite the boss's health in that method

glossy elk
#

a

digital ibex
#

im confused.

#

what isn't working as expected?

tulip ledge
#

The method is called before the console.log() but the method finishes after the console.log()

#

Meaning when accessing the boss.health object it has yet to be overwritten

#

Where is Tim if you need him D:

digital ibex
#

so... you want to overwrite the bosses health?

left lake
#

so you're attempting to overwrite a column in a database with a new value,

#

and then pull that new value

tulip ledge
#

No

left lake
#

but the database is pulling the old value?

tulip ledge
#

Boss is a class

#

Like Itold you

digital ibex
#

yes?

tulip ledge
#

Yes @digital ibex I am overwriting it but the code after the method is executed before the method finishes

left lake
#

make it await it overwriting

#

it wont execute any further code until that line has completed

tulip ledge
#

async await doesn't work in methods

#

I also tried to await player.move but that doesn't work either

left lake
#

i have no idea what you're even trying to code here

#

so im out

#

👋

digital ibex
#

send the health method

autumn aspen
#

async await doesn't work in methods
@tulip ledge I cant find a mute command and duration can u help out bud?

left lake
#

😐

#

you ping some random person

autumn aspen
#

No

tulip ledge
#

What are u doing @autumn aspen

#

Yes

#

You pinged me with no valid reason

#

Why?

autumn aspen
#

A mute command

#

Yes

left lake
#

youy dont just ping some random person

tulip ledge
#

Yeah would be helpfull rn so I can mute you

digital ibex
#

@autumn aspen learn js, idek why you're still here

left lake
#

especially one thats already asking for help, he can care less about your issue

#

literally google

#

you're adding a role, setting a timeout,

#

then removing a role

autumn aspen
#

@autumn aspen learn js, idek why you're still here
@digital ibex Shut the fuck my bot now is bigger then ur future now

left lake
#

😕

digital ibex
#

uh ok

left lake
#

i bet my private bot is in more guilds than you

#

so lets stop flexing 1 testing guild

autumn aspen
#

😕
@left lake and tf who asked u??

digital ibex
#

@glad charm

left lake
#

as far as im concerned nobody asked

#

but i truly dont care

#

your ego is overflowing out of the bucket

autumn aspen
#

Hmm sureeeeeeee

tulip ledge
#

@autumn aspen Who in the fuck asked you to ping me?

left lake
#

if you want help, we can help

#

but please stop disrespecting all of us

autumn aspen
#

Alright can we just restart

tulip ledge
#

No

autumn aspen
#

Sorry

digital ibex
#

lmaoooooooooo

left lake
#

you need to chill

tulip ledge
#

I'm not fucking helping you anymore

left lake
#

like seriously

autumn aspen
#

aight

left lake
#

if you needhelpjustaskfor help

#

dont start cussing everyone out

autumn aspen
#

Ok

tulip ledge
#

So no one knows how I can fix my issue?

solemn latch
#

🤔

#

ive complained about this guy before

digital ibex
#

same

autumn aspen
#

I need help with a mute command and reason and duration but cant fint it anywhere :/

slender thistle
#

Thanks rudy, I was about to get active in here with my warnings

digital ibex
#

chicken dev

#

asyncronise the method and then try awaiting it

tulip ledge
#

Shivaco do you know if there's a way to make methods wait untill they're done

digital ibex
#

it may work

tulip ledge
#

I tried it already

#

It doesn't work

autumn aspen
#

Thanks for helping guys! big help rlly

tulip ledge
#

Thanks for cussing us out HoLd! big help rlly!

slender thistle
#

Stop

#

Both of you

sudden geyser
#

can't find what anywhere

autumn aspen
#

Ok

digital ibex
#

did u get an error when awaiting?

tulip ledge
#

Nope

#

It just won't await

#

It still executes the other code first

digital ibex
#

then move it above?

tulip ledge
#

Whta?

digital ibex
#

i do not understand your issue at all

tulip ledge
#

I'm calling a method on a class that is overwriting a different class but when accessing the different class the object hasn't been overwritten yet

cunning gorge
#

Question, if you verify your bot, when you add new people to your team will they still get a badge?
or do u need to add people to ur team before it gets verified for them to have the badge

digital ibex
#

they said that they're gonna verify the people who contact them, and then the other devs (if they weren't provided) after since it'll be quicker and it'll all be done before whenever the deadline is

tulip ledge
#
1 - undefined
3 - 1000
2 - 353

The numbers in front are the order of when they're executed

#

The weird part is that "undefined" is the same method as 353 but since the method isn't finished yet it logs undefined

#

I basically do:
console.log(player.move())

#

it logs undefined

#

the method is executed

#

Inside the method is a console.log

#

Wich logs the 353

digital ibex
#

what does the move method look like?

tulip ledge
#
      move(type) {
        if(type === "strike") {
          if(this.weapon === "none") {
            
          }
          else {
            client.con.query(`SELECT * FROM items WHERE itemid = "${this.weapon}"`, (err, rows) => {
              if(err) throw err;
              if(rows.length < 1) return "error";
              // Calculation stuff
              boss.health -= totaldmg;
              console.log("2" + boss.health)
              return totaldmg;
            })
          }
        }
      }
#

The thing is that mysql queries take time to resolve

cunning gorge
#

they said that they're gonna verify the people who contact them, and then the other devs (if they weren't provided) after since it'll be quicker and it'll all be done before whenever the deadline is
@digital ibex
So even if a developer is not officially listed on a team, they can still get the badge?

tulip ledge
#

Thats why it takes longer for the method to finish

digital ibex
#

it takes type, provide the type where u console.log(player.move('whatever this is meant to be')); and it should work

cunning gorge
#

So as an owner, even if my dev wants the badge, but I don;t feel comfortable giving them admin access, it should be fine as long as I contact them?

tulip ledge
#

Yes

#

I do player.move("strike")

digital ibex
#

afaik, you dont need to be on dev portal for that application

tulip ledge
#

Thats not the issue

#

Like I said

digital ibex
#

no you didn't

cunning gorge
#

oh ok thx

tulip ledge
#

I never said the issue was that type wasn't defined

digital ibex
#

you said player.move() is undefined

tulip ledge
#

I would've had errors then

#

Yes

#

Do you listen?

#

it logs undefined since the method isn't resolved yet

digital ibex
#

why are you talking to me as if i am supposed to help you?

#

im not meant to help if i dont want to

#

you need to chill

tulip ledge
#

Dude it's 12 am I've been tryna fix this for 2 hours now

#

I just wanna go to sleep ffs

digital ibex
#

thats weak

tulip ledge
#

I mean sure

#

If you find it week 2 hours trying to get 1 stupid thing to resolve before executing the next code sure

#

I just need help

#

And if you can't help me then stop helping me

digital ibex
glossy elk
#

dum ping

tulip ledge
#

Is there literally no way to let methods resolve before going onto the next pice of code?

#

It's all due to the mysql query

#

I just commented it to try and see what it does

#

And then it worked

#

But I can't do it without the mysql query D:

#
      async move(type) {
        if(type === "strike") {
          if(this.weapon === "none") {
            
          }
          else {
            await client.con.query(`SELECT * FROM items WHERE itemid = "${this.weapon}"`, (err, rows) => {
              if(err) throw err;
              if(rows.length < 1) return "error";
              // Calculations
              boss.health -= totaldmg;
              console.log("2" + boss.health)
              return totaldmg;
            })
          }
        }
      }

This just turned the "undefined" into [object Promise]

#

Doing the async await

quartz kindle
#

you cant await callbacks

#

you can only use await if query explicitly says it returns a promise in their docs

tulip ledge
#

Is there a different way to do it then?

quartz kindle
#

if there is no promise, there is no async/await support

tulip ledge
#

Ok

quartz kindle
#

its purely callback based

#

you can promisify it yourself tho

#

like this

tulip ledge
#

And then I can await it?

quartz kindle
#
await new Promise(resolve => {
  ...query(bla,result => {
    resolve(result)
  })
})
tulip ledge
#

const query = await util.promisify(client.con.query).bind(client.con);?

#

Oh

#
await new Promise(resolve => {
  ...query(bla,result => {
    resolve(result)
  })
})

Would be my method then?

quartz kindle
#

you put whatever has callbacks inside a promise

#

so then you can properly await for the callback

tulip ledge
#

ok

digital ibex
#

im having a small issue with my website, i have an online chat-room which makes the text go down instead of up, like this:

tulip ledge
#

i'm confused now

digital ibex
#

the text is at the bottom, does anyone know how i can make the text go up?

tulip ledge
#

Do you mean like this?

            await new Promise(resolve => {
              client.con.query(err ,rows => {
                resolve(rows)
              })
            })
            await client.con.query(`SELECT * FROM items WHERE itemid = "${this.weapon}"`, (err, rows) => {
              if(err) throw err;
              if(rows.length < 1) return "error";
              // Calculations
              boss.health -= totaldmg;
              console.log("2" + boss.health)
              return totaldmg;
            })
digital ibex
#

instead of down (you cant really see it as its that far at the bottom)

tulip ledge
#
1 - [object Promise]
3 - 1000
2 - 353
#

This is the console now

digital ibex
#

resolve the promise then

tulip ledge
#

I did this

            await new Promise(resolve => {
              client.con.query(`SELECT * FROM items WHERE itemid = "${this.weapon}"`, (err ,rows) => {
                if(err) throw err;
                if(rows.length < 1) return "error";
                // Calculations
                boss.health -= totaldmg;
                console.log("2" + boss.health)
                resolve(totaldmg);
                  
              })
            })
#

I resolved it

digital ibex
#

doesn't look like it

tulip ledge
#

I'm going insane

#

Why is there always this 1 thing in your code that doesn't want to work

tulip ledge
#

404
We couldn’t find this page.

#

And wdym

#

I am friking resolving it

digital ibex
#

have you read it?

tulip ledge
#

It's 12 am

#

I'm tired af

digital ibex
#

12am isn't even late lmao

#

especially on lockdown

tulip ledge
#
2 - 353
1 - undefined
3 - 353

Wtf

#

I did await player.move()

#

And this is the result

#

It worked

#

But

#

It's still undefined

#

It's working

#

But

#

I still have undefined

#
console.log(totaldmg)
resolve(totaldmg);

Logs 647 and then when I console.log(player.move()) I get undefined

sick cloud
#

does firefox send have an api, or are there any decent private file sharing apis around that take files of about 100mb

#

can't send over discord attachments

misty sigil
#

@split hazel smug just posted this on almost all channels

grizzled raven
#

support development testing api

opal plank
#

hmmmm

#

not sure if i should be concerned

misty sigil
#

no

#

its normal in the new update

#

i think its just stopping it urself

opal plank
#

was trying to find the err but its only throwing once i exit the application

#

that actually might be good in my favor

misty sigil
#

no

#

its normal

#

unless we both made the same error Thonkang

opal plank
#

which is possible

#

it only happened when i added some stuff today

#

and i didnt see a vsc changelog or anything new

misty sigil
#

vsc did update

opal plank
#

lemme see changelog rq

tulip ledge
misty sigil
#

waoh

opal plank
#

maybe this?

misty sigil
#

yes

#

there we are

opal plank
#

@tulip ledge have you decided who you'll turn into bosses?

#

i recall you saying 15 or so

tulip ledge
#

I want 15 bosses but only have 2 atm: Woo and Tim

opal plank
#

havent gotten any other ideas?

tulip ledge
#

Nope

#

Well I have 3 actually

#

The final boss will be a chicken

#

The fighting is almost complete

#

And the cool thing is that it's all dynamic if I wanna add more possible moves I just have to add some stuff in a json file if I want more bosses add some stuff in a json file

#

@opal plank

opal plank
#

Dead looks better

tulip ledge
#

Alright

#

The WOO used 1 means he used his ability (doesnt work yet)

opal plank
#

why not use a DB and make them customizable?

tulip ledge
#

Wdym

#

I use a DB for users

opal plank
#

I just have to add some stuff in a json file

tulip ledge
#

Well I mean it's kind of the same

earnest phoenix
#

NO JSON

#

nooo

tulip ledge
#

Dude

earnest phoenix
#

Lol

tulip ledge
#

Did you listen?

#

It's not to save and write data

#

It just contains some variables

#

Of the boss's health, dmg etc

#

A DB would be unneccessary

#

idk how u spell it

earnest phoenix
#

Chicken dev dm me

tulip ledge
#

Why

opal plank
#

👀

solemn latch
#

ah, i died

tulip ledge
#

It's like:

"WOO": {
  "floor": 1,
  "lines": ["Text", "Text"]
  "attack": [maxdmg, mindmg]
  "ability": {//Stuff}
}
solemn latch
#

feels sad man

opal plank
#

i need to clean my index, speaking of which

tulip ledge
#

lol

opal plank
#

too many dependencies on it

#

though all of them are in use

tulip ledge
solemn latch
#

🤔

#

being the first boss, ill be the most to die, and the most to win

opal plank
#

clapping newbies cheeks, i see

tulip ledge
#

True true

#

And I mean

#

Your ability

#

I wonder how many times you'll end up killing yourself

solemn latch
#

LOL

#

a lot

timber plume
#

hey help me

tulip ledge
#

Probably

opal plank
#

what did u make the poor fella do?

#

@timber plume speak

solemn latch
#

i was my idea

tulip ledge
#

He damages himself

solemn latch
#

it

tulip ledge
#

On his ability

opal plank
#

why tho

solemn latch
#

because its a first boss

#

and a good meme

opal plank
#

lmao

#

i guess

timber plume
#

how do i use a function from a different file | nodejs

tulip ledge
#

@solemn latch But does he do like 50 damage always or like how much damage he usually does on users?

opal plank
#

you want to export them @timber plume

tulip ledge
#

@timber plume You export it with module.exports

opal plank
#

ES6 exports can do that

timber plume
#

how do i do that

#

ok

opal plank
#

try the new ES6 syntax

tulip ledge
opal plank
#

better than the old one

timber plume
#

im nub coder

tulip ledge
#

@solemn latch But does he do like 50 damage always to himself or like how much damage he usually does on users?

solemn latch
#

normal damage imo

tulip ledge
#

Alright

#

Imma go sleep now

opal plank
tulip ledge
#

its 1 30 AM