#development
1 messages · Page 9 of 1
Is there a reason that running the guildinfo in an external server to the support one, outputs this error?
Its a slash command
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.
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.
@hard wraith does the problem reproducible btw
I haven’t got the repo yet.
i forgot to ask
And they don’t use discord.js it seems they use express
same thing, different implementation
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
@hard wraith i'm tempted to rewrite this guy's project in typescript
🤷 I wanna re-write it to utilise discord.js with a better command handler for the bot portion.
they are bloated with jsdocs
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 😂
@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
Then don’t use pythonanywhere 😂
no man it's something stupid about the connectionn
the solution to everything is not to use it wtf O_o
you might need to encode the string to something like base64 then decoding at the other end before inserting
why does it differ if I'm using the SSH tunnel though
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
because the communication happens with bytes regardless
if the charset is different it'll get corrupted at one of the sides
don't both sides start and end at the same places?
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
always split into multiple files
Alright
i was stuffing all my functions in a separate file but that's not good
make files based on context
Ye
multiple separate files if the content deserves its own category and longer than 450 lines
Alright that sounds fair
here's what happens if you shove em all in one
that's not even a matter of personal taste, the compiler suffers from very long files
the IDE too
you can't split data files
json

@lyric mountain remember that one 160k lines of character data
character data?
yaml, toml, timl, properties, ini
Depends honestly. If it's all related? One file. If it's misc.? I usually have a utils.ts file where I export different functions that aren't really grouped together
prts
remember that bot someone posted here that had like 50 if elses inside each other?
something about a weather command
hell
yall wanna see my first bot
i think i need to make a progress bar for this one
penguin stats
lemme make sure there's nothing sensitive in the bot before I upload the file
yall are going to be horrified
yeah
yes pls
what even is arknights about?
:^)
a game
about a world
with cancer rocks
arkham knights
about a world
with cancer rocks
so...rio de janeiro?
https://www.toptal.com/developers/hastebin/raponaqube.js ok have fun with this garbage
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
rap on a qube
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
it aint that bad
@lyric mountain i think my true potential
will be unlocked after i know how to program sprite animations
^
This is a pg server
yk, java has a great lib for 2d games
lots of great libs
it's beautiful
Take your programming porn away.
and by java it also includes kotlin if u must
BRO
tbh, I love how any JVM lib is useable on any JVM lang
i plan to use rust or c++
Sprite anim programming is so beautiful its porn lol.
then i will animate them
whatever
as long as it within my interest
porn, is not one of them
No...
i have many ideas but can only achieved ones i know the presequisites
Have you never heard anyone refer to something as so good its whatever category that thing is in porn?
@lyric mountain asset update
lmao
Like idk... Food porn being when you see really good looking food on social media or a tv show?
but i can't push em since that introduces breaking changes
sprite animation code is programming porn lol
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...
I am creating a development blog. I am thinking of making "series" for different languages. Apart from Web Dev, what else should I add?
no, i'm rewriting it to rust / c++

