#development
1 messages · Page 1780 of 1
let money = db.all()
.filter(e => e.ID.startsWith(`balance_${message.guild.id}`, { sort: '.data'}))
let content = "";
for (let i = 0; i < money.length; i++) {
let user = client.users.cache.get(money[i].ID.split('_')[2]).username
content += `${i+1}. ${user} ~ ${money[i].data}\n`
}
const embed = new Discord.MessageEmbed()
.setDescription(`**${message.guild.name}'s Coin Leaderboard**\n\n${content}`)
.setColor("#FFFFFF")
message.channel.send(embed)```
I wish it sorted by highest money
(**nobody respond on quick db server**)
👀 does quickdb even support sorting?
You mean i can Set admin?
in the invite link sure.
Ok
just dont require it for commands to function
I check in the setup command the Server owner
you dont need any perms to do that
Ok ok thnaks mate
y an empty array is truthy, in js
wdym ?
i did, Boolean([]) and !![], and it gives true
you sure ?
ooh sorry, I meant double !
iirc, [] internally converts to a string of "0" so this is truthy
so [] == true is same as "0" == true which is definitely false
Excuse me
What the fuck
you were answered lol
Do you guys know an API list that contains the most of WebAPI's?
Thats nice thanks a lot
[] is an object which is always truthy in js
check_user = storage.execute("SELECT * FROM users WHERE tag=ctx.message.author")
if check_user:
await ctx.send("HERE IS YOUR LIFE:")
Is this correct?
can someone tell me is there like a module or smth to make the bot not get triggered to replies
Hi I come to this store to buy ctx.message.author
.py*
wdym you don't have that in your store
Message.referenced_message or something
rtd
ty
Check if there's a referenced message and if yes, ignore it
why i fell like it lacks defining ctx.message.author as a var ? 
like the f?
@lofty cedar this is what your SQL query is saying
F-strings are a hard no
Prepared statements
ye
Do you know what that is
Google is your friend
I'm not
await button.send(
content="THIS IS YOUR LIFE:",
channel = ctx.channel.id,
components = [
ActionRow([
Button(
label="test",
style = ButtonType().Primary,
custom_id = "test"
)
])
]
)
#Da finire
#else:
#Da finire
#print(",")
@button.click
async def test(ctx):
await ctx.reply(content="ciao")
How to edit the msg after a btn press? (ctx.edit says: 'InteractionContext' object has no attribute 'edit')
u need to listen, to interaction event on client
wdym
you are trying to assign a new value to a var defined with const
it would be let p =""
How to edit the msg after a btn press? (ctx.edit says: 'InteractionContext' object has no attribute 'edit') (discord.py)
and not const p = "" since you can't assign new value
what ide is that?
it isnt
looks like console
hmm what type of console
wdym what type
it's the node REPL
oowh okay, thanks!
you mean the colors? or what?
no i meant how he could log all those info's etc
have seen that around here for quite some time now
thats just interactive node
you just type node on any console/terminal
and it will enter the repl/interactive mode
How to edit the msg after a btn press? (ctx.edit says: 'InteractionContext' object has no attribute 'edit') (python)
check the docs
.addField("Version", `${config.version}`, true)
What's wrong with this code?
What's wrong?
it says it right there man
Read the error dude
no question, just fix
fucking finally found it, page 38
that's because it's an empty string
empty strings are false
judging by the fact it probably didn't work, there's either a ; at the end of the previous line to that or config is not defined
next time provide the actual error
we're not fucking wizards to magically guess what's wrong with your 'code'
lol
I would make that te bot sends a message like: your job: job your money: money and all but i have to check the values from a database so how i can do like cur.execute and fetchall for 3 different keys and still using 1 message
(python)
collect all the data first, then send the message lol?
yes i mean like i do fetchall and then how to get the actual data
😕 ??
data=storage.fetchall()```
ok then how i get the value for the key job for example
tag is ID?
yes actualy thought to do another way at the start but changed my minds
anyone here a pro at dynamodb? i have a table with records that look like this. is it possible to setup an index that would let me query(not scan) this so that it returns all the records with results[].playerIds[].contains("SOME_PLAYER_ID") sorted by the recordedAt timestamp?
AttributeError: 'sqlite3.Connection' object has no attribute 'fetchall'
How is that possible?
what's the code that's throwing that error?
storage = sqlite3.connect("/LifeSimulator/storage.db")
result = storage.fetchall()
what about this
result = storage.fetchall()```
adding the .cursor()
the /LifeSimulator/storage.db path might be wrong. are you on unix type system? mac linux?
I’m on Ubuntu
is there a folder in the root called /LifeSimulator/
It works now, ty
Anyway is out of root
storage.execute("INSERT INTO users (tag, job, money) VALUES (?, no_one, ?)", (ctx.author.id, 0))
Command raised an exception: OperationalError: no such column: no_one
What should I do here?
how do i make my bot put custom emojis on suggestion?
I just want to set the column job for that tag as no_one
use a \ before the emoji
<= the original emoji
then you will get this
and use that instead of the normal emoji
this is for all emojis
might be missing quotes around no_one "no_one"
\"no_one\"
'no_one'
Yes it works now but now it says that the storage var we set before has no attribute commit
cursor = storage.cursor()
result = cursor.fetchall()```
@ocean imp this?
update that
thats how emoji is caled
Ok, I’ll do it
yea and then
yea an it just sends the emoji
It works, ty
make sure to close the cursor after you are done using it
nm, that might be handled automatically. idk
I’m probably stupid or something but I think I didn’t do the right thing:
for i in cursor.fetchall():
await button.send(
content=f"THIS IS YOUR LIFE:\nmoney: {i[2]}\njob: {i[1]}",
channel = ctx.channel.id,
components = [
ActionRow([
Button(
label="test",
style = ButtonType().Primary,
custom_id = "test"
)
])
]
)
It doesn’t send the message
what is button?
From discord_buttons_plugin
button.send that button
t and d
it should be the message object not a button object
message.send
not button.send
truth or datre
is there some code that does button = something...
is that passed into the message handler?
Wdym
where is button defined?
is your code in a message handler? is it responding to a command?
Is on @ client.command()
what library is that from?
class MyClient(discord.Client):
async def on_message(self, message):
if message.author == self.user:
return
if message.content.startswith('$hello'):
await message.channel.send('Hello World!')```
do you have that message object?
No
what about a TextChannel or DMChannel object?
those object have a send method that you can use to send messages to
I use like ctx.send
what is button in await button.send
is there any api docs about it?
Oh button is from discord_buttons_plugin lib
const buttonClient = new discordButtons(client)
And I tried it before and worked but I think the problem is the for cycle or something other
button = ButtonsClient(client)
No
is the embed field missing?
there isn't embed in that msg
is there any error thrown?
no
content=f"THIS IS YOUR LIFE:\nmoney: {i[2]}\njob: {i[1]}"
does it work if this is changed to a static string?
content="test"
yes
assign f"THIS IS YOUR LIFE:\nmoney: {i[2]}\njob: {i[1]}" to a variable first
then put it in content=myVar
it works
nice
yes
It's standard.
the auctions for the music tag go for like 5k a month here
it's generic
and also not worth it
there's no point in developing music bots anymore
sound image thumbnail is a VERY dangerous thing to show that open
you cannot rival with big players like rythm and groovy, people will always prefer those two (and other popular ones)
plus you need a big budget
to bypass ip bans
any dynamodb pros know the answer to this?
#development message
wth, a dev?
hey can someone help me? I am really confused on why this doesn't work.
if(message.content.startsWith(`${prefix}tip`)) {
const args = message.content.substring(prefix.length).split(" ");
const tip = args[1]
if(tip === 1) {
const embed = new Discord.MessageEmbed()
.setTitle("We have assignable roles!")
.setDescription("Check out [#813553616530571313](/guild/264445053596991498/channel/813553616530571313/) :D")
.setColor(color)
message.channel.send(embed)
return
}
}
What doesn't work about it?
it jhust doesn't send it
tip === 1
Tip is probably a string
whats the python buttons module?
has anyone used documentdb? is the pricing per month?
https://aws.amazon.com/documentdb/pricing/
might be per hour
$199.44 a month for the cheapest
yeah, this looks like its for quite large applications for handing 100k+ users.
100k+ users frequently accessing data*
they need smaller instance types
they do have smaller stuff, just not in documentdb.
Amazon DocumentDB is designed for 99.99% availability and replicates six copies of your data across three AWS Availability Zones (AZs).
its just not really meant for projects like discord bots.
yeah
bit cheaper. https://www.mongodb.com/pricing
a lot of these managed services do seem to have multiple copies in multiple locations, which dramatically increases price.
oh nice! i should be able to keep it under 5gb
oh wait. 512mb
the indexes grow super big
i need to figure out how to use dynamodb better
cant u just self host your db?
why pay premium for something you can setup in a few minutes
im using dynamodb which is premium and free
but can't do what i want it to
but it probably can do it
what do you want it to do
nice, lemme add yet another entry for "things easily solved in sql but overcomplicated in mongo"
aint it the same as mongo?
documentdb is the same
Incorrect number of bindings supplied. The current statement uses 1, and there are 18 supplied.
^ what does it mean?
cursor.execute("SELECT * FROM users WHERE tag = ?", (str(ctx.author.id)))
Ok and?
dont explode it
So what should I do?
if you explode the string it'll become N different params
just pass the id as a whole
Ok
Ik
it took less than 10 seconds to find this https://stackoverflow.com/questions/16856647/sqlite3-programmingerror-incorrect-number-of-bindings-supplied-the-current-sta
maybe my data should go in sql
i mean probably
if this is for a discord bot
you're storing relational data, so might as well go for a relational (inherently sql) db
i have a few different databases that do different parts
storing the elo rankings needs more querying functions than dynamodb has
mongodb is too expensive
are there good managed sql hosts that are free?
nm, aws has a free tier for rds
just install sql in ur vps bruh
the setup is insanely simple
or if u dont want to install anything just use sqlite
my vps has 512mb
sqlite has 512 b
it has aws internet
jokes aside, there's literally no db that can be as small as sqlite
not even txt files
i want lots of indexes on the data
so?
you call 5 a lot?

sql ain't like non-relational dbs
it loves indexes
it loves relationship between tables
make an in-memory sqlite file
i only have 512mb
^
node uses ~80mb
you're underestimating how small it is
unless you're making a world-grade business management enterprise-plus ultra database, you ain't gonna make it go big enough to become a trouble
amazon ranks the rds higher
my database is currently 34.99 KB
or that one table
only 125 items
trust me
you're not going to be able to get sqlite to become "too big" for your space requirement
setting this up in rds will be complicated
i'd need to make foreign keys and tables
there's a reason pretty much ALL softwares use sqlite as settings storage
i want to be able to sort by recordedAt and filter by gameId or guildId or results[].playerIds[]
the results[].playerIds[] part is the tricky part
whats the reccomended bitrate for ytpl
you're going to need two extra tables
one for results and one for playerIds
then just
...
INNER JOIN results r ON r.something = a.something
INNER JOIN playerIds p ON p.something = r.something
WHERE playerIds IN (your array)
ORDER BY a.recordedAt
or something like that
just note that NOONE will be able to help you depending on how different rds is from postgresql/sqlite/mysql
looks like aws rds instances are ~$200 a month for the cheapest instance
i need to figure out how to use dynamodb better
cheapest rds
i want to keep the vps lightweight
and i need my website to have access to the db
so i'd have to setup firewall rules and secure the database
managed services are easier
found a cheaper version
but still not free
free databases are generally considered a really bad idea
@ocean imp yo can i name a channel diffrent than 'SUGGESTIONS' so suggestion bot can work cause if i change the name my suggestion wont come out
@proven lantern
looks like nosql is the best type of database in the current year
explains why sql is no longer used
https://youtu.be/HaEPXoXVf2k?t=188
This session is for those who already have some familiarity with DynamoDB. The patterns and data models discussed in this session summarize a collection of implementations and best practices leveraged by Amazon.com to deliver highly scalable solutions for a wide variety of business problems. The session also covers strategies for global secondar...
Mongo is good
And it's free for the cloud version basic plan
no longer used in amazon?

but still, you can just use sqlite without installing anything
my cpu is small
for the 4182804712th time
sqlite with joins is going to be slow
bruh
cpu
not it's not
joins
??
joins what?
sql was created to be used with table JOIN
it's literally one of its major selling points
i guess i can make indexes to trade memory for cpu
I must ask you to not make statements which you can't personally back up with at least your own experiences. Dynamodb is good but depends on the kind of usage, if you're going to do complex queries or even queries other than normal key-fetch dynamodb isn't what you want
what?
NO AGGREGATIONS
bro it keeps auto deleting
yes, because you're sending stuff which contains links
oh
or tokens
is it a discord.gg link?
idk if luca has a anti-token feature tbh
yea
then remove it and send it here
description: "Help Command",
execute(message, args, Discord) {
const newEmbed = new Discord.MessageEmbed()
.setColor('#A82A3C')
.setTitle('Bot Help')
.setURL('IVITE LINK')
.setDescription('Help command for all areas of our bot, @Senpai Bot™#7127')
.addFields(
{name:'__(prefix)help setup__', value: 'To show all of our Bot Set Up Commands, and help for each one.'}, {name:'__*help fun__', value: 'Help for all of the fun commands.'}
)
.setFooter('yo');
message.channel.send(newEmbed);
}
}``` HOw can i make it have it use my prefix fuction instead of saying *help
there
you need a database
maybe amazon is joking about sql no longer being that useful
obv amazon will try to sell their fish
but it looks like rds is to save on storage
it's called promoting own content over others
and use more compute
i have this const prefix = '*';
bezos will never say another database is better if he has amazon's
I work w dynamodb and my company actually buys that shit aws sells them
and now I have to do tons of shit
to do queries
that's a constant
because I'm forced to use dynamo
you still need a database if you plan on making customizable prefixes
it's a fucking pain lol
I was asked to make an analytics dashboard and the data is to be fetched from dynamo
I want to kms
in my experience, you'll probably never find a database as fast and small as sqlite
it's literally the Assembler-tier of databases
now let's not just
go for sqlite
I mean why not but yeah
there's better out there
I've to use various frameworks and some other things for it to work
while we could've just used redshift
hate when there's ppl w no knowledge on higher ends
not for companies
redshift isn't redis
redshift is for big data
data warehouse
I'm still looking for a good database based around immutability
Maria db
file coalition 
Immutable databases don't really make sense. Immutability is more of a application concern.
But this is a good read: https://www.red-gate.com/simple-talk/opinion/opinion-pieces/ninja-immutable-databases/
'Immutable' databases operate under the principle that data or objects should not be modified after they are created. Once again they hold the promise of providing strong consistency combined with horizontal read scalability, and built-in caching. Are Immutable databases a new idea? Are they different in any way from the mainstream RDBMSs.
I read the article, and it is a good read. It's opened my third eye! I've experienced difficulty keeping the integrity of the data and table in tact while writing efficient queries to select data as appropriate. Operations like unique constraints, aggregations, etc. have become difficult or unavailable (for example, a username unique constraint is practically no good).
Does it make sense to have an engine for an immutable database? I think not. Developers are fully capable, with existing RDBMS, of implementing immutability of data in whatever tables justify it. They’ve been doing so for decades. As we’ve seen, MVCC resource burden in providing session level immutability hasn’t been eliminated by contemporary hardware, and current immutable databases have had to admit the impracticality of universal immutability of table data.
But all paradigms have their ups and downs, and immutability is a critical component to my project, so I'll just need to think harder
Have you tried using the embed builder (e.g. Discord.MessageEmbed or sending the JSON directly)? You're saying that need help embedding your message, so I assume the localization and sending of a message is working.
Well, immutability doesn't mean you can't remove or update data.
The main crux of immutability is no side effects where possible. Pure functions etc.
But the thing is, a database is full of side effects - unless you only ever have one application using it at a time.
You never know when another replica / instance of your app is going to change the data.
I know that part, but the immutability is used to create a historical model on something. For example, the changes to an article over the course of its lifetime (along with publication, deletions, etc.)
Oh right, if you want to keep snapshots of an entities history then that's another thing entirely.
Immutability itself doesn't make any guarantees about the lifetime of data.
const Discord = require('discord.js');
module.exports = {
name:"kick",
execute(message, args){
const member = message.member
if(member.hasPermission("KICK_MEMBERS")){
message.channel.send(":redTick: wat")
}
else{
message.channel.send(":redTick: You need the `KICK_MEMBERS` permission.")
}
}
}``` it does nothing. No error.
are you sure the command is being executed
You should log the state of your program (e.g. use step points with a debugger or logging statements)
if(member.hasPermission("KICK_MEMBERS")){
^
TypeError: member.hasPermission is not a function``` help
i fixed it.
But i have this new problem
a 401: Unauthorised when using a Bearer token means the token has expired, right?
Yes
@grizzled raven how did you fix it
Ye
Oh lol
i just figured out how to tell the library that the user is no longer authenticated and they had to authenticate again
yeah i was passing undefined instead of null
get emoji from server bot is in
do \:emoji_name:
\ will do the following

