#development

1 messages · Page 9 of 1

civic scroll
#

the first 2 file in stack i inspected seem to only consume the object

earnest phoenix
#

Is there a reason that running the guildinfo in an external server to the support one, outputs this error?

hard wraith
#

Its a slash command

earnest phoenix
#

I find it quite odd that running the command works in the support server, but not any others.

Edit I have figured the reason, it is because in said external server there is too many roles for the bot to print and so, the error is given.

hard wraith
#

Just one thing… the command that’s not working… has no visa nkw place where executeCommand is listed.

#

I’ve asked for a fit repo so you can look at the full code… it’s… messy and confusing.

civic scroll
#

@hard wraith does the problem reproducible btw

hard wraith
#

I haven’t got the repo yet.

civic scroll
#

i forgot to ask

hard wraith
#

And they don’t use discord.js it seems they use express

civic scroll
#

same thing, different implementation

hard wraith
#

Like I would never dream of using pure rest for discord…

#

But I do know that if you have a command that is calling executeInteraction and the command file it’s calling to DOESNT have that defined… it won’t work 😂

#

I got my team calling me so I can’t put more time into helping sadly, hopefully you find something more beneficial than a method being called that doesn’t seem defined.

#

Cus I couldn’t find it, and that stopped my debugging because where can I see the .url part of a command execution I can’t locate 😂

#

love being called about people not knowing how to expand a pipeline job to view the console output on a fail

civic scroll
#

@hard wraith i'm tempted to rewrite this guy's project in typescript

hard wraith
#

🤷 I wanna re-write it to utilise discord.js with a better command handler for the bot portion.

civic scroll
#

they are bloated with jsdocs

hard wraith
#

Mhm

#

Messy handlers too

#

Instead I’m stuck in a meeting about too many failed pipelines… because someone made a new pipeline yaml and that caused failures Cus of error checking… and the reviewers don’t know how to view pipeline job logs… this isn’t my job. My job is to fix the pipeline and make new ones for apps 😂

frigid robin
#

@lyric mountain I have kind of a breakthrough, it seems that when I run the same code locally and connecting to the DB via SSH tunnel, the bot sees the emojis in the DB and prints them normally, but if I run it through PythonAnywhere (which is not through the SSH tunnel) it sees the emojis and prints them as ? ? ?.
So I came to the conclusion that it's something with the connection. But wtf? Because I set both to utf8mb4. This is the code that connects:

def create_mysql_connection(tunnel=tunnel_mode):
    try:
        if not tunnel:
            connection = MySQLdb.connect(
                user=database_username,
                passwd=database_password,
                host=database_host_address,
                db=database_name,
                charset='utf8mb4')
            return connection

        else:  # Connecting through SSH tunnel, needed if outside of PythonAnywhere network
            sshtunnel.SSH_TIMEOUT = 5.0
            sshtunnel.TUNNEL_TIMEOUT = 5.0
            tunnel = sshtunnel.SSHTunnelForwarder(
                    (ssh_hostname),
                    ssh_username=ssh_username,
                    ssh_password=ssh_password,
                    remote_bind_address=(
                            database_host_address, 3306)
            )
            tunnel.start()
            # tunnel.stop()
            connection = MySQLdb.connect(
                user=database_username,
                passwd=database_password,
                host='127.0.0.1', port=tunnel.local_bind_port,
                db=database_name,
                charset='utf8mb4') #necessary for emoji character support
            return connection
hard wraith
frigid robin
#

no man it's something stupid about the connectionn

#

the solution to everything is not to use it wtf O_o

lyric mountain
frigid robin
#

why does it differ if I'm using the SSH tunnel though

earnest phoenix
#

Do u guys store ur functions in the main file, in a separate file or in multiple separate files

Just wanna see what people prefer because I lose visibility of my code easily at over 500+ lines

lyric mountain
#

because the communication happens with bytes regardless

#

if the charset is different it'll get corrupted at one of the sides

frigid robin
#

don't both sides start and end at the same places?

lyric mountain
#

even if they do, nothing grants they're both expecting the same charset

#

? means the emoji is getting parsed to some charset that doesn't contain emojis

#

since that's the default value for unknown characters

lyric mountain
earnest phoenix
#

i was stuffing all my functions in a separate file but that's not good

lyric mountain
#

make files based on context

earnest phoenix
#

Ye

lyric mountain
#

drawing functions? graphical utils file

#

math? math utils file

civic scroll
civic scroll
lyric mountain
#

that's not even a matter of personal taste, the compiler suffers from very long files

#

the IDE too

civic scroll
#

you can't split data files

#

json

#

@lyric mountain remember that one 160k lines of character data

lyric mountain
#

character data?

lyric mountain
wheat mesa
civic scroll
quartz kindle
#

remember that bot someone posted here that had like 50 if elses inside each other?

#

something about a weather command

civic scroll
#

hell

wheat mesa
#

yall wanna see my first bot

civic scroll
#

i think i need to make a progress bar for this one

lyric mountain
#

penguin stats

wheat mesa
#

lemme make sure there's nothing sensitive in the bot before I upload the file

#

yall are going to be horrified

civic scroll
quartz kindle
#

yes pls

civic scroll
#

it's the site for item drop rates

#

in arknights

quartz kindle
#

anything for entertainment

#

so we can numb ourselves

lyric mountain
#

what even is arknights about?

quartz kindle
#

:^)

civic scroll
#

about a world

#

with cancer rocks

quartz kindle
#

arkham knights

civic scroll
#

but

#

it has great arts

#

and banger music

lyric mountain
#

about a world
with cancer rocks
so...rio de janeiro?

wheat mesa
wheat mesa
#

it's better than the first version, I had a messageCreate event for EACH command

#

ngl looking back at my old stuff is funny

#

sometimes I feel like I haven't really learned a whole lot then I look at shit like that

quartz kindle
#

it aint that bad

wheat mesa
#

it used to be way worse

#

look at my first mesages in top.gg and you'll see

civic scroll
#

@lyric mountain i think my true potential

#

will be unlocked after i know how to program sprite animations

hard wraith
#

ew