just web dev
for now
ah
im so tired lol. Ive been staring at a yaml file for hours
lmao
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
I wish I could be in a queue for any game…
are you high elo or is the game dead?
rip
ow2 coming out in 2 months tho hopefully that'll revive the game
hey sadly putty is only for ssh, does anyone know a ftp client?
FileZilla
imagine using putty
I use putty
To connect to over 30 Ubuntu servers. It makes selecting and connecting to them easy.
I prefer bitvise
@lyric mountain the plot thickens https://stackoverflow.com/questions/62829879/error-1273-but-my-schema-dont-contain-utf8mb4-0900-ai-ci
but I'm not sure where/how I'm supposed to alter the engine like that
where is this
engine=create_engine('mysql+mysqlconnector://user:***********@**********:3306/amatdbcharset=utf8mb4&collation=utf8mb4_general_ci')
supposed to be executed?
that's the connection url
uh im using the library though
wherever u set the database url in it
What’s the advantage of putty to the inbuilt ssh client of windows?
putty allows saving connections ig
that said, the same can be done with a bash script
Putty has an easy ssh key gen that also saves the details of it for use. And it’s what work lets us use. The windows one is blocked 😂
I could still use it using my heightened clearance… but I’ll stick to operating under the radar without breaching regulations.
Windows saves those details in your profile folder .ssh too
Imagine using putty
also iirc, putty ssh keys aren't compatible with regular ssh keys
Strange that you say that considering I have no issues 😂
They are not no
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
That’s why Unix and windows systems have this shit already integrated in their cli
No need for 3rd party apps at all
I guess it was made for those who want a ui
Although putty could of just built on top of the built-in ssh
Friends, I made a code to list the voters, I set everything, but it does not send the message, what is the reason?
It's better for you to show the code
Does it log an error there? Or does it do nothing at all?
it doesn't show an error and it doesn't send a message on the console either
Have you tried logging if the /dblwebhook endpoint is receiving a request at all?
how can i disable cloudflare captcha thing for my api endpoint?
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');
...
});
what does discord do with thier endpoint?
cloudflare aint flagging my ip with that but my own project is being flagged by cloudflare
Discord's API endpoints don't have a CAPTCHA or anything of that sort
Just basic ratelimits in place
ah
no it didn't happen again
Did it not log anything?
no
Then there's an issue with your webhook URL you've set in your Top.gg webhook page
Nice IP address
Will it be an ip address?
There’s no valid SSL certificate for an IP
It has to be HTTP not HTTPS
Use http protocol without secure protocol
and delete that screenshot, just in case
Doesn't work when using http
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
Turkey
Also I doubt you would listen to port 80 with ssl enabled
I tested it by clicking that button, I'm already trying
looks like the cloudflare panel does not have the firewall option showed in that thread
Then you're probably providing the wrong IP address
Show what you entered without the IP
https://<ip>:80/dblwebhook
how so
Dude https and :80


