#development

1 messages ยท Page 736 of 1

earnest phoenix
#

@lavish shuttle video call me

#

we'll figure it out real quick

#

and then you owe me

#

massive praise

lavish shuttle
#

Alright

formal vine
#

How do I make my bot DM the person who invited. I've seen this used as a grasp for them to get people to a support page if they need it, but I have no clue how to actually do it. please @ me if you have a response i'm going to be gone for a while so I'd like to be able to find it.

split hazel
#

You can't, otherwise you have them go through an oauth2 and force them to login through discord

#

Which is too much effort just for that & probably something else like redirecting them to a help page would be good

#

@formal vine

formal vine
#

Gotchu, thanks

earnest phoenix
#

I know it's not allowed to send server count to DBL if it's fake. What if I'm testing it? Is it allowed to display a lower number?

split hazel
earnest phoenix
#

Ahh, okay thanks.

split hazel
vivid vapor
#

Can someone dm me and help my how its working

vital lark
#

can you provide the question you need

vivid vapor
#

I need help i whant to learn it but i need all the codes names and what its meaning

#

I now h2 that stuff

split hazel
#

Learn what?

earnest phoenix
#

have you ever written code before?

distant plank
#

How can I get the leaderboard position of the user who sent the message?

 econ.query(`SELECT id, bank, bag FROM economy ORDER BY ${requestorder} DESC`, (err, rows) => {
                if (err) {
                    throw err;
                }
                const embed = new Discord.RichEmbed()
                    .setColor('#800080')
                    .setTitle('Tabla de primeras posiciones')
                    .setThumbnail("https://static.thenounproject.com/png/714871-200.png")
                    .setDescription(`Ordenado por ${orderby}`);
                let order = 0;
                for (let i = 0; i < 10; i++) {
                    if (i > rows.length - 1) {
                        break;
                    }
                    if (!type || type == "all" || type == "total") {
                        select = Number(rows[i].bank) + Number(rows[i].bag);
                    }
                    else if (type == "bank" || type == "banco") {
                        select = Number(rows[i].bank);
                    }
                    else if (type == "bag" || type == "bolsillo") {
                        select = Number(rows[i].bag);
                    }
                    if (message.guild.members.get(rows[i].id)) {
                        const user = message.guild.members.get(rows[i].id).user;
                        if (!user.bot) {
                            embed.addField(`${numbers[order]} ${user.username}`, `$${select}`)
                            order++;
                        }
                    }
                }
                message.channel.send(embed);
            });
#

this is my code

quartz kindle
#

if your leaderboard has bots in it, its better to filter them out first

distant plank
#

the bots are not in the table, put the users into the database individually

quartz kindle
#

then why do you check for bots there?

amber fractal
#

loading...

formal vine
#

Does command prompt need to be open in order for the bot to run?

earnest phoenix
#

Yes

#

Or host the bot on vps

tacit stag
#

yay imma try and get a nice and cheap vps so i can start running my bots 24/7

#

now that i just finished two of my bots

mossy vine
#

no if you have a different way of spawning the bot process

dusky marsh
#

Anyone know why discord oauth would be giving a 401 on any redirect url except localhost?

#

my application works fine on local, but when deployed to my site, it doesnt work

stray wasp
#

have you changed the link?

#

from localhost to your domain?

dusky marsh
#

yes

wheat jolt
#

you need to add a redirect url

#

for your domain

dusky marsh
#

I did

formal vine
#

Is there a difference between using a prefix when coding for a bot and just using the entire argument itself? For example should I be doing the whole [prefix] + command thing or can I just do prefixcommand together

#

It works the second way but is it better if I do it the other way around

keen willow
#

using prefix + command is better because you can just change the prefix in 1 clic (or in a config file)

modest maple
#

^

#

Altho saying that I have prefixCommand together but I use string formatting

formal vine
#

hmmm okay, thank you

earnest phoenix
#

anyone uses coderunner in vs code? and know how to add extra compiler flags like -pedantic or -Wall

late hill
#

Or use a command handler where you check for the prefix just once

green kestrel
#

i nicked some ideas from dyno's service status page and made a nice status section... thoughts? did i miss anything?

mossy vine
#

i wouldnt display a list of servers if i were you

green kestrel
#

Why not?

#

The point is knowing if an outage affects the bots ability to see your servers

#

It's not like you can see servers you're not a member of

vital lark
#

it's against the tos iirc

scenic kelp
#

If it's only your servers that you can see it's fine

#

but you don't own DBL so

amber fractal
#

It's not like you can see servers you're not a member of

#

You dont need to own it to see if it's online in the guild

scenic kelp
#

I guess that's fine

#

yeah

green kestrel
#

Yeah it's showing servers which both you and the bot are in

#

You can only manage servers where you have the correct permission though

west raptor
#

@green kestrel looks hot

#

Also no, it is not against ToS as long as it's one of 2 things:

  1. It's only showing servers you're a member of
  2. It's exclusive to the owner
#

In this case it's number 1

green kestrel
#

yup

#

i would be curious to have an oversight list as the bot owner, but i have no need for it, so its wasted dev time

#

curiosity isnt worth it, and its something someone could potentially hack into, so...

#

just fixed that list to work with mobile, added touchstart and touchend events

west raptor
#

I'm always careful what power I give myself

green kestrel
#

yeah, i dont even have an eval command

west raptor
#

Me neither

green kestrel
#

although, trying to make an eval command in C++ would be "O_o"

#

it would have to run gcc against some code, compile and link it as .so and dynamically load it

west raptor
#

If I need information regularly about something I'll make a command for it

green kestrel
#

and thats just asking for trouble

west raptor
#

Yes

#

My bots that I'm working on is in rust

#

So

green kestrel
#

i have enough trouble convinging people that my javascript interpreter is secure ๐Ÿ˜›

west raptor
#

Eval commands are just so dangerous

#

No matter what you do

#

There is gonna be some exploit

green kestrel
#

yup

#

i think i covered all bases i can cover in my bot, i wanted to offer javascript scripting to untrusted users, so i wrote the bot in C++ and linked in a js interpreter where i can control the amount of memory it uses, the amount of cpu cycles its allowed, and even no filesystem or networking access apart from what i allow

#

to actually make a properly secure system, its kind of unforgiving, people have complained "but i cant do anything with that" because they have to approach JS in a quite old fashioned way without promises, lambdas, threads

west raptor
#

Mhm

#

Giving people just little bit too much access can be really bad news

green kestrel
#

yeah, its amazing what you have to take into account

#

eยทg. give them no network access, they still need to access discord, so you need to be careful what bindings they have, how often they can use them, and make sure they can't flood

west raptor
#

Yep

green kestrel
#

give them e.g. http requests, and you then have to be strict on even the dns timeouts, the download and post sizes...

west raptor
#

It's a scary thing tbh

green kestrel
#

and stop them chaining http requests together

#

yeah

#

i had a bunch of people throwing exploits at my bot for a couple of weeks, only one person managed to cause any issues

#

that was due to a malicious regex

#

and that was because the interpreter lib itself was missing something, so i had to patch that and submit the patch to the lib author

#

its a rabbit hole and a half

