#development

1 messages ยท Page 1383 of 1

leaden rover
#

well, I need to know how the heck to alert the user IF the subreddit is NSFW

lyric mountain
#

it should be if reddit.subreddit.over18:

leaden rover
#

oh ok

#

Instance of 'SubredditHelper' has no 'over18' member

#

Hmmm

lyric mountain
#

there's no over18 attribute to subreddit object then

leaden rover
#

oh ok

lyric mountain
#

look how it should be retrieved in the lib's docs

leaden rover
#

Ok

drifting wedge
#

how would i do tooltips?

#

i looked it up

#

but didnt work

lyric mountain
#

depend on how you're building ur site

#

but F12 generally helps css stealing

drifting wedge
rustic nova
#

i do that through apache2 configurations because I'm different ๐Ÿฅถ

cerulean mason
#

Hi

crude coral
#

Do you know of another panel to host node js app?

earnest phoenix
#

what

crude coral
#

@earnest phoenix a panel to setup on my vps

earnest phoenix
#

why would you need a panel for that

crude coral
#

I need it for a project

earnest phoenix
#

why would you need a panel for that

crude coral
#

I need a panel for a private project ๐Ÿ˜‘

earnest phoenix
#

why would you need a panel for that

crude coral
#

To host many bots

earnest phoenix
#

why would you need a panel for that

rustic nova
#

why do you want many bots?

#

Potential selfbots raider here? Suschamp

earnest phoenix
#

literally just download node with your distro's package manager and use it lol

#

you don't need a panel

crude coral
#

I have created a discord bot engine

#

E i want to pubblic them

earnest phoenix
#

you're not making any sense

tulip ledge
#

is there anyone here who might be able to tell me how much I can sell my laptop for?

lyric mountain
#

good conditions? 75% at most

#

but yk, hardware tend to degrade over time

earnest phoenix
#

what's a good tutorial for programming tutorial for discordgo

sudden geyser
earnest phoenix
#

i wanna learn go

sudden geyser
normal sage
#

My bot hit 75 servers and when I apply it asks me for a government-issued ID, which I don't currently have. Is there any other way I could submit one?

lyric mountain
#

no

timid radish
#

nah you need a way to proof that you is you

#

which is what government-issued ID are for

lyric mountain
#

well, theoretically you could transfer ur bot to one of ur parents/friends

#

then have them verify

#

but it'll be permanently theirs

normal sage
#

o ok

tardy hornet
#
bot.user.setActivity(`a!help | ${bot.guilds.cache.size} Servers.`, { type: 'PLAYING'}).catch(console.error);
lyric mountain
#

setInterval

drifting wedge
#

is running flask enough to run the vps webserver?

lyric mountain
#

also, 10s is too fast

drifting wedge
#

like just literally running it?

crystal wigeon
#

hey guys i need help with a loop im trying to figure out

young flame
#

mhmmm

tardy hornet
#

also, 10s is too fast
@lyric mountain then what i should do? 30?

crystal wigeon
#
setInterval(() => {
  const interval = setTimeout(() => {
    const newInterval = setTimeout(() => {
      console.log("this is a new interval")
      x--;
    }, 2000);
    console.log("outside")
  }, 2000);
  console.log("outisdeasdasd")
}, 2000)```

so basically what im trying to do here is i wanna exec the inner statements in a while look based on some value x, and then wait for some functions to exec, those funcs have inner funcs that need to wait for 200secs and then when the val x is 0 i want while loop to break, obviously using the "while" loop here will sit in an infinite loop... and im stuck trying to figure it out
young flame
#

uh

crystal wigeon
#

i dont wanna use a custom "sleep" because it'll stop the execution of everything, if itry to access other commands becasue of the sleep the response is slow

#

im using sleep for now, but it isnt eficient

young flame
#

i don't think you can have two intervals going in the same line-

#

or i dont use it

hollow sedge
#

There's something called periods and sentence structure that would help

young flame
#

seems unreliable

lyric mountain
#

@lyric mountain then what i should do? 30?
@tardy hornet mine updates every hour

young flame
#

@hollow sedge why did i block u lmao

crystal wigeon
#

what i want to do is, start a function and then inside those functions i need them to wait

hollow sedge
#

Because I pinged you in testing to annoy you @young flame

rustic nova
young flame
#

ohhh

rustic nova
#

literally every review

young flame
#

LOL

sudden geyser
#

sounds like a timeout

crystal wigeon
#

;-;

tardy hornet
#

@tardy hornet mine updates every hour
@lyric mountain arg i forgot how to do setInterval

young flame
#

YEAH

crystal wigeon
#

i used a timeout

#

but

#

i cant have nested

#

timeouts

sudden geyser
#

You should be able to.

young flame
#

just have a timeout in two different lines

#

not in one

crystal wigeon
#

the func inside the timeout also needs to wait after its called

young flame
#

because your calling the timeout but since theres two you didn't spesify wich one to call

lyric mountain
#
setInterval(() => {
  //doStuff
}, 60000) //every minute
young flame
#

so it doesn't call anything ig

#

^^^

crystal wigeon
#

i get that

young flame
#

you have two timeouts but it's a timeout in a timeout

crystal wigeon
#

but inside that interval

#

i have a func

#

which needs to wait

#

so if i use another interval there

young flame
#

so you do await?

crystal wigeon
#

the next loop will cause it displayat same time

young flame
#

that's what await is for lmao

#

to await a message or fuction

sudden geyser
#

Like, unless I'm misunderstanding this: js setInterval(() => { // Let's say this function is called every 5 seconds. setTimeout(() => { // Let's delay this by 2 seconds. 5 + 2 = 7 console.log(":)") }, 2000) }, 5000)

tardy hornet
#

wait @young flame is it like that:

#
setInterval(() => {
      bot.user.setActivity(`a!help | ${bot.guilds.cache.size} Servers.`, {type: 'WATCHING'});
  }, 60000);
  
  })
young flame
#

yeah

crystal wigeon
#

so my settimeout will exec after 7 sec?

#

everytime right?

tardy hornet
#

okay

lyric mountain
young flame
#

that should work @tardy hornet

tardy hornet
#

okay ty

#

but wait

young flame
#

god please no
@lyric mountain see

#

you need to use await

#

lol

crystal wigeon
#

what im trying to say is, inside that timeout func i need to wait xD

lyric mountain
#

it'll create an uncontrollable overflow of intervals

tardy hornet
#

is it ms's right?

crystal wigeon
#

yeah

sudden geyser
#

@crystal wigeon sort of

young flame
#

you cant call a interval in a interval

tardy hornet
#

okay

crystal wigeon
#

which is what im trying to solve

#

await is not issue here

young flame
#

is it ms's right?
@tardy hornet yeah

#

50000 is 50 seconds

#

ect

#

uhhh

#

okkay my turn to complain

#

i'm making a ban command where you can mention someone or use there id but uhhh

crystal wigeon
#

(wait 2sec, (wait 2sec after the outter func exec ( wait 2sec after middle func exec))
but the middle func has dependant values from the inner most func

#

i'll try using await

young flame
#

it just keeps saying i need to mention someone

#

i'll try using await
@crystal wigeon you cant use await in two funnctions

#

have one function

#

then await setInterval

#

or whatever

crystal wigeon
#

mhm i'll give it a shot

young flame
sudden geyser
#

remember that the interval is called every 5 seconds and the timeout is called 2 seconds after the interval is called. The interval is forever repeating and both are non-blocking. This can cause overlaps as in it won't be like a 7-second delay between each console log.

If you have an understanding of threading/concurrency, it'll probably be easier to understand. If this is okay for your use case, then go ahead and use it.

- = represents interval. A different symbol represents execution.
+ = represents timeout. A different symbol represents execution.

-----==---==-==----==--====-----==
goes on

crystal wigeon
#
    if (!user) return false;
    var mentionedUser = message.guild.member(
      message.mentions.users.first() ||
        (await message.guild.members.fetch({ query: user, limit: 1 })).first()
    );
    if (!mentionedUser) return false;
    return mentionedUser;
  },```