#

sprite anim programming is dirty...

wheat mesa
#

^

hard wraith
#

This is a pg server

lyric mountain
civic scroll
#

WHAT

#

what do you mean

wheat mesa
#

lots of great libs

civic scroll
#

it's beautiful

hard wraith
#

Take your programming porn away.

lyric mountain
#

and by java it also includes kotlin if u must

hard wraith
#

...

#

I think you misunderstood...

civic scroll
#

BRO

lyric mountain
#

tbh, I love how any JVM lib is useable on any JVM lang

civic scroll
hard wraith
#

Sprite anim programming is so beautiful its porn lol.

civic scroll
#

since i wanna compile it to webassembly

#

and use it on the browser

civic scroll
#

whatever

#

as long as it within my interest

#

porn, is not one of them

hard wraith
#

No...

civic scroll
#

i have many ideas but can only achieved ones i know the presequisites

hard wraith
#

Have you never heard anyone refer to something as so good its whatever category that thing is in porn?

civic scroll
#

@lyric mountain asset update

lyric mountain
#

lmao

hard wraith
#

Like idk... Food porn being when you see really good looking food on social media or a tv show?

civic scroll
hard wraith
#

sprite animation code is programming porn lol

civic scroll
#

nah

#

chaotic

#

i have the sprite animation code in js

#

but i want to rewrite them

hard wraith
#

you know im pretty sure there is something that can turn a js app to a ts app...

#

its some node library I saw once...

quartz kindle
#

@wheat mesathis was one of the first versions of my bot

cursive musk
#

I am creating a development blog. I am thinking of making "series" for different languages. Apart from Web Dev, what else should I add?

quartz kindle
#

yes, the bot is inside an html file

#

run by nwjs

civic scroll
civic scroll
hard wraith
#

im so tired lol. Ive been staring at a yaml file for hours

wheat mesa
#

I've just been queueing in overwatch for hours

#

just queued for 10 minutes to get a game that was over in less than 5 minutes

hard wraith
#

I wish I could be in a queue for any game…

quartz kindle
wheat mesa
#

both

#

queueing top 500 na games rn but the game is also just dead

quartz kindle
#

rip

wheat mesa
#

ow2 coming out in 2 months tho hopefully that'll revive the game

eternal osprey
#

hey sadly putty is only for ssh, does anyone know a ftp client?

hard wraith
#

FileZilla

lyric mountain
#

imagine using putty

hard wraith
#

I use putty

#

To connect to over 30 Ubuntu servers. It makes selecting and connecting to them easy.

solemn latch
#

I prefer bitvise

frigid robin
#

where is this
engine=create_engine('mysql+mysqlconnector://user:***********@**********:3306/amatdbcharset=utf8mb4&collation=utf8mb4_general_ci')
supposed to be executed?

lyric mountain
#

that's the connection url

frigid robin
#

uh im using the library though

lyric mountain
#

wherever u set the database url in it

boreal iron
lyric mountain
#

putty allows saving connections ig

#

that said, the same can be done with a bash script

hard wraith
#

I could still use it using my heightened clearance… but I’ll stick to operating under the radar without breaching regulations.

boreal iron
sharp geyser
#

Imagine using putty

lyric mountain
#

also iirc, putty ssh keys aren't compatible with regular ssh keys

hard wraith
#

Strange that you say that considering I have no issues 😂

sharp geyser
#

Some programs if you're logging into a vps via ssh/ftp require it to be generated by putty as well

#

So it kinda sucks sometimes

boreal iron
#

That’s why Unix and windows systems have this shit already integrated in their cli

#

No need for 3rd party apps at all

sharp geyser
#

I guess it was made for those who want a ui

#

Although putty could of just built on top of the built-in ssh

fierce kindle
#

Friends, I made a code to list the voters, I set everything, but it does not send the message, what is the reason?

earnest phoenix
earnest phoenix
fierce kindle
earnest phoenix
frail condor
#

how can i disable cloudflare captcha thing for my api endpoint?

earnest phoenix
# fierce kindle no how do we do

Try logging something inside the webhook listener, at the first line of it