lunar crystal
#
  console.log('Musique ma geule')
});

client.on('message', message => {
  // Voice only works in guilds, if the message does not come from a guild,
  // we ignore it
  if (!message.guild) return;

  if (message.content === '!7join') {
    // Only try to join the sender's voice channel if they are in one themselves
    if (message.member.voiceChannel) {
      message.member.voiceChannel.join()
        .then(dispatcher => { // Connection is an instance of VoiceConnection
          message.reply("**J'ai rejoint le salon vocal avec succรจs :thumbsup:**");
        })
        .catch(console.log);
    } else {
      message.reply("**Vous devez d'abord rejoindre un salon vocal :x:**");
    }
  }
});```
vital lark
#

what's wrong?

#

just displaying code won't help what u need help with

west raptor
#

That path is incorrect

#

And where is dispatcher being declared?

lunar crystal
#

.then(dispatcher => { // Connection is an instance of VoiceConnection

west raptor
#

Where is const dispatcher = connection.playFile('โ€ชโ€ชC:\Users\hieli\Downloads\Vitas 7th Element 2002.mp3')

#

Also that's a callback

#

Your paramater is dispatcher

earnest phoenix
#

HELP

#

you didn't screenshot the field that causes the error

#

๐Ÿ‘

west raptor
#

Also this isn't the right channel

royal egret
#

eehm

#

bye

#

i will leave

earnest phoenix
#

lnvaid server format

west raptor
#

The server should be it's id

#

And it must be on DSL

earnest phoenix
#

i have an egentification server

west raptor
#

What

modest maple
#

What

quartz kindle
#

What

vital lark
#

what

modest maple
#

Okay

lunar crystal
#

@west raptor I dont understand ( ๐Ÿ‡ซ๐Ÿ‡ท )

west raptor
#

Ehh

#

@flat pelican can you assist pls

flat pelican
#

@lunar crystal Quel est le souci?

lunar crystal
#

oki ^^

charred loom
west raptor
#

You are calling toLowerCase on undefined

charred loom
#

yes

blissful scaffold
#

yes

west raptor
#

You can't do that

#

@charred loom looks like you aren't passing in any args on the message

#

Check if they exist first

modest maple
#

Bruh isn't that the 5th he's asked?

#

Or is this a new issue?

blissful scaffold
#

Last time was a similar screenshot, but a different issue

charred loom
#

So, are you helping me?

west raptor
#

We just did

#

Refer to my message

charred loom
#

ok

#

well, what do?

west raptor
#

I just fucking said

#

Check if the argument exists before calling toLowerCase on it

charred loom
#

which argument

blissful scaffold
#

check line 15

#

and see what argument the toLowerCase is used on

#

that argument does not exist/is not set

charred loom
#

idk

earnest phoenix
#

read your errors

blissful scaffold
earnest phoenix
#

for fucks sake

charred loom
#

yes bro, yes, but how do?

vital lark
#

you check if the argument isn't specified

scenic kelp
#

Do you have any experience with any programming language

earnest phoenix
#

english

slender thistle
#

It's very doubtful they don't just poke around to try to get their errors fixed

charred loom
#

what should i put on line 15?

sinful lotus
#

what should you put on line 15?

#

its your code doesnt it?

charred loom
#

?

sinful lotus
#

its says "of undefined"

charred loom
#

yes

sinful lotus
#

thats like the easiest thing you can fix

earnest phoenix
#

^

sinful lotus
#

what is undefined on that case?

#

if it says "toLowerCase of Undefined"

charred loom
#

In vain do you try to take me bypasses and try to guess, because I would ask you, if not, I would do it myself

sinful lotus
#

I wont be spoonfeeding the answer to you directly

#

thats why Im asking you the long way

charred loom
#

...

sinful lotus
#

Its your code, I just rack your brain for you to find it out

#

it literally says "toLowerCase() of undefined"

slender thistle
#

I thought developers are supposed to read the errors, use their knowledge of the language syntax, apply logic

sinful lotus
#

what is the value that goes before the toLowerCase()?

blissful scaffold
#

@charred loom I will give you some help:
you want to check if the argument exists

sinful lotus
#

of undefined

#

if you googled what is the use case of this thing called "of"

charred loom
#

input?

sinful lotus
#

do you have input on line 15?

#

do you have a variable called input?

charred loom
#

๐Ÿคฆโ€โ™‚๏ธ

sinful lotus
#

where is the function "toLowerCase()"

#

where did you put it?

#

screenshot it

#

now once you know where that thing is

charred loom
sinful lotus
#

the error says "toLowerCase() of undefined"

#

it means

charred loom
#

yes

sinful lotus
#

the value "BEFORE" toLowerCase() is undefined

slender thistle
#

Are you sure the thing you call toLowerCaseon exists

blissful scaffold
#

Did you already try running it after you added line 14?

sinful lotus
#

the thing is

#

args is defined

#

the problem is

charred loom
#

yes WhiteSpirit

sinful lotus
#

he doesnt know how to even check if a its an empty array or nope

#

he is directly accessing an array without knowing if something is inside there at the first place

#

as simply as it sounds

#

the thing you need to do is to check if you array has actual string inside of it

#

of course that would throw errors if someone breaks your bot by inputting a blank argument

charred loom
#

leave it so, give it right

sinful lotus
#

thats the answer to your problem ๐Ÿ‘€

blissful scaffold
#

check the length of your array

charred loom
#

I see apples

blissful scaffold
#

or check if the array is empty

charred loom
#

@blissful scaffold help me with example with line?

blissful scaffold
#

My bots are not made in JavaScript, but I can give you an example in another language

dusky marsh
#

They told you exactly what the problem is, you should be able to research from here

modest maple
#

#trycatch

blissful scaffold
charred loom
#

no

earnest phoenix
#

lol

mossy vine
#

lul

modest maple
#

welp

#

you try to teach people

#

xD

charred loom
#

are you the one to write a line?

vital lark
#

StixilSigh we have given you answers on your question

#

we're not gonna spoon feed you S3SataniaDead

modest maple
#

now go out and explore the work of learning!

charred loom
#

oh, is stupid

blissful scaffold
#

I'm out of here before Spider gives me another warning xD

modest maple
#

hide yourselves

charred loom
amber fractal
#

solo is undefined

charred loom
#

solo or wins?

vital lark
#

solos is undefined

slender thistle
#

How are those errors not self explanatory

earnest phoenix
#

they are

#

the problem is that they don't want to read them

#

despite being told to about 5 times now

charred loom
#

what

#

Well what do I do in my dick, say example not links and all the crap

earnest phoenix
#

that made no sense but somehow managed to make me laugh

slender thistle
#

I'm fairly sure someone with knowledge of the language syntax should know how to use documentation

charred loom
#

ok, so help or no help

mossy vine
#

we help but you just disregard everything

charred loom
#

yes

mossy vine
slender thistle
#

That's... not false after all.

quartz kindle
#

he doesnt want help, he wants spoonfeeding

charred loom
#

Good night, I have nothing to do with you

quartz kindle
#

his definition of "help" is being given working code to copy and paste

#

if you want code to copy and paste, you can always pay someone to do it for you

charred loom
#

yes :))

vital lark
#

^

#

well, we're not gonna spoon feed you

charred loom
#

give you 1 e paypal

earnest phoenix
#

that might be of help, if you can be bothered to read that

charred loom
#

you are stupid bro!

quartz kindle
#

lmao

slender thistle
#

I would argue that

vital lark
#

how are we stupid? we know how to use the languages we learned and know how to read errors and find the solution...

ruby talon
#

Is it just me or does Perl look like chinese shizzle?

slender thistle
#

You are the one who has no willingness to read your errors or really listen to any advice you are given.

earnest phoenix
#

perl is fun to work with but it has messy syntax

quartz kindle
#

advices are useless for people who dont want to learn

earnest phoenix
#

from my experience

slender thistle
#

Learning does not consist of literally copying and pasting examples all the time

ruby talon
#

@earnest phoenix where did you learn it? (Just interested in the basics :D)

earnest phoenix
#

i took a few courses on udemy

ruby talon
#

@slender thistle besides that, stackoverflow is bae tho right xP

slender thistle
#

Your post has been marked as duplicate

ruby talon
#

@earnest phoenix I'll take a lookn thanks. ^^

#

lul

slender thistle
#

I would recommend official servers for the Discord libraries instead of SO

modest maple
#

yh

slender thistle
#

I personally usually go either on Google or asking my friends

ruby talon
#

Whats SO?

slender thistle
#

StackOverflow

ruby talon
#

Ah

earnest phoenix
#

SO is useful, sometimes but it's spoonfeeding heaven

#

solutions often promote bad practices

modest maple
#

and sometimes gives the wrong info

ruby talon
#

SO is amazing, but ya gotta understand the code ๐Ÿ˜›

earnest phoenix
#

especially on discord related questions

ruby talon
#

reddit is suprisingly good for discord coding questions

slender thistle
#

Being limited to simple/Discord libraries, Google and Discord servers have helped me out so far. Might use SO someday when getting to other libs

ruby talon
#

Uhu, what language do you use?

quartz kindle
#

you graduate from beginner to intermediate programming when you move from stackoverflow to official documentations

#

well, you never really stop using stackoverflow, you just use them way less

#

xd

ruby talon
#

Yup.

slender thistle
ruby talon
#

First check if you know how2fix,
if not, check docs,
then google &SO

slender thistle
#

Python so far, thinking about getting used to C++/C# later

quartz kindle
#

i mostly go to SO to see how people implement some specific solution, then end up making my own anyway

modest maple
#

C++ is good

slender thistle
#

Ah, yes, reinventing the wheel smug

modest maple
#

i still prefer python tho

vital lark
#

I only use SO if I need help on an error

quartz kindle
#

im the champion of wheel-reinventing

ruby talon
#

Nice, I'm currently also working in py, learning c# and basics cpp (for school), c# is pretty nice. [Still love python more]

modest maple
#

love the utility of python, if theres somthing you need theres almost defo a module for it

ruby talon
#

Indeed

slender thistle
#

Python worked so far with me in my college adventures

quartz kindle
#

i tried making my own login system because i couldnt be bothered to learn how to use composer

ruby talon
#

And if there isn't a default module there are most likely other public libaries available.

quartz kindle
#

but i gave up at some point

slender thistle
#

Getting straight to CPP after python is hard

quartz kindle
#

lmao

slender thistle
#

lol

ruby talon
#

@slender thistle probbably bc's ur expectations are 2 high.
Might wanna start again with the mental state of: "OMAGAWD HELLO WORLD" ๐Ÿ˜›

slender thistle
#

๐Ÿ˜‚

ruby talon
#

And c# is easier than cpp

#

:))

slender thistle
#

I've been learning C++ for the past few days, boy will it take some time to get used to the syntax

ruby talon
#

ye, kuch ;

quartz kindle
#

i had to learn some bits of it to mess with node native modules

ruby talon
#

๐Ÿ˜‚

quartz kindle
#

it was hell

slender thistle
#

I can imagine

ruby talon
#

Shivuwu, try to switch back to python for a sec, you'll type ;'s everywhere lmao

quartz kindle
#

like how to convert ::string<T> to ::string<V> or whatever the hell that means, how how to convert it to anything that node understands

#

stupid v8

slender thistle
#

I don't have a problem with semicolons

ruby talon
#

I DO

modest maple
#

python is good for its simplicity

#

who even needs ;

#

or {}

quartz kindle
#

i cant live without {}

modest maple
#

cuz ur just using the bad janguage

#

JaVA

quartz kindle
#

lul

#

javascript doesnt need {} everytime

#

but i still use it

mossy vine
#

^

#

its parsing is so weird

slender thistle
#

Habits

quartz kindle
#

i mean, C does the same thing

#

and many other languages

modest maple
#

yh

quartz kindle
#

you dont need {} if you have only line after if

#

i had to modify a C library once, and it was confusing af because the authors rarely ever used {}

#

and bad indentation lmao

modest maple
ruby talon
#

jeez

modest maple
#

altho missing some stuff

#

havent got dropbox api on it yet

quartz kindle
#

thats direct dependencies you require? or does it include dependencies your packages need?

modest maple
#

there the external modules

ruby talon
#

mine

modest maple
#

there are alot of custom modules i use

ruby talon
#

mao

modest maple
#

had to custom build our own WebHander for large scale data gathering xD

quartz kindle
#

my bot has very few dependencies, but a few of those dependencies have like 50 dependencies

modest maple
#

yh

quartz kindle
modest maple
#

biggest pain in the world: Threading with async

quartz kindle
#

actual node_modules folder

#

lmao

slender thistle
#

Oof

modest maple
#

xD

ruby talon
#

wth

#

lol

modest maple
#

The bot uses:

11 Custom Modules as dependencies
36 External Modules

then those modules use:

186 Diffrent modules

#

100 of those extra modules are google and google alone -_-

mossy vine
#

<#id> iirc

quartz kindle
#

have you guys heard about the event-stream fiasco?

#

made people lose shit ton of money in bitcoin

#

one of the greatest hacks

#

powered by npm

modest maple
#

xD

ruby talon
#

lmao

grizzled raven
glacial lynx
#

Hey I need help, I actually started to develope a bot but I have problem

#

I can't get the bot online, node . And index.js are not working, screenshoot (I deleted the token in purpose)

slim heart
#

@quartz kindle I couldnโ€™t relate to anything more

#

I have like 5 dependencies, but my node_modules has 400 sub dirs lmao

late hill
#

@glacial lynx what response do you get when using those commands

glacial lynx
#

When I type node. It's respons with desktop or something like this

#

And when I type index.js it says that the command not found but it is exists

#

@late hill

slim heart
#

Show the command please

late hill
#

You're probably in the wrong directory

#

Navigate to the project folder using cd or if vsc has the option, you might be able to just open a terminal in vsc that'll already be set to the project directory

earnest phoenix
#

Alright

#

I have no skill in coding

#

So can someone put the code in my bot?

mossy vine
#

not how it works

earnest phoenix
#

I can't send an empty .txt file, have someone fill it in to my requirements, and then have them send it back?

mossy vine
#

..what?

earnest phoenix
#

Ok so

#

I send you a Text File

#

And then you code it to what I want it to do

modest maple
earnest phoenix
#

Then you send it back

mossy vine
#

unless you pay, likely not

modest maple
#

^

earnest phoenix
#

Ah shit, your right

mossy vine
#

unless its really really simple

earnest phoenix
#

Well

#

I'll say what it does

#

You decide if its simple

#

please stop sending files ๐Ÿ‘

#

This bot should just be able to give members in a server a role when they hit a level mark; They reach level 5 they get a Level 5 role, etc.

modest maple
#

mee6

earnest phoenix
#

I have to pay

modest maple
#

if u dont need a dedicated bot

#

mee6

earnest phoenix
#

find another bot

#

No

#

I wanna make a bot

#

ok

modest maple
#

then learn to program

#

instead of asking others to program it for you

mossy vine
#

are you sure thats good advice lul

earnest phoenix
#

"i want to make a gourmet meal but i dont know how to cook"
then order food or go to a restaurant
"no"

#

like what

mossy vine
#

sums up this channel pretty well

earnest phoenix
#

why would you go through a possible mental breakdown to make a bot that won't even be good quality instead of taking 5 minutes to find another leveling bot

mossy vine
#

is this like a personal attack of something

earnest phoenix
#

im self reflecting here โœŒ๏ธ

#

my stubborn ass went on to spend 4 hrs making a youtube to mp3 tool when i could've used ytdl and ffmpeg lol

mossy vine
#

lmao

modest maple
#

tbf cry you did make minecraft interact with another program

earnest phoenix
#

pssst

#

i dont think i slept when i was making that lol

mossy vine
#

yeah coding while being asleep is significantly more difficult

modest maple
#

tbf

earnest phoenix
#

agreed

modest maple
#

half of innkeeper was made at like 3am

#

and tbh i only do like 90% of my coding just to compete with a friend

twilit rapids
#

I haven't worked on my rewrite for months because I'm just lazy

quartz kindle
#

my coding consists of perpetually improving my code and never releasing it

earnest phoenix
#

t h i s

modest maple
#

tbf

#

some of my code

#

is just idk

mossy vine
#

@twilit rapids ayy same but i started it again recently. making a list of what needs to be done and slowly nomming at it is very productive

earnest phoenix
#

i love creating programs and tools i just never release half of it

modest maple
#

somehow i turned a 500 line paginator into a 100 line program

#

and it works

#

the joys of having try and except

#

xD

twilit rapids
#

I would need to look where I left off and what I still need to do and what not

earnest phoenix
#

it's why coding is fun, you can literally create anything you want

modest maple
#

yh

quartz kindle
#

it becomes a huge problem when you decide you want to release a production ready api

#

because it never becomes production ready

modest maple
#

tbf

#

just release it anyway

#

and just enjoy the issues xD

quartz kindle
#

lmao

earnest phoenix
#

discord is just a one big issue but it is still released ๐Ÿคทโ€โ™‚๏ธ

near ether
#

if im sharding, how can i dm a specific user by their id? would bot.fetchUser work even if sharding?

quartz kindle
#

because they have a team working on those issues

#

xD

earnest phoenix
#

i feel like no one there does their job properly

quartz kindle
#

i believe someone tested that and it seems fetching works across shards

near ether
#

hmm really? thats strange lol

#

thanks my dude

#

tim highkey a hero

quartz kindle
#

dont take my words for it tho xd

modest maple
#

only one way to find out xD

near ether
#

^

earnest phoenix
#

fetchUser works anywhere because it uses the REST endpoint which returns basic user info without having a shared guild

near ether
#

ah ok

#

thanks man

modest maple
#

is it really a bug if the bot just spews out errors breifly till the cache is ready?

#

or is it just a helpful insight to make sure its working

earnest phoenix
#

you should do your best to minimalize the amount of errors you get

#

coming soon: merging google speech audio recognition with cognitive AI models for detecting toxic langauge patterns to build an AI moderator

#

I, for one, welcome our technocratic overlords

#

also

#

working on an ear rape detection bot

modest maple
#

that can only go well

#

and tbf

#

its cuz on_message starts firing away as soon as the Webdrivers are fired up

#

once on_ready has booted its fine

#

just needs the global var xD

earnest phoenix
#

any ideas how to make to display other guilds membercount in command ??

modest maple
#

wdym?

earnest phoenix
modest maple
#

if you have the ID of the guild you can do client.get_guild(ID)

twilit rapids
#

@earnest phoenix what library are you using

earnest phoenix
#

discord.js

twilit rapids
#

Well, you get the number of members by doing <Guild>.memberCount, where <Guild> is the guild object

earnest phoenix
#

i want to shows for every guild membercount ๐Ÿ˜‚

summer torrent
#

client.guilds.get("guild ID").memberCount

sterile minnow
#

How do i make a guild list for my Bot in a embed with reaction menu (+100 servers)

The best would be an example code because I have no idea how to do it

Thanks for the help in advance

floral stone
#

What language??

zealous veldt
#

Are you asking how to make a command that sends an embed containing a list of all the guilds your bot is in? @sterile minnow

floral stone
#

Yes, and supposedly with an embed menu.

#

That is what I read, atleast.

zealous veldt
#

You should know that we don't allow bots that have publicly accessible server-listing commands

sterile minnow
#

yeah im a embed menu for discord.js

floral stone
#

Can't help, sorry.

sterile minnow
#

Thats only for my my Feam

#

Team*

zealous veldt
#

Tony created a guide on how to do reaction menus

sterile minnow
#

Okay thx

#

I'll have a look at it

earnest phoenix
#

would you like some help, why not write the one who writes the command? @commands.command() @commands.has_role('ASD') async def clear(self, ctx, amount : int): await ctx.channel.purge(limit=amount) await ctx.send(f'Tรถrรถlve **{amount}** รผzenet.') @clear.error async def clear_error(self, ctx, error): if isinstance(error, commands.MissingRequiredArgument): await ctx.send(':exclamation: Adj emg egy รฉrtรฉket ami nagyobb mint **1** รฉs kisebb mint **500** :exclamation:') if isinstance(error, commands.MissingRole): await ctx.send(f'{message.author} Nincs jogod')

#

here I would like you to write the name of the command user await ctx.send(f'{message.author} Nincs jogod')

#

I just can't figure out why it's not good

zealous veldt
#

Please provide more info, such as what library you're using, what exactly you're trying to do, what the problem is, what's happening, the errors produced, etc.

scenic kelp
#

message.author refers to the Member class

#

you'd want display_name probably

earnest phoenix
#

yap

#

sorry not the best english
I want someone who has no right to say this
@earnest phoenix you have no rights

#

I'm writing in python

vital lark
#

what does it return in the channel when you execute the command

earnest phoenix
#

you have successfully deleted it to create a message

#

I get this error Command raised an exception: NameError: name 'message' is not defined

#

to this codeawait ctx.send(f'{message.author} Nincs jogod')

vital lark
#

message isn't defined

#

maybe check the docs for the context class

slender thistle
#

Yep

slender thistle
#

Context has message property

earnest phoenix
#

I read earlier but couldn't find a solution, so I came here

vital lark
#

message doesn't exist in the function, maybe do what shivu said

earnest phoenix
#

sikerรผltawait ctx.send('{} Nincs jogod ehez a parancshoz'.format(ctx.message.author.mention))

#

thanks for the help @slender thistle

slender thistle
#

@vital lark you technically linked almost exactly what I said

#

@earnest phoenix ctx has shortcuts btw

#

You can use ctx.author

earnest phoenix
#

thanks

#

โค๏ธ

west spoke
#

ok I'm so tired that I thought that was js help me

distant plank
#

I have a problem that I cannot solve, I am using mysql to store data.
I have a function that I want in the channels specified by the user, does not work, but how do I upload the channels to the database?, since there would be many

sudden geyser
#

uhh, could you be more specific? Like, do you want to just save one channel the user set?

wheat jolt
#

@distant plank share your code

green kestrel
#

@distant plank if youre in control of the query itself, rather than building it from class methods you really need to use the syntax INSERT INTO table (fields) VALUES(...) ON DUPLICATE KEY UPDATE field = 'newval', otherfield = 'newval'

#

that will insert it, or if it exists, update it

#

using REPLACE INTO is dog slow, because this table you want to create will very quickly end up huge

#

i speak from experience as this is how my own bot stores its data in mysql and i made that mistake at first ๐Ÿ˜„

formal vine
#

Could anyone help me figure out code that creates an entity for every single member in a server, and for every single time someone joins a server? I guess a bot would be the thing that detects who joins, but I can't imagine how.

modest maple
#

If you read the docs you'll find that there's a function / event that fires off every time someone join a server the bot is in

#

Somthing like on_server_join() somthing like that

earnest phoenix
#

Here you can ask questions about bots ??

vital lark
#

"Channel for chatting about (bot) development."

earnest phoenix
#

ah

#

v:

#

But you can still ask questions about bots?

#

xd

vital lark
sterile minnow
#

its not going... (reaction menu)

#

it cannot read collected every time is a error

#

i have a new idea

earnest phoenix
#

guys if you need I made much better lyrics api that beats ksoft in cache response time and doesnโ€™t require any attribution https://lyrics.tsu.sh

solemn harness
#

hey any github expert here?

vital lark
#

@solemn harness what do you need help with

solemn harness
#

how i solve the conflicts problem while i am merging pull request

vital lark
#

what is the conflict

#

that is preventing you from merging

solemn harness
#

yes

vital lark
#

what

solemn harness
#

let me recheck again

#

oh it's automatically fixed

vital lark
solemn harness
#

merge complete

formal vine
#

Would anyone be able to help me create code that makes a .txt file with each persons name who types in a certain command, along with what responses they added.
For example: (in a .txt)
Name Response
hiero#4663 yes, no, blue, orange, xyz
blah#4567 no, yes, orange, xzy

modest maple
#

Use a DB

#

Be better than a text file

#

Also do it off user ID

#

As if people change their name the bot won't see it anymore

formal vine
#

I wouldn't know how to set it up with either to be honest

modest maple
#

Where as their ID stays the same throughout

formal vine
#

I get why I should use, ID and why DB would be easier. But still how would I create that, is there short way. I know we had a chat earlier, but this is just the very start of what i'm planning.

modest maple
#

Well you can get the user ID just via the bot

#

For a DB search up how to use SQL lite as it pretty easy to learn and understand

formal vine
#

So i'm imagining, the command being typed in, and the bot asking "Please enter your response in this format 'x-y-z-a-b-c'" and then the bot responds after the person has typed it in, with thank you your info has been saved.....

#

Would that work with what your telling me

#

the whole message author thing

celest pivot
#

Lyric

manic light
#

guys i need help ..

#

its so complicated for me. when i edit something in my project js or anything, my jsons are rewinding 1 hours and i didnt understand why its happening to me. if u know anything about please help

restive furnace
#

Show your code?

manic light
#
  stat[message.author.id] = {
    hp: 0,
    mana: 0,
    guc: 0,
    defans: 0,
    hiz: 0,

  }
        
              fs.writeFile("./kayฤฑtlar/stats.json", JSON.stringify(stat), (err) => {
    if(err) console.log(err)
  });
 }
      
    
  

  

  });
earnest phoenix
#

avoid using json files as a database

manic light
#

its true but i didnt expect so many people would use it my bot XD

earnest phoenix
#

How can get 100 in here?

db.add(`test_${message.author.id}`, 100)

db.get(`test_${message.author.id}`)

db.get is not function

#

I'm trying to do invite system

quartz kindle
#

what is db?

manic light
#

const test = await db.fetch(`test_${message.author.id}`); if(test === '100')

#

i think

quartz kindle
#

depends on what db is

#

there are hundreds of database engines, drivers, frameworks and libraries out there

manic light
#

i think he is using quick db

quartz kindle
#

if so, then the answer is in the quick.db documentation (which is an unholy mess)

fickle anvil
#

probably a stupid question
I want to find out how many days/hours/minutes are left on my server (which has a different timezone) to 2019-12-02T21:00:00Z

how can I approach that ?

earnest phoenix
#

uh

#

are left?

fickle anvil
#

how much time from now to 2019-12-02T21:00:00Z

#

sorry if my grammar isn't perfect. Not a native english speaker.

earnest phoenix
#

so... you just want to convert your timezone to UTC?

fickle anvil
#

Is my question really that badly stated? Or are you making fun of me? o.O

2019-12-02T21:00:00Z <--- This is the time when something happens

now <-- is the time that is now

I need to find out the time from now to that date. So currently about 4d 8h and 14m

earnest phoenix
#

oh

#

you could've just said time difference

#

convert both dates to UTC then subtract them

#

you'll get the amount in milliseconds

fickle anvil
#

what does the T and Z mean in the string? 2019-12-02T21:00:00Z

earnest phoenix
#

they are just markers

#

T is time, Z is the (UTC) offset

fickle anvil
#

okay thanks

fickle anvil
#

                            var leagueend = new Date(file[x].end).getTime();
                            var now = new Date().getTime;
                            var timespan = leagueend - now;
                            var days = Math.floor(timespan / (1000 * 60 * 60 * 24));
                            var hours = Math.floor((timespan % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
                            var minutes = Math.floor((timespan % (1000 * 60 * 60)) / (1000 * 60));
                            var seconds = Math.floor((timespan % (1000 * 60)) / 1000);

I guess I am doing something wrong. I am getting NaN

grizzled jackal
#

@fickle anvil I believe getTime is a method and not a property

fickle anvil
#

yeah forgot a ()

#

just found out

#

works now like a charm

late hill
#

You could straight up subtract the Date objects

#

You can also put the outcome of that into a Date object

#

And then use the methods provided in there

#

Instead of your days/hours/.. calculation

real mango
#

Bbb

modest maple
#

What

amber fractal
#

@late hill they did... var timespan = leagueend - now;

#

They're formatting it

late hill
#

What I'm saying

#

Is that they can simply use the Date object itself

#

As in

#

Not using getTime()

#

The exact same result would be achieved

charred loom
slender thistle
#

Is that the full error

amber fractal
#

I already told him solo is undefined

#

and duo

charred loom
#

yes

#

how do

amber fractal
#

Say you have obj When you do obj.x and it says Cannot read property 'x' of undefined it means obj is undefined

#

and you fix it by actually defining it

#

idk how you get the stats, so I can't help with that

earnest phoenix
#

i don't know what time this is that you're getting told to read the error

charred loom
#

In my dick, I read it!

earnest phoenix
#

what is in your dick

charred loom
#

wtf

earnest phoenix
#

i don't think it's healthy to have something in your dick

charred loom
#

...

#

In pula mea ..

#

:)))

earnest phoenix
slender thistle
#

Does one get hang of those errors by learning JS beforehand

earnest phoenix
#

I think, depend

charred loom
#

he has hell on him this bot

slender thistle
#

I mean surely there's a lot of resources om the Internet to at least try to find solution for the error

earnest phoenix
#

undefined property error is one of the most basic errors in javascript

#

Yes this is true shivuwu

charred loom
#

Well I tried to find, I tried to do, but it doesn't work

#

๐Ÿคฆโ€โ™‚๏ธ

#

Can you help me or not?

earnest phoenix
#

you know that you can't literally copypaste the entire error into google and expect it to return a solution to you

#

right?

twilit rapids
#

Slowly read the error: Cannot read property 'wins' of undefined

slender thistle
#

First thing I got on Google

charred loom
#

What do in this situation

#

ok

#

yes, i read this

outer niche
#

So there's no such thing as ID anymore what would I put in place of it

charred loom
#

Where do I fill in?

earnest phoenix
#

So there's no such thing as ID anymore what would I put in place of it
what

outer niche
charred loom
#

help meee

slender thistle
#

Oh good lord

#

where are you running that

earnest phoenix
#

id always exists

#

check the docs for your library

#

to see how to get the currently logged in user's id

slender thistle
#

The connection hasn't been established yet when the server count is trying to be posted

#

So user property doesn't exist at the time of posting the server count

charred loom
modest maple
#

Omfg not this again

mossy vine
#

how is this guy not muted yet

slender thistle
charred loom
#

if you do not want to help me!

earnest phoenix
#

we've helped you

outer niche
#

ok

modest maple
#

Read the error

outer niche
#

thx

modest maple
#

It tells you

slender thistle
#

We gave you the answer multiple times, Ciprica

#

You are refusing to comprehend it

earnest phoenix
#

shivaco gave you a link to see how to handle the error even, you probably didn't even visit the site

modest maple
#

I don't even do JS and I can read that error and understand what I gotta do

charred loom
#

Well, if I don't understand

modest maple
charred loom
#

Give me an example of my ideas, not others

slender thistle
#

Do you also not understand that message

modest maple
#

Try:

Catch:

#

Oh what a wonderful thing it is

earnest phoenix
#

Give me an example of my ideas, not others
the solution to solving the error is the same regardless of the context it's in

modest maple
#

Search it up

earnest phoenix
#

Hey, I know this is bit of a stupid question but I was wondering what language should I learn from these 2 to start Discord botting java or python?

modest maple
#

Learn the basics of the language first

slender thistle
#

It depends on your preference really

mossy vine
#

python is the easiest to jump into with no programming experience afaik

slender thistle
#

It's simple but I wouldn't go that far

modest maple
#

Some what yh

charred loom
#

@earnest phoenix Yes? Where i put 10 ?

earnest phoenix
#

10 what

charred loom
earnest phoenix
#

oh god

twilit rapids
#

Alright, let me just

earnest phoenix
#

you just looked at the picture from the embed and thought that's the solution, didn't you?

modest maple
#

Read ๐Ÿ‘ The ๐Ÿ‘ Error ๐Ÿ‘ Search ๐Ÿ‘ it ๐Ÿ‘ up ๐Ÿ‘

charred loom
#

exampleeeeeee, i read the error

modest maple
#

You havent

#

If you read it you would know the issue smh

slender thistle
#

There was an example

#

two of them, actually

charred loom
#

yes?

twilit rapids
#

@charred loom please, before you continue with any questions learn the basics of JS (JavaScript). Read online guides er even rent a book at your local library. If you continue with asking questions without learning or doing research your own you will get muted for 3 days.

slender thistle
#

Yes, there were

charred loom
#

where?

loud salmon
#

wow smfh

#

timo

#

I was gonna yell at him

#

fucking stealing my dopamine

#

give it back

earnest phoenix
#

you need to understand how javascript works and you need to understand the point of undefined in javascript, otherwise we can't really help you out more than we have

charred loom
#

Ok until you give me 3 days, give me the answer

slender thistle
#

First one being simpler

outer niche
#

I still don't get it

modest maple
#

This is why discord bots suck, people try to make them without the slightest bit of programming knowledge smh

#

Not at u culan btw

slender thistle
#

object.property
say you get Cannot read property 'property' of undefined
That means whatever is before .property is type undefined

mossy vine
#

can confirm, ive been there lol

slender thistle
#

@outer niche What's up

#

The error?

modest maple
#

@loud salmon bean this kid

mossy vine
#

aight whos gonna steal the mute

loud salmon
#

-m @charred loom rude, help vampire, unwilling to learn in order to grow as a programmer | 1 week

gilded plankBOT
#

๐Ÿค Muted zZCipricaZz#1442 (@charred loom)

outer niche
#

I am still getting the no attribute ID

mossy vine
#

and the winner is spider ๐Ÿ‘ ๐Ÿ‘ ๐Ÿ‘

twilit rapids
#

SPIDER, THIS WAS STILL WITHIN 5 MINUTES

slender thistle
#

Where are you posting the server count

twilit rapids
#

WHY

modest maple
#

I give it a couple days before he gets banned

loud salmon
#

@twilit rapids fuck you i was faster

outer niche
#

At this point I have no idea what I am doing wrong

earnest phoenix
#

@modest maple i mean some people are willing to learn as they go, and that's really appreciated but when you have people like these coming in here asking to be spoonfed and not willing to learn or read anything at all it's just straight up degeneracy

twilit rapids
#

also leaking mod chat, smh

modest maple
#

Yup

slender thistle
#

Just hold it there, culan

#

Take a step back and relax.
Good, now... where in your code are you trying to post your bot'sserver count?

outer niche
#

It's at the very bottom

slender thistle
#

Can you send me a screenshot?

#

Reset your DBL token please

outer niche
#

I'm going to be honest I do not know that is

slender thistle
#

Mind opening your command prompt and type pip show discord.py

#

Wait, what do you not know?

modest maple
#

Have they got the 1.2.4 version issue?

slender thistle
#

What's with it

#

They are accessing bot.user outside of any function

#

aka when it doesn't exist yet

modest maple
#

Oof

outer niche
#

Version 1. 2. 3

slender thistle
#

Specifically the part about servers?

outer niche
#

Nope but I will now

#

Yeah I'm pretty sure that is supposed to be guilds

slender thistle
#

Yup

#

Anything server is guild after 1.0.0 version

modest maple
#

Also update to 1.2.5 atleast bte

#

Btw*

slender thistle
#

Ah right the animated error

outer niche
#

I fixed that but I'm still getting the ID error

slender thistle
#

What does your code look like now?

outer niche
slender thistle
#

It is bot.guilds

outer niche
#

What do you mean

modest maple
#

Not .guild

#

.guilds

#

Your missing the s

outer niche
#

Oof

#

I'm still getting the no ID error

slender thistle
#

Also, read about the wait_until_ready

outer niche
#

Well thank you but I have to go now

#

Have a good Thanksgiving

slender thistle
#

You are trying to use bot.user when it wasn't assigned still
Solution: put wait_until_ready in your on_ready and below that, the line where you declare the variable url

#

Hope that helps

west spoke
#

I do stuff like asyncio.sleep on my on ready before I send the request, to allow everything to start up properly

slender thistle
#

Also, that code will send a request each time your bot either joins or leaves a server, I suggest you use a time-fixed loop for that

west spoke
#

^

slender thistle
#

wait_until_ready delays until internal cache is ready for use

west spoke
outer niche
#

Ok

west spoke
#

you know I'll do whatever I want to make something work

#

lol

outer niche
#

So this

mossy vine
#

nice token leak

outer niche
#

I am going to reset that

#
url = "https://top.gg/api/bots/" + bot.user.id + "/stats"
headers = {"Authorization" : dbltoken}

async def on_ready():
    payload = {"guilds_count"  : len(len(wait_until_ready))}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)

async def on_server_join(server):
    payload = {"guilds_count"  : len(len(wait_until_ready))}
    async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(url, data=payload, headers=headers)

async def on_server_remove(server):
    payload = {"guilds_count"  : len(wait_until_ready)}
    async with as aioclient:
            await aioclient.post(url, data=payload, headers=headers```