you can use this to get either the author or the mentions
#

this works even if you just type "moon chan"

#

or "moon"

young flame
#

@rustic nova its funny because it had 120 likes before but top.gg did a like sweap and all my likes went away but they started to come back

lyric mountain
#

(wait 2sec, (wait 2sec after the outter func exec ( wait 2sec after middle func exec))
but the middle func has dependant values from the inner most func
@crystal wigeon react has a lib with something called cascade, see if there isn't a lib that does something similar for node

crystal wigeon
#

ah thanks

lyric mountain
#

cascade basically chain stuff with an optional delay between steps

crystal wigeon
#

remember that the interval is called every 5 seconds and the timeout is called 2 seconds after the interval is called. The interval is forever repeating and both are non-blocking. This can cause overlaps as in it won't be like a 7-second delay between each console log.

If you have an understanding of threading/concurrency, it'll probably be easier to understand. If this is okay for your use case, then go ahead and use it.

- = represents interval. A different symbol represents execution.
+ = represents timeout. A different symbol represents execution.

-----==---==-==----==--====-----==
goes on
@sudden geyser yep i understand how this works, but i kinda need it to execute alternatively, im thinking maybe if i double the delay on the inner func that might work but still feel its inefficient. taht way i'll have to triple the delay on its inner functions that require a delay as well

#

nvm that wont work either

quartz kindle
#

what are you trying to do?

crystal wigeon
#

can we get on vc or soemthing?

#

ig its hard to explain waht im trying to do

#

hehehe

quartz kindle
#

i cant vc rn

crystal wigeon
#

sure np

#

i'll try my best to explain

grave ermine
#

slaw

#

slaw

#

hi

crystal wigeon
#

i have a dependent value X,
Until this X is 0 i need my functions to execute,
now these functions have a delay (2secs)
var y = someFunc({
// do something
delay(2secs)
}):
x = y;
delay(2secs);

now i dont need them to be concurrent. also async await doesnt matter here as well since the func execute pretty fast i need them to wait for 2secs. i tried using a custom sleep() for 2 secs but that is stopping every other executions that may take place other than this, for example a "ping" command. lets say the above snippet is some functionA, so when i start exec of FuncA and then if i try "ping" it takes 2secs for ping to reply back because of the delays. setTimeout wont work here in this came.

quartz kindle
#

how did you make this "sleep" func?

lyric mountain
#

sorry, I'm failing to understand your use-case, could you give an example (code)?

quartz kindle
#

it shouldnt be stopping anything

crystal wigeon
#
  sleep: (milliseconds) => {
    const date = Date.now();
    let currentDate = null;
    do {
      currentDate = Date.now();
    } while (currentDate - date < milliseconds);
  },```
quartz kindle
#

LOL

lyric mountain
#

oh, wow

crystal wigeon
#

ye

lyric mountain
#

that's, wow

quartz kindle
#

you're blocking the whole process

crystal wigeon
#

yep

quartz kindle
#

thats like, not how you do a sleep func xd

#

use promises

crystal wigeon
#

even with promisses

#

i need the delay

quartz kindle
#

promises are non blocking

crystal wigeon
#

i thought of promisses

quartz kindle
#

you can create a delay

#

like this

crystal wigeon
#

ahh

#

so i can use the sleep() inside promises?

quartz kindle
#
await new Promise(x => setTimeout(x, 2000))
lyric mountain
#

js is single-thread, so most "sleep" methods will stop the code

#

promises would be the only way

crystal wigeon
#

i thought of using promises but then i thought i need a delay by functions dont need to await for anything

#

yeah i understand now haha

quartz kindle
#
function delay(time) {
  return new Promise(x => setTimeout(x,time))
}
lyric mountain
#

let's say instead of a sleep you made a knockout function lul

crystal wigeon
#

xD

earnest phoenix
#

node can be multithreaded by using worker threads but you lose the most important feature of multithreading; synchronization

quartz kindle
#

hitting your program with a pan

#

in the head

#

xD

crystal wigeon
#

i had once written a hyperloop function between files xD one func lead to another file and the func in that file led back to the original file and i was like tf is this not working for xD

#

uwu learning

#

thanks a lot guys!

#

appreciate the patience ๐Ÿ˜„

lyric mountain
#

once I killed my program with too many threads, that day I learned that I should use cached threads for what I was doing

crystal wigeon
#

kikiki

lyric mountain
quartz kindle
#

i am working on something that actually needs micro-blocks using while loops

#

its so weird

lyric mountain
#

stutterwalk

quartz kindle
#

xD

lyric mountain
#

"empty while loop detected" - every IDE ever

#

my code has a ton of @SuppressWarning

quartz kindle
#

my vsc doesnt say anything

rustic nova
crystal wigeon
#

wew

#

i tried out eslint xD my whole code base was in red

#

xD

lyric mountain
#

because "I cAnT qUeRy FoR uNcHeCkEd LiStS"

quartz kindle
#

its kind of a shelved project, half of it is not working anyway

tardy hornet
#
const msg = await message.channel.send(helpss);
 await msg.react('๐Ÿ—‘๏ธ')
 await msg.awaitReactions((reaction, user) => user.id == user.id && (reaction.emoji.name == "๐Ÿ—‘๏ธ"), {max: 1, time:15000})
 .then(async collected => {
   if(collected.first().emoji.name == "๐Ÿ—‘๏ธ"){message.delete()}
   else return message.channel.send("error")
 })
``` why didnt delete the message?
quartz kindle
#

but the empty while loop is actually intentional

lyric mountain
#

like, I made the tables, I stored the values. Goddammit java, ik what each value is

earnest phoenix
#
#include <Windows.h>
DWORD WINAPI totallynotgoingtorunforever(LPVOID lp)
{
  while(true) {}
  return 0;
}


while(true)
{
  CreateThread(NULL, 0, totallynotgoingtorunforever, NULL, 0, NULL);
}

:)

quartz kindle
#

lmao

earnest phoenix
#

this is going to absolutely nuke any windows pc

stark abyss
#

Anyone got a idea or cool project/command I should make in js or djs?

earnest phoenix
#

i left that on a school pc as a joke program and renamed it to "RUN ME"

#

i got written up

#

lol

quartz kindle
#

xDDD

stark abyss
quartz kindle
#

i made a batch file that opened a bunch of stuff like paint.exe forever

lyric mountain
#
int i = 0;
while (i < 3) {
  //do something
}
i++;
#

see the world burn

stark abyss
#

lmao

earnest phoenix
#

for loop but make it spicy

lyric mountain
#
int a = 0;
for (int i = 0; i < 10; a++) {

}
earnest phoenix
#

cursed

stark abyss
quartz kindle
#
function a() {
  while(true) {
    a();
  }
}
feral aspen
#

What is the event called where I can console log that my bot is in a new server

runic garnet
#

Does there happen to be anyone that builds discord bots? I need help with coding so that a .gif file will work via command. The gif works in visual studio but when commanded via discord, it only shows an image. Idk what Im doing wrong...

lyric mountain
#

onGuildAdd ig

stark abyss
#
while(true){
  if(false) return;
}```
tardy hornet
#
const msg = await message.channel.send(helpss);
 await msg.react('๐Ÿ—‘๏ธ')
 await msg.awaitReactions((reaction, user) => user.id == user.id && (reaction.emoji.name == "๐Ÿ—‘๏ธ"), {max: 1, time:15000})
 .then(async collected => {
   if(collected.first().emoji.name == "๐Ÿ—‘๏ธ"){message.delete()}
   else return message.channel.send("error")
 })
``` why it didnt delete the message?
lyric mountain
#