from that
to that
Any tips for starting with JDA?
I just finished getting my environment ready: https://github.com/hornet-bot/hornet
JDA eh? 
Any tips? I have like 12 hours of Java experience tops (a little more of Objective Programming)
Just general tips since I barley know where to start with JDA
use setMemberCachePolicy, disable setBulkDeleteSplittingEnabled and use a fixed thread for setEventPool
those 3 things alone fixed a helluva amount of issue I had early on
just note that if you use a fixedthreadpool for eventpool you'll need to worry about parallelism
like, one data being manipulated by 2 simultaneous events
the membercachepolicy allows you to define what gets cached and what doesnt
unless you plan on answering bots you don't really need to cache them
or members that are blacklisted
also, use some command handler, be it hand-baked or from a lib

I were going to release a cmd handler for jda but stuff got in my way
you just did it above...
maybe one day
...
hi
then you prob arent doing it correctly
I'm always here if you need specific tips or help
jda is way too big for me to say about everything it has
I think you're mistaking something
state it
so...2 prefixes?
ive never worked with 2 prefixes before, but if you want to change one you would need a database
do u use a const for ur prefix
is it ```const prefix = '--';````
like that?
ok
try const prefix = ('--', '!');
hmmm
Anyone here good with data systems and algorithms? Or discord.js I need someone to teach me. Please dm me if you can help.
const prefix = ['-', '!']
prefix.some(e => msg.content.startsWith(e))```
or something
ive never implemented it myself
@earnest phoenix try this
args[0] == prefix1 || args[0] == prefix2
"prefix": [ 'prefix1' , 'prefix2']```dont know how to add this into code but found these
^
oh
@earnest phoenix try this
const prefixes = ('--', '!');
just ask ur doubts
@earnest phoenix u using djs?
for your cosnt
How about
const PrefixList = [
"_",
"!",
"$"
]
// Client on message
let sw = false
PrefixList.forEach( p => {
if(message.content.startsWith(p){
sw = true
}
})
if(sw){
//The commands
}
//End of on-message
I guess he meant
["", ""]
or whatever
const prefixes = ('--', '!'); is the same as const prefixes = '!';
oh. wow, how does that work?
dude
ever heard about code blocks ?
parentheses can be used to make a list of expressions without using a code block
it works without the parenthesis too
doesn't look like it
y the, how js is ignoring all the strings and accepting last one
it working without parenthesis for me
That's how it's designed to work
Im damn sure, u hv copied this code from somewhere!
i doubt, coz u hv change ur prefix from a string to array. And hvnt changed anything else to adapt this change in ur code
Try using json instead of a database for prefixes
just make a file named prefixes.json and store orefixes per server with : server id owner name and prefix
And then code it so people can update their prefix with a command.
https://discord.js.org/#/docs/main/stable/typedef/ImageURLOptions try to pass options, its possible that you use a non supported format
I dont know much about js but maybe try using message.author.guild.icon_URL ?
then it should work for thumbnail too
my main is python
so I cannot tell you about js
Where do I find the API to tell me who upvoted my bot?
Hi, How can I ensure that the user I have authorized does not go away even if my api client is closed and opened?
Hey all! 👋
if (itemToSell === "attitudecoin" || itemToSell === "attitudebadge" || itemToSell === "attitudetrophy") data.multiplier = 1;
Any faster way for this if statement?
Pretty sure you can do something like this if (itemToSell === ("opt1" || "opt2")) ...
if (
["attitudeCoin", "attitudeBadge", "attitudeTrophy"].indexOf(itemToSell) !== -1
) {
data.multiplier = 1;
}
Damn, that's long.
Does this work?
Didn't test but it should
if (itemToSell === ("attitudeCoin" || "attitudeBadge" || "attitudeTrophy")) data.multiplier = 1;
if (
["attitudeCoin", "attitudeBadge", "attitudeTrophy"].includes(itemToSell)
) {
data.multiplier = 1;
}
This is even better
👍
Use or operator not comma (||)
Oh.
Thank you as well!
👍
Switch case is for when you have a lot of different actions for different values right? This is a lot of values for one action.
You can use it in this case as well
switch(itemToSell) {
case "some value":
case "another value":
// Do things
break
}```
Although I personally prefer an if statement in this case
I like this since you can just add something to the array and ur done. Don’t have to worry about anything else. Very handy for changes in the future.
that won't work
The things inside the () will return true and itemToSell is not true so this will always return false.
hello?
hey
is anyone here known with rocketreach?
Their api for js really confuses me
like, it limits my json output to 10 max users only?
Why is that
the website shows 10 user per page, but how can i get the total amount of users?
it says total 8000000
because its paginated
is there any way to get the next page for example?>
Or get all the info at once
then check again
i can send you the website if you want
i have been looking for 2 hours
Rocketreach finds email, phone & social media links for 450M+ professionals. Try for free at rocketreach.co.
i cant, my mobile data is almost finished
owh alright no problem
curl --request 'POST' --location 'https://api.rocketreach.co/v2/api/search'\ --header 'Api-Key: '\ --header 'Content-Type: application/json'\ --data '{"query":{"name":["Amit Shanbhag"],"keyword":["Founder"],"current_employer":["RocketReach.co"]}}' this is their v2 version, which has pagination set off. However i am confused with what curl means. is that just a post request?
are user bots allowed in this server
no
how do i make them all attached?
(i need something like
Text1 Text2 Text3 etc.)
like remove padding of the container
Or just put them in one container
Instead off adding each one to a quote add a line break
> test<br />test2<br />test3
which will work as well
how to check if bot has a specified permission py
if u got documentation link for this send me it :)
ty
how can i make a vote link
hyperlink
how do i put in an embed
which language?
js
do i have to have the first "text" part
yeah i think u need that arg
\n
but then it will have to be like,
text
hyperlink
text
hyperlink
ohhh okay
Delete this.