You entered this address (http://<ip>/dblwebhook) on topgg, then pressed save, then test?
It won't work without the port 
Try it for yourself then lmao
I am trying
Yeah I know it or I wouldn’t call it bullshit
Oh really? Like fr? 👀
No fucking http request in the world without secure connection requires you to add the default port to the url
didn't happen again
Can you actually show us what you're setting the webhook URL as? Without the IP address
As well as you don’t need to add the default ssl port to the url, too
Lemme get through the login process
I think we all know that, I meant the other ports than the default one (80), although Top.gg probably doesn't work without it, who knows
I haven't created a webhook, I'm trying to send it via bot, vds is also hosted on the bot
We aren't talking about Discord channel webhooks here, the webhook page on Top.gg requires a webhook URL to do a POST request to
So you can listen to it and receive the vote data
Context Voltrex … he added port 80 to its url and I stated he doesn’t need to, then you responded with its required
So…?
Do I need to create a webhook via top.gg
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
I wasn't going with that context, but whatever you say; but yeah they seem to be misunderstanding some things we say
You don't need to create a webhook, the webhook URL can just be your VPS' IP address and port (if it's not the default one), and whatever endpoint you want it to be (such as /dblwebhook shown in the examples)
so yes, I translate what you say through translation, most of them are inverted sentences
Well you was obviously
Idk… we don’t seem to collaborate well today
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
Did you actually ask him if he tries to use his home IP instead of a server?
Yeah got off the track there a little bit, sometimes this kinda happens
Kinda, mayhaps
#development message
I feel like he doesn’t get what we mean tho
yeah, and since they're using a translator, it makes it worse
like this
Without the <>, that's just placeholders
<> they have vds ip in them
Yes but you can not add < > to your URL
That’s no valid URL
http://ipaddr/dblwebhook
<> I removed them, just say I'll try with vds ip
no it didn't happen again
It didn’t log anything?
no
it says the site is unreachable
when i use it in vds it says this too
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.
I thought it was meant to be a POST endpoint though...
It is… but for debugging.
Since it accepts webhook data incoming
Just to check the ip works.
Because I copied the code exact from the website and it worked.
Post data and all.
how can i do it can you help me privately
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…
I don't know how to use php
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.
i know what eventhandlers work on but i don't know top.gg mixed documentation
topgg is just…
Ignore topgg stuff because your listener isn’t working.
Once that works, you look at topgg
hmm okey
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.
what do you need to check
I have a way to negate using the topgg api at all using express I just need to make and test it.
what
How odd... Nothing is showing in console...
does express even wor...
wait a minute...
what are you having issues with?
if you want that endpoint to be visible by people you have to do app.get() instead of app.post()
util.inspect instead of debugger… I rest my case
its getting a post request not a get request...
I don't even know what you're having issues with
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
Then probably don’t want to be answering if you don’t know what he’s having issues with :p
just use typescript at that point :c
trying to get the full response of the test webhook from top.gg
just guessed 
i dont know ts
Got any ideas now?
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}));
what iss the post request suppose to do?
And util inspect allows console.log() to display the full json object on the console.
No clue... RN I just want to see what is posted to the endpoint by topgg lol
Console.log should do that regardless afaik
Or is it logging [Object object] whenever you do that
Nope, there is a limit. I found that out with an object from stripe.
It’s not a big object
IDC. I am using it just incase lol.
Plus you could use the debugger for that in the future instead of littering your code with util.inspect calls
so you want to do a post request and want that logged in your console?
do you have another app that makes that post request?
yes because topgg uses post requests on vote...
The code is pretty self explanatory
and do you get a console log from that post request?
Just saying
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
mate... im using it on a webhosting server I just spun up. It listens to whatever port that tells it to.
I do this stuff for a living...
do you have the IP and port of ur webserver host? better host on the same port as ur server
I build an app build webhook for work that uses get and post at the same time.
All on a custom domain through cloudflare dns and yes I checked, it works.
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
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...
That might be it
I've seen a lot of websites filter unsecure connections recently so might be
no it cant be that... Because their docs default to port 80 wich is exclusively http not https which is port 43.
443
what issues?
Nope
Yeah figured.
Yeah I see chat didn’t scroll again

Idk discord client getting more unstable from day to day
I mean I can always lesenncrypt my endpoin.
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
LMFAOOOOOOOOOOO
how can i put the background (yellow color) in the background and that image behind on top?
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
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
fair
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
yeah, in my case i have a pretty complex canvas code that i dont want people copying xd
You could go open source after your bot is already dominating that space :^)
Since nobody would have a chance to catch up
With a comment and copyright of somebody else somewhere hidden in it

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
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
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
That's the pains of going open source
Just gotta accept it
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
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?
Also, my no topgg-api required webhook thing is ready, feel free to add feedback to it. https://github.com/JCoNet/node-topgg-webhook
A simple express listener to work with on node.js that recieves a vote webhook from Top.GG and responds by posting a message to a discord channel through your bot. - GitHub - JCoNet/node-topgg-webh...
They are slash commands... And the description is the help command...
I really wonder… a help command for slash commands isn’t really needed any longer
Rightt?
It wasn't even about him not having a help command
My help command opens a support ticket lol
He was missing commands

