#development
1 messages · Page 1599 of 1
where did drama come into this lmfao
log out before you close the process
the bot is going to stay shown as online until the next heartbeat fails
logging out tells discord to stop heartbeating and kills the ws connection
https://pastebin.com/Tj3jGyHr my userinfo keeps erroring TypeError: Cannot read property 'bot' of undefined my bots structure is client but both bot client does that error any help is handy dandy
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
await message.guild.members.fetch(args[0])
how many messages can a collector collect on d.js
2^24
ty
you have to add the npm executable to PATH
how
google it
Why is my client missing?
how do you do a only for donators command?
You check if a user is a donor or not
How you check depends on which service you use for donations
hey guys
let filter = m => m.author.id === message.author.id
message.channel.send(`${randomItem1}`).then(() => {
message.channel.awaitMessages(filter, {
max: 1,
time: 10000,
errors: ['time']
})
let filter1 = m => m.author.id === message.author.id
message.channel.send(`${randomItem2}`).then(() => {
message.channel.awaitMessages(filter1, {
max: 1,
time: 10000,
errors: ['time']
})
})
let filter2 = m => m.author.id === message.author.id
message.channel.send(`${randomItem3}`).then(() => {
message.channel.awaitMessages(filter2, {
max: 1,
time: 10000,
errors: ['time']
})
})
let filter3 = m => m.author.id === message.author.id
message.channel.send(`${randomItem4}`).then(() => {
message.channel.awaitMessages(filter3, {
max: 1,
time: 10000,
errors: ['time']
})
})
message.channel.send("<@"+message.author.id+"> "+ m)
});``` i want to wait until the user has put in a message.
After that it will get on to the next filter.
But it doesn't seem to be working
Sa
?
#general-int @earnest phoenix
You await all of the messages at the same time
So if I for example send one message, all of the collectors will collect it
owwwhh.
Also, you shouldn't be using awaitMessages for this, using a single collector is better
I should put a timeout on the other filters
i was told that djs collectors are a bad practice and that i could better await.
All I learned from that above code is that they don't have Syntax highlights on Mobile
collectors are a bad practice if you want to do sequential request-response patterns
yeah that is what i meant. I only wanted the bot to move on to the next message if the user responded.
you have to await everything
1 could work. I just realized collector.next is a thing
not use .then
aha okay.
one collector would work yes, but its more complicated to implement correctly
that's why i implemented it in different collectors
I though that it would be easier.
use the same filter
if filter1 filter2 and filter are the same thing, then why don't you use just 'filter'
why don t they revieu my bot
await .send("question1");
result1 = await .awaitMessages(filter, {max:1, time:10000})
await .send("question2");
result2 = await .awaitMessages(filter, {max:1, time:10000})
yeah i just noticed. Thanks!
Yeah i've done that too! Thank you for the example!
also, if you put errors:[time], then you need to catch it as well
its better to not use the error, and just check if result.size is 0
Aha got it! Thanks, really helped me out a lot!
it takes some time for that. I waited not much than 1 week for mine
but how would i check whether they responded or not?
like, if(result1 ==1){} wouldn't work.
you should pobably make an 'askQuestion' function or something like that
then pass the message and the question to it
so you don't repeat yourself
something like
just make a function called askQuestion with 2 parameters
first one being the message and second a string or something with a question
and just the function return something in the end ig
function askQuestion(message, filter, question) {
send(question)
return awaitMessages(filter, {max: 1, time: 10000})
}
maybe replace send with message.reply
would make more sense if you ask me
but whatever
it's pseudo code
fine
it doesn't need to make sense
just like javascript as a whole
lmao
im trying to hook data from vote api but there was error
i think it happen from authing myself but i dont know how to auth
help please
if(message.author.id !== client.id){ why is this bot still responding to itself?
ah stupid of me!
What in the actual fuck is this. The error prints html code 🤣 I have never ever seen this before.... This is a dbl py error from checking if a user has voted for my bot in the past 12 hours.
Try pasting it
its over discord char limit
a simple check using dblpy causes this error: https://paste.pythondiscord.com/oxufadedex.xml it seems to be a problem with the API not me because my code was working like 4 hours ago and I have not touched anything.
well, the help command worked in js
now in ts it finds the command though it's aliases, but doesn't send them in the embed
hey so i have been watching a tutorial online. They use prompt in javascript, however what is it?
// program to check if the number is even or odd
// take input from the user
const number = prompt("Enter a number: ");```
That's a browser js function
that's only available in the browser, not in node
when you run that function a small popup appears on screen
smol
whera i cn ad new bot
in all browsers
open your browser's dev tools, and type the following: let x = prompt("What time is it?")
and then press enter
then you can check x's value by just typing x and then pressing enter on your kb @eternal osprey
every browser implements their own prompt function
unless you're using some dumb shit like netscape it should work
there u go, np
need halp
export interface Cmd {
name: string;
aliases?: string[];
execute(bot: Client, message: Message, command: Cmd, db: any, lang: any, language: string, prefix: string, args: string[], serverSettings: Object): void;
}
export class botClient extends Client {
commands: Collection<string, Cmd> = new Collection<string, Cmd>();
}
this is what I have for the command collection
when I do gp!help pfp, it shows me the gp!avatar info, it's supposed to since pfp is an alias for avatar
but the available aliases don't show up in the command info
I'm kinda confused
const argsString = args.toString();
const name = argsString.toLowerCase();
command = commands.get(name) || commands.find(c => c.aliases && c.aliases.includes(name));
if (!command) {
message.reply(lang.error.noCommand).catch(err => { console.error(err); });
}
else {
const commandEmbed = new MessageEmbed()
.setColor('#9900ff')
.addFields(
{ name: `${lang.name}`, value: `${command.name}` },
{ name: `${lang.category}`, value: `${lang.command[command.name].category}` },
{ name: `${lang.howToUse}`, value: `\`${prefix}${lang.command[command.name].usage}\`` },
{ name: `${lang.description}`, value: `${lang.command[command.name].description}` },
);
if (!command.aliases) {
message.channel.send(commandEmbed).catch(err => { console.error(err); });
}
else {
const lastEmbed = commandEmbed;
const newEmbed = new MessageEmbed(lastEmbed)
.addFields(
{ name: `${lang.aliases}`, value: `${command.aliases.join(', ')}` },
);
message.channel.send(newEmbed).catch(err => { console.error(err); });
}
}
that's doesn't really sound like a ts issue, but how you implemented the command
gonna do, i was thinking about that too
ikr, therefore I'm confused, don't know where I failed
command = commands.get(name) || commands.find(c => c.aliases && c.aliases.includes(name));``` maybe it's this line
that looks fine
it gets the command if I use the alias
but then at```ts
if (!command.aliases) {
message.channel.send(commandEmbed).catch(err => { console.error(err); });
}
if it does, it'll .addFields() with the aliases info
Ok
maybe it's command here
only gets it's name, but not the aliases
but that command is Cmd type, with my interface
is it because aliases are optional?
how do i show an image if it's even for example?
const number = prompt("Enter a number: ");
let z = ""
if (number % 2 == 0){
if(z == true){
z = "https://www.w3schools.com/js/pic_bulbon.gif"
}
else {
z = "https://www.w3schools.com/js/pic_bulboff.gif"
}
document.write("The number is even." + `${z}`)
}
else{
document.write("The number is not even." + `${z}`)}
```i;'ve got this.
the problem was I looked at aliases as a whole, should've done if(!command.aliases[0]
if there's nothing on [0], there will be nothing on [1] for sure, since I don't do aliases = ['', 'pfp']
so I can do that way to check
you want a pic in the popup?
or in the page?
yeah exactly
so I should make an interface everytime I have a JSON?
but that is html
a JSON?
how can we do a setprefix command?
how am i able to use that in the browser js console>
Just an object that has a fixed structure in general
hmm, lang is a big object with many phrases
write the args to a database. Then read it and set a variable of your prefix to it.
I gave it type any
Ok
636 lines @pale vessel, what about that one?
damn
i've seen that, but how can i use this in the browser console
not sure if you can
maybe this?
you can use [key: string]: any
ah i can use jquery
^o^
Or Record<string, any>
?
is this meant for me or?
no
woah, what's Record?
don't use discord webhooks, they're a different kind of stuff
ah. Yeah i am starting to get into real javascript rather than discordjs.
Basically an object, with typed keys/value pairs. It's the same as [key: string]: any but more handy
But how woud i do it then?
everything is a string there, so
Using the document api
[key: string]: string
im doing java script
Record<string, string>
document.getElementById("someImg").src = "linkTOImage";
You must have already created an <img> tag with the id someImg
You can also create it dynamically with document.createElement and document.append
both for serverSettings and for lang I'm sure, both only have strings
poop ok
owh!
like this ig
for serverSettings I really have to make a interface
const number = prompt("Enter a number: ");
let z = ""
const newDiv1 = document.createElement("div");
const newDiv2 = document.createElement("div");
if (number % 2 == 0){
if(z == true){
z = document.getElementById('newDiv1').src='https://www.w3schools.com/js/pic_bulbon.gif'
}
else {
z = document.getElementById('newDiv2').src='https://www.w3schools.com/js/pic_bulboff.gif'
}
document.write("The number is even." + `${z}`)
}
else{
document.write("The number is not even." + `${z}`)}```it returns me undefined tho
ok now some cloud this is stoping me
One message removed from a suspended account.
One message removed from a suspended account.
what are you trying to do? that doesnt make much sense
One message removed from a suspended account.
lovly
One message removed from a suspended account.
<3
tim is cool, she's right
"prefixMsg": "Our prefix for this server is ",
"notIndicated": "_Not indicated_",
"by": "by ",
"reason": "Reason:",
"sent": "sent!",
"botsNoProfile": "bots have no profiles!",
"help": "Help"
```not everything is like this
was tim ever not cool?
no
"error": {
"cmd": "there was an error when trying to execute that command!",
"noProfile": "you haven't created a profile yet! To create a profile use "
}
```what about these?
what the fuck are you attempting to do?
does anyone know how to eliminate this margin?
😔
what if i dont want to put any
you use js
but it's a bad habit using any
string | object
yeah, that
what if i dont wanna use js
return to monke
okay!
margin: 0
can you use like string | Record<string, string>
it..doesn't work
hmmm
sorry bro, i'm js gang
Any one can help me
may I DM you? cuz my code is pretty long
ok
does that work
are you trying to redirect from client side?
you have to do it from server side, not client
won't
gonna do any, fuck it
redirect if the user is authorized
An error has occurred while validating your input:
Forced themes are only enabled for creators who use custom CSS in their detailed description.
what is must do?
add <style></style> somewhere in your bot detailed description
idk how i must create a site.. how i do that then?
literally do what flazepe said
await
but like
if you're doing it for your own bot
you dont need to fetch lol
you literally just do client.user.displayAvatarURL()
async def antisnipe(ctx):
await ctx.message.delete()
message = input("Enter the message you would like to Send : ")
await ctx.send(message)
await asyncio.sleep(2)
await ctx.delete(message)
dick = await ctx.send(".")
await ctx.message.delete(dick)
await ctx.send("***__Windex's Antisnipe, the best antisnipe around!__***")
I need help, it sends the message, but I want it to delete the new message sent, but it doesn't, it just deletes the command message, but I want it to delete the
"message"
so it'll send "message" but it won't delete "message"
I assume I did something wrong with syntax?
oh
Aight ty
so instead of ctx.message.delete(message) it's just await message.delete()?
yes
ok
Hello
@quartz kindle
Traceback (most recent call last):
File "C:\Users\beast\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 85, in wrapped
ret = await coro(*args, **kwargs)
File "C:\Users\beast\Desktop\Windex.py", line 70, in antisnipe
await message.delete()
AttributeError: 'str' object has no attribute 'delete'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\beast\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 902, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\beast\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 864, in invoke
await injected(*ctx.args, **ctx.kwargs)
File "C:\Users\beast\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\core.py", line 94, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'str' object has no attribute 'delete'```
Client.on("message", message => {
if(message.content.startsWith(prefix + "muted")){
let mention = message.mentions.members.first();
if(mention == undefined){
message.reply("Membre non ou mal mentionné.");
}
else {
message.guild.roles.create({
name: "Muted",
Permissions: 0
})
let role = message.guild.roles.cache.find(x => x.name === "Muted");
mention.roles.add(role);
message.channel.send(mention.displayName + " mute avec succès.")
const embed = new Discord.MessageEmbed()
.setAuthor(`[MUTE] ${mention.user.tag}`, mention.user.displayAvatarURL())
.addField('Utilisateur', mention, true)
.addField('Modérateur', message.author, true)
.addField('Durée', '∞', true)
.setColor("#ff0001")
message.guild.channels.cache.get("811219629854687252").send(embed)
}
}
});
@earnest phoenix come dm
Help me pleas
What's the issue?
pls ping @earnest phoenix for me
are you sure you did .delete() on the variable returned by ctx.send() and not the one returned by input()?
we're not your ping service, if they can't answer then wait until they're available.
message is the input, so I did
await message.delete()
thats not what i said to do
oh
you send the input using ctx.send()
and you save the return value of ctx.send() in another variable
that one is the actual message after it was sent
the input is just text, not a message
await ctx.send(message) is this not correct?
it is correct, but now you need to save the response
like i showed
something = await ctx.send()
this something is now the message that you just sent
remember to await it
So it'd be
await something.delete()```
yes, gotta await both of them
Why don't you pass something to the delete_after kwarg?
Client.on("message", message => {
if(message.content.startsWith(prefix + "muted")){
let mention = message.mentions.members.first();
if(mention == undefined){
message.reply("Membre non ou mal mentionné.");
}
else {
message.guild.roles.create({
name: "Muted",
Permissions: 0
})
let role = message.guild.roles.cache.find(x => x.name === "Muted");
mention.roles.add(role);
message.channel.send(mention.displayName + " mute avec succès.")
const embed = new Discord.MessageEmbed()
.setAuthor(`[MUTE] ${mention.user.tag}`, mention.user.displayAvatarURL())
.addField('Utilisateur', mention, true)
.addField('Modérateur', message.author, true)
.addField('Durée', '∞', true)
.setColor("#ff0001")
message.guild.channels.cache.get("811219629854687252").send(embed)
}
}
});
@umbral zealot tu peux maider ?
yo si tu veux de l'aide, pose ta question
someone already asked you what the question was
interact with actual people that want to help you and stop bugging me personally, I'm working and busy.
oq eu faço?
what do I do @umbral zealot
?
en gros la commands elle marche mes il cree le role mes il mes pas le nom (mute) et il donne pas le role a la personne @umbral zealot
Great, now stop pinging me, and ask in english.
This is a code for deleting messages. If you wanna use it, use it. I just want a command which you can define how many messages you want to delete
client.on('message', message => {
if(message.content === '${prefix}clear') {
message.channel.bulkDelete("number of messages you want to delete")
const clearEmbedSuccesful = new Discord.MessageEmbed()
.setColor('#51FF00')
.setTitle('Succesful Command')
.addField('Messages deleted succesfuly!', `${message.size} deleted!`)
message.channel.send(clearEmbedSuccesful)
.then(msg => {
msg.delete({timeout: 4000})
})
}
})```
depends on the programming language and discord library you're using
you can also just use the bot invite link
python discord.py
len(<client>.guilds)?
is it sharded ?
nope
then do what flaxepe said
please stop bothering her
shine speak, wait a moment waiting for information from the mentioned user
help - me
mine was in 3 guilds someday
it just got verified like 9 hours ago i didnt even tell people to add it how is it alr in 16 lol
we're not that bot's support server, we can't help you with that
That's a good start
Also if the growth is too much You'll get verification problem with Discord when it's in 75+ servers
#general-int for other langs
i know about that
i just need a passport right to verify
i mean
get verified
and is being 18+ required ?
No
no
okay
I'm 15 and still got verified
im 14
ya
|| kohai kun ||
The only age requeriment on discord: be minimun 13 years old, it's on discord ToS
lmao
13
i started making my bot like 3 months ago
ok
My DOB wasn't even the same on with my passport
lmao
Still they verified me
lel
So you should be fine
ill just go and get my bot in 75+ servers xd
Nooooooooooo
If many servers have the same user set They'll fuq you up
na na
that isnt the case
also i didnt do embeds for the bot need to work on that lol
it looks so bad rn
I mean if you use less embeds, it looks definitly better on mobile
This is official
member count has absolutely no impact on verification.
yes
well that makes it ezzr
Verification is a chore not a benefit, it's required if your bot grows and offers no significant advantage. There is literally no point to taking steps yourself to get verified, just let your bot grow organically.
The only thing you'll get by trying to force bot growth is that your bot will be denied for growth that's too fast ("suspicious") or owned by the same people/alts ("inorganic")
Exactly.
Let it grow, let it grow, can't verify anymore... let it grow, let it grow, don't advertise your bot no mooore.
lol
is that the frozen song? lmao
anyway we can get number of servers a client is in with its id
yea it is
O ok
only if you use oauth2
yes
wait Erwin,
You're supposed to solve our problems
Not create them yourself
i mean, i know a bunch about top.gg api after i created the typings, but still, not nearly enough to debug this
it might
deleting the code where the api is used is the solution, no more errors after that
might be on their end then
oh shit
its been happening quite a few times
yeah everytime i try to post stats
hmmm
how often do you post stats?
Do you use the old module ir the new one ?
Wait I have the same error @opal plank
hmmmm i see there are issues, prob related, but its a different one
yeah its server wide than
thats all i needed
so many errors recently
Yeah lots of updates
oof
Have you tried reading
ohk
^
helpp
this should have worked, might be discord.js issue
What do you need?
try setPresence()
wait, it takes at least a week
huh?
ohnohh
if it still doesn't work, provide the status to your ClientOptionsjs new Client({ presence: { status: "idle" } });
u guys know tango bot?
no
ohkw
are you using a crossOrigin policy of anonymous
hm. I think they do something with non https
might need an ssl cert
easy to get one tho
The api cant get the user info from the url
CORS man
true
@modest maple what should i do?
easiest way to test stuff is to setup a reverse proxy so you're pointing to the same address still
Client#guildMemberUpdate fires even when the user change their username right?
But when i console log the oldMember and the newMember and change my username, It would show the username that's changed rather than showing the old username and then the new username. Any idea to overcome this? 🤔
hmm yeah
Are you sure you're logging different things and not references of the same GuildMember object? Have you also tried the client user update event to see if the same issue persists?
does anyone know how to change an image size if the user is on mobile for CSS?
and yes it's about my bot's top.gg page
module.exports = async (client, oldMember, newMember) => {
console.log(oldMember.user)
console.log(newMember.user)
// Rest of the code
yup
Doesn't it go to user update?
If you want responsive image size, you can do
class {
width: 100%;
height: auto;
}
replace class with whatever you're targeting
try .on("userUpdate")
oh i use a different way for the events tim.
I have a event folder and bind the event files to the client.
it didn't worked well sorryy
then name it userUpdate.js
User object doesn't have user property doe
well, that's the way to resize things, try different values and percentages. Search google for your issues as well. W3Schools has a lot of css help
it fixed on mobile but it's HUGE on desktop
client.on('userUpdate') ?
yes
Thats an event?
it would still fire it under guildMemberUpdate.js
when i do
console.log(oldMember)
console.log(newMember)
it would show up, but by the time i log it it would be same for both 🤔
yes
w3schools is down
Never knew that one lol
bullshit it's down. I was just looking at it
Hlw
Oh ok
FUCK
Then your firewall might be blocking it
try running the windows network diagnostic like it suggests
because userUpdate doesnt actually exist in the discord api. its a discord.js creation. you receive a guildMemberUpdate, and the user data from it is emitted as a separate userUpdate event, which happens to happen before the processing of the member data, so by the time the member event is emitted, the user data was already updated
its saying "not using DNS server"
@lament rock if you want to talk this over voice, im in general vc
Ah so i would need to userUpdate.js here.. but how can i log it? Like i want the bot to send saying the username was changed to a log channel. 🤔
No. I'm out walking. Not available
sorry ;-;
w3schools working fine for me
H O W
just do it with the userUpdate
and check oldUser.username vs newUser.username
i need a vpn?
probably try restarting your router ig lul
i opened vpn and it opened
yes yes ik... But i won't get the Guild object with this right?
i guess w3schools.com is illegal here?
w3schools isn't illegal, it's just crap
lmao
nope, not the guild object
check solution 1 and 2
you can also try ipconfig /flushdns from cmd
but im pretty sure solution 2 is what will fix it
so ig i won't be able to send a log message whenever the user changes their username(?)
didn't worked :/
then do solution 2
one option is to use some custom handling, another is to use the raw events
do you have the presences intent?
raw events would probably be good. Assuming you can get the current cached state before djs processes it. Might wanna duplicate the data in case djs mutates the state and you have to do something async
so you have to use the raw event for both guildMemberUdate and presenceUpdate
this one
Hmm alrighty... I'll look into it.
Thank you 👍
module.exports = raw => {
if(raw.t === "GUILD_MEMBER_UPDATE" || raw.t === "PRESENCE_UPDATE") {
if(raw.d.user.username && raw.d.user.username !== client.users.cache.get(raw.d.user.id).username) {
// do something with raw.d.user.username and raw.d.guild_id
}
}
}
omg the mobile one worked!
thats solution 1
do solution 2
adapter settings, change ipv4 properties and put a custom dns
8.8.8.8 for google
1.1.1.1 for cloudflare
both are better than what your internet provider gives you by default
thats the cloudflare one
if that doesnt work, try the google one
8.8.8.8
8.8.4.4
if this error happens again, go back there and try cloudflare again
sometimes these dns servers go down temporarily, then back up
isp dns servers are shit
imagine not running your own DNS server
i prefer 1.1.1.1 the resolve times are usually a bit quicker
cf goes down sometimes tho and that's alright. Caching dns queries are good tho
google also goes down some times
if you got a home server you could run your own DNS server that requests DNS entries directly from the register
sure will be slow first until the common stuff is cached
not everyone has a nas
you can run it on a RPI
I want a pi
got a RPI 3B+ that does its job now for about 3 years
or until you need more memory
it runs a Pihole, that doesnt need much ram. if i need more Ram i have my Self Build NAS
setup a small linux machine as both router and dns server
would like to run a PF Sense box, but my LAN network doesnt allow it. and i cant get a 2nd Cable throu the conduit
and i dont really want to run a Server in the Basement, its a really old Basement, it survived atleast 1 world war maybe even 2
well its quite hard to keep a server down there clean, you can try to get rid of the dust, until the Lead Based paint gives up and more dust comes up
also for a Buttload of requests should i use Express or a Websocket?
what kind of requests?
Discord bot to an Tensorflow instance. call on pretty much every message event
isnt tensorflow slow af?
yea, but i want to look into having mutiple instances with a loadbalancer running, also the stuff i do usually is at max around 100-200ms
thx
you should be doing that server-side
how do u get a bot developer role in here...?
uhm, develop a bot, and post it in DBL
i did
It needs to be accepted
is it verified?
wait
if not instantly
you can't unfortunately
ohokay! thx! :)
when it gets approved you'll be notified in #logs
I think, don't remember
you'll know when the time comes, dw
yeah PM is for sure
oh thx!
how can i make that it will return if there is more than 1 args
i tried and it didnt work
i did message.content.args.length > 1
message.content is a string
It depends on how you've set up your command handler
if args is an array with your arguments, you'd check with args.length > n
race condition goes Brrrt https://i.s8s.app/ojMT-rS9
what are you doing that needs to send every single message to tensorflow?
a discord bot that learns from other discord bots and self writes its own commands to overtake the discord bot community with paid features and exp commands
wat
yes
my teacher was right
One day programs will rewrite themselves while learning until full world domination
more like asynchronous go brrrr
determining if a Sended message is Toxic, Insult, Sexual harassment and some other stuff. Got it currently directly integrated into a Bot, but i have the feeling it will bog down the entire Bot bcs of Tensorflow. so i want to run it as a Backend API on its own process that can scale itself with Worker nodes
including content, embed, image, link, everything?
ah
well that way you can at least ignore messages with no content
its already slightly better than all messages xD
yea i will filter stuff out, like command messages and empty messages, but it will be still a buttload of stuff
@lusty quest my slash command API does so much shit in the background like that lol
lol
is there any way through which i can make a timeout for top.gg api in case it fails to check vote for the user, try/except doesnt seems to be working. i use python
hey guys
umm
so i have an ilike query, how would i pass query parameters using pg client?
ilike '%$1%' and then db.query(query, [name])
?
this didnt work
are you talking about regex?
LIKE $1, ["%abc%"]
this also didnt work
how did you do it?
what's the difference between ts if(/*some condition*/) return /*some action*/; //logic and ```ts
if(/some condition/) { return /some action/ }
else { //logic }
the syntax.. but logically, absolutely none
cuz TS says not every path returns a value
there might be some tiny tiny tiny performance boosts by omitting the else but that's so small it's irrelevant
so I might do else more often to avoid that warning
or to use else without return
you still have to return in the else
if you expect a return value you do
but I don't
thonk
cuz it's a function to just answer in chat
can you show the method
to work as a command and answer
example: ```ts
export function execute(bot: undefined, message: Message, command: undefined, db: undefined, lang: Record<string, string | any>, language: undefined, prefix: undefined, args: string[])
then the logic inside
try {
command.execute(bot, message, command, db, lang, language, prefix, args, serverSettings);
}
catch (err) {
console.error(err);
message.reply(lang.error.cmd);
}
```in index
if your type is a function, you shouldn't return anything inside of it, you should only use return if you want to break the execution and return out of the method
i.e only return;
well, what happens if it reaches the end of the command?
should close the process
without returns
How can i do in the bot status he count all the members that are using the bot?
client.users.cache.size iirc
uh.. this isn't discord based.. it's javascript based
i have a function that ALMOST clones a class how I want it to(no, lodash.clonedeep does less)
I want to COMPLETELY clone a class(by extension any javascript cloneable thing(but for now ill focus on cloning a class))
take Array for example.. if I clone it(with my function), lots of things get cloned.. the __proto__ gets cloned.. the things inside, the string tags, the functions.. it's beautiful
EXCEPT Array.constructor==Function() while clonedArray.constructor==cloneOf Object()
if anyone thinks they can solve i'll send code(but it's a bit big)
15 lines maybe?
eh i'll send anyway
First off, why do you want to deep clone an object? What do you need that for
This channel is for chatting about bot development
That doesn't work
it really isn't an x y problem if that's what ur REALLY asking
i dont think whatever ur doing is necessary
how do i check quick.db is registering input? idk if its picked up when i set the welcome channel after i do the command
"necessary"? discord isn't necessary.. also a clone on that level should be able to completely run code in a safe "virtual" setup and a lot of other fun things i cant put words to rn
theres a better way to do whatever ur trynna do
you want all users the bot has? or your main server has?
All users
at startup the users aren't cached yet
so you can't get them all as soon as you bot starts
this isnt for ONE environment(let's say chrome window where I would have extremely specific stuff to roughly imitate parts of the browser)
You need to put that code in the ready event
I did that
if a complete clone down to the protos of things can be fully done, you would be able to clone environments(like have a shadow browser tab, or a shadow nodejs server)
the users are cached at ready
ppl have to send one message at least after that to get in the counter xD
ok.. i was just checking to see if there was an obvious answer :{
ig i'll ask on stackoverflow then
it doesnt really work like that
The ready event gets emitted after the bot caches everything - so you have access to everything in your ready event
hmm
It work! Thanks!
i got a error
const peopleReactedBot = embedSent.reactions.cache.get("🎉").users.fetch();
my bot said
An unknown error happened during th draw of the giveaway test : TypeError: Cannot read property 'cache' of undefined
hes delusional
Kore ga Requiem da!
out of all the people here why do i get the ping?
how?? i need the translate :c
ahh ok. but the screenshot ive made where only like 10 prints. out of 1k ive made for testing the loadbalancer
btw it isn't JA, it's JP @latent heron
i got a error
const peopleReactedBot = embedSent.reactions.cache.get("🎉").users.fetch();
my bot said
An unknown error happened during th draw of the giveaway test : TypeError: Cannot read property 'cache' of undefined
JA you said?
ja is the language code, jp is the country code
ja Japanese
ja-JP Japanese (Japan)
JAlapeño
pornhub is responsible for alot of that confusion tbh
just like
GB - German
DE - Germany
rrrrrrrrrrrrrralapeño
wait what
Is GB german?
DE stands for Deutschland
yeah
it's wrong actually
de German
de-AT German (Austria)
de-CH German (Switzerland)
de-DE German (Germany)
de-LI German (Liechtenstein)
since when is gb for german?
how can i just not cache anything
and not get any errors
like any erros are just ignored?
like command not found etc (DPY)
depends on ISO @outer perch
REEEEEEEEEEEE
lmao
it's really bad
I think most people still use ISO-639
-1 to be specific
but others now use -2 or -3
you mention like 3 entirely diffrent things in that one sentence
no gb is great britain
on wikipedia it says unassigned
in what language?
evil man
yes, wikipedia is a reputable source
dpy
lmao you do
Great Britain.. aka English UK
just so i can access objects
like fetch_x
bc i dont want the bot to DO anything
you're a bit late to the convo bud
idc
lol ok
GB is the country code, not the language code
litterally pointless exercise
@modest maple bc i will still need to use some of the bots functionality
but i wont need caching for that
just use ipc then with your actual bot
the language code for germany is DE in -1 and GER/DEU in -2 and -3
well yes, like i said it's ISO specific
d.py becomes pretty much in-operable without it's standard cache of guilds
you can disable all your intents and it'll disable all cache
but then you wont be able todo anything cuz yano
you dont subscribe to that
its not
it is
Please no
help pls
i need to
- be able to send messages
- be able to use like fetch_whatever
but i wont need any cache for that
so... just use raw http requests
alr then
instead of logging n amount of times per worker
🌐 A discord.py extension for inter-process communication. - Ext-Creators/discord-ext-ipc
this is the thing imma use
thats IPC
you dont run a seperate bot instance
it lets your website interact with the bot in a more high level way using the events system
im so confused
unconfuse yourself
YES
i know
so thats good?
cuz i dont want the bot instance for the dashboard to use like 500mb memory lol
thats not how it works....
you never run another bot instance on the web server
the webserver sends a message to your bot
the bot responds to said message
thats nothing like what you said lmao
and another is the bot which is responding to the webservers request
rest > ipc
so do i need to do anything or will it already not cache?
@modest maple
sorry for the confusion
thats what i mean
clarified
mhm
and communicate with the main bot instance
you do not mess with cache n shit
your just use your main bot
@modest maple but...
no buts
my "main" bot is clusters
its not one main bot
each cluster is a different proccess
with specific shards assigned to it
Which one of your bots are over 15k guilds 
@modest maple dude shh
me when i clustered at 20 guilds
its not that tho
its cuz WHEN the bot gets to a lot of guilds
then ill implement the system
for now i only use one cluster
you litterally dont need to cluster unless your in atleast 15k servers
@modest maple its not a cluster rn
ok
i KNOW
its not clustered
but it supports the cluster
the system supports clustering
Talk about preemptive
lol
my bot is clustered too
so i would like to be able to do it supporting clustering
onyl at 2k
cuz i dont wanna deal with porting or adapting code further down the line
^^^^
its clustered but only using 2 shards
that's why you should do it at -1 guilds
so its only 1 cluster, but it dynamically spawns more as needed
bro ngl judging from your confusion in prior conversations your code is gonna need to be re-written wayyy before you need clustering
how do i get more information about a already registered domain name?
NO
my spagetti code is my child
dnslookup

whois lookup
lol
ok so what DO i do
what can i use
learn things
?
wym
and learn best programming practices
i dont even know what was the question tbh
not you, to 0Exe
did you just ignore our conversation just now
was it IPC related? if so i can give a help
I've been trying to get info about .al domain names but i just can't
yes it is
hello, i wanted to report an issue that i have been facing lately when visiting the site, the picture below demonstrates my issue
ok lets start over
what exactly you trying to accomplish?
i want my dashboard to be able to use bot resources
oh ok
CAN someone help me with this crap_
and so on
keep in mind i actually managed to ddoss twitch accidently by spawning over 2k shards and connecting them all within 40 seconds, so take what i say with a grain of salt 
thanks for the information, because i was the only one facing this therefore it seemed strange to me
lol
you're not but sure
so basically i thought i would run a bot instance FOR the dashboard
site rn -> 
Anyone who can help me with this? https://prnt.sc/1003o3e It says Discord has blocked the access for the bot joining my server.
DO NOT DO THAT
i'd recommend using a microservice to pool all your data from all your clusters or use prometheus instead
@modest maple what do i do then?
have each instance have a prometheus and a job assigned
huh
actually, no scratch that
even luka though prometheus was overkill
i need to stop recommending it for people
okay, lets go the normal route
this we're getting slightly into the realms of too complicated for them
That looks like an error about discord.js not being reachable, not a problem about the bot being blocked
IPC, right
what you can do is spawn them all with Fork
What's Discord js?
🌐 A discord.py extension for inter-process communication. - Ext-Creators/discord-ext-ipc
this is what im using
that will create an IPC pipe between the spawner and the forked process
you can use process.send()
wot
spaghett