yeah ikr
ive decided to download the virus
lol
no
oh f
i dont have enough time to download and learn how to set it up
shit virus 0/10 stars
https://i.imgur.com/7xYajFc.png
LOLOLOLOL
@azure lark
thanks
:)
how to check if bot has a specified permission py
if u got documentation link for this send me it :)
@earnest phoenixwut
tysm
No problem
wait wut xd
hey so, i am currently doing this:
if (!client.cache.has(guild)) client.cache.set('guild', guild);
if (!client.cache.has(member)) client.cache.set('member', member);
are there any alternatives which are better for performance?
guild and member are my db stuff btw
client.cache is a map btw
what's the point if the map can have only 2 entries?
guild and member
thats all the things i need atm
and yeah, i wasnt so sure about the map and i didnt really know what to use
so i jus stuck with it but now idk
you have 2 keys and you're wondering about performance lol
yeah, cuz when i was making a db call multiple times per message sent and now im doing it once, it barely changed
not barely sorry, didnt change at all
I'd use an object, otherwise the code for setting and checking if an entry exists in an object/map is very fast
what didn't change?
the ping
why would that change the ping
? its taking less time to get to that
do you know what ping is
yes
the ping isn't affected by your app's performance 
but wouldnt it like, run it faster ?
the internet speed and the location of your server matter for the most
the distance from my house to yours doesn't depend on whether you live in a mansion or a hut
hm yeah alr, is console.time the only way i can like test if this actually improves the performance or are there any ways to do it
most of the time you can see if something is performant by just looking at the code, if you want to benchmark your code then use a library like benchmark.js or the performance built-in lib
kk ty man
whats ur question
its not gonna hurt to send it one more time
and i literally just came to this channel
no
what are u talking about
just tell me ur question
something like canvas
if youre using js
then use canvas
thats what most people do for generating images
i have a problem i stored a channel id in a variable using a cmd, then i called it in another function/cmd to send embed to that specific channel but nothing is working :/ any ideas?
.py
are you passing the variable in the function?
hmmm
like calling it?
well, is the variable in the same scope? or is it being passed to the function in some way.
👀 so if you log it in the other function the correct id is given?
yeah i used print it works
but
it doesnt work here
the cmd doesnt send the msg
i even tried to name them global in the functions
@solemn latch so.. :D
i dont know py, so cant really help further than i have.
Can I like, somehow use multiple html files?
for what?
anyone here having a bot with 10k+ servers coded in java using discord jda? because I have a question about a problem I'm facing since lika 2 weeks ago
My problem is that my bot (nearly 6k servers, running on 7 shards), meaning all 7 shards, reconnect around 3 times per hour, which seems not normal to me since the bot stood online 24/7 when I was around 1-2k servers...
i dont use jda, but im pretty sure they have a debug event for Gateway events, i would monitor the gateway events and see if something weird happens
helped me to find some weird stuff happening with on of my bots.
what was the cause for your bot?
afaik, you cannot do multiple pages on a bot page directly.
You may be able to do so with iframes.
I keep getting this error:
AttributeError: 'Bot' object has no attribute 'topgg'
My Code related to the topgg module:
import topgg
client = commands.Bot(command_prefix='h!', intents=Intents.all())
dbl_token = "token"
client.topgg = topgg.DBLClient(client, dbl_token)
@tasks.loop(minutes=30)
async def update_stats():
try:
await client.topgg.post_guild_count()
print(f"Posted!")
except Exception as e:
print(f"Failed! \n{e.__class__.__name__}: {e}")```
Where is the `Bot` object?
nvm
I fixed it
@prisma lion make sure the ID is an integer
yup it is
what does it return?
i even declared the var as int
no I'm saying what does get channel return
even while debugging it does
what does this return?
print the output of partners
consider naming your topgg var differently
I'm not an expert but it will collide with dpy client object
wait code didnt print that smth i wrong before smh
that's what i did Fixed it already
If I have a webpage (a github page), can I have that automatically set as description?
via an iframe, but i don't think the js on the gh page will function
Can you tell me how do I do it? I was able to do it, but like, somethings wrong
it looks wrong
theres no scrolling, the sites navbar appears on top of my iframe
etc
you should go to support channel for that
oh yeah sorry
Hi
text_enc="v9bqzTHQBax++H2N2TGWMw==$VAxgy7vA4D8BoX4dg9QeaADrMrKlRcuGOb9IYsO1/dBed19fc50VChZDJSxOsPe3RleYTzbKTbdTTEaIXa+5WA=="
How can I decrypt
like this
The string to be decoded is not correctly encoded
oh, there are 2 base64 stings stuck together
split them up
Any py modules which I can use for decode
??
base64string = '''.......................'''
base64.b64decode(base64string)```
you provided no context with your question
where is that snippet from, where did you get the string, what is it about
I am getting this on a websocket
how to decrypt is a question that covers a very wide range of topics
you need to be more specific about what you're doing
Incorrect padding
How can I decrypt it without knowing key or how it's encoded bcz I am getting it on a websocket
you have 2 base64 strings
v9bqzTHQBax++H2N2TGWMw== and VAxgy7vA4D8BoX4dg9QeaADrMrKlRcuGOb9IYsO1/dBed19fc50VChZDJSxOsPe3RleYTzbKTbdTTEaIXa+5WA==
Splited
yeah, remove that $ in between the two
what websocket, what are you doing
b'\xbf\xd6\xea\xcd1\xd0\x05\xacG\xd8\xdd\x93\x19c0'
[Program finished]
I got this
How can I convert it into string
are these the strings you are expecting?
"¿ÖêÍ1Ð\u0005¬~ø}Ù13" and
```T\f`Ë»Àà?\u0001¡~\u001dÔ\u001eh\u0000ë2²¥EË9¿HbõýÐ^w__s\u0015\n\u0016C%,N°÷·FWO6ÊM·SLF]¯¹X
it isn't a valid string
that's why i'm asking
what in the literal fuck are you doing lol
its either zlibed or its binary data
try creating a buffer or uint8 from the base64 string
why aren't these valid strings?
this
if the b64 produced an actual sane string it wouldn't output garbage like this
No actually the string will be in the question format
judging from the $ symbol, it could be a bcrypt or argon hash
how was the string encoded?
Idk sir I got this on websocket when I connected using websocket-client
so the two valid strings might be the salt and hash strings
Nope a trivia game
bcrypt would need a second $ in there with the salt round count so I doubt that
then check the docs for this trivia game
Trivia game
it will tell you what it is
i love how they refuse to say the platform
Their is no docs sir
are you trying to connect to kahoot lol
then how did you connect to their websocket?
What kahoot??
sounds against tos
it's most likely encrypted client side so you have to tediously reverse engineer it
Oh
until they update their private key and you have to do it all over again
And I am getting idsigned variable
In websocket
'idSigned': '8790$106618403$d9851c73eb1bc255dd18c5f96a2c35c39a9c2461',
nobody can help you until you tell us what your end goal is and which platform you're trying to use
by platform i meant the website lol
no
you just have to reverse engineer it
if you think that's bad, you'll love what the new vote payload looks like for top.gg
chances are there's already something somewhere for it already
but you won't tell us what platform it is
so we can't help you