I read the deny reason it states clearly why it was denied
default member permission on slash commands.
While some sort of obviously entry might still be helpful like when mentioning the bot it should respond with “hey use slash commands”
The commands are there. Just if you do not have the minimum permission, you cannot see them.
But that would require a gateway connection you don’t actually really need for interactions
So yeah…
Do you state this anywhere?
Yes
Then dispute it
Right in the command list.
It's not too late to dispute the deny reason
He was missing the commands?
So instead of crying about it do smth about it
Aren’t that global commands?
Yeah...
They are global...
You can see what he can see in the imgur...
but clearly the commands are there.
If you feel the deny reason was unwarranted dm the br
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.
You could also make a slash command called wherearecommands :^)
That'd definitely get the point across
You need to check if they’re available in direct messages
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
You can see ‘em all when direct messaging your bot?
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
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?
You should fix your command issue first
thats sorted
There’s only a limited amount of denies
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?
By using a service checking the image for you
ok
well azure it is lol
nah that costs $1 every 1000 images...
best not to use machine learning
I don’t see how you should that yourself without some sort of trained AI detecting implicit images
Where can i question my bot's dispute? It is valid but I want to ask a question for my fix.
DMs of the reviewer
That's allowed?
Yes
Azure has pre-trained AI for it.
I just don’t really see any use case why you should bother with that
Trust me, it is so annoying to go through a list with a bunch of commands...
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
You can include categories and people will know what you support and what you don't support/include
So you’re not speaking about command testing just generally about to get to know all commands a bots offers?
Because you shouldnt be able to send porn to sfw channels... So now I am looking for a safesearch api
Yes, that is what I am mostly referring to
Well as long as you don’t request images from external sources but using image links from users as arguments in your commands you don’t need to bother about that
I can also upload explicit content without a bot
They provide an image they want to use for the welcome banner... They can include porn... I need to stop that, but no clue what API to use.
So per TOS the responsibility is by the user
^
I agree I agree
If they want to they can easily without using your app
Just comparing on how it looks like when you have a proper help command, maybe even without a dropdown
Thought you meant command testing
But yeah that’s not wrong at all… the more user friendly the better
When it comes to testing I can't complain, though on a personal level I still prefer help commands
Depends, I would say
Since commands are alphabetically arranged, 2 commands that are connected to each other by functionality could get seperated and that would confuse anyone
Imagine someone having a bunch of sub-commands for one command 
I was only referring to command testing tbh
more than 3 should go to a subcommand option instead
/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
Still want to find a way on how to reduce some commands/sub commands
Outside of that a help command makes sense but only if you got a bunch of commands of course
I feel personally attacked right now
I also thought about autocomplete sometimes when it comes to this
Like autorole [True / False] instead of autorole True & autorole False
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
Imagine not using sub commands for commands of the same category like /config /set etc…

Looks like my bot in some way 
lol
And now imagine having one command with autocomplete for similar sub-commands
Yeah that’s way easier to understand for user tbh
You reminded me that I have to implement autocomplete for my reload command, tired of typing it out all the time
Yeah, thats the reason I did that
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
For so long already
Lol
well to this date, i never understood the autocomplete of slash commands
Neither did i try to test it out
Very useful to search a database for example and list the results based on your input
I am gonna act like I understood how it works from that message
Oh damn thats cool
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
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
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
Currently using a fork, have not really switched over to discord.py
nextcord?
return [disnake.OptionChoice(name=str(k), value=str(k)) for k in self.bot.extensions if string.lower() in k.lower()][:19] 
disnake
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 
Let’s not talk about the result