app.post('/dblwebhook', webhook.listener(async (vote) => {
  console.log('Top.gg vote webhook request receieved');

  ...
});
earnest phoenix
frail condor
#

cloudflare aint flagging my ip with that but my own project is being flagged by cloudflare

earnest phoenix
#

Discord's API endpoints don't have a CAPTCHA or anything of that sort

#

Just basic ratelimits in place

frail condor
#

ah

earnest phoenix
fierce kindle
#

no

earnest phoenix
lyric mountain
#

try acessing the url on the browser

#

see what error pops in the F12 console

earnest phoenix
#

Nice IP address

fierce kindle
#

Will it be an ip address?

boreal iron
#

There’s no valid SSL certificate for an IP

earnest phoenix
#

It has to be HTTP not HTTPS

boreal iron
#

Use http protocol without secure protocol

lyric mountain
#

and delete that screenshot, just in case

fierce kindle
quartz kindle
earnest phoenix
#

I don't think you've tested it, you can also use the Test button in the webhook page to test your webhook instead of voting

sharp geyser
#

Turkey

boreal iron
fierce kindle
frail condor
earnest phoenix
boreal iron
lyric mountain
#

https://<ip>:80/dblwebhook

fierce kindle
boreal iron
#

Dude https and :80

lyric mountain
boreal iron
#

Typical Java user

lyric mountain
boreal iron
earnest phoenix
#

It won't work without the port troll

boreal iron
#

Bullshit

#

80 is the default port

#

No need to enter it

earnest phoenix
#

Try it for yourself then lmao

boreal iron
earnest phoenix
#

Oh really? Like fr? 👀

boreal iron
#

No fucking http request in the world without secure connection requires you to add the default port to the url

fierce kindle
earnest phoenix
#

Can you actually show us what you're setting the webhook URL as? Without the IP address

boreal iron
#

As well as you don’t need to add the default ssl port to the url, too

#

Lemme get through the login process

earnest phoenix
fierce kindle
boreal iron
earnest phoenix
#

So you can listen to it and receive the vote data

boreal iron
#

So…?

fierce kindle
boreal iron
#

I just think he doesn’t understand anything we say, as he’s lacking some English basics it seems

#

Which might be the real issue

earnest phoenix
# boreal iron So…?

I wasn't going with that context, but whatever you say; but yeah they seem to be misunderstanding some things we say

earnest phoenix
fierce kindle
#

so yes, I translate what you say through translation, most of them are inverted sentences

boreal iron
earnest phoenix
#

So you can basically set the webhook URL field in your Top.gg webhook page as http://<IP address, your VPS IP address in this case>:<port, this part isn't needed if you're using the default port which is 80>/dblwebhook

boreal iron
#

Did you actually ask him if he tries to use his home IP instead of a server?

earnest phoenix
boreal iron
#

lol

#

Maybe he tried to send the webhook to his home IP

boreal iron
#

I feel like he doesn’t get what we mean tho

earnest phoenix
#

yeah, and since they're using a translator, it makes it worse

earnest phoenix
#

Without the <>, that's just placeholders

fierce kindle
#

<> they have vds ip in them

boreal iron
#

Yes but you can not add < > to your URL

#

That’s no valid URL

#

http://ipaddr/dblwebhook

fierce kindle
#

<> I removed them, just say I'll try with vds ip

boreal iron
#

If your webhook listener is listening to port 80

#

Make sure it’s running

fierce kindle
boreal iron
#

It didn’t log anything?

fierce kindle
#

no

boreal iron
#

Can you open and access the url in your browser?

#

http://ipaddr/dblwebhook

fierce kindle
#

when i use it in vds it says this too

hard wraith
#

Yeah Cus your webhook is listening for post requests not get.

#

🤦

#

Change post to get and you won’t have that error.

#

Or just copy what you have for post… and duplicate it and change one of those listeners to get.

wheat mesa
#

I thought it was meant to be a POST endpoint though...

hard wraith
#

It is… but for debugging.

wheat mesa
#

Since it accepts webhook data incoming

hard wraith
#

Just to check the ip works.

#

Because I copied the code exact from the website and it worked.

#

Post data and all.

fierce kindle
hard wraith
#

I wanna tell you to use php because then I can just throw my code at ya

#

My express code I don’t use for webhooks…

fierce kindle
#

I don't know how to use php

hard wraith
#

You don’t know how to use node or express either from what I saw…

#

Or how event handling and listeners work.

#

So it wouldn’t matter what language I helped you in, because I would basically have to make the entire code myself and spoon feed you, and I’m not doing that.

fierce kindle
hard wraith
#

topgg is just…

#

Ignore topgg stuff because your listener isn’t working.

#

Once that works, you look at topgg

fierce kindle
#

hmm okey

hard wraith
#

I used php and I didn’t even need to do anything with topgg api

#

Actually hold on… I think I need to check something about express. Cus if I can convert my pho to express then I’ve solved your issue 😂

#

Yep solved it.

fierce kindle
#

what do you need to check

hard wraith
#

I have a way to negate using the topgg api at all using express I just need to make and test it.

fierce kindle
#

what

ancient nova
#

guys why does banning by ID doesn't work?

hard wraith
#

How odd... Nothing is showing in console...

#

does express even wor...

#

wait a minute...

ancient nova
#

what are you having issues with?

ancient nova
wheat mesa
#

util.inspect instead of debugger… I rest my case

hard wraith
#

its getting a post request not a get request...

ancient nova
rocky dagger
#

so im trying to make a table to check if every command option is valid so i made this but it doesnt output the correct path in the error. so instead of it logging for example 1.0.name is not a string it just logs .name is not a string https://srcb.in/QI7H32McCe

wheat mesa
#

Then probably don’t want to be answering if you don’t know what he’s having issues with :p

wheat mesa
hard wraith
rocky dagger
hard wraith
#

To satisfy you... And no neither worked.

#

but connecting to that endpoint did

hard wraith
#

Feel free to have a play, this is how express handles post an get requests so like... Not sure why topgg isn't triggering either.```js
const express = require("express");
const app = express();
let port = 3000;

const util = require("util");

app.post('/', async (req, res) => {
console.log("post");
console.log(util.inspect(req, false, null, true));
res.send("We see you");
});

app.get('/', async (req, res) => {
console.log("get");
console.log(util.inspect(req, false, null, true));
res.send("We see you");
});

app.listen(port, () => console.log(Webook listener running on port: ${port}));

ancient nova
hard wraith
#

And util inspect allows console.log() to display the full json object on the console.

hard wraith
wheat mesa
#

Or is it logging [Object object] whenever you do that

hard wraith
wheat mesa
#

It’s not a big object

hard wraith
wheat mesa
#

Plus you could use the debugger for that in the future instead of littering your code with util.inspect calls

ancient nova
#

do you have another app that makes that post request?

hard wraith
#

yes because topgg uses post requests on vote...

wheat mesa
ancient nova
#

and do you get a console log from that post request?

wheat mesa
#

Just saying

hard wraith
#

This is the receiving endpoint...

#

No thats the issue

wheat mesa
#

Make sure your port is open

#

Try sending a curl post request to your endpoint

#

If it doesn’t work then you likely haven’t portforwarded that port and it’s being blocked by your machine

hard wraith
#

mate... im using it on a webhosting server I just spun up. It listens to whatever port that tells it to.

wheat mesa
#

Ah

#

Odd then

hard wraith
#

I do this stuff for a living...

ancient nova
hard wraith
#

I build an app build webhook for work that uses get and post at the same time.

hard wraith
wheat mesa
#

I don’t know you or your experience, there’s often a lot of people that come into this channel with little to no experience about some things

#

I generally assume the lower level of knowledge because it’s a safer option :p

hard wraith
#

I built an api for my bots to use, using secure webhooks I think this one should work... because thats how the api for work handles things. but nothing is triggered.

#

Does topgg require the endpoint to be https I wonder...

wheat mesa
#

That might be it

ancient nova
hard wraith
#

no it cant be that... Because their docs default to port 80 wich is exclusively http not https which is port 43.

lyric mountain
#

443

hard wraith
#

Glad I dont have these issues on php lol.

lyric mountain
#

what issues?

hard wraith
#

Yeah figured.

boreal iron
#

Yeah I see chat didn’t scroll again

#

Idk discord client getting more unstable from day to day

hard wraith
#

I mean I can always lesenncrypt my endpoin.

boreal iron
#

As long as you use the full chain cert no issues should appear

#

But not really required for webhooks as theres no private data involved anyways

ancient nova
#

LMFAOOOOOOOOOOO

stuck dawn
#

how can i put the background (yellow color) in the background and that image behind on top?

earnest phoenix
#

Hey guys I was considering making my project open source for more transparency and ensuring quality/trust but my only fear is that someone might steal the whole code 1:1 and then promote it as their project
Keep in mind my bot is not known yet and I plan to make it somewhat known for a specific audience/group im targeting, and there isn't many competitors around so I would like to use my opportunity

#

Do you guys have your bots open source and what's your opinion or two cents about this?

#

Would appreciate ig

quartz kindle
#

i only open sourced my discontinued bots

#

my main bot is not open source primarily because its unique in what it does, it has no competitor

#

if it were a generic bot, i would make it open source

earnest phoenix
#

fair

lyric mountain
#

my bot is fully open source (gpl), also has no competitor but even if someone tried they wouldn't understand the logic behind it lmao

#

also most of the actual good stuff requires you to make your own cards

#

so ig I'm pretty safe

#

the rules is: if you have hard-worked logic that is innovative, make it closed source

#

or at least hide the good part

#

otherwise don't bother with it, nobody is gonna copy a regular bot

#

there's also a big advantage about going OS: most services offer licenses for open source devs

#

especially jetbrains

quartz kindle
#

yeah, in my case i have a pretty complex canvas code that i dont want people copying xd

wheat mesa
#

You could go open source after your bot is already dominating that space :^)