oh it's an app lol
It's an android and iOS apk
nice, what encoding/compression?
{'code': 41, 'question': {'textEnc': 'v9bqzTHQBax++H2N2TGWMw==$VAxgy7vA4D8BoX4dg9QeaADrMrKlRcuGOb9IYsO1/dBed19fc50VChZDJSxOsPe3RleYTzbKTbdTTEaIXa+5WA==', 'number': 10, 'totalQuestions': 10, 'idSigned': '8790$106618403$d9851c73eb1bc255dd18c5f96a2c35c39a9c2461', 'textEnc2': '5J8EiO6/NMAIt5Et6JM5og==$e9ssklRGAOxFDk+ZuB2A15NCeznQ/RkH84X0e9eu2ECTTNAPbNruLvqyx25gh6inI/xmsJqnO9o3K5Bb+7npuQ==', 'secondsToAnswer': 10}
msgpack
Then you can't help
cool
nobody here can
Y
you're essentially reverse engineering an app
idsigned looks like bcrypt now, it has two $
like xet said
xd
well bcrypt is in the form of $12$abcd
then idk
would be kind of weird to send a hash over
it's most likely a base64 encoded binary payload
which I imagine would be some sort of AES encryption
so you have to dig through the source to see what the key is
AES encryption needs a private key
yes
To decrypt
client side encryption is used to make your life more difficult
Oh
because obviously you're breaking ToS rn

in theory yes but if you want to stop automation it's pretty good
also, if you're trying to make an auto solver of some sorts, you probably shouldn't even bother
you're breaking this app's tos so they want to make it harder for you to reverse
there's a 99% chance that the app doesn't the correct answer to the client
in most cases you will have to write code that will parse the AST of the code or write some sort of regex that can extract the private key from the app because if the devs are competent it'll be rotating
reading the description
you won't reverse engineer that
they have actual money at stakes
the point is to make it so annoying that you won't even bother
unless you're making millions of dollars from it like with reselling hype clothes from supreme it's just not worth it. That's how bot protection works
I am making question solver
i assumed so
work smarter, not harder
you're just not experienced enough to tackle this lol sorry
Hm
emulate the app on pc and make a desktop app that analyzes what's on the screen
you won't be able to crack through their encryption
Ocr
reverse engineering is lots of very tedious work and when you're making bots often the app you're reversing will change something and you'll end up throwing away tens of hundreds of hours of work
Oh
you generally end up resorting to more expensive solutions like OCR or browsers to automate things and usually that's just too slow and costly to do at scale (or at all)
Thanks
@opal plank @lyric mountain only in brazil https://spcultura.prefeitura.sp.gov.br/projeto/4971/
bloons td 6 mod apk, bloons td 6 apk mod, bloons td 6 mod apk android 1, bloons td 6 apk no mod, descargar bloons td 6 apk mod, bloons td 6 apk mod unlimited money, bloons td 6 mod apk platnummods, bloons td 6 apk version 12.1 not mod, bloons td 6 mod apk unlimited knowledge, bloons td 6 mod apk 14.2, bloons td 6 mod apk all unlocked, mod apk bl...
What
The hec
fun fact
this is a page in the official gov of sao paulo website
Exactly, how and what?
hi
ninja kiwi doesn't do any verification whatsoever when saving your account details so in bloons td 6 you can just send a request with a payload that has 999999 coins and shit like that 💀
i did it on another account and got banned within a week though
lmao
In all honesty, its likely to pass as a bill, considering our governors
hi dennissss
they can't really fix it either because they can't differentiate whether you earned it or bought it
I mean, I'm wondering how that's hosted in a gov site to begin with
hiii
also i just realized this is #development and not #general
it could be a domain hijacking case
then move to #general
Maybe
"if you need help, contact me at mailto:chamealdir@gmail.com"
a gmail address in a gov website
it literally means "call aldir"
professional government
@lyric mountain @opal plank edit the project id in the link
there are tons like that lmfao
Can I do client.user.setPresence({}) in discordjs, but without the type:?
Big yikes, looks like hijacking as kuhakuh said
Call aldir?
Not me lul, cry
I just agreed
Oh, yeah,, cry
Or both
they seem to be posting these
as actual gov projects
or some insider getting paid
10/10, first world country, rated 4.8 stars on uber eats
https://spcultura.prefeitura.sp.gov.br/busca/##(global:(enabled:(event:!t),filterEntity:project,viewMode:list))
Of course they would support mobile, cuz 90% of users in brazil have a computer
/s
look at that horrendous query param structures
but check the link, is all ads for android games
lmao
the fuck is this that looks more like a custom rule on ublock origin
some ads even have booking dates, book your seat now until 2033
lots of spanish ads
No hot ladies in your area ads?
nope
lots of fake whatsapp ads
whatsapp plus v12
whatsapp GB v9
whatsapp FM
(for those who didnt read, this is inside an official brazilian government website)
Tf
throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
^
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/runner/FearlessBot/node_modules/parse-ms/index.js
require() of ES modules is not supported.
require() of /home/runner/FearlessBot/node_modules/parse-ms/index.js from /home/runner/FearlessBot/commands/info/uptime.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/runner/FearlessBot/node_modules/parse-ms/package.json.
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1015:13)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/runner/FearlessBot/commands/info/uptime.js:1:12)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at /home/runner/FearlessBot/index.js:107:21
at Array.forEach (<anonymous>)
at /home/runner/FearlessBot/index.js:104:13
at FSReqCallback.oncomplete (fs.js:156:23) {
code: 'ERR_REQUIRE_ESM'
}
Help?
Must use import to load ES Module: /home/runner/FearlessBot/node_modules/parse-ms/index.js
require() of ES modules is not supported.
How can I fix that?
youll need to use import to load es modules
how do I do that :/
the issue seems to be with parse-ms, not djs anyway
/home/runner/FearlessBot/node_modules/parse-ms/index.js
ok, where do I put the import code at? in the package or?
at the location you are requiring
ok thank you
(node:7752) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'set' of undefined ?
I dunno if that's a question for development lol
wrong channel
Isn't Google's search API closed
no, but heavily limited in free version
Is there an equivalent command to client.get_channel('ID') that allows you to send the message to a specifically named text channel. :)
you mean get channel by name?
there's probably a method for that, just be aware that it doesn't guarantee you'll get the channel you expected