Funny number!!
haha my sense of humor is so funny ikr I'm the funniest man alive 
Looks like a calculator you can trust a 100%
mhm
Sounds like you need a recursive descent parser! https://github.com/Jwaffled/math_parser_rs shameless plug
rust
Sometimes you need an extremely efficient calculator
https://github.com/AceLewis/my_first_calculator.py/blob/master/my_first_calculator.py
Tf… is there literally anything you can do without using somebody else stuff
smh those calculators suck
I see your repo and I raise you one https://github.com/Jwaffled/my_first_calculator.rs
NO WAY
It’s much more performant than his version was
if problem == '1+1' return 2
elif problem == '1+2' return 3
elif problem == '1+3' return 4
# ...
I generated a 188 million line file
Best calculator
7 gigabytes
🤦♂️
So many that I had to use powershell to count it because it wouldn’t open in any editor obviously
cat
Safe search was too much of a pain to implement
Oh
Well not exactly a verified bot, it doesn't have to be verified; but you get the role one your submitted bot is approved, unless by "verified" you meant approved
That was my first ever rust project and then I stopped using rust for like 6 months ngl
Yeah I meant approved
Awesome
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
Opening the my_first_calculator.rs file at 3 AM (GONE WRONG) (EXPLOSION)
you don’t need to validate the users input as long as you don’t fetch stuff from external sources like Reddit
We had this discussion 15mins ago
:troll:
No we didn't
If somebody wants to set an explicit image as banner he can do it, without your app
We means the channel and myself as context
ah
Not anymore.
Google helped me out
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
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
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 ?
What exactly is ImageJson
I feel like there is a much better way to do this
Not correct
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
Json file
So if the bot reposts a profile picture or an NSFW user banner, the bot is at fault? but how to avoid it :/
for an external source you fetched data from
if it's a discord user nsfw banner or pfp, their account will go poof instead of your bot
You use safe search.
No. It’s only about external sources - data you fetch and provide in discord channels.
Anything else is a violation of the user itself
So like when they provide an image link for a welcome banner for instance 😂
Ok i didn't understand ty
Should I be modifying something like <Class>.prototype.someFunctionImadeHere()?
Or should I just make the function within the class only?
Like this, supposedly: https://cdn.hamoodihajjiri.com/kOIcF0rQYz .
Why would you prototype pollute
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
Just use classes
But should functions be on prototype or on the class itself?
I'm so confused
Not on prototype unless you are going to call person1.prototype.getFullName()
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?
In the class itself...
adding .prototype means you have to call the function on .prototype every time
Wdym
To fight the oop style
Its still oop lol
he isnt making prototypes like that
he is making an object i his main object called prototype... that he then has to call by object.prototype.