#

Since nobody would have a chance to catch up

boreal iron
sharp geyser
#

Even if they steal your code, alot of licenses require leaving in your copyright mark in the code files assuming you put them there

#

So even if they steal your code you get credit

wheat mesa
#

you're relying on people to be ethical about it

#

and to not just remove the comment and slightly modify it

#

cough cough itsokaybae with dyno css

boreal iron
#

At the end nobody gives a fuck about using anyone else code or software for private usage
Same goes for cracked programs etc
As long as you don’t have a commercial use case most countries don’t even judge it

#

Thing is… if you wanna prevent people from using and stealing your stuff you shouldn’t release it

#

You think people should feel guilty for cracking a program or OS? No

sharp geyser
#

Just gotta accept it

boreal iron
#

Well either you develop something for “anybody” or keep it for yourself

#

Not really an ethical decision

#

Not to say that honoring something is worthless or bad at all

hard wraith
#

my bot got denied because they couldnt see the commands... But didnt read this in the description...

#

You cannot see the commands you don't have the required perm for.

#

I wanna cry...

#

I can cry about that right?

sharp geyser
#

🤷‍♀️

#

Did you at least have a help command?

hard wraith
#

They are slash commands... And the description is the help command...

sharp geyser
#

Okay

#

Dispute the deny reason then ig

boreal iron
#

I really wonder… a help command for slash commands isn’t really needed any longer

hard wraith
#

Rightt?

sharp geyser
#

It wasn't even about him not having a help command

hard wraith
#

My help command opens a support ticket lol

sharp geyser
#

He was missing commands

#

I read the deny reason it states clearly why it was denied

hard wraith
#

default member permission on slash commands.

boreal iron
#

While some sort of obviously entry might still be helpful like when mentioning the bot it should respond with “hey use slash commands”

hard wraith
#

The commands are there. Just if you do not have the minimum permission, you cannot see them.

boreal iron
#

But that would require a gateway connection you don’t actually really need for interactions

#

So yeah…

hard wraith
#

Yes

sharp geyser
#

Then dispute it

hard wraith
#

Right in the command list.

sharp geyser
#

It's not too late to dispute the deny reason

boreal iron
#

He was missing the commands?

sharp geyser
#

So instead of crying about it do smth about it

boreal iron
#

Aren’t that global commands?

hard wraith
#

They are global...

#

You can see what he can see in the imgur...

sharp geyser
#

Here's the reference to it

hard wraith
#

but clearly the commands are there.

sharp geyser
#

If you feel the deny reason was unwarranted dm the br

hard wraith
#

I did, I gota resubmit. So I am going to modify the description to plainly state you cannot see commands you dont have the required perm for.

sharp geyser
#

You could also make a slash command called wherearecommands :^)

#

That'd definitely get the point across

hard wraith
#

on the list...

#

there are 32 commands ahead of that to work on

boreal iron
#

Those pictures can also show guild commands

#

You can’t see the difference in guild chats

#

Could be accidentally registered as guild command

#

I have to say that as it happened to me too since I forgot to move it over to a global command after testing it as guild command

hard wraith
#

Resubmitted.

#

No commands on my bot are guild commands.

boreal iron
#

You can see ‘em all when direct messaging your bot?

hard wraith
#

no

#

i use dmPermission as well that allows me to set if they can be used in dm

boreal iron
#

It’s not about your permission handler and where you can use em

#

If you can not see those commands in direct messages when entering a / then they aren’t global commands

hard wraith
#

ok well... Now I need to figure how to check an image url someone sends me is sfw.

#

if all I am getting is a string of a url to an image, how do I check if that is SFW?

boreal iron
#

You should fix your command issue first

hard wraith
#

thats sorted

boreal iron
#

There’s only a limited amount of denies

hard wraith
#

It was an easy fix.

#

the issue now is them being able to set pornography as the welcome banner image... How do I detect NSFW content from a url?

boreal iron
#

By using a service checking the image for you

hard wraith
#

ok

#

well azure it is lol

#

nah that costs $1 every 1000 images...

#

best not to use machine learning

boreal iron
#

I don’t see how you should that yourself without some sort of trained AI detecting implicit images

lone wing
#

Where can i question my bot's dispute? It is valid but I want to ask a question for my fix.