Does there happen to be anyone that builds discord bots? I need help with coding so that a .gif file will work via command. The gif works in visual studio but when commanded via discord, it only shows an image. Idk what Im doing wrong...
@runic garnet what lang?

#

gifs are veeeeery weird to work with

#

especially if you want to overlay stuff in it

stark abyss
#

I think he need a filter

south sinew
#

Are you using local files or a link for it

#

I'm assuming local

runic garnet
#

@lyric mountain Im sorry Im really new to all this. Idk what your asking

#

@south sinew You are correct locally

south sinew
#

And are you sending it in an embed or on a normal message

lyric mountain
#

what language: java? js? python?

earnest phoenix
#

they're annoying to work with because in order to edit a gif you need to unpack it, edit every single frame and repack it :feelsbadman:

runic garnet
#

java

south sinew
#

Jda?

lyric mountain
#

they're annoying to work with because in order to edit a gif you need to unpack it, edit every single frame and repack it
@earnest phoenix and extract the metadata

#

then add it later when packing

tardy hornet
#

please someone help

runic garnet
#

@south sinew I was sending it as a normal message. One sec. Ill post the coding I have. It will pull fine with the command but just comes up as an image.

lyric mountain
#

java
@runic garnet use InputStream is = yourClass.getClass().getClassLoader().getResourceAsStrea("Path to file");

#

then send the InputStream

runic garnet
lyric mountain
#

ImageIO.read() has an issue of converting everything to either JPG or PNG

quartz kindle
#

thats not java lol

lyric mountain
#

lul

#

java sucuripto

quartz kindle
#

java sucuri

runic garnet
#

Like I said Im new.

south sinew
#

Javascript is different from java

#

So you are using nodejs?

lyric mountain
#

don't worry, we're just kidding

quartz kindle
#

java and javascript are completely different things and should never be confused

lyric mountain
#

many people mistake java for javascript

runic garnet
#

yes nodejs

earnest phoenix
#

car and carpet

quartz kindle
#

^

#

lmao

#

good one

south sinew
#

Discordjs as well im assuming as that doesn't look like eris

runic garnet
#

My bad lmfao Im a noob. Ill take the heat. but im not leaving the kitchen. I got work to do lmfao

lyric mountain
#

it was all fine until fire nation attacked

proven cliff
#

when the world needed him most

#

he vanished

runic garnet
#

My idea was to have it pull from the files in which gifs were saved randomly with given command ?gifs

south sinew
#

Ah i see

quartz kindle
#

your code is saying they are .jpg tho

lyric mountain
#

you're appending ".jpg" to the file name

#

ah

south sinew
#

There's your problem

runic garnet
#

I pulled the other coding. One second. Ill fix it and show you

#

I pulled the coding for the gif as it wasnt working. One second

proven cliff
#

Hi guys, I had an idea for a bot (discord.py) that would pick through a list of responses based on a second entry. For example: search chairs and it would pull from a list of responses that come from a json file in the same directory. Someone would do search chairs and it would respond with 1. cushion chair 2. wood chair 3. rocking chair. Later on I could incorporate like a reaction system to cycle through pages and stuff. I have two issues. I can't seem to find how the bot would search for relevant json files (eg. chairs.json) to find the response needed, as well as pick from a random response. Its not that I can't find ways, its just that I'm finding a lot of different ways and I'm a bit confused as to which one I should go for.

south sinew
#

Also I'd recommend instead of defining the number of gifs with number, use fs.readdirsync to grab all of the file names, put them into an array, then you can array.size for your math.random

#

Then you can also name the gifs anything as well as you can just do gifArray[index]

quartz kindle
#

if the number of files is known, its better that way so you dont need to query the directory on every single run

earnest phoenix
#

how do i make a image command to my bot

tulip ledge
#

fatal: couldn't find remote ref master

south sinew
#

Thats true, just figured it would be easier so that if he wants to add or delete them he can without worrying about changing code

tulip ledge
#

git, I'm tryna pull from my repository already tried this:

git rm origin
git remote add origin <Link>
south sinew
#

Is it private?

tulip ledge
#

yes

#

its private

runic garnet
#

@south sinew I was changing the number of the file making it 1-whatever. I just started coding like 3 days ago. So im like new new lol

south sinew
#

Ah ok lol, dont worry bout it

#

@tulip ledge have you logged into git or are you specifying your username and password when pulling?

tulip ledge
#

MMmh I should probably do that shouldn't I

#

haha

south sinew
#

Yeah lol

runic garnet
#

Well now it works.... weird. Maybe it was the gifs I was trying to use.

tulip ledge
#

how do I do that again

#

I've only started using git since last week

south sinew
#

so tbh not super good with gut from command line, and the way I do it is probably a bad way to do it but it works

#

Lemme grab the script I have saved on my vps

proven cliff
#

Hi guys, I had an idea for a bot (discord.py) that would pick through a list of responses based on a second entry. For example: search chairs and it would pull from a list of responses that come from a json file in the same directory. Someone would do search chairs and it would respond with 1. cushion chair 2. wood chair 3. rocking chair. Later on I could incorporate like a reaction system to cycle through pages and stuff. I have two issues. I can't seem to find how the bot would search for relevant json files (eg. chairs.json) to find the response needed, as well as pick from a random response. Its not that I can't find ways, its just that I'm finding a lot of different ways and I'm a bit confused as to which one I should go for.

earnest phoenix
#

that's super complicated

#

why not just scrape ddg

proven cliff
#

Because I would like the answers to be verified

#

and not random

#

well not random but I don't want a chance for them to be wrong/broken

earnest phoenix
#

seems like you'd want something like ML and not statically served responses

south sinew
#

@tulip ledge git clone --depth=1 https://USERNAME:PASSWORD@github.com/USERNAME/REPO.git

#

that will pull your current code from your default branch

crimson vapor
#

hmmmmm

proven cliff
#

I mean I didn't think it would be that complicated tbh

crimson vapor
#

ah it is ChickenDev

proven cliff
#

cause I could just use with open and specify that anything between " " is a response

earnest phoenix
#

the principle of how you want it to work isn't complicated

#

the execution of it is

proven cliff
#

I see

#

tbh it sounds dumb but I'm trying to make a bot for recipes

earnest phoenix
#

you'd manually have to cover every object in the english language

proven cliff
#

as in cooking recipes

earnest phoenix
#

oh

#

well

#

you could just go back to the method of scraping

proven cliff
#

and I want smth like !recipe muffin or !recipe chickensoup

#

yeah but where would it scrape from?

#

A json file or just online?

earnest phoenix
#

any recipe website that is queryable

#

do you know/understand what scraping is

proven cliff
#

yeah I think so

#

it just searches the internet

earnest phoenix
#

yeah, hence scraping, you scrape off the content you get and parse it

proven cliff
#

So you suggest I scrape responses from the internet instead of pulling them from a local file?

earnest phoenix
#

yeah

hollow sedge
#

There's probably an API too

earnest phoenix
#

that too

proven cliff
#

alright well I'll look into that then :D

#

Thanks a lot for the advice guys

#

very much appreciated

earnest phoenix
#

the site seems to be super scrapable

somber pulsar
#

I mean couldn't you get a .json and just do something like requests.get()

earnest phoenix
#

there's a ton of options out there from various websites, some providing APIs, etc.

#

that's not how the internet works most of the time

#

you can't just make a webpage return you a json response at will lol

somber pulsar
#

i mean

#

there are some stuff that do return a json

earnest phoenix
#

that's not how the internet works most of the time

#

that site seems to be SSR'd regardless

somber pulsar
#

isnt that hmtl LOL

earnest phoenix
#

yes

#

...?

somber pulsar
#