Didnt you read the example given.
you have to call .prototype.getFullName() to use this lol
You didn't read what I sent
the moz docs?
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.
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
Read through this article. https://discord.news/navigating-the-bot-tos-in-a-post-notsobot-era/.
Your bot can get actioned from User-Input. I emailed Discord myself months prior for information on Developer Policy for this specific reason. Anyone saying you can't is wrong.
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
I think it's limiting coming from discord in the sense that checking each entry may be impossible (example of a log bot that reposts each user message and whose goal is precisely to manage these concerns)
And if the bot gives the id and the link of the message for example?
The exact issue NotSoBot faced, yep. Which was terminated following that situation
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.
Okay ty for infos
That's a lot of concern for little bots
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.
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
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;
Your safeguarding page could be on your website for your bot, that requires to spend X time on the page before clicking accept at the bottom, that then enables the command using a database request.
I use Github pages atm so it's not a possibility
I have no backend
To do that, you store each user ID that has already placed an order, right?
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.
All I do is store the channelid + messageid of my bots OWN messages so I can index them if I need to delete them.
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.
Oof… can’t do that with a welcomer bot… that would completely spam fill the database.
But discord won't hold you responsible for user actions?
But it's obvious in that scenario, your bot is liable to Discord TOS violations.
They can but as my tos and privacy are legal documents that do state that user input to commands is not the liability of the bot or company they wouldn’t get far.
My bot does however “validate” inputs to make sure they comply with discord tos.
Of course, cause our bots still have to comply with the standard Terms of Discord of every user.
Mhm
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()
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.
Ah mine do interaction.reply so like… 😂
Yeah reply is way better cause the context is attached.
It's not possible in my use-case.
My problem is that I create a logging bot
But I want it to be able to precisely track users who do not respect the TOS, but in this case then the bot will violate them itself
Users have to use a very specific / command to give user-input. That's all I log, not standard messages. And I ensure that all users know that if they are choosing to use that command they acknowledge we store information to safeguard our bot.
I do believe if your message is a :reply() like @hard wraith. You're entirely safe.
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.
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.
But i can't store all messages x(
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 😂
@hard wraith it's good solution
You can store deleted ones.
How exactly is the user-input displayed with your bot?
But then if you’re in Europe make sure you comply with GDPR…
Don't we all have to?
All message sent/edited/deleted
When I got verified Discord sent me lengthy emails asking for my process of user data deletion and compliance with GDPR.
America doesn’t comply with GDPR unless working directly with European customers.
But i think to remove messages sent
They have a California data protection thing.
Yes
I like having the data my company processes be stored by third parties like discord and my payment provider.
Not sure, there are massive bots like https://ygg.fun/ that have commands that literally post user-input cross-servers.
I’m not liable for how they handle that data on their records. I’m just liable for how I handle it.
They have message content filters.
So users can send what thay want this my bot
But in my case i can't filter messages if goal is to have logs
Hmm
It's useless if i filter
Does your bot post those logs?
Or, and this is the better way… host the logs on a website from a database.
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
So the channel says “view message contents” and links to the log
I assume their goal is to allow individual servers to have a logs channel, same as bots like dyno
Yeah… they use embeds and shit.
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.
I don't know why people use Dyno for this anymore anyway.
There are Audit logs and discord are basically building it into Discord
They already have 😂
And audit logs don’t show the message content after delete that’s why.
And if author delete message
I see
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
It's a good solution
But I also want a bit super simple to use, and I would have to make a website 😂
For small developers there are therefore not really viable solutions :/
I mean to be fair, its such a rare non-issue that just having a well-written Privacy & Terms is good enough.
I’m a small developer…
🤔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
The official JCoNet Chloe disord bot website
See hosted site.
“Small” developers can do everything big devs can.
I talk about a very small developper who learn programming
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.
You might want to focus on the english displayed on your site as some things aren't really correct.
I’m aware
At the end of the day if (in the rare circumstance) your bots message is reported to Discord. Just make sure its obvious its user-input. Maybe in the footer add a disclaimer to say "This is a message from x" or whatever.
I use discord.py and I Host my bot on a Friend's server x)
I threw that up because I needed to deploy the URL it’s from a template. The actual dashboard is still on localhost 😂
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
Are you not in the Discord API server?
Yes, I always put the author, his id, and the link of the message
I am i think
It’s interaction.guild.members.cache.fetch(“userID”);
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
No it's not lol?
Uhm, yes, it is 😂
No lmao
What DJs are you using? v12?
Oh fuck…
you see that it's an interaction, how can it be v12
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.
get is not a promise
doesnt hurt tho and my code says it works on that string
yeah
then you DO need the await
exactly
what the fuck are you saying
userID?
I have stored my variable to user
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
JCO, shut the fuck up. Sorry but you are only confusing me.