#

So that

west spoke
#

No

#

no no no

outer niche
#

Lol ok

#

Gtg

sudden geyser
#

I didn't even know bots had a /stats endpoint umaruworried

west spoke
#

smfh

#

it's for the guilds and stuff

#

to post to

sudden geyser
#

Oh, I was thinking of only get requests. I know about the post stuff

slender thistle
#

async with as aioclient:
uhh
also len(len(wait_until_ready)) that's a no, and change the dict keys back to guild_count

#

Events names are affected too so that's going to be on_guild_x

earnest phoenix
#

uh i was just about to answer

#

well whoever deleted their message

#

oh nvm

#

sorry didn't see the ignore message

tepid hedge
#

another command wasn't defined properly, and affected everything else

earnest phoenix
#

ah ok

tepid hedge
#
    if(!message.member.roles.some(r=>["test"].includes(r.name)) )
    return message.reply("Sorry, you don't have permissions to use this!");

let member = message.mentions.members.first();

member.addRole(role).catch(console.error);
member.removeRole(role).catch(console.error);
}
``` it was this and needed 
```if(command === "role") {``` at the front
earnest phoenix
#

oh ok lol

tepid hedge
#

Error here?

earnest phoenix
#

uh

#

edit that code block

#

remove the invite pls

#

before a mod sees

tepid hedge
#
if(command === "info")   {
    const exampleEmbed = new Discord.RichEmbed()
    .setColor('#0099ff')
    .setTitle('Zone Wars Public')
    .setURL('')
    .setAuthor('Developed by agentt', 'https://i.imgur.com/bLDvSyi.png', 'https://agentt1x.github.io/agentt/')
    .setDescription('Fortnite Zone Wars Discord')
    .setThumbnail('https://i.imgur.com/bLDvSyi.png')
    .addField('Management', 'agentt, Sentrah, Pogy')
    .addBlankField()
    .addField('Bot is online 24/7, But occasionally may go down for maintenance')
    .addField('Need help?', 'DM a staff member')
    .setImage('https://i.imgur.com/bLDvSyi.png')
    .setTimestamp()
    .setFooter('Developed by: Agentt', 'https://i.imgur.com/wSTFkRM.png');
  message.channel.send({embed});
}
#

there

earnest phoenix
#

what's the error?

tepid hedge
#

doesnt send at all

earnest phoenix
#

and all other commands work fine?

tepid hedge
#

wait

earnest phoenix
#

oh

slender thistle
#

const exampleEmbed = new Discord.RichEmbed()
message.channel.send({embed});

earnest phoenix
#

lolol there's your solution

slender thistle
tepid hedge
earnest phoenix
#

yeah embed is not defined

#

change it to what you defined it as

#

in the TextChannel#send part

sudden geyser
#

have you considered defining it

tepid hedge
#

fixed i think

sudden geyser
#

does it send?

tepid hedge
#

yes

tepid hedge
#
.setColor('#0099ff')
    .setTitle('Zone Wars Public')
    .setURL('')
    .setAuthor('Developed by agentt', 'https://i.imgur.com/bLDvSyi.png', 'https://agentt1x.github.io/agentt/')
    .setDescription('Endgame Practice')
    .setThumbnail('https://i.imgur.com/bLDvSyi.png')
    .addField('What is Zone Wars Public?', 'Zone Wars Public is one of Best ways to Simulate End-Game scenarios and Improve in all areas.')
    .addBlankField('')
    .addField('Bot is online 24/7', 'But occasionally may go down for maintenance')
    .addField('Need help?', 'DM a staff member')
    .setImage('https://i.imgur.com/bLDvSyi.png')
    .setTimestamp()
    .setFooter('Developed by: Agentt', 'https://cdn.discordapp.com/avatars/290946913921138688/a_9b276ea79aebee7f716ce325bf130705.gif?size=2048');
  message.channel.send({embed});

the error strikes again

sterile minnow
#
.setColor('#0099ff')
    .setTitle('Zone Wars Public')
    .setURL('**There must be a link in there**')
    .setAuthor('Developed by agentt', 'https://i.imgur.com/bLDvSyi.png') //('https://agentt1x.github.io/agentt/' only one Author link)
    .setDescription('Endgame Practice')
    .setThumbnail('https://i.imgur.com/bLDvSyi.png')
    .addField('What is Zone Wars Public?', 'Zone Wars Public is one of Best ways to Simulate End-Game scenarios and Improve in all areas.')
    .addBlankField()
    .addField('Bot is online 24/7', 'But occasionally may go down for maintenance')
    .addField('Need help?', 'DM a staff member')
    .setImage('https://i.imgur.com/bLDvSyi.png')
    .setTimestamp()
    .setFooter('Developed by: Agentt', 'https://cdn.discordapp.com/avatars/290946913921138688/a_9b276ea79aebee7f716ce325bf130705.gif?size=2048');
  message.channel.send({embed});```
tepid hedge
#

there was no link in url because its a discord invite

#

thanks

sterile minnow
#

i think it schould go+

sudden geyser
#

Your problem was .addBlankField(); it accepts a true or false.

sterile minnow
#

Is it going?

tepid hedge
#

I did what @sudden geyser said and it worked

sterile minnow
#

k cool

modest maple
#

nothing like finally completing a piece of code to realise it is completly pointless -_-

distant plank
#

Is it possible to put 2 data in a single field in mysql?, I have a configuration command that I want to deactivate commands in channels that the user chooses, but I don't know how I can store the id of the channels in a single field, something like this

id supsafe affectbots spamdelmsg disabledchannels
611714357809905684 1 1 1 629048908852494354
629048732863692800
637358847543214080

modest maple
#

indentation is all over the plac em8

#

is this for an embed or on DB

earnest phoenix
#

code blocks exist

#

store it as an array

distant plank
#

ok xD

earnest phoenix
#

id,id2,id3,id4...

distant plank
#

:|

earnest phoenix
#

then when fetching the value from the database, split by the comma and return the array

distant plank
#

@earnest phoenix And if the user wants to reactivate it, can I only remove the id of the channel he choice?

earnest phoenix
#

yes... because it's an array

#

remove the element from the array and then when updating the value just join them with the comma again

distant plank
#

I'm something new xD

#

thanks

earnest phoenix
#

basically, for getting

get value -> split by comma -> return the array

for updating

add / remove element from the array -> join by comma -> update the string in the field
distant plank
#

@earnest phoenix Can that be done in a varchar?

earnest phoenix
distant plank
#

:v

modest maple
#

def main(url):
    import requests
    if "https://drive.google.com/file/d/" in url:
        url = url.replace("https://drive.google.com/file/d/", "")
        url = url.split("/")
        url = url[0]
        url = f"https://drive.google.com/uc?export=download&id={url}"
        r = requests.get(url, allow_redirects=True)
        FileName = r.headers["Content-Disposition"]
        FileName = FileName.split('"')
        FileName = FileName[1]
        open(f"{FileName}", 'wb').write(r.content)

    elif "https://www.dropbox.com/s/" in url:
        if ".orcbrew?" in url:
            url = url.replace("dl=0", "dl=1")
            r = requests.get(url, allow_redirects=True)
            url = url.replace("https://www.dropbox.com/s/", "")
            url = url.split("/")
            url = url[1]
            url = url.replace("%20", "")
            FileName = url.replace("?dl=1", "")
            open(f"{FileName}", 'wb').write(r.content)```
#

ah joy

#

gotta love string manipulation in python

#

which needs doing separately -_-

quartz kindle
#

you cant do .replace().split()[0] in python?

modest maple
#

it doesnt get the correct string that way

#

but yes you can

quartz kindle
#

weird lul

modest maple
#

it would work with a string thats contant in terms of the string

#

but urls are weird

#

not to mention, GoogleDrive has this amazing thing where it encrypts the share link

#

for some reason

amber fractal
#

probably for that reason

#

They don't want people downloading it like that I'd guess

modest maple
#

nananana

#

na

#

ive been through that

quartz kindle
#

batman

modest maple
#

ive been through that hell

amber fractal
#

hell?

modest maple
#

the user cant grant access to the files and folders without going through their Oath2 system

amber fractal
modest maple
#

which opens host side

#

so the API works for servers / programs using it to grab files as storage

#

but not for people to change around

#

that was 3 weeks of hell xD

#

i did discover that the link system is way way more efficent

#

xD

earnest phoenix
#

I have a question regarding webhooks

modest maple
#

whats up

formal vine
#

anyone know how long it ususally takes to get accepted or denied

modest maple
#

1 week +- a few days

formal vine
#

Thanks

fickle anvil
#
                    let curIndex = 0;
                    let relativeIndex; 
                    for(relativeIndex = 0; relativeIndex < 5; ++relativeIndex) { 
                        if(relativeIndex > (resultList.length - curIndex)) {
                            break;
                        }
                    }
                    let results = [];
                    for(; curIndex < resultList.length - curIndex; ++curIndex) {
                        results.push(resultList[curIndex]);
                    }
                    var curString; //first item undefined if not set to any value ref XCur1
                    
                    if(resultList.length>10)
                    {
                        curString = "Too many results";
                    }
                    else
                    {
                        //results.forEach(curIcon => { curString += curIcon + " "; }); // trying to add icon here later for now output its url 
                        results.forEach(currency => { curString +=  currency + "\n"; });  
                        //First item malformatted. If search for "alt" predicted output "Orb of Alteration" and "Exalted Orb". Orb of Alteration is an undefined result. XCur1 
                    }```

Can someone help me? 
the first entry of curString is always undefined instead of the real first result.
modest maple
#

how can you += a undefined string

#

if its going to the else isnt it trying to curString += currency + "\n"

#

and if curstring is undefined which it is if result.list > 10

fickle anvil
#

technically it works. just the first entry is always "undefined"... here the first entry should be "Orb of Alteration"

late hill
#

Because there's a difference between x++ and ++x

#

You're using ++x which will be executed first

#

So you're starting at index 1

#

Not 0

fickle anvil
#

so relativeIndex++ and curIndex++ ?

late hill
#

I didn't really look at your code much

#

But I'd guess that's your issue

amber fractal
fickle anvil
#

still the same

distant plank
#

@earnest phoenix I did it, thank you very much

late hill
#

It's difficult to tell what you're even trying to do especially as there's missing code in what you shared up above @fickle anvil

#

What's resultList like for example

fickle anvil
#

it's too much text to put into discord, that's why I only took that part

modest maple
#

pastebin

earnest phoenix
#

avoid pastebin

modest maple
#

yh

#

couldnt remember the other names

earnest phoenix
#

pastebin is basically an eye blinding tracker lol

modest maple
#

yup

fickle anvil
#

died from braincancer of my beautiful code? x)