lone wing
#

That's allowed?

boreal iron
#

Yes

hard wraith
boreal iron
#

Not sure if there’re also free APIs for it

#

But I guess there are

hard wraith
#

to azure I go

#

it should be free...

boreal iron
#

I just don’t really see any use case why you should bother with that

whole knot
boreal iron
#

Well I mean the slash commands being sorted alphabetically

#

So remembering the last tested one then going on with the next…

#

While I still agree to that I don’t see how an help command makes anything better

#

Speaking about application commands of course

whole knot
#

You can include categories and people will know what you support and what you don't support/include

boreal iron
#

So you’re not speaking about command testing just generally about to get to know all commands a bots offers?

hard wraith
whole knot
boreal iron
#

I can also upload explicit content without a bot

hard wraith
boreal iron
#

So per TOS the responsibility is by the user

hybrid cargo
#

^

boreal iron
whole knot
#

Just comparing on how it looks like when you have a proper help command, maybe even without a dropdown

boreal iron
#

But yeah that’s not wrong at all… the more user friendly the better

whole knot
#

When it comes to testing I can't complain, though on a personal level I still prefer help commands

#

Depends, I would say

hybrid cargo
#

Since commands are alphabetically arranged, 2 commands that are connected to each other by functionality could get seperated and that would confuse anyone

whole knot
#

Imagine someone having a bunch of sub-commands for one command weary

boreal iron
#

I was only referring to command testing tbh

hard wraith
hybrid cargo
#

/enable <command> and /disable <command> could be seperated so much if there are other commands which could be alphabetically arranged between them. But still these both commands are interlinked with each other in a way

whole knot
#

Still want to find a way on how to reduce some commands/sub commands

boreal iron
#

Outside of that a help command makes sense but only if you got a bunch of commands of course

hybrid cargo
boreal iron
#

I literally only have like 4 or 5 or 6

#

Idk

whole knot
#

Like autorole [True / False] instead of autorole True & autorole False

hybrid cargo
#

But also thats the reason why I had to do this, categorize commands directly in the slash commands. So the command itself is the category and then the sub commands are the actual commands in that category

boreal iron
whole knot
#

And now imagine having one command with autocomplete for similar sub-commands

boreal iron
whole knot
#

You reminded me that I have to implement autocomplete for my reload command, tired of typing it out all the time

hybrid cargo
boreal iron
#

IF THERE WAS ONLY SUB COMMAND NESTING (not showing em all at any time)

#

This is planned since the beginning of introducing the app commands

#

But yeah

hybrid cargo
#

It is planned to do so iirc

#

Yeah

boreal iron
#

For so long already

hybrid cargo
#

well to this date, i never understood the autocomplete of slash commands

#

Neither did i try to test it out

boreal iron
#

Very useful to search a database for example and list the results based on your input

whole knot
#

It can be pretty useful sometimes, especially when you have a lot of entries

hybrid cargo
#

Oh damn thats cool

boreal iron
#

Yes a pretty easy example for this can be a selection of time zones

#

Instead of choosing from a list of hundreds you start typing and filtering the result you show the user

hybrid cargo
#

Ohh

#

okay now that actually makes sense

boreal iron
#

The same sort of autocomplete you use in forms already your entire life in the net

#

Vision?

#

Better example

#

LITERALLY the same sort of autocomplete like when you enter (slash) command names in discord

#

When I’m going to enter /reset my command /config reset will be shown too

#

Since it’s matches the name filter

whole knot
#

I tricked Discord

#

Can't watch it in full screen

lone wing
#

Discord.py? That's cool how you're reloading individual components

#

Why don't I do that

#

It's pretty easy, I can just redeploy command files

whole knot
#

Currently using a fork, have not really switched over to discord.py

lone wing
#

nextcord?

whole knot
#

return [disnake.OptionChoice(name=str(k), value=str(k)) for k in self.bot.extensions if string.lower() in k.lower()][:19] smart

#

disnake

lone wing
#

oh cool

#

My bot is just another generic discord.js bot

#

My biggest flex is migrating from v13 to v14 without issues

#

Wtf is this abomination I have created WearyFluent

boreal iron
#

Let’s not talk about the result

lone wing
earnest phoenix
#

Funny number!!

lone wing
#

haha my sense of humor is so funny ikr I'm the funniest man alive NeutralFluent

boreal iron
#

Looks like a calculator you can trust a 100%

lone wing
#

mhm

wheat mesa
lone wing
#

rust

wheat mesa
#

Yes

#

Rust is based

lone wing
#

fortran is based

#

Is bot developer role given once you submit a verified bot?

earnest phoenix
boreal iron
lone wing
#

smh those calculators suck

wheat mesa
earnest phoenix
#

NO WAY

wheat mesa
#

It’s much more performant than his version was

lone wing
#
if problem == '1+1' return 2
elif problem == '1+2' return 3
elif problem == '1+3' return 4
# ...
wheat mesa
#

I generated a 188 million line file

lone wing
#

Best calculator

wheat mesa
#

7 gigabytes

boreal iron
#

🤦‍♂️

wheat mesa
#

So many that I had to use powershell to count it because it wouldn’t open in any editor obviously

lone wing
#

cat

hard wraith
#

Safe search was too much of a pain to implement

lone wing
#

Oh

earnest phoenix
wheat mesa
#

That was my first ever rust project and then I stopped using rust for like 6 months ngl

lone wing
#

Yeah I meant approved

earnest phoenix
lone wing
#

I hope my bot meets the requirements

#

I got declined back because the reddit command could return nsfw posts but i fixed that

#

The only thing that could be bad is the embed command

#

Since people could bypass automod, but at least it is the user at fault. You can disable it in settings

earnest phoenix
boreal iron
#

We had this discussion 15mins ago

lone wing
boreal iron
#

If somebody wants to set an explicit image as banner he can do it, without your app

boreal iron
lone wing
#

ah

hard wraith
#

Google helped me out

boreal iron
#

Your bot is not responsible for an user input but it pretty is for an external source you fetched data from and violate discords tos

lone wing
#

Yeah I fixed the reddit command