thsoe are my fucking variables bro
there is no member.roles.fetch lol
its rolemanager
wahahahah wait what i just noticed
console.log(member.roles.fetch(role.id));```
This seems super legit.
its GuildMemberRoleManager
nice job jco you are the best coder 👍
it doesnt have fetch
what is this embed called which pops out when you send a link
like this https://discord.com
yep... its resolve...
opengraph tags
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
i get from cache lol
thanks
I think your real issue is making a bot in js
could just use lua like real programmers like me

lmao lua

My bot handles roles in php and js so like... takke your sarcasm and choke on it.
have fun counting from 1 instead of 0
Lua... scripting lool
lmao
jokes on you
I swear I will use Java before touching lua
With no offense, but you have literally said everything wrong that you could have.
who wants to make roblox lego games
and that within2 minutes
its called having fun with friennds and being at a party drunk and just tryne help. stuff gets blury

at least im not a minecraft plugin dev

Imagine being at a party and being on discord instead of fucking having fun.
Yeah… well kinda just waiting on food rn.
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"
Why would I create it if I already have it made?
Great comeback.
I do remember being able to fetch roles tho… musta been ages ago tho…
what version are you on ?
💀
Rn? V14
Oh that would be it Cus I have a webhook thing…
discord does not expose an endpoint to fetch individual roles
Gives a role to a member by fetching the guild from guild id and the role from role id.
How the fuck can't you know what interactions are then omg
I mean clearly I do… my entire bot uses them.
your words are more confusing than okaybea’ ones
And you’re a tosspot
You asked if i used v12 while i clearly posted an await interaction.guild method
I ain't a wizard for sure, but v13 and above uses interactions i think?
It was a sarcastic based insult 😂
it wasn't you fucking mororon
And these? are they also insults?
That’s just me mixing shit up Cus I ain’t 100% there rn.
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
i mean lua has one thing up on js
Cus guild.roles.fetch works.
I've never seen such toxicity on people just trying to help damn
Have you smoked or snorted anything then
you guys arn't chill at all lmao
lmao
I am chill but he confuses the fuck out of me
3 eddibles 😂
I think you must have sneaked in a few grams of coke
And discordjs is a big thing to remember every minute thing off the top of your head.
what
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.
I was 100% sure of it… just turned out my being sure was for guild not guildMember 😂
pfp is accurate
hmmm? I love my pfp. Cats are the best
Php is so much easier anyways… you just request a url 😂
your issue is because you have broken files in your computer, run this command to fix them: sudo rm -rf /


Let’s change topics and hate about lua
🤦
Tim no…
I have used an unbutu vps for a long time. Can't trick me anymore timmy
lol
this clearly doesn't fix everything
You need to try it before arguing
Next you’ll say rm -rd c:/system32
I have used lua for a little while, it's pretty nice
not everything but most of it, then all you need to do is throw it in the trash
Or whatever the path is.
this would be for linux, so it doesn't really have a system32 path
that's mainly for windows or am i tripping heavily?
ig this would be better
sudo rm -rd /efi
You don’t have a clue…
Gif bash on windows.
It’s for BASH
That can be used on any compatible terminal on any os.
why did they name it "bash"
No clue
bash is the type of formatting and stuff
Linux uses bash basically.
bash batch Powershell etc are formatting types or smth
git bash emulates Linux's bash
Well ubuntu uses bash… and Linux terminal…
thus why git bash
I love git bash…
aurel speaks with the truth of the gods.
its called bash because back then youd have to constantly bash your keyboard to make it work
daddy timmy knows a lot as well tho
fr
whahahah yeah like this
Accurate for MS Dos too.
Powershell because Microsoft thinks it's powerful
facts
Well it is… sorta…
sorta
its powerful but more confusing than flying an airbus a380
its like bash and regex had a kid
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.
and named it java
imagine the person who made it
The heck is this conversation getting into
Guys, i am scared. I am attending my first year of CS after this summer vacation. What could i expect?
Cursed language.
Customer Support? Expect Karen’s that can’t follow basic error instructions on their screen.
pain
a classroom
counter strike
Or basic.
ig they start with c
doesnt cs start with assembly and C?
I think that we are starting with simplified c at my university tho
yeah
But it's a dutch university, not sure.
Depending on syllabus it’s either basic, assembly or python (simplified c)
dutch C
But that’s the UK education for you. It’s both the best and worst in the world.
dutCh
Can’t you check your course syllabus before you get to class?
lmao
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
I got nothing in my mailbox so far.
No like… on their website about your course it should tell you the syllabus they work from.
wait for it
syllables
it'll be below your pillows
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.
why not? does it include murder?
anyone knows how can i add an shadow to fontawesome icons?
css
No it goes into job specific requirements.
text-shadow
^
So your employer defines them on the submission and you get sent a list of what those requirements add to your course.
yeah this in css
it doesn't work
Like my 2 year course is now 3
show code
i saw css
good luck
no, back to css jail
It’s easy… they teaching me things I already do 😂
lel
Peep the devops use for my bot 😂
ah

