#development
1 messages · Page 689 of 1
One message removed from a suspended account.
One message removed from a suspended account.
message.channel.send(`you rolled a ${rollDie()}`)
format your code
One message removed from a suspended account.
then get a linter
formatted ```js
const Discord = require('discord.js');
module.exports.run = async (client, message, args) => {
function rollDie(sides = 6) {
Math.floor(Math.random() * sides) + 1;
}
message.channel.send(you rolled a ${rollDie}!)
}
module.exports.help = {
name: 'roll'
}```
vs unformatted```js
const Discord = require('discord.js');
module.exports.run = async(client, message, args) => {
function rollDie(sides = 6) {
Math.floor(Math.random() * sides) + 1;
}
message.channel.send(you rolled a ${rollDie}!)
}
module.exports.help = {
name: "roll"
}```
formatted code is way easier to read
if people can't read your code your chances of getting help are lower
also most editors have formatting built into them
const Discord = require('discord.js');
module.exports.run = async (client, message, args) => {
message.channel.send(`you rolled a ${rollDie}!`)
}
function rollDie(sides = 6) {
return Math.floor(Math.random() * sides) + 1;
}
module.exports.help = {
name: 'roll'
}
``` *fixed
One message removed from a suspended account.
One message removed from a suspended account.
missing return
One message removed from a suspended account.
you don't call the function
looks like the redesign changed code formatting colors?
ah, a blind change hater
everything is perfect except font width
too thicc
after a client restart it fixed itself
One message removed from a suspended account.
One message removed from a suspended account.
what you had before was fine
you just werent calling the function
One message removed from a suspended account.
log rollDie() and see the output
>>> what you had before was fine
you just werent calling the function
oh i was reading your code 
One message removed from a suspended account.
One message removed from a suspended account.
where did you put the console.log
One message removed from a suspended account.
move the function outside of the module.exports.run and try again
One message removed from a suspended account.
One message removed from a suspended account.
No, just move the function
To the bottom of the file
Or top
Or wherever, just not in the .run
Or .help 
One message removed from a suspended account.
One message removed from a suspended account.
You have the console.log out of run
One message removed from a suspended account.
One message removed from a suspended account.
is run even getting called
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
what
One message removed from a suspended account.
One message removed from a suspended account.
its generally not a good idea to keep the function inside .run
since it'll create a new one each time .run is called
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
when you run the command does it send anything
One message removed from a suspended account.
so
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
because if its not executing anything the run function isn't getting called
did you load the command into the bot
One message removed from a suspended account.
const Discord = require('discord.js');
module.exports.run = async(client, message, args) => {
const rand = Math.floor(Math.random() * 6) + 1;
message.channel.send(`you rolled a ${rand}`)
}
module.exports.help = {
name: "roll"
}```
One message removed from a suspended account.
tbh don't use a function for that
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I doubt it's gonna make a difference though since I just got rid of the function
One message removed from a suspended account.
change message.channel.send() to console.log()
then run it and check console
Anything? @sage bobcat
One message removed from a suspended account.
np, so did anything show in the console?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
kill the bot
I have a strong feeling it's in the main file, theres something wrong with the command handler
go to your roll file then console.log(message)
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
if (message.channel.type == 'dm' || message.author.bot) return;```
One message removed from a suspended account.
One message removed from a suspended account.
what's strange is the command handler looks fine but no clue why it's not sending the roll message
go to the roll file and console.log(message)
and tell me what you get
One message removed from a suspended account.
so it does work
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
const Discord = require('discord.js');
module.exports.run = async(client, message, args) => { // client is supposed to be bot
const rand = Math.floor(Math.random() * 6) + 1;
message.channel.send(`you rolled a ${rand}`)
}
module.exports.help = {
name: "roll"
}```
One message removed from a suspended account.
since in your command handler you defined it as bot
One message removed from a suspended account.
One message removed from a suspended account.
It doesnt matter what it's called when you pass it
One message removed from a suspended account.
As long as he passes it as bot it can be whatever
Yes
he passed it as client in the file
One message removed from a suspended account.
He defined it as bot in the main file
One message removed from a suspended account.
One message removed from a suspended account.
async (client, message, args)
should be async (bot, message, args)
One message removed from a suspended account.
Still doesn't answer why it doesn't send the message
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Because it doesnt matter what it's called after you pass it. It's just a variable name
But
Is it just not sending?
Still doesn't explain why it's not sending
One message removed from a suspended account.