modest maple
#

no from the hell of paste bin xD

fickle anvil
#

pffff

modest maple
#

i forgot what the good ones were xD

#

as cry corrected me lmao

fickle anvil
#

now live with your own fault and help me akuma_xdlol

modest maple
#

im the python dude here

#

idk js

sudden geyser
#

a sure beauty she is

fickle anvil
#

then learn js ๐Ÿ˜›

modest maple
#

but js bad xD

fickle anvil
#

but much easier than python :3

sudden geyser
#

uh oh

fickle anvil
#

what uh oh? is that a nerd-trigger?

#

@late hill did you take a look at the paste? :3

late hill
#

no

#

i bed

fickle anvil
#

๐Ÿ˜ฆ

#

I am trying to fix that part for like 2 weeks now x.x

valid frigate
#

hi hello yes ill get straight to the point, best way to create json in kotlin?

#

there's a lot of ways to do it

#

but i need opinions & personal accounts here on what the best way to do it is

#

because for some reason every jvm based languge hates json

valid frigate
#

ps august i'd tag you rn but youre probably sleeping

knotty steeple
#

hi

#

whats a nice and lightweight java ide i can use

amber fractal
#

eclipseidk any lightweight ones

knotty steeple
#

i mean actual lightweight

#

my 2009 macbook runs nothing mmLol

amber fractal
#

Lol

valid frigate
#

well

#

intellij is a thing but you said lightweight

#

eclipse

#

or you could use dr java

knotty steeple
#

i feel like vscode with some java plugin might work a bit

#

lmao jk

valid frigate
#

i mean

#

vscode is a text editor

#

i bet there would be a java plugin

modest maple
#

Yh

#

I mean hey

#

Who needs java when python exists

#

Jk jk

#

But would certainly recommend intellij

knotty steeple
#

l i g h t w e i g h t

#

ive tried intellij already it is slow on my pc