nah just never used html for this kind of task

earnest phoenix
#

we're discussing scraping for a reason lol

lusty quest
#

someone here who know a bit about scraping with cheerio? want to get a Table from a website but for some reason it adds a ton of whitespace between the values and .trim() does nothing

#
    array.push($(item).text().trim());
});
eternal osprey
#

hey guys

#
   
                                    const name = getName(raid.pokemon_id);
                                    const lat1 = raid.lat.substring(1);
                                    const lng1 = raid.lng.substring(1);
                                    console.log(name, + "\n" + raid.gym_name, + "\n" + raid.lat, + "\n" + raid.lng);
                                    const exampleEmbed = new Discord.MessageEmbed()
                                           .setColor('RANDOM')
                                           .setDescription(`[Google Maps](http://www.google.com/maps/@${lat1},${lng1},6z)` + " | " +  `[Apple Maps](https://www.apple.com/maps/?daddr=${lat1},${lng1})`)
                                           .setFooter("Command Created For Pokehub!") 
                                    return `${lat1}, ${lng1}\n`
                                    
                                           + `**${raid.gym_name}**` + "\n"
                                           + `**Raid level: **${raid.level}  |  ${name}  |  **Pokemon Cp: **${raid.cp}\n`
                                           + `**Egg Spawn Time: ** ${getFormattedTime(raid.raid_spawn)}\n`
                                           + `**Raid Start Time: **${getFormattedTime(raid.raid_start)} | **Raid End Time: **${getFormattedTime(raid.raid_end)}\n`
                                           + message.channel.send(exampleEmbed)
                               })``` why is this only returning the embed, and not the other return info
rustic nova
#

that needs cleanup

eternal osprey
rustic nova
#

definitely

eternal osprey
#

yeah for sure

lusty quest
eternal osprey
#

i first want to fix this shit and then make it better (cleanup)

#

anyways you know what the problem is?

earnest phoenix
#

you're returning a string + promise

#

lol

hollow sedge
#

nah just never used html for this kind of task
@somber pulsar the HTML is for the website, which you need to look at to see what parts of it to scrape

They aren't writing a scraping script in HTML

earnest phoenix
#

that'll endup in something like your big string [Promise promise]

eternal osprey
#

how would i fix that then?

earnest phoenix
#

i don't know

eternal osprey
#

cuz i need to return these 2 values

earnest phoenix
#

i don't know your intentions

eternal osprey
#

i am trying to send the info and embed

earnest phoenix
#

so why not just move the string inside of the message content

eternal osprey
#
 return `${lat1}, ${lng1}\n`
                                    
                                           + `**${raid.gym_name}**` + "\n"
                                           + `**Raid level: **${raid.level}  |  ${name}  |  **Pokemon Cp: **${raid.cp}\n`
                                           + `**Egg Spawn Time: ** ${getFormattedTime(raid.raid_spawn)}\n`
                                           + `**Raid Start Time: **${getFormattedTime(raid.raid_start)} | **Raid End Time: **${getFormattedTime(raid.raid_end)}\n`
                                           + message.channel.send(exampleEmbed)```
#

hmm

lusty quest
#

@eternal osprey make sure only one instance of the bot is running. its possible multiple instances are running -> spam

tardy hornet
#
const msg = await message.channel.send(helpss);
 await msg.react('๐Ÿ—‘๏ธ')
 await msg.awaitReactions((reaction, user) => user.id == user.id && (reaction.emoji.name == "๐Ÿ—‘๏ธ"), {max: 1, time:15000})
 .then(async collected => {
   if(collected.first().emoji.name == "๐Ÿ—‘๏ธ"){message.delete()}
})
``` its deleting the `a!help` instead of the help command,
eternal osprey
#

it is already in the message.content

earnest phoenix
#

?????????

lusty quest
#

@tardy hornet where did you refer the message you want to delete? bcs you just delete the command message

eternal osprey
#

@earnest phoenix what did you mean

#

by moving it into the message content

earnest phoenix
#

exactly what i said lol

lusty quest
#

is your msg value your help message you send?

tardy hornet
#

@tardy hornet where did you refer the message you want to delete? bcs you just delete the command message
@lusty quest so how do i do that

lusty quest
#

if(collected.first().emoji.name == "๐Ÿ—‘๏ธ"){msg.delete()} if yes

eternal osprey
#

@earnest phoenix define your fucking intentions

#

cuz i dont get it

earnest phoenix
#

that seems like a you problem

lusty quest
#

lol did you know what you code there?

eternal osprey
#

srry if it came out a bit bold

#

i do

lusty quest
#

const msg = await message.channel.send(helpss); refers your message i guess

tardy hornet
#

i want it to delete the embed that its putting the reaction on

earnest phoenix
#

i don't have any intentions lol

#

i literally just said what you have to do

eternal osprey
#

yeah okay

earnest phoenix
#

if you don't understand what i said, that's a you problem and you need to refine your knowledge

eternal osprey
#

but i was asking if you could explain it more

#

okay sure

earnest phoenix
#

why are you not straight up sending the string with the message

eternal osprey
#

nevermind then. Thannks for the help anyways

crystal wigeon
#
  console.log("okokok")
}
function f(z) {
  console.log("hello world", z)
  delay(2000);
  y()
}
function delay(ms) {
  return new Promise(x => setTimeout(x, ms))
}
f(2)```

umm, so i tried this. i want by func y() to exec after 2sec but both of them are executing together and it waits for 2secs before proces.exit()
earnest phoenix
#

and instead trying to return it

tardy hornet
#

OMG I AM SO DUMB LOL @lusty quest FORGOT I DID THAT

#

ty mate

eternal osprey
#

okay i got it

#

thanks man

lusty quest
#

@crystal wigeon make the delay function async i guess. should be async bcs of the promise but its just an idea

#

then await the delay

crystal wigeon
#

wew noobness is real

#

thanks man

#

i keep thinking async await is only used during network calls ;-;

lusty quest
#

if you need to wait for something to complete you need it too

crystal wigeon
#

yep understood the concept now

#

thanks !

earnest phoenix
#

async is fun

#

think of it like cooking

lusty quest
#

yea

earnest phoenix
#

guys

#

imagine if our lives were sync

#

do you know any discord channel that discuss something like

#

programming languages

#

C C++ python

#

etc?

lusty quest
#

Discord API server as example

#

Discord Developers Server also

earnest phoenix
#

there are also a lot of guilds that are focused around a single language

hollow sedge
#

do you know any discord channel that discuss something like
@earnest phoenix you can use the community server search thing to find other servers

pure lion
#

is there a way to have multiple routes for an app.use("/", router) in express?

earnest phoenix
#

uh

#

my love actually I am pretty new on discord

lusty quest
#

what exactly did you want to do?

pure lion
#

618544756431126529

#

lie

earnest phoenix
#

why would you not just app.use("/route", router)

#

oh

#

parameters?

pure lion
#

what exactly did you want to do?
not have like 500000 app.uses

earnest phoenix
#

I am studying Electronics Eng

pure lion
#

i dont want a fat index

#

if ya get me

earnest phoenix
#

I know C and learning python

crystal wigeon
#

you can write controllers

#

and then map each route

pure lion
#

e?

earnest phoenix
#

sometimes I need help to ask what's wrong but compilers may be unfunctional

crystal wigeon
#

xD

earnest phoenix
#

stackoverflow site seems nice but sometimes I need urgent respond

pure lion
#

sometimes I need help to ask what's wrong but compilers may be unfunctional
its not the motion of the boat that broke the ocean

hollow sedge
#

What?

#

Compilers are not working?

pure lion
#

what im saying is learn the lang before you write it

hollow sedge
#

Stackoverflow is pretty quick

#

If you write a clear question

earnest phoenix
#

oh

lusty quest
#