One message removed from a suspended account.
One message removed from a suspended account.
What's the current code
One message removed from a suspended account.
you got pranked
support is in #general
this is support for development of bots
rather than adding them

Try to add .catch(e => console.error(e)) after the .send
And you're sure the command is running right?
it logged it to console to yes
that never confirmed if the command is running
logged in the actual command
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
https://vinniehat.is-inside.me/N9GdPevb.png What do you guys think? Any suggestions?
I am not the best but I am proud lul
I went with this font called Manjari instead of the usual for me called Montseratt or something like tha
Both look blue
second better, ultimate bit kinda cringe ngl
i'd make the gradient diagonal or remove it
I will try a gradient diagonal
https://vinniehat.is-inside.me/yu8cxbV6.png what do u think?
hey yall
at nikki
the library of alexandria
the library of noob help
common misconception
!
it wasnt actually burned down
i was just about to do something and then stopped so that way I didn't get in trouble
oh interesting
ikr
Lol
a lot of people care about what I think
kek
Really who?
apparently the library was only said to have burned down, but in reality the most likely occurrence was that only a place that housed some scrolls burned down
ok sorry off topic
Lol
memeas
ok
what's the map function to view guild emojis
We dont spoonfeed
@earnest phoenixik
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
Bing helps you turn information into action, making it faster and easier to go from searching to doing.
Who uses bing....
cultured people ofc
"Google" is the #1 most searched thing on there
Rather use ie than bing 
^
fine use https://yahoo.com for all of your searching needs
Even worse
The search engine that helps you find exactly what you're looking for. Find the most relevant information, video, images, and answers from all across the Web.
Didn’t know that existed
it apparently does
Looks like a rip-off of google
why
best search engine
why is that a thing
We weren't going to give you the code anyways.
^
"what's the map function to view guild emojis" you asked for the map function
i.e. what to put in your .map()
he asked for a string of characters that makes up a word or multiple words
mehhhh true
lol
you could've sent me the collections guide for me to read though 🤷
well yeah, but actually,
yeah
but https://frontier.com/search has got your back
Well you knew that .map() existed so if anything we should've sent this https://discord.js.org/#/docs/main/stable/class/Emoji
Which would tell you the method used to turn an emoji object into a string that discord will turn into an emoji
Or used the pattern yourself
or just use 100% of your brain ofc
So <:name:id>
👌
I have coded this bot in java. It is still getting features and these are the first 2.
I have coded mostly everything.
This channel is about talking about development?
Oh.
How could I go about sweeping my db monthly and deleting user data if a user left a guild
@lusty dew this channel for talking about development
not just asking
read title
@lusty dew really depends on what db you use but what I’d do is get the entire db, then filter by if the client has that guild id, then update the entire db with that filtered data
I have question, how do I make a command which reads a text document and sends something random from that text file?
in node.js
ik but after that i need define callback "fs..reafFile(path, callback)"
a function
you could've spent 5 seconds on google to go to node.js docs and see how to use it https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback
readFileSync is the worst you can do to your performance, but if that doesn't matter it's fine
cuz the only thing i want is my bot should read a text file and copy one of the texts
If performance is an issue why’re your reading from a file in the first place
and i started with try to code discord bot yesterday so im pretty bad
help yourself
@slim heart reading from a file isn't a performance issue, blocking the whole thread while reading it, is one
No that’s an issue but ok
Hm k then I wonder why my fucking bot doesn't has problems with performance, because most of the time it's just reading files (with streams)
let money = db.startsWith(`money_${message.guild.id}`, { sort: '.data'})
let content = ""
for (let i = 0; i < money.length; i++) {
let user = client.users.get(money[i].ID.split('_')[1]).username
content += `${i+1}. ${user} ~ ${money[i].data}\n`
}
const embed = new Discord.RichEmbed()
.setAuthor(`Leaderboard`)
.setDescription(content)
console.log(content)
it didn't change the content var somehow when i added the += thing
log money
Can anyone recommend me a course (udemy or sum shit) to learn the proper way for building a rest API with express, typescript and request validation
thats your problem
since a promise has no length, the for loop will never run
you have to await the promise
then something's wrong with your db
is there an event that triggers when the bot disconnects from a voice channel?
i n
w h i c h
l i b r a r y
node lib
which one
you can't expect someone to read your mind and know which lib you're using
This is basic in the docs...
Although that event does all voiceStateUpdates so you will have to check the user that leaves and joins the voice channel.
Yeah
It emits old member and new member
Check if they had a voice channel before and if they have one now
I want several text in 1 field. How do I do that?
add more text?
use the newline character, \n
And where do I add that?
or if you are in python you can do """ """
anywhere you want a newline
yes
I'm doing js
Using `` in js should have the same effect as """
""" from python.
.addField("Information", "Test")
Can you tell me where to put it?
I don't really know.
Where do you want a new line?
'' help ''
"Test\nMoreText"
" " "
Like that?
Yeah if that's how you want it.
Is it?
backslash, not frontslash
Backslash
But there is a max on how much text per field value so watch out.
db.set(`money_${message.guild.id}`, { sort: '.data'})
let money = await db.startsWith(`money_${message.guild.id}`, { sort: '.data'})
let content = ""
for (let i = 0; i < money.length; i++) {
let user = client.users.get(money[i].ID.split('_')[2]).username
content += `${i+1}. ${user} ~ ${money[i].data}\n`
}
(money[i].ID.split('_')[2]) is undefined
you are not saving anything in the db?
console.log what you get from money.
(node:2296) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'username' of undefined
Print money on its own without split or anything
money[i].id only?
hai
@earnest phoenix js let money = await db.startsWith(`money_${message.guild.id}`, { sort: '.data'}) console.log(money)
I got it fixed
client.users.get(resp[i].ID.split('_')[2]) Is undefined though
resp[i].data is [Object object]
do i need to map it?
again, show the contents of the object you're working on
if you changed money to resp, do console.log(resp) right after you define it
[object Object] Means it's an object which has more properties just console.log it and you'll see what you need to get from the object.
@quartz kindle [ { ID: 'money_601331300925702144', data: { sort: '.data' } } ]
I need your opinion
I got this
Your bot @BF1 Server Browser was declined. Reason: Your bot spams each BF1 servers info in a row on a channel for every querry which meets with a server's name. For example, it spammed 20 embeds in a row for "DICE" and this is considered as an API abuse. Consider limiting the max messages amount sent to a reasonable amount or add every information a single embed when any occurence is found from your BF1 API.
read
I have a command +search that sends some results as embeds (1 embed per result)
I am thinking of making a command +more
and making +search send only the first 5
and +more sends 5 more
@earnest phoenix I know how to read
🙂
I just ask if 5 messages at a time is reasonable ammount
the ratelimit is 5 messages per 5 seconds iirc
@earnest phoenix split returns a 0-indexed array, meaning [0] becomes money and [1] becomes the id
[2] doesnt exist
@polar sentinel
Psuedocode:
for amount of (result):
add field to embed with result (without images)
@west spoke the problem is the fields suck. The allignment is horrible. And I can only have up to 25 fields.
inline=true
Maybe I can use 1 embed for every 5 results using 5 fields and use the triple backticks trick
yes i know
it is horrible
i want everything alligned
you can split each result with \n if you want
it makes the embed larger still
or you can just use one field and append the results to that
It's only one message instead of 5 though.
anyway thanks for recommending that i use the fields
if you send 5
but discord fields suck dick really. there is no correct alignment if you use many fields with different string size
@polar sentinel how do your search results look like?
wait i send you screenshot
then you can split the string itself with \n
each time the characters go over a certian limit
This is a really random question but does a developer in here know a way to change the nickname of all the users within a server or even a channel and it show in real time without it being janky or glitchy
thats api abuse @torn folio
Yeah that's what I figured. But it really isnt' a question of fair use
More so possibility
For my sanity
Actually
for my sanity i better not use discordbots at all
my bot is doing what it is supposed to do
that's fine to just join the embeds, or use a pager/embed
hmm, does mass role assigns count as api abuse?
i see
i wonder why Dyno gets away with it
But that is how it is
how can i join the embeds?
@hybrid orchid it does it over time, not instantly
i am using discord.js
oh i see
So ... what discordbots tells me
is that i make my bot shit in order to comply
lmao
i also wonder the same about these
how the fuck is this allowed and not mine?
theres heroes that go up to 7 abilities, each skill with their own embed
wtf
@quartz kindle i changed it to 1 same thing
Pretty cool concept. Reminds me of the super hero mod project from cs 1.6
@hybrid orchid i like your design
@polar sentinel thanks! thought of a single embed but this looks more sensible for mobas
in my case i also needed to make every embed box size the same
You running a UI/Inventory embed with that design, @hybrid orchid ?
so i had to use the code snipet thing
^
ok anyway fuck discordbots
lmao
i ll just send links to invite my bot
They are simply telling you that the method you're using
not gonna comply
just make it a single embed, or make it scroll
Scroll is definitely pref IMO
it's honestly not that hard, since most langs have one
man wtf if i make it a single embed i cant do that same result
i cant have the images
You can
simple button scroll would be awesome
With scrolling
If you only display one result per page you can still use a thumbnail image
^
^
^
If you are going to use a single embed, yes
:/
If its going to be a pager, then do what you already did
Also this is outside development, but you should be humble; my guy
なに?
Not really cool to blast moderators who try to uphold quality
^
it is going to be a pain but i will try it next week. maybe i will just have a buffer to put the info and grab 5 servers to fill 5 fields with the images and then another embed for every 5 more
ok
You should really be driven by denial.
thanks everyone!
Failure is the greatest achievement
++
If you don't fail, you aren't innovating.
Stalin is the Russian not German.
I have added 7 commands to my bot already.
i know man
i know a perfect place to start
has anyone tried out deploys.io?
im thinking of migrating my bot from glitch to there
Glitch?
I'm using glitch to code my bot on
outside of*
hmm yeah digitalocean, might look around
webhooks can send multiple embeds
DO isnt worth it