#

For subreddits with minimal nsfw, it just skips the posts

#

I added an image resize command to learn attachment options

bright thorn
#

I want that from a json a random image will come and then it will show in embed but i dont want to see same image in 2 time

let ranimages = Object.values(ImageJson)
let random_images = 5;
async function image() {
  // refill the array if needed
  if (!ranimages.length) {
    for (var i = 0; i < random_images; i++) {
      ranimages.push(i);
    }
  }
  var index = Math.floor(Math.random() * ranimages.length);
  var val = ranimages[index];
  ranimages.splice(index, 1);
  return val;
}

But from this function it will come for some time after some time i am getting output like : 2, 3,4,5,
Which is image number not image link

any one can help me ?

sharp geyser
#

I feel like there is a much better way to do this

maiden urchin
#

Discord can and will email you in situations where your bot posts something violating TOS (User input or not). If you don't remove it your bot can go poof

bright thorn
earnest lantern
pearl trail
#

if it's a discord user nsfw banner or pfp, their account will go poof instead of your bot

boreal iron
#

Anything else is a violation of the user itself

hard wraith
#

So like when they provide an image link for a welcome banner for instance 😂

earnest lantern
#

Ok i didn't understand ty

feral aspen
#

Should I be modifying something like <Class>.prototype.someFunctionImadeHere()?

#

Or should I just make the function within the class only?

pale vessel
#

Why would you prototype pollute

earnest phoenix
#

Hey

#

Little question

#

Does anyone know how to send a message

#

After the collector timer runs out?

#

Did i explain myself?

#

Nvm

#

I think i got it

#

Yea

#

Got it

cinder patio
feral aspen
#

But should functions be on prototype or on the class itself?

pale vessel
#

I'm so confused

hard wraith
feral aspen
# pale vessel I'm so confused

Basically, when I have classes, and I want to have functions or methods. Should I define them in the class itself or should I make a prototype function?

hard wraith
#

In the class itself...

pale vessel
#

Yuh

#

Why would you do the latter?

hard wraith
#

adding .prototype means you have to call the function on .prototype every time

pale vessel
#

Wdym

boreal iron
hard wraith
#

Its still oop lol

hard wraith
#

he is making an object i his main object called prototype... that he then has to call by object.prototype.

pale vessel
hard wraith
#

Didnt you read the example given.

pale vessel
#

😭

#

Trolled

hard wraith
#

you have to call .prototype.getFullName() to use this lol

pale vessel
#

You didn't read what I sent

hard wraith
#

the moz docs?

boreal iron
#

okaybea 2.0

hard wraith
#

you sill have to call to the prototype no matter what way you do it... Just so you can use the function you are setting.

#

im going to watch MrRobot for the 12 time lol. C ya round.

carmine summit
#

assuming an event happens in 30 hours, do you say it happens in 1 or 2 Days?

#

floor, ceil, or round it?

#

I think it's better to floor it, cause when the user checks in 24 hours, it will say 6 Hours. rather than checking in 48 hours and completely miss the event

quartz kindle
#

1 day is better yes

#

or something like 1.3 days

cinder patio
#

1 day and 6 hours

#

don't be lazy

boreal iron
#

More than one day

#

:P

maiden urchin
#

If your bot posts something, user-input or not, and it is in your bots message then your bot is just as responsible for the input as the user. Especially if its not a reply. Reply might be the only exemption where if your interaction is a attached to the slash of the user so Discord can see the context on the message itself. But if its a totally separate message, then you best hope you're able to delete it if it violates TOS and gets reported

carmine summit
#

maybe 1.3 Days is better

earnest lantern
earnest lantern
maiden urchin
#

Don't get me wrong even I allow user-input through a / command of my bot. But I do my best to ensure should my bot's message get reported, Discord are fully aware its user input. I also store all data (as listed in the bots Privacy Policy) of the channel-id and message-id of my bot's message if it has user-input in it.

#

So should they request removal, I can at least try.

earnest lantern
#

That's a lot of concern for little bots

maiden urchin
# earnest lantern Do you use a db?

No, I'm pretty lazy with mine. I literally just amend a new line to a text file that's named after the unique id of the "game" its used in. Then should I need to bulk delete problematic messages, I can parse the file.

#

Don't get me wrong, it's a flawed solution as if your bot is public, if your bot is kicked from a server you lose the ability to delete its messages.

#

Maybe discord will respect and understand if this happens, if user input causes a message that violates TOS and you cannot possibly remove it, however;

#

There is some precedent that suggests that's not the case. i.e, NotSoBot's initial termination.

earnest lantern
#