exept you end up with a niche case that is not on Stackoverflow

hollow sedge
#

Yes, you ask it yourself

#

Also when does that happen lol

lusty quest
#

well you could ask and end up with downvotes

hollow sedge
#

Who cares

#

oH nO mEaN mAn On sTacKoVeRfLoW dOwNvOtE

lusty quest
#

at some point the post gets locked but then you probably asked something really stupid or are bitchy af

hollow sedge
#

Yeah that's why I said "if you write a clear question"

lusty quest
#

well enough Headache from a website scraper for today. have a nice evening.

tardy hornet
#

forgot how to edit a message

#

is it

#

message.edit()

#

?

earnest phoenix
#

@tardy hornet if ur using discord.js, yes

tardy hornet
#

i tried

earnest phoenix
#

what happens?

tardy hornet
#
const msgfunny = await message.channel.send(funny);
 await msgfunny.react('โฌ…๏ธ')
 await msgfunny.react('โžก๏ธ')
 await msgfunny.awaitReactions((reaction, user) => user.id == user.id && (reaction.emoji.name == "๐Ÿ—‘๏ธ"), {max: 100, time:15000})
 .then(async collected => {
   if(collected.first().emoji.name == "โžก๏ธ"){msgfunny.edit(funny6)}
   if(collected.first().emoji.name == "โฌ…๏ธ"){msgfunny.edit(funny)}
})
#

didnt work

young flame
#

hmmm'

#

what are you trying to do

tardy hornet
#

that it will react with

#

and when you click on of them

#

it will edit the embed to the other embed

#

@young flame

lyric mountain
#

what lib?

#

ah, JS, nvm

#

you need a messageReaction listener dedicated to that

drifting wadi
#

Hey! How can I reduce the number of decimals in a variable to 2?

earnest phoenix
#

in...?

drifting wadi
#

Im making a cm to inch converter, and I want only to display 2 decimals

tulip crater
#

what coding language

drifting wadi
#

Js

earnest phoenix
drifting wadi
#

thx

young flame
#

@young flame
@tardy hornet uh

#

just use a collection

#

and if someone reacts to the emoji make it edit the embed so it displays the next page

tardy hornet
#

i think i did

#

but still didnt work

#

wait i think i got it

#

nope nvm

young flame
#

lol

#

well watcha tutorial on it

tardy hornet
#

lol i saw one

#

still didnt work

supple sail
#

Hi! I am using js message.guild.members.forEach but loop only works for one(if we include bot itself = 2) time. (Server member intent = on) (V11)

pure lion
#

@supple sail v11 is decapitated

supple sail
#

I know but it still works.

earnest phoenix
#

it won't very soon lol

#

migrate to v12

#

it's deprecated for a reason

sudden geyser
#

v11 is decapitated
something about this wording scares me

supple sail
#

I am too lazy to migrate to v12. Does anyone know why its only working for one time?

vague kelp
#

If anyone has experience with custom prefixes in discord.py would you mind a DM chat to help me out?

sudden geyser
#

So, you can pass a function and get the custom prefix by guild in there.

vague kelp
#

Hypothetically, if my bot went down, would that not mean people having to add their custom prefix again? I assume I'd need to run a form of database for redundancy?

sudden geyser
#

Yes, you'd need a database so you can store the prefixes persistently across restarts.

#

If it's something simple, I'd go with SQLite.

earnest phoenix
#

can someone help me with cooldown in python? the cooldown works and i want when user tries to run command again to say message like "you need to wait 3 seconds to run command again". i tried everything on internet theres nothing much about that so if someone can help it would be nice. thanks

vague kelp
#

Gonna take an educated guess and say excel isn't going to cut it? ๐Ÿ˜‚

earnest phoenix
#

no, you need to use a proper database

vague kelp
#

Shovel what language are you using?

earnest phoenix
#

databases are built to be used as... databases

#

python 3.8

#

simply writing to a file (such as excel files) won't cut it, there's no concurrency support, no overwrite protection, no thread safety etc.

#

i made my database in notepad

vague kelp
#

@earnest phoenix
import asyncio
(command you want cooldown on)
await asyncio.sleep(delay=3)

Should work I believe, you may need to tweak it

earnest phoenix
#

i used @commands.cooldown(1, 30, commands.BucketType.user)

#

thanks

vague kelp
#

@earnest phoenix @sudden geyser thanks

earnest phoenix
#

@vague kelp but that will just wait code i mean like using command cooldown for user typing command but i cant make like if user tries to use command on cooldown then to bot reply with that hes on cooldown

north birch
#