@quartz kindle Yeah I just found out yesterday
looks tempting
Looks like it has a cute dashboard
But how do the servers run
LMK when you do some testing
I can toy around with it

If it is just load test it and you'll know pretty quick lol
What's that
deploys.io. Providing remarkably high-quality servers at a very affordable rate.
aight looks cash-centric for me lol
disregard this, will be looking around for better services
Can't really speak for that service but I don't know what you mean by cash-centric. Any good host is going to require denote for their service
$$$ talks
nah, its just me and their dashboard design lol
true ^^^
site is quite reasonable for the integrations they are giving you
I mean if you know html and css you can make your own server dashboard
sheesh
and js
like actually
why pay 3 euros for that when i can pay 3 dollars for 1gb ram and 15gb ssd?
I pay 3 euros for 2gb ram and 20gb ssd
i need to take a nap before school
wait wtf i havent seen that part yet LMAO
that is the most ridiculous shit i've ever seen tho
i guess they run a master node.js server and put each bot in a worker process, so the bot doesnt need to use a dedicated process
im shook
else node.js by itself already uses all that ram lul
discord.js will still make it oom pretty quick lul
they support node.js and java
I was actually thinking of creating some sort of bot hosting provider (free tho) but I don't know enough shit about virtualization
so maybe if you bot is in java, you might get more milleage
i said java
I seen bots with 100 servers using 30mb
python is retarded and sucks up ram by keeping stuff in ram
javascript too, its not a good idea to run a bot with 64 MB ram
you have zero buffer, you cant really cache anything
what is in the library
a bunch of shit
databases?
I mean my bot caches discord memes and images also songs
you cache songs? rip
i get songs but why cache memes?
my fun cog has a 13mb cache on its own
because its python it likes to cache everything
I'd have to consult my java boy on that so I'll just trust there
I'm just the guy that writes the docs
anyways gl to all the developers joining with questions, @quartz kindle outside of API abuse I'd be keen to know if it is even possible to do the mass nickname change if you got anything
Be easy guys. Good morning and good day!

@torn folio the only way would be to make a queue and execute it over time
Discord api just naturally deny mass changes like that naturally? @quartz kindle
it will deny them, and possibly ban you if you get too many denies lol
most libraries have queuing to avoid being denied by the api
i believe the current rate limit for changing nicknames is 1/1s per guild
That makes a lot of sense. When we tried testing it the only nick change was on the bot.
Question: Is there a way to "get" How many users(and bots) in a voice channel
discord.js
Library?
<VoiceChannel>.members
Returns a Collection of all the users within the channel.
it's possible i push another cmd variable in js?
your bot needs to be approved first, which may take several days. you will receive a message when its done
it's possible i push another cmd variable in js??
explain @rugged bramble
can i dm you?
i'd rather you write here
explain what you need?
How do I claim
@rugged bramble you mean, a match making system?
you need to add both the requester and the requested to the database
can you give me an example??
with the way you're using your database, it would be something like db.set("request_queue_IDFROM_IDTO")
and on the other function, you need to get from the database an item that contains "request_queue" and the user's id
this would be simpler if you used objects instead of strings
Is it possible to use my VPS's mysql server on my current machine?
as a remote database?
Yeah, I'm currently rewriting my bot but using Java and was planning on implementing a database instead of doing that on localhost I was hoping could use the VPS so when upload don't have to recreate everything.
yes its certainly possible
Alright.
I take it just requires creating a using with host being my IP.
Public IP*
yup, ip port username password
Thanks.
if your db is not secured yet, you should secure it before opening it for connections
So I know this sounds dumb but secure?
or if you really need connections from the outside, you have to use ssl or you have a smoll problem
secure it with a password lul
and if you dont have ssl, and connect from outside the server, everyone can read that password 
they'd still need to tap into your connection
more effort than those bruteforcing plagues that run 24/7 all over the internet
probing unsecured ips
i'd recommend leaving the db to only be accessible from the server (aka only localhost connections) and using a ssh tunnel to connect to it
yeah but he wants to use it remotely from another machine
It would be temporary and would be removed once rewrite was done.
SSH tunnel from a project?
oh yeah, ssh tunnel, forgot that was a thing for a sec
Am I getting something wrong (don't know much about ssh tunnels), or does the library that connects to the db has to support them?
Ngl, My knowledge in this area is very very basic so I guess will just leave it for now.
my only experience with ssh tunnel is with using chrome's dev tools to inspect a remote node process
last time I tried to save a 500MB heapdump my process crashed
same
which is safer than exposing the db to the internet
(in my case, the db port is blocked from even reaching the server)
I have it blocked except from my home ip
damn, my bot needs 27 seconds from start until being connected to everything
i do stuff with ssh because then i can access it from anywhere safely
discord.js
If i force disconnect a bot (voice channel) is there a function that would be called something like client.on , guildMember.add like these
how can i get a log like
main bla bla | <here the console.log()>
If the bot leaves it's self?
Yeah
@peak quail custom logging
Idk. I don't think so.
Np.
wont have to search google
Could always check https://discord.js.org/
eyah ust checking the docs
yeah just*
i'm pretty sure you get a voice state update for all joins/leaves
There could be a property within one of the parameters passed from voiceStatusUpdate. But highly doubt it.
State*
Ok!
For some reason I can't get a bigint to store in Java.
I've got a big int within my database just for testing but it doesn't do anything, It doesn't log at all but the numbers that are the size of an int do. Any idea?
never used java for discord bots so am crap
wait i can go the hard way
for my problem
I wanna start on a bot in java (lol)
show code
one more question

in the bot i am making i only read a command from user and it prints some message
do i need only these?
@west spoke 
No
Unless the bot has a role saying it cant read messages
@polar sentinel if its just text then yea
Its fine
hey im trying to fetch all embed messages that the bot sent
this is my code
what am i doing wrong?
@earnest phoenix error?
its just returning me a map with nothing in it
idk
Msg.type also doesn’t have embeds
message.embeds.length
this is i think the code
you can check for
if(message.embeds.length>0)
@earnest phoenix
anytime mate
public static HashMap<String, String> getUserProfile(String userID) throws SQLException {
HashMap<String, String> toReturn = new HashMap<String, String>();
checkUser(userID);
Statement statement = con.createStatement();
ResultSet results = statement.executeQuery(BaseCommand.format("SELECT * FROM userprofile WHERE uid=\"{0}\";", new Object[] {
userID
}));
NumberFormat Money = NumberFormat.getCurrencyInstance(new Locale("en", "GB"));
String cash;
int defaultMoney = 2500;
System.out.println(results.getInt("cash")); // Doesn't display when the number is larger than an Integer.
if (!results.next()) {
cash = Money.format(defaultMoney);
checkUser(userID);
toReturn.putIfAbsent("cash", cash);
toReturn.putIfAbsent("job", "None");
return toReturn;
} else {
cash = Money.format(results.getInt("cash"));
toReturn.putIfAbsent("cash", cash);
toReturn.putIfAbsent("job", results.getString("job"));
return toReturn;
}
}```
I know it's terrible. It just doesn't display a number that is bigger than 2147483647
wow java hard af
Nah.
for making bots
That's not for bots.
store as long instead of int
oh af
I tried and it still didn't log.
long can store 8 bytes unlike int which can store 4
there's probably an exception occuring somewhere then
try catch
and see
nevermind
i'm blind
ignore what i just said
long should work
I will try again.
make sure you're using long everywhere
That worked, I tried that before but nothing happened lmao. I must of done something wrong.
Also instead of the NumberFormat you're using you could just do String.format("£%,.2f", money)
You might have to cast money to a float though
kudos
Question:
can bots go live
it might be available in future libraries i think
then they can live streams etc
I doubt that the endpoint for that is accessible for bots
lel
doubt, would just cause even more load and traffic for Discord because some people would let their bots stream 24/7
we will see, I highly doubt it
yeah whatever lmao
it would allow some really cool things, but can also end horribly in so many ways
@warm marsh
- Don't specify HashMap as the return, prefer Map
- Don't return a map there, creating an object to represent the data is safer
- You have an sql injection vulnerability there. Use prepared statements instead of
statement.executeQuery
you also never close the result set
so you leak resources
Object means "anything"
Object[] is an array of anything
creating an object would be creating a class to represent that data
public class MyUserData {
private X x;
private Y y;
//...
public MyUserData(X x, Y y, ...) {
this.x = x;
this.y = y;
//...
}
getters and setters
}```
So I should make classes for each thing I use, e.g. UserProfile class and GuildSettings?
you should prefer a class over a map
if it'll always have the same keys, prefer making it a class
This JDBC Java tutorial describes how to use JDBC API to create, insert into, update, and query tables. You will also learn how to use simple and prepared statements, stored procedures and perform transactions
Isn't that just the same ?
because your lib didn't properly set the username
.user.username
and i need to get the array of the people reacted
thats the code
and its return null
hm
.find() ?
message.reactions.array().foreach(re=>{
if(re.emoji.name == "🎉){
something?
}
})
tried to do get
isnt working
oh
i got it i think
thats how to do it?
no you would search for \🎉, not 🎉
I mean in python its both
from werkzeug.utils import secure_filename
filename = secure_filename(file.filename)
``` is there any way to ensure that cyrillic will be supported?
Anyways
Could someone help me make a http request to a .txt file (on my url) and return the text in java

Ping if u can/dm
i need someone seriously big brains
PostgreSQL jsonb type: {key : {key1 : str, key2 : list}}
i want to iterate trough every value in key
Language?
python3, doesnt matter, it's SQL i have problems with
no it doesnt matter, sql is the one to handle the iteration 
if it was one value i'd easily use concatenate as i am using currently
INSERT INTO
user_bookmarks(user_id, {0}_image_id_list)
VALUES ($1, $2::jsonb)
ON CONFLICT (user_id) DO
UPDATE SET {0}_image_id_list = user_bookmarks.{0}_image_id_list || excluded.{0}_image_id_list
RETURNING *, (xmax = 0) AS inserted;
this is the way to insert values to it
but from {key : {key1 : str, key2 : list}}, i'd want to extract all keys matching all values in a list input
SELECT *
FROM user_bookmarks
WHERE sfw_image_id_list->>ANY->'image_type' = 'SFW'
is there a posibility to replace ANY with every key in sfw_image_id_list
@west spoke wait what
get text from a url (I know how to do that) but how do I return it, eg say I called the class GetNekos()
It would return 107 (currently)
@trim swallow
I assume you're using aiohttp?
httpurlconnection
and atm its edited code from stack, but I have been working with this same thing for my app.
But my app worked, since I was able to route it through oncreate
and edit the text
but I'm trying to return result;
I cant provide code, atm
since it's at school

You can
br = new BufferedReader(new InputStreamReader((conn.getInputStream())));
sb = new StringBuilder();
String output; while ((output = br.readLine()) != null) { sb.append(output); }
return sb.toString();
well fuck
That formatting failed
But yeah
I'll reformat it, but ty!
You can use that to get the input stream and stringbuilder to turn it into a string

Oke
conn is HttpConnectionURL
Do you have any code
Yeah
lemme copy-paste rq
fs.readdir('./commands/', (err, files) => {
if(err) console.log(err);
let jsfile = files.filter(f => f.split(".").pop() === "js");
if(jsfile.length <= 0) {
return console.log(`[ERROR] Couldn't find commands.`);
}
jsfile.forEach((f, i) => {
let pull = require(`./commands/${f}`);
bot.commands.set(pull.config.name, pull);
pull.config.alias.forEach(alias => {
if(alias !== "") {
bot.aliases.set(pull, pull.config.alias);
}
});
});
});
...
try {
delete require.cache[require.resolve(`./commands/${cmd}.js`)];
let ops = {
ownerID: ownerID,
active: breep
}
let messageArray = message.content.split(" "); //args but whatever it works easier this way
let cm = messageArray[0];
let commandFile = bot.commands.get(cm.slice(prefix.length)) || bot.commands.get(bot.aliases.get(cm.slice(prefix.length)));
if(commandFile) commandFile.run(bot, message, args, ops, tools);
} catch (e) {
console.log(e.stack);
}
sorry its so long but hastebin isnt working
I need help
]]faq 10 -c
AAAAAAA
Please don’t ping all of our, especially for no reason.
Kk
But not so bad that mods have to be pinged
So who I ping?
a single mod, not the role.
<@&265158261945270273> I saw a dm ad bot. Is that a problem? Sorry for ping.
omfl
oh my god
https://luca.is-inside.me/YUzPE2Co.png this also applies to admins
@earnest phoenix dude. You were told to fucking ping ONE PERSON

But I didn’t ping you
LOL
well you did earlier
hahaha I love this chat rn
Ye
Before I did by accident
i almost fucking choked on my cookie
Now to owner
BY ACCIDENT
I NEED HELP
YOU JUST PINGED OLIY YOU FOOL
-m @earnest phoenix clearly doesnt follow instructions and pinged roles for non-emergencies after being told not to | 6h
oh btw mods
🤐 Muted Pro Gamer YT#0001 (@shut mango)
lol
no @modern elm
ok
oof
can i get something less boring?
no
If u boost the server then yeah
ok
you can change your name
lol
U have nitro
i have $5 nitro on a gift
so use it lol
One message removed from a suspended account.
@west spoke can u help me with my code pls
sa