So the best thing to do is to store the post id and channel id of a user entry
(by the way I wonder if it's useful if the user deletes his message) if I understood correctly

maiden urchin
#

I'm not entirely sure. In my case, I just do the most I possibly can and hope thats enough.

#

All users are forced to read this before using the command;

#

And every single message, I apply this to;

hard wraith
maiden urchin
#

I have no backend

earnest lantern
hard wraith
#

Plus my bot has a tos and privacy policy. Meaning that as a company we aren’t Liable for things that users do with our products that violate these, but as a result the users can and will be prohibited from using the services.

maiden urchin
#

The whole issue of user-input is case-by-case. Imagine your bot accepts user input that lets them change your bot's status. An insanely stupid thing to do, but its still user-input.

hard wraith
#

Oof… can’t do that with a welcomer bot… that would completely spam fill the database.

earnest lantern
maiden urchin
#

But it's obvious in that scenario, your bot is liable to Discord TOS violations.

hard wraith
#

My bot does however “validate” inputs to make sure they comply with discord tos.

maiden urchin
hard wraith
#

Mhm

maiden urchin
#

My bot is the worst scenario, it posts user-input of a user into Discord's they're not even in, thus it's a stand-alone message with no :reply()

hard wraith
#

So while if a user bypasses the checks and it breaches my bot isn’t liable, the user that did it is… the emphasis is on the developer to try and limit the ability of the user to make the bot break tos.

hard wraith
maiden urchin
#

It's not possible in my use-case.

earnest lantern
maiden urchin
#

I do believe if your message is a :reply() like @hard wraith. You're entirely safe.

hard wraith
#

Oh I don’t save that. If you put “whaddup my n-words” in the welcome message during the setup command and it somehow passes validation, then when it’s added to the welcome image the bot is protected from that, and the user that did setup command isn’t logged, but the guild owner is and they would be held liable for that breach.

maiden urchin
#

Cause the context is attached to the message, its only in cases like mine really where the user-input is shown in a non-reply.

earnest lantern
hard wraith
#

Which is why the command can only be run by server admins.

#

Welcomer is the ONLY feature I have that has the bot exactly post what the user inputs 😂

earnest lantern
#

@hard wraith it's good solution

hard wraith
maiden urchin
hard wraith
#

But then if you’re in Europe make sure you comply with GDPR…

maiden urchin
#

Don't we all have to?

earnest lantern
maiden urchin
#

When I got verified Discord sent me lengthy emails asking for my process of user data deletion and compliance with GDPR.

hard wraith
#

America doesn’t comply with GDPR unless working directly with European customers.

earnest lantern
#

But i think to remove messages sent

hard wraith
#

They have a California data protection thing.

hard wraith
#

I like having the data my company processes be stored by third parties like discord and my payment provider.

maiden urchin
hard wraith
#

I’m not liable for how they handle that data on their records. I’m just liable for how I handle it.

hard wraith
earnest lantern
earnest lantern
hard wraith
#

Hmm

earnest lantern
#

It's useless if i filter

hard wraith
#

Does your bot post those logs?

earnest lantern
#

In channel with specific name

#

In the same guild

hard wraith
#

Or, and this is the better way… host the logs on a website from a database.

maiden urchin
#

Just add Dyno to your server and check how they do it. What warnings, if any they have in place, etc. Maybe skim their Terms / Privacy to see what they have

hard wraith
#

So the channel says “view message contents” and links to the log

maiden urchin
hard wraith
#

Discord have their own version of this with alerts.

#

And auto mod. They actually paste the whole message. But I never actually tried with blatant racism or hate speech to see what it would say.

maiden urchin
#

I don't know why people use Dyno for this anymore anyway.

#

There are Audit logs and discord are basically building it into Discord

hard wraith
#

They already have 😂

#

And audit logs don’t show the message content after delete that’s why.

earnest lantern
maiden urchin
#

I see

eternal osprey
#

hey guys i have this weird issue. I am logging this: js let member = interaction.guild.members.cache.find(user => user.id === user.id) console.log(member.roles.cache.some(role => role.id === '994812838113710091')). I have the exact role equipped but it logs me false?

#

How the fuck is it pososible

earnest lantern
maiden urchin
earnest lantern
#

🤔okay
Can I have Privacy & Terms directly on the bot
For example use a command to display them and remind to respect them when the bot joins a server or in the help command

hard wraith
#

See hosted site.

#

“Small” developers can do everything big devs can.

earnest lantern
hard wraith
#

Mate… I started out doing web dev with a html page hosted on a free host.

#

You’re using node already for your bot right? Learn how to use express.

#

Then host the logs that way.

eternal osprey
hard wraith
#

I’m aware

maiden urchin
earnest lantern
hard wraith
eternal osprey
#
 let member = interaction.guild.members.cache.find(user => user.id === user.id)
          console.log(member.roles.cache.some(role => role.id === '994812234758901820'))```
I literally have the role equipped after using the cmd but it still returns false? How the fuck is this happening?
#

I am going crazy

maiden urchin
earnest lantern
eternal osprey
#

I am i think

hard wraith
maiden urchin
#

If nobody is able to help here you can always post the question in the channel for that language there.

#

iirc the api server has individual channels where people help with each language quite actively

eternal osprey
hard wraith
#

Uhm, yes, it is 😂

eternal osprey
hard wraith
#

What DJs are you using? v12?

eternal osprey
#

it has to be get

#

v13

hard wraith
#

Oh fuck…

eternal osprey
#

you see that it's an interaction, how can it be v12

hard wraith
#

fetch is not cache

#

I was… yeah I’m stupid I was correcting that you don’t need to do that long string when it’s just “userID” 😂

#

Yeah it’s js let member = await interaction.guild.members.cache.get(user.id); console.log(member.roles.cache.get(role.id));

#

That should work for you.

quartz kindle
#

get is not a promise

hard wraith
#

doesnt hurt tho and my code says it works on that string

maiden urchin
#

discord never keeps promises anyway

quartz kindle
#

lmao

#

doesnt hurt but its not really correct lol

hard wraith
#

yeah

quartz kindle
#

also members are not guaranteed to be cached

#

so fetching is recommended

hard wraith
#

then you DO need the await

quartz kindle
#

exactly

eternal osprey
#

userID?

#

I have stored my variable to user

boreal iron
#

Don’t let ‘em confuse you

eternal osprey
hard wraith
#
let member = await interaction.guild.members.fetch(user.id);
console.log(member.roles.fetch(role.id));
#

idk replace user.id with the user id lol

eternal osprey
#

JCO, shut the fuck up. Sorry but you are only confusing me.

hard wraith
boreal iron
eternal osprey
quartz kindle
#

there is no member.roles.fetch lol

hard wraith
eternal osprey
quartz kindle
eternal osprey
#

nice job jco you are the best coder 👍

quartz kindle
#

it doesnt have fetch

boreal iron
#

You either resolve it or get it from the cache

#

There’s no fetch method

gentle condor
hard wraith
#

yep... its resolve...

eternal osprey
#

Anyways i got it working, thanks y'all. Especially JCoDog! He should be hired by everyone out there as he's really good in dc coding

hard wraith
#

i get from cache lol

gentle condor
maiden urchin
#

I think your real issue is making a bot in js

#

could just use lua like real programmers like me

quartz kindle
#

lmao lua

boreal iron
hard wraith
quartz kindle
#

have fun counting from 1 instead of 0

eternal osprey
maiden urchin
#

WOAH

#

actual haters

quartz kindle
#

lmao

maiden urchin
#

jokes on you

boreal iron
#

I swear I will use Java before touching lua

maiden urchin
#

who can make roblox lego games

#

not you.

eternal osprey
quartz kindle
#

who wants to make roblox lego games

eternal osprey
#

and that within2 minutes

boreal iron
hard wraith
eternal osprey
quartz kindle
boreal iron
eternal osprey
hard wraith
#

Yeah… well kinda just waiting on food rn.

eternal osprey
#

We know that ain't true, so get your ass back into the shithole that you call "creating a role manager in php and js"

hard wraith
eternal osprey
#

Great comeback.

hard wraith
#

I do remember being able to fetch roles tho… musta been ages ago tho…

eternal osprey
#

what version are you on ?

gentle condor
#

💀

hard wraith
#

Rn? V14

quartz kindle
#

you can fetch roles from guild.roles

#

not from member.roles

hard wraith
#

Oh that would be it Cus I have a webhook thing…

quartz kindle
#

discord does not expose an endpoint to fetch individual roles

hard wraith
#

Gives a role to a member by fetching the guild from guild id and the role from role id.

eternal osprey
hard wraith
boreal iron
#

your words are more confusing than okaybea’ ones

hard wraith
#

And you’re a tosspot

eternal osprey
#

I ain't a wizard for sure, but v13 and above uses interactions i think?

hard wraith
#

It was a sarcastic based insult 😂

eternal osprey
eternal osprey
hard wraith
#

That’s just me mixing shit up Cus I ain’t 100% there rn.

eternal osprey
#

Instead of insulting me and trying to give others shitless help that only confuses people into getting their code and mind completely fucked into pieces, get your nose back into the djs guides bro

maiden urchin
#

i mean lua has one thing up on js

hard wraith
#

Cus guild.roles.fetch works.

maiden urchin
#

I've never seen such toxicity on people just trying to help damn

eternal osprey
maiden urchin
#

you guys arn't chill at all lmao

quartz kindle
#

lmao

eternal osprey
hard wraith
eternal osprey
hard wraith
#

And discordjs is a big thing to remember every minute thing off the top of your head.

gentle condor
#

what

eternal osprey
#

Okay, well... thank you for trying to help me. But next time, maybe don't say anything at all if you are not 100% sure.

hard wraith
#

I was 100% sure of it… just turned out my being sure was for guild not guildMember 😂

eternal osprey
hard wraith
#

Php is so much easier anyways… you just request a url 😂

quartz kindle
boreal iron
#

Let’s change topics and hate about lua

eternal osprey
boreal iron
#

lol

gentle condor
boreal iron
#

You need to try it before arguing

hard wraith
#

Next you’ll say rm -rd c:/system32

eternal osprey
quartz kindle
hard wraith
#

Or whatever the path is.

eternal osprey
#

that's mainly for windows or am i tripping heavily?

gentle condor
#

ig this would be better

sudo rm -rd /efi

hard wraith
#

Gif bash on windows.

#

It’s for BASH

#

That can be used on any compatible terminal on any os.

gentle condor
#

why did they name it "bash"

hard wraith
#

No clue

rustic nova
#

bash is the type of formatting and stuff

hard wraith
#

Linux uses bash basically.

rustic nova
#

bash batch Powershell etc are formatting types or smth

#

git bash emulates Linux's bash

hard wraith
#

Well ubuntu uses bash… and Linux terminal…

rustic nova
#

thus why git bash

hard wraith
#

I love git bash…

eternal osprey
#

aurel speaks with the truth of the gods.

rustic nova
#

no lol

#

Tim about to behead me

quartz kindle
#

its called bash because back then youd have to constantly bash your keyboard to make it work

eternal osprey
#

daddy timmy knows a lot as well tho

rustic nova
gentle condor
#

facts

hard wraith
rustic nova
#

sorta

quartz kindle
#

its powerful but more confusing than flying an airbus a380

#

its like bash and regex had a kid

hard wraith
#

I mean it can do things better than the bash terminal in windows terminal… but I think that’s just the powershell supporting windows better.

quartz kindle
#

and named it java

gentle condor
#

imagine the person who made it

boreal iron
#

The heck is this conversation getting into

eternal osprey
#

Guys, i am scared. I am attending my first year of CS after this summer vacation. What could i expect?

hard wraith
hard wraith
eternal osprey
#

WHahhaha i am serious, what languages do we start with?

#

Java right?

hard wraith
#

No

#

Normally python

hard wraith
#

Or basic.

gentle condor
#

ig they start with c

quartz kindle
eternal osprey
#

I think that we are starting with simplified c at my university tho

gentle condor
#

yeah

eternal osprey
#

But it's a dutch university, not sure.

hard wraith
quartz kindle
hard wraith
#

But that’s the UK education for you. It’s both the best and worst in the world.

gentle condor
#

dutCh

hard wraith
#

Can’t you check your course syllabus before you get to class?

quartz kindle
#

lmao

eternal osprey
#

Bro i get maths in english now, i just finished my final tests with 6 out of the 40 points, and now it's in english as well. I will get totaled

eternal osprey
hard wraith
gentle condor
#

wait for it

quartz kindle
#

syllables

gentle condor
#

it'll be below your pillows

hard wraith
#

Like when I signed up for my devops course it told me I would be doing the whole of azure and azure devops. Python and three workplace projects.

#

Amongst other things I won’t get into.

#

But it told me the languages that we would need to know and the languages that they would cover the basic fundamentals of.

quartz kindle
stuck dawn
#

anyone knows how can i add an shadow to fontawesome icons?

gentle condor
#

css

hard wraith
quartz kindle
gentle condor
#

^

hard wraith
#

So your employer defines them on the submission and you get sent a list of what those requirements add to your course.

gentle condor
#

yeah this in css

hard wraith
#

Like I got cyber security added, as well as aws

#

And a lot of other things 😂

stuck dawn
hard wraith
#

Like my 2 year course is now 3

quartz kindle
civic scroll
#

i saw css

quartz kindle
quartz kindle
hard wraith
stuck dawn
hard wraith
#

Peep the devops use for my bot 😂

stuck dawn
civic scroll
#

ah