So hm..i got a problem here, i actually use this filter to make equip command in my economy bot, it work but when there are 2 weapons of the same type it return error, what can i do for fix this?

    if(args[0] === 'Weapon1') {
        if(userWeapons == 'Weapon1') {
        message.channel.send('You equipped Weapon1');
        if(isSomethingEquipped === true) {return message.channel.send(Somethingh is already equipped')};
        db.set(`${message.author.id}_equippedweapon`, 'Weapon1');
        equipweap = db.fetch(`${message.author.id}_equippedweapon`)
        const filtro = weap;
        const newinv = filtro.filter(weap => weao!= equippedweapon);
        db.set(`${message.author.id}_weapon`, newinv)}
        else {
            message.channel.send('You dont have this weapon!')
        }

I used quick.db

mellow cairn
#

How do I write to an SQLite database in discord.py?

earnest phoenix
#

use an adapter for your language

mellow cairn
#

Ty

earnest phoenix
#

why not use txt file to make database like me

#

because that's being an idiot

#

Using text files as a database is the most inefficient thing i have ever seen

#

making databases are too complicated for me

#

that's a you problem

#

So you're saying, using an actual database like MongoDB or whatever are too complicated?

vague kelp
#

Plus, depending on the information you're storing it could potentially be a huge privacy leak

earnest phoenix
#

i just find user what line in text file and i split it and use it

#

ez

north birch
#

Lmao

earnest phoenix
north birch
earnest phoenix
#

I literally had a SyntaxError in my brain just reading that

#

users can easily break that by injecting their own data

vague kelp
#

๐Ÿ˜‚

earnest phoenix
#

since you're just writing to a file

north birch
#

What t- LMAO

I literally had a SyntaxError in my brain just reading that

earnest phoenix
#

users can easily break that by injecting their own data
@earnest phoenix nah nobody would

#

that's a dumb thing to say

vague kelp
#

I would.

earnest phoenix
#

I would.
@vague kelp why

#

committing a murder is illegal, people would still do it

vague kelp
#

I'm an online privacy&security expert

sudden geyser
#

Better safe than sorry.

earnest phoenix
#

you can't use your own opinion to justify a claim

#

lol

#

It's like saying "I have an open eval and i expect nobody to break my bot with it"

#

I'm an online privacy&security expert
@vague kelp "privacy&security" expert

#

if you are privacy&security expert why touching my bot

#

What

vague kelp
#

depends what information it has

earnest phoenix
#

because people have their hobbies and their free time

#

I just lost half of my brain cells wtf

#

yeah ruining others projects

#

hobby

#

don't blame others for your incompetence

#

yes i am sorry

north birch
#

depends what information it has
@vague kelp Probably nasa passwords

earnest phoenix
#

yes

#

it has how much sarmas users have

vague kelp
#

@north birch aight brb

earnest phoenix
#

I sometimes regret joining this channel lmao

#

just a slight reminder

#

thats very useful

north birch
#

@north birch aight brb
@vague kelp LMAO

earnest phoenix
#

if your data gets leaked (which is conveniently discord's data) your discord account will get terminated because you violated their TOS

#

i mean i can send you my code i made to get values from my database

vague kelp
#

I need a facepalm emote

earnest phoenix
#

if someone wants

north birch
#

So hm..i got a problem here, i actually use this filter to make equip command in my economy bot, it work but when there are 2 weapons of the same type it return error, what can i do for fix this?

    if(args[0] === 'Weapon1') {
        if(userWeapons == 'Weapon1') {
        message.channel.send('You equipped Weapon1');
        if(isSomethingEquipped === true) {return message.channel.send(Somethingh is already equipped')};
        db.set(${message.author.id}_equippedweapon, 'Weapon1');
        equipweap = db.fetch(${message.author.id}_equippedweapon)
        const filtro = weap;
        const newinv = filtro.filter(weap => weao!= equippedweapon);
        db.set(${message.author.id}_weapon, newinv)}
        else {
            message.channel.send('You dont have this weapon!')
        }

I used quick.db

earnest phoenix
#

The moment when you join this channel and ask a question but instead lose all of your brain cells, very epic

mellow cairn
#

i mean i can send you my code i made to get values from my database
@earnest phoenix Is it SQLite?

earnest phoenix
#

@earnest phoenix Is it SQLite?
@mellow cairn similuar

#

the txt file

north birch
#

This guy it's creating his own db

earnest phoenix
#

@north birch Codeblocks exist you know

hollow sedge
#

Txt files are similar to SQL

#

Ez

mellow cairn
#

Idk how to use databases

earnest phoenix
#

ez

north birch
#

@north birch Codeblocks exist you know
@earnest phoenix I actually never used filter so dont even ask me LMAO

earnest phoenix
#

ok i will send you

#

discord can send you to court if you don't protect their data by law

#

what their dat

#

data

#

God wtf is even happening in this channel holy shit

north birch
#

WhAt

vague kelp
#

I'm way too drunk for this

earnest phoenix
#

any discord data, excluding IDs, must be encrypted

#

like how much users have made sarmas?

mellow cairn
#

Txt files are similar to SQL
@hollow sedge Youโ€™re telling me I donโ€™t need to learn a db, but using a txt file will get the job done?

hollow sedge
#

WTH are sarmas

vague kelp
#

@earnest phoenix can you post that face palm again on my bahalf. thanks.

earnest phoenix
#

type on google sarma

#

its my SARMA bot

hollow sedge
#

@hollow sedge Youโ€™re telling me I donโ€™t need to learn a db, but using a txt file will get the job done?
@mellow cairn no I was being sarcastic, you should learn a DB.

mellow cairn
#

SHWARMA

earnest phoenix
#

yes

mellow cairn
#

Alright

#

@mellow cairn similuar
@earnest phoenix Send pls

hollow sedge
#

You have a bot..for one food?

earnest phoenix
#

no dont listen txt files are most efficient

hollow sedge
#

what's the point

#

no seriously what's the point

mellow cairn
#

Breh

earnest phoenix
#

ok @mellow cairn

hollow sedge
#

Tell me, can you query a txt file?

mellow cairn
#

Query?

#

Can you query JSON?

earnest phoenix
#

Oh my god wtf

vague kelp
#

Okay I'm leaving

opal plank
#

i was about to step in but the iq here is dropping negative

earnest phoenix
#

Sudden brain cancer

mellow cairn
#

In case u couldnโ€™t tell I donโ€™t know the slightest things about dbโ€™s

hollow sedge
#

It's fine lol

#

You can't query JSON

earnest phoenix
#

well theoretically...

mellow cairn
#

Except JSON, I can use that cuz itโ€™s simple enough

vague kelp
#

I want to leave but I cant bring myself to do it ๐Ÿ˜‚

opal plank
#

fuck it, im stepping in

mellow cairn
#

Wdym Query?

#

As in a particular thing ina table?

#

in a*

hollow sedge
#

I mean like search and filter

opal plank
#

you can use a .txt as a database, you dont need to QUERY anything, you can simply reads its contents or keep it stored on memory

#

its shit though

#

absolutely garbage

earnest phoenix
#

No don't step in, you'll lose brain cells to the Number.NEGATIVE_INFINITY level

hollow sedge
#

I realize that but you lose the functionality

earnest phoenix
#

it's unsafe and goes against discord developer TOS lol

mellow cairn
#

No don't step in, you'll lose brain cells to the Number.NEGATIVE_INFINITY level
@earnest phoenix Iโ€™m not that low of an IQ

opal plank
#

both of you are spewing bs since neither of you know what you are talking about

hollow sedge
#

??? What are you talking about

north birch
#

it's unsafe and goes against discord developer TOS lol
@earnest phoenix Niice and gooood

hollow sedge
#

Who are you even talking to

vague kelp
#

import terrible_idea

earnest phoenix
mellow cairn
#

From terrible_idea import txtfile

earnest phoenix
#

I swear imma just process.exit() in real life from this chat

opal plank
#

QUERY a json? even though he's talking about a .txt file? you CAN use a .txt as a database, explain to them that its possible but its nota good idea, dont go straight up saying BURH< CAN U EVEN QUERY TXT??

vague kelp
#

yep. implementing good security is a terrible idea

#

gotcha

hollow sedge
#

I wasn't talking about what that guy was saying

#

Cypher asked a different question

mellow cairn
#

Is there a SQL x DPy tutorial?

earnest phoenix
#

you don't need a tutorial

mellow cairn
#

Do I not?

earnest phoenix
#

follow the library for sqlite i sent you, they have a plethora of samples

mellow cairn
#

Iโ€™m worse then u may think

earnest phoenix
#

Documentation cries in the corner

vague kelp
#

Is there a SQL x DPy tutorial?
@mellow cairn I ship it

opal plank
mellow cairn
earnest phoenix
#

correct

mellow cairn
#

@mellow cairn I ship it
@vague kelp What?

#

Oh

earnest phoenix
#

you may need to read up on SQL though

hollow sedge
mellow cairn
#

SQthon

earnest phoenix
#

IQisLowHereThon

opal plank
#

yes, thats precisely what i was on about

hollow sedge
#

And I said can you query a txt because the other guy was saying that they are the best dbs

vague kelp
#

I prefer .pdf

opal plank
#

clearly a troll

earnest phoenix
#

.psd

hollow sedge
#

I don't think they are a troll

#

Just completely clueless

earnest phoenix
#

I through json was bad for a db but this man fucking used a txt file

#

see kids

#

this is why people spend 6 years on IT education

vague kelp
#

Dont do drugs

opal plank
#

this is why people spend 6 years on IT education
@earnest phoenix or do the smallest bit of research

north birch
#

I through json was bad for a db but this man fucking used a txt file
KEKW

earnest phoenix
#

i've seen worse

vague kelp
#

Dont do drugs
You'll start thinking txt's make good DB's

north birch
#

i've seen worse
@earnest phoenix Db in png file

earnest phoenix
#

storing in memory then wondering why data go poof when the bot crashes

hollow sedge
#

wdm guys? just use a dict

opal plank
#

ive seen people do their own .txt parsers and readers to use it as a simple db, of course it was for experience, but it wasnt half bad

earnest phoenix
#

Like how the fuck would you think of a txt file being a good database as the very first option?

rustic nova
#

1 word

#

json

#

lmao

vague kelp
#

storing in memory then wondering why data go poof when the bot crashes
@earnest phoenix Is that where all my usernames and passwords went??

opal plank
#

petition to ban half of the people on this channel

earnest phoenix
north birch
#

I wanna see DB.PNG

earnest phoenix
#

Petition to bring back my lost brain cells in this channel

sudden geyser
#

I swear imma just process.exit() in real life from this chat
@earnest phoenix don't forget to rm -r ./ to be safe

earnest phoenix
#

my biggest problem with this channel is dumb people asking dumb questions and then proceeding to do it their way after receiving a proper, smart answer

opal plank
#

the best is asking for help and not listening

#

love those the most

rustic nova
#

can you stop describing dbl in a nutshell?

#

please sad

earnest phoenix
#

DBL isn't a joke, it's development channel is

opal plank
#

^^

north birch
opal plank
#

.gif

#

not .png

rustic nova
#

.json

earnest phoenix
#

dumb people will claim they're smart but smart people will claim they're dumb mmLol

rustic nova
hollow sedge
#

you've seen txt files, but have you seen the discord server db?

earnest phoenix
#

oh my god

#

yes

#

done

#

Don't you love it when people come up with the most unexpected possible ways to their own problems when they ask a question?

hollow sedge
#

lol

earnest phoenix
north birch
#

Gif db to store photos frame

earnest phoenix
#

What the fuck

opal plank
#

im out

#

bye

#

cant take this

hollow sedge
#

LOL you're a troll

#

for sure

earnest phoenix
#

My brain just lagged in real life

#

and the person justified it "it updates fast enough" yeah 120ms for something that would've taken 500us-5ms on a normal database

umbral zealot
#

that's not a database.

earnest phoenix
#

@hollow sedge no i really made that

hollow sedge
#

"ok this took me 1 hour to make and its very useful, one of best and challeging things i ever made"

north birch
earnest phoenix
#

yes seriously

hollow sedge
#

and you wrote python code in a txt file

earnest phoenix
#

i am new to python

sudden geyser
#

I feel a common issue with asking for help is with a few where someone new/inexperienced gets nervous/confused when writing their question, so they end up posting the vague/hard to interpret question, which only confuses more people causing the thing they weren't trying to be.

earnest phoenix
#

yes

#

Man, even god doesn't know how to explain this

hollow sedge
#

why did you write python in a txt file

earnest phoenix
#

thats the source code

#

in txt

#

ah a person from balkan

hollow sedge
#

you realize the extension is .py right?

earnest phoenix
#

explains it

#

YES BUT YOU WONT RUN IT

hollow sedge
#

why would i run your code?

earnest phoenix
#

Chill

#

i dont know its jut source code

#

We mostly don't even run code from here

north birch
#

Coronavirus.exe joined the chat

earnest phoenix
#

trust me

#

happy???

umbral zealot
#

It's great that you're learning python, but just to let you know: a txt file is not a database. It's a txt file. Just about the worst ever way to store data you modify. Please don't call it a database.

vague kelp
#

I really don't want to download that

earnest phoenix
#

but the only way to get free database

opal plank
#

.........

umbral zealot
#

Literally not

opal plank
#

one sec

#

nono

earnest phoenix
#

If you guys don't download it i can fetch it in the testing channel

opal plank
#

dont asnwer that

north birch
#

DATABASE ARE FREE LMAOAMAMMAOFDF

opal plank
#

i got this evie

#

i got this

#

chill

north birch
#

LMAOJFNGBSFJG

#

Sorry

earnest phoenix
#

no i was on google and i saw it cost

#

i can break your database super easily

umbral zealot
#

@north birch relax, your comments are purely pointless. laughing at the guy answers nothing.

earnest phoenix
#

and i was like

#

why dont make own

#

ez

#

just name myself something with a colon and game over, i broke your database

north birch
#

@north birch relax, your comments are purely pointless. laughing at the guy answers nothing.
@umbral zealot No it's not me laughing it's..

#

idk

hollow sedge
#

why dont make own
@earnest phoenix but you didnt really make your own

earnest phoenix
#

you are telling me that i wasted 3 hours making that?

#

Wtf, mongodb, quick.db, and many others are free, tf are you talking about

#

yes, you did

hollow sedge
#

also they're free on the cloud too

umbral zealot
#

@earnest phoenix it's not wasted. You actually learned something doing it.

north birch
#

no i was on google and i saw it cost
@earnest phoenix Maybe online database costs

hollow sedge
#

no

#

500 mbs free on mongodb atlas

opal plank
#

@earnest phoenix

hollow sedge
#

should be enough to get started at least

opal plank
#

pick your poison

earnest phoenix
#

i will send you my bot code so you can see what i want

#

only enterprise databases cost, and 95% of people here aren't enterprise

opal plank
#

you clearly didnt do your research shovel

#

every single database i posted above is free to use

earnest phoenix
#

No no no no no, we don't want more cancer

#

what cancer

#

its good code

#

stop insulting me

opal plank
#

personal recommendation, sqlite for simple stuff which is what you are likely using.
postgres for the big bois
cassandra if you are a platform

earnest phoenix
#

"good code" sure but anyways

#

dont put it in quotes

umbral zealot
#

@earnest phoenix dude don't be a dick.

earnest phoenix
#

its actually good

#

why you cyber bullying me

hollow sedge
#

you're a troll

#

stop

earnest phoenix
#

How am i being a dick?

umbral zealot
#

calling people's code cancer and insulting their code is being a dick.

earnest phoenix
north birch
#

So hm..i got a problem here, i actually use this filter to make equip command in my economy bot, it work but when there are 2 weapons of the same type it return error, what can i do for fix this?

    if(args[0] === 'Weapon1') {
        if(userWeapons == 'Weapon1') {
        message.channel.send('You equipped Weapon1');
        if(isSomethingEquipped === true) {return message.channel.send(Somethingh is already equipped')};
        db.set(${message.author.id}_equippedweapon, 'Weapon1');
        equipweap = db.fetch(${message.author.id}_equippedweapon)
        const filtro = weap;
        const newinv = filtro.filter(weap => weao!= equippedweapon);
        db.set(${message.author.id}_weapon, newinv)}
        else {
            message.channel.send('You dont have this weapon!')
        }

I used quick.db

hollow sedge
#

you aren't..this guy is legit trolling

earnest phoenix
#

@hollow sedge I JUST WANT TO FIX MY CODE THATS WHY I CAME CAN YOU STOP

north birch
#

why you cyber bullying me
@earnest phoenix Poor man

opal plank
#

@earnest phoenix did you bother looking at the links i sent you? im one of the few providing you with proper links to what you need

earnest phoenix
#

shut up

hollow sedge
#

@earnest phoenix you're trolling because you aren't listening to what anyone is saying and keep proclaiming that your txt db is the best

umbral zealot
#

I'll second Erwin - if you want to use a database, there are plenty of options.

earnest phoenix
#

your fix is to refactor your code and redo it with a proper database

#

@earnest phoenix you're trolling because you aren't listening to what anyone is saying and keep proclaiming that your txt db is the best
@hollow sedge thats my first time making database can you stop making fun of me

vague kelp
#

hold up

earnest phoenix
#

a bunch of what you sent are stolen snippets from SO

hollow sedge
#

I'm not making fun of you?

vague kelp
#

I hope I'm just too much whiskey in right now

earnest phoenix
#

you are telling that my code is terrieble

#

u are

#

yes

opal plank
#

its not fix your code, the base of the code itself is flawed. its like you saying you want us to fix the tire of your car. But the car is on fire and theres no engine, what good will it do if it wont work properly? Use one of the databases i provided above @earnest phoenix

vague kelp
#

but am I reading a Client.command to open a database

umbral zealot
#

@vague kelp yes. you're too much whiskey. you're all the whiskey. ๐Ÿ˜›

earnest phoenix
#

nvm

#

i won't sugar coat critisism

#

loll

#

i am here to get help

umbral zealot
#

We're helping you

opal plank
#

AND IM SENDING YOU, AND YOU'RE IGNORING IT FOR DRAMA

#

REEE

umbral zealot
#

Sometimes help is telling you that you're doing something wrong.

earnest phoenix
#

stop i will send now my bot

#

We're trying to help you by providing free databases and solutions but you won't listen

vague kelp
#

@umbral zealot I dont think I'm enough whiskey for this...

north birch
#

My question got killed by all this message lmao

opal plank
earnest phoenix
#

and hide ofc token i will not make second time mistake

opal plank
#

he either blocked me or cares more about drama/spoonfeeding that actual help

umbral zealot
opal plank
#

next person that needs assitance, please step foward

earnest phoenix
#

@umbral zealot ok

#

@opal plank I have no words to say about this anymore and so do you

opal plank
#

this

earnest phoenix
#

here

#

SEFRG

#

GRE

#

noooo

#

[Visible Confusion]

north birch
#

What

earnest phoenix
#

nvm

#

heres my code

umbral zealot
#

ok. I can see it

#

what's the issue?

earnest phoenix
#

i wrote in code

umbral zealot
#

Could you not just lead with "I want to make a cooldown on my commands"? instead of all this damn drama

earnest phoenix
#

i was

#

but they started telling me that i am idiot

#

which is unprofessional

umbral zealot
#

I came in here with you talking about having made a database, so maybe you got confused as to what question you were asking

earnest phoenix
#

...

#

Idk how you sending your entire bot code related to fixing your database

#

can you just fix my code so i can leave this server

earnest phoenix
#

I DONT WANT to fix my database

umbral zealot
#

docs on cooldown, which is a built-in discord.py feature apparently

earnest phoenix
#

my database is FINE

#

we finished this

umbral zealot
#

stop getting distracted.

earnest phoenix
#

ok ok

umbral zealot
#

If you don't want the noise of people calling your code shit, discord.py has an official server.

earnest phoenix
#

this is the cooldown @dense frostmmands.cooldown(1, 30, commands.BucketType.user)

umbral zealot
#

you might get less people screaming at you there

vague kelp
#

Shovel385Today at 22:02
can someone help me with cooldown in python? the cooldown works and i want when user tries to run command again to say message like "you need to wait 3 seconds to run command again". i tried everything on internet theres nothing much about that so if someone can help it would be nice. thanks

ArcticVeilToday at 22:05
Shovel385
import asyncio
(command you want cooldown on)
await asyncio.sleep(delay=3)

Should work I believe, you may need to tweak it
Shovel385Today at 22:06
i used @dense frostmmands.cooldown(1, 30, commands.BucketType.user)
thanks

earnest phoenix
#

now i feel demotivated and useless because of this

#

can someone fix

vague kelp
#

to be fair, he DID ask for help with his command

opal plank
vague kelp
#

]

earnest phoenix
#

because you're behaving like a brat instead of a rational human being

umbral zealot
#

Can you guys stop pinging @co please

opal plank
earnest phoenix
#

to be fair, he DID ask for help with his command
@vague kelp it did not solve the problem

umbral zealot
#

Looks if you're doing what the docs say and it doesn't work, then the problem is discord.py

#

their server invite is, I think, just /dpy so go there

earnest phoenix
#

itsn ot problem with python

opal plank
#

shovel, it seems like you are expecting us to simply fix stuff for you, we cant spoonfeed you, we can explain how you fix your code

vague kelp
#

Can you guys stop pinging @co please
@umbral zealot unintentional, sorry

earnest phoenix
#

you dont get it what i want

umbral zealot
#

You want a cooldown

earnest phoenix
#

i want like when i type +getsarma so to not they spam +getsarma i want to tell them to wait to cooldown finishes

#

thats i want

opal plank
#

shovel, did you read what evie sent?

umbral zealot
#

yeah. that's called a cooldown

earnest phoenix
#

is it that hard

opal plank
#

at all?

umbral zealot
opal plank
earnest phoenix
#

That's basically cooldown, d.py has it built-in

umbral zealot
#

if you don't know how to use the docs, ask the devs.

#

tell 'em to add examples

earnest phoenix
opal plank
#

thats exactly what you want though

umbral zealot
#

Well then the docs are shit and the devs should make them better

earnest phoenix
#

a hour ago

umbral zealot
#

the hell are we supposed to do about it

earnest phoenix
#

@earnest phoenix thank you my man

opal plank
#

he wants spoonfeed code im afraid

#

and he's not gonna find any here

umbral zealot
#

Yes thanks Voltrex for linking the thing I linked 20 messages ago that @earnest phoenix didn't want to read

earnest phoenix
#

shut up and bye

umbral zealot
#

typical, a man stealing a woman's answer as their own ๐Ÿ˜‚

vague kelp
#

Evie, can I ask a question

umbral zealot
opal plank
#

can someone fix

can you just fix my code so i can leave this server

earnest phoenix
#

๐Ÿ—ฟ We can make a whole meme out of this

#

they finally left at least

umbral zealot
#

They're gone can we just fucking move on

opal plank
#

little does he know a bunch of people here are on dpy too

umbral zealot
#

@vague kelp you can try asking, for sure ๐Ÿ˜„

opal plank
#

๐Ÿ—ฟ We can make a whole meme out of this
@earnest phoenix pls dont, i dont wanna have any memory of this tomorrow, hopefully the booze shields me from such

north birch
#

Can i ask something now lmao?

opal plank
#

go ahead

vague kelp
#

@umbral zealot is the @-co community managers? is that why it keeps pinging people?

earnest phoenix
#

Yea, we already lost enough brain cells lmao

opal plank
#

^^

umbral zealot
#

No it's because people don't know how to use codeblocks

#

if you write @command in a text it pings @co because it's literally saying @co in the message.

#

unless you use some backticks as you should for all code

earnest phoenix
#

That mostly happens on PC tho, on mobile it basically doesn't ping at all but using one liner codeblocks for sharing small code is still a good idea

vague kelp
#

my curiosity is who it's pinging though...

umbral zealot
#

@co is the first match for a mention because it's the shortest

vague kelp
#

OH

opal plank
#

omg

vague kelp
#

THAT makes sense

earnest phoenix
#

Anyways can i re ask my question now?

opal plank
#

wait a second, i have an idea

umbral zealot
#

yes please ๐Ÿ˜„

north birch
#

Anyways can i re ask my question now?
Me too LMAO

opal plank
#

if i were to change my name do m everytime someone does @ mods it would ping me instead? Peition to change my nick to m

earnest phoenix
umbral zealot
#

The answer is : if it works, it ain't broke, don't fuck with it

opal plank
#

its not updating the embed though...?

umbral zealot
#

I looked at it briefly, it looks readable.

earnest phoenix
#

It's updating it

north birch
#

So hm..i got a problem here, i actually use this filter to make equip command in my economy bot, it work but when there are 2 weapons of the same type it return error, what can i do for fix this?

            if(userWeapons == 'Weapon1') {
            message.channel.send('You equipped Weapon1');
            if(isSomethingEquipped === true) {return message.channel.send(Somethingh is already equipped')};
            db.set(${message.author.id}_equippedweapon, 'Weapon1');
            equipweap = db.fetch(${message.author.id}_equippedweapon)
            const filtro = weap;
            const newinv = filtro.filter(weap => weao!= equippedweapon);
            db.set(${message.author.id}_weapon, newinv)}
            else {
                message.channel.send('You dont have this weapon!')
            }```

I used quick.db
opal plank
#

how though?

umbral zealot
#

lol_quick_db.gif

opal plank
#
case ":rewind:":
                if (pages === 0) return;
                pages = 0;
                break; ```
where does this edits the message?
earnest phoenix
#

It edits the message at the very bottom

opal plank
#

you updating on EVERY reaction?

#

wot?

vague kelp
#

I read code, I see emojis, brain hurt

earnest phoenix
#

Uhh, it should update in every reaction because it's a pagination system?

opal plank
#

not rlly

#

why u updating it on a delete?

earnest phoenix
#

I'm not

opal plank
#

this will run

earnest phoenix
#

That's why there's something called return

umbral zealot
#

return

opal plank
#

oh right

#

my bad

umbral zealot
#

are you tired, Erwin? ๐Ÿ˜›

opal plank
#

im drunk