#development

1 messages · Page 1599 of 1

fathom frost
#

I just dont know how to do a lot of things XD

#

Now stop putting me down

nocturne peak
#

i dont really think i am

#

i litreally spoonfed you the code

fathom frost
#

ok ty for that

#

but i dont want drama

nocturne peak
#

where did drama come into this lmfao

fathom frost
#

so we will give a virtual hug and be online strangers again

#

Deal?

nocturne peak
#

uh

#

ima dip

#

take a handshake

#

bye

fathom frost
#

Eh ok

#

byeeeee

earnest phoenix
#

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

onyx hare
quartz kindle
#

await message.guild.members.fetch(args[0])

slender wagon
#

how many messages can a collector collect on d.js

cinder patio
#

2^24

slender wagon
#

ty

limpid topaz
#

npm init doesn’t work for me

#

It says

#

npm isn’t recognised

cinder patio
#

you have to add the npm executable to PATH

limpid topaz
#

how

cinder patio
#

google it

limpid topaz
#

Ok

#

Alright found it

#

Thanks for help

exotic portal
#

Why is my client missing?

steel arch
#

how do you do a only for donators command?

cinder patio
#

You check if a user is a donor or not

#

How you check depends on which service you use for donations

eternal osprey
#

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

earnest phoenix
#

Sa

eternal osprey
crimson vapor
cinder patio
#

You await all of the messages at the same time

earnest phoenix
#

Nerelisin iz

#

Siz

cinder patio
#

So if I for example send one message, all of the collectors will collect it

cinder patio
#

Also, you shouldn't be using awaitMessages for this, using a single collector is better

eternal osprey
#

I should put a timeout on the other filters

eternal osprey
cinder patio
#

That's one way to do it, but it's not a good one

#

Where did you hear that from

near stratus
#

All I learned from that above code is that they don't have Syntax highlights on Mobile

quartz kindle
#

collectors are a bad practice if you want to do sequential request-response patterns

copper cradle
#

why are you declaring 3 filters that are all the same

#

just use one ffs

eternal osprey
quartz kindle
#

you have to await everything

lament rock
#

1 could work. I just realized collector.next is a thing

quartz kindle
#

not use .then

eternal osprey
quartz kindle
#

one collector would work yes, but its more complicated to implement correctly

eternal osprey
#

that's why i implemented it in different collectors

#

I though that it would be easier.

copper cradle
#

use the same filter

#

if filter1 filter2 and filter are the same thing, then why don't you use just 'filter'

junior fjord
#

why don t they revieu my bot

quartz kindle
#
await .send("question1");
result1 = await .awaitMessages(filter, {max:1, time:10000})
await .send("question2");
result2 = await .awaitMessages(filter, {max:1, time:10000})
eternal osprey
#

yeah i just noticed. Thanks!

eternal osprey
quartz kindle
#

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

eternal osprey
#

Aha got it! Thanks, really helped me out a lot!

outer perch
eternal osprey
#

but how would i check whether they responded or not?

#

like, if(result1 ==1){} wouldn't work.

cinder patio
#

Check if there's a message in the collection

#

result2.size

#

for example

copper cradle
#

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

marble juniper
#

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

copper cradle
#
function askQuestion(message, filter, question) {
    send(question)
    return awaitMessages(filter, {max: 1, time: 10000})
}
marble juniper
#

maybe replace send with message.reply

#

would make more sense if you ask me

#

but whatever

copper cradle
#

it's pseudo code

marble juniper
#

fine

copper cradle
#

it doesn't need to make sense

marble juniper
#

just like javascript as a whole

copper cradle
#

at all

#

ye lmao

marble juniper
#

typings in js? what are those

#

I can do '1' == 1 and its gonna be true

copper cradle
#

lmao

analog tinsel
#

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

eternal osprey
#

if(message.author.id !== client.id){ why is this bot still responding to itself?

pale vessel
eternal osprey
#

ah stupid of me!

leaden crystal
#

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.

blazing sage
#

Try pasting it

leaden crystal
blazing sage
#

Oh LOL

#

not here, I meant in a .html file

#

But ask sm1 else

pale vessel
#

collected is a collection of messages

#

try collected.first().content

leaden crystal
misty sigil
#

It’s a problem with api

#

you should (generally) use webhooks to store votes

outer perch
#

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

eternal osprey
#

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: ");```
cinder patio
#

That's a browser js function

copper cradle
#

that's only available in the browser, not in node

eternal osprey
#

aha got it!

#

Thanks!

copper cradle
#

when you run that function a small popup appears on screen

outer perch
#

smol

earnest phoenix
#

whera i cn ad new bot

eternal osprey
#

hmm, but is that in google chrome?

#

Or did they open a live server?

cinder patio
#

in all browsers

copper cradle
#

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

cinder patio
#

every browser implements their own prompt function

copper cradle
#

unless you're using some dumb shit like netscape it should work

eternal osprey
#

owh okay let me try!

#

holy moly that worked!

#

thanks!

copper cradle
#

there u go, np

outer perch
#

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

pale vessel
#

serverSettings: Object hmm

#

you should make an interface for it

outer perch
#
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); });
  }
}
cinder patio
#

that's doesn't really sound like a ts issue, but how you implemented the command

outer perch
outer perch
#
command = commands.get(name) || commands.find(c => c.aliases && c.aliases.includes(name));``` maybe it's this line
cinder patio
#

that looks fine

outer perch
#

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

solemn leaf
#

Ok

outer perch
#

only gets it's name, but not the aliases

#

but that command is Cmd type, with my interface

#

is it because aliases are optional?

eternal osprey
#

how do i show an image if it's even for example?

outer perch
eternal osprey
#
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.
outer perch
outer perch
# outer perch

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

outer perch
#

or in the page?

eternal osprey
#

yeah exactly

outer perch
eternal osprey
#

but that is html

pale vessel
#

a JSON?

earnest phoenix
#

how can we do a setprefix command?

eternal osprey
#

how am i able to use that in the browser js console>

pale vessel
#

Just an object that has a fixed structure in general

outer perch
eternal osprey
outer perch
outer perch
pale vessel
#

damn

eternal osprey
outer perch
#

maybe this?

pale vessel
#

you can use [key: string]: any

eternal osprey
#

ah i can use jquery

outer perch
umbral zealot
#

eww don't use jquery

#

you probably don't need it.

cinder patio
#

Or Record<string, any>

sly breach
eternal osprey
cinder patio
#

no

outer perch
lyric mountain
# sly breach ?

don't use discord webhooks, they're a different kind of stuff

eternal osprey
cinder patio
#

Basically an object, with typed keys/value pairs. It's the same as [key: string]: any but more handy

eternal osprey
#

But how woud i do it then?

outer perch
#

everything is a string there, so

cinder patio
#

Using the document api

outer perch
#

[key: string]: string

sly breach
#

im doing java script

pale vessel
#

Record<string, string>

sly breach
#

but im trying to add my server to top.gg

#

with a web hook

cinder patio
lyric mountain
#

webhooks are for webserver processing

#

not for channel webhooks

cinder patio
#

You can also create it dynamically with document.createElement and document.append

outer perch
sly breach
outer perch
#

for serverSettings I really have to make a interface

eternal osprey
#
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
sly breach
#

ok now some cloud this is stoping me

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
sage bobcat
#

One message removed from a suspended account.

sly breach
#

lovly

sage bobcat
quartz kindle
#

<3

outer perch
#

oh wait

#

Record<string, string> won't work

misty sigil
#

tim is cool, she's right

outer perch
#
"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
crimson vapor
#

was tim ever not cool?

misty sigil
#

no

outer perch
#
"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?
crimson vapor
#

what the fuck are you attempting to do?

pale vessel
#

ok just put any

#

lol

vernal moth
#

does anyone know how to eliminate this margin?

outer perch
misty sigil
#

what if i dont want to put any

pale vessel
#

you use js

outer perch
#

but it's a bad habit using any

quartz kindle
#

string | object

outer perch
misty sigil
pale vessel
#

return to monke

misty sigil
#

okay!

quartz kindle
pale vessel
#

can you use like string | Record<string, string>

vernal moth
pale vessel
#

sorry bro, i'm js gang

quartz kindle
#

show code

outer perch
#

Record<string, string | Record<string, string>>

#

xD

wintry terrace
#

Any one can help me

vernal moth
#

wait no sorry

#

that was way too long

vernal moth
quartz kindle
#

ok

pale vessel
quartz kindle
#

you have to do it from server side, not client

outer perch
outer perch
wintry terrace
earnest phoenix
#

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?

pale vessel
#

add <style></style> somewhere in your bot detailed description

earnest phoenix
#

idk how i must create a site.. how i do that then?

quartz kindle
#

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()

smoky thorn
#
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?

quartz kindle
#

something = await ctx.send()

#

await something.delete()

smoky thorn
#

oh

#

Aight ty

#

so instead of ctx.message.delete(message) it's just await message.delete()?

quartz kindle
#

yes

smoky thorn
#

ok

earnest phoenix
#

Hello

smoky thorn
#

@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'```
earnest phoenix
#
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

smoky thorn
earnest phoenix
#

pls ping @earnest phoenix for me

quartz kindle
umbral zealot
smoky thorn
quartz kindle
#

thats not what i said to do

smoky thorn
#

oh

quartz kindle
#

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

smoky thorn
#

await ctx.send(message) is this not correct?

quartz kindle
#

it is correct, but now you need to save the response

#

like i showed

#

something = await ctx.send()

smoky thorn
#

Ah

#

I see I see

quartz kindle
#

this something is now the message that you just sent

copper cradle
#

remember to await it

smoky thorn
#

So it'd be

await something.delete()```
copper cradle
#

kinda

#

something = await ctx.send

quartz kindle
#

yes, gotta await both of them

smoky thorn
#

oh ye

#

but alr

#

ty

earnest phoenix
#

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 ?

umbral zealot
#

yo si tu veux de l'aide, pose ta question

umbral zealot
earnest phoenix
umbral zealot
#

interact with actual people that want to help you and stop bugging me personally, I'm working and busy.

earnest phoenix
#

oq eu faço?

earnest phoenix
#

?

#

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

umbral zealot
#

Great, now stop pinging me, and ask in english.

amber quiver
#

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})
    })
  }
})```
rocky pulsar
#

hi

#

how do i see

#

my bots server count

umbral zealot
#

depends on the programming language and discord library you're using

pale vessel
#

you can also just use the bot invite link

pale vessel
#

len(<client>.guilds)?

near stratus
rocky pulsar
earnest phoenix
near stratus
#

then do what flaxepe said

earnest phoenix
#

what do I do @umbral zealot
?

pale vessel
#

please stop bothering her

rocky pulsar
#

thanks for the help

#

guys

#

its in 16 guilds pog

earnest phoenix
# earnest phoenix

shine speak, wait a moment waiting for information from the mentioned user

#

help - me

near stratus
rocky pulsar
#

it just got verified like 9 hours ago i didnt even tell people to add it how is it alr in 16 lol

umbral zealot
near stratus
rocky pulsar
#

i just need a passport right to verify

#

i mean

#

get verified

#

and is being 18+ required ?

glossy spoke
#

No

near stratus
#

no

rocky pulsar
#

okay

near stratus
#

I'm 15 and still got verified

rocky pulsar
#

im 14

glossy spoke
#

ya

near stratus
glossy spoke
rocky pulsar
#

lmao

slender thistle
#

13

rocky pulsar
#

i started making my bot like 3 months ago

earnest phoenix
near stratus
#

My DOB wasn't even the same on with my passport

near stratus
#

Still they verified me

rocky pulsar
#

lel

near stratus
#

So you should be fine

rocky pulsar
#

ill just go and get my bot in 75+ servers xd

near stratus
rocky pulsar
#

y not

#

i know i cant spam servers

#

i will add it to servers above 100+ members

near stratus
#

If many servers have the same user set They'll fuq you up

rocky pulsar
#

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

small tangle
#

I mean if you use less embeds, it looks definitly better on mobile

near stratus
umbral zealot
rocky pulsar
#

oh

#

so it just has to be

#

owned by

#

different people

#

right ?

umbral zealot
#

yes

rocky pulsar
#

well that makes it ezzr

umbral zealot
#

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")

rocky pulsar
#

oh

#

ok

#

i wont tell people to add it then

#

let it grow

#

D:

umbral zealot
#

Exactly.

#

Let it grow, let it grow, can't verify anymore... let it grow, let it grow, don't advertise your bot no mooore.

rocky pulsar
#

lol

quartz kindle
#

is that the frozen song? lmao

stuck pike
#

anyway we can get number of servers a client is in with its id

quartz kindle
#

you mean a user?

#

nope

stuck pike
stuck pike
quartz kindle
#

only if you use oauth2

stuck pike
#

hm to authorize

#

got it

quartz kindle
#

yes

opal plank
near stratus
#

wait Erwin,
You're supposed to solve our problems
Not create them yourself

opal plank
#

i mean, i know a bunch about top.gg api after i created the typings, but still, not nearly enough to debug this

quartz kindle
opal plank
#

it might

earnest phoenix
#

deleting the code where the api is used is the solution, no more errors after that

quartz kindle
#

its 5xx, its server side

#

also someone else was having that issue as well

opal plank
#

might be on their end then

#

oh shit

#

its been happening quite a few times

#

yeah everytime i try to post stats

#

hmmm

quartz kindle
#

how often do you post stats?

opal plank
#

once

#

erm

#

every hour

#

every single request failed

near stratus
#

Do you use the old module ir the new one ?

opal plank
#

what?

#

also isnt Time-out a typo?

pale vessel
near stratus
#

Wait I have the same error @opal plank

opal plank
#

hmmmm i see there are issues, prob related, but its a different one

#

yeah its server wide than

#

thats all i needed

cinder patio
#

so many errors recently

umbral zealot
#

Yeah lots of updates

quartz kindle
#

so yeah

opal plank
#

oof

delicate zephyr
#

@opal plank yea it's fucking DBL stats too

#

Reee

misty sigil
glossy spoke
#

Yo

pale vessel
#

Have you tried reading

earnest phoenix
#

not working

pale vessel
#

You're looking for setStatus()

#

setPresence() takes an object

earnest phoenix
#

client.user.setStatus("idle");

#

same

#

issue

glossy spoke
#

dude

#

Read the docs

earnest phoenix
#

ohk

deep minnow
#

helpp

pale vessel
glossy spoke
pale vessel
#

try setPresence()

small tangle
#

wait, it takes at least a week

glossy spoke
#

huh?

deep minnow
pale vessel
small tangle
deep minnow
#

u guys know tango bot?

earnest phoenix
#

no

deep minnow
#

ohkw

wintry terrace
#

Help

lament rock
#

are you using a crossOrigin policy of anonymous

wintry terrace
#

I'm using it to fetch if the user is authorized or not

lament rock
#

hm. I think they do something with non https

#

might need an ssl cert

#

easy to get one tho

cobalt spruce
#

what's rong?

wintry terrace
modest maple
#

CORS man

cobalt spruce
wintry terrace
#

@modest maple what should i do?

modest maple
#

easiest way to test stuff is to setup a reverse proxy so you're pointing to the same address still

wise umbra
#

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? 🤔

empty vault
#

hmm yeah

lament rock
#

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?

vernal moth
#

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

wise umbra
earnest phoenix
#

Doesn't it go to user update?

lament rock
wise umbra
#

oh i use a different way for the events tim.
I have a event folder and bind the event files to the client.

vernal moth
earnest phoenix
#

User object doesn't have user property doe

lament rock
#

02shrug 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

vernal moth
zenith terrace
quartz kindle
#

yes

zenith terrace
#

Thats an event?

wise umbra
#

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 🤔

quartz kindle
#

yes

zenith terrace
#

Never knew that one lol

lament rock
#

bullshit it's down. I was just looking at it

golden steeple
#

Hlw

quartz kindle
lament rock
zenith terrace
#

Oh ok

golden steeple
#

FUCK

lament rock
#

Then your firewall might be blocking it

vernal moth
#

:(

#

h o w

lament rock
#

try running the windows network diagnostic like it suggests

quartz kindle
vernal moth
#

@lament rock if you want to talk this over voice, im in general vc

wise umbra
#

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. 🤔

lament rock
#

No. I'm out walking. Not available

vernal moth
wise umbra
#

w3schools working fine for me

vernal moth
#

H O W

quartz kindle
#

and check oldUser.username vs newUser.username

vernal moth
wise umbra
#

probably try restarting your router ig lul

vernal moth
#

i opened vpn and it opened

wise umbra
vernal moth
umbral zealot
#

w3schools isn't illegal, it's just crap

vernal moth
#

lmao

quartz kindle
quartz kindle
#

check solution 1 and 2

vernal moth
#

oh ok

#

thx

quartz kindle
#

you can also try ipconfig /flushdns from cmd

#

but im pretty sure solution 2 is what will fix it

wise umbra
#

so ig i won't be able to send a log message whenever the user changes their username(?)

vernal moth
quartz kindle
#

then do solution 2

quartz kindle
#

do you have the presences intent?

wise umbra
#

yes

#

i have it enabled

lament rock
quartz kindle
#

so you have to use the raw event for both guildMemberUdate and presenceUpdate

vernal moth
wise umbra
#

Hmm alrighty... I'll look into it.
Thank you 👍

quartz kindle
#
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
    }
  }
}
vernal moth
#

omg the mobile one worked!

quartz kindle
#

do solution 2

#

adapter settings, change ipv4 properties and put a custom dns

vernal moth
#

is that solution 2?

#

oh

quartz kindle
#

8.8.8.8 for google
1.1.1.1 for cloudflare

#

both are better than what your internet provider gives you by default

vernal moth
#

well

quartz kindle
#

thats the cloudflare one

#

if that doesnt work, try the google one

#

8.8.8.8
8.8.4.4

vernal moth
#

omg it worked

#

tyyy

quartz kindle
#

if this error happens again, go back there and try cloudflare again

#

sometimes these dns servers go down temporarily, then back up

lament rock
#

isp dns servers are shit

lusty quest
#

imagine not running your own DNS server

vernal moth
#

I was using 1.1.1.1 before

#

not the 8.8.8.8

quartz kindle
#

both are good

#

but sometimes they fail

lusty quest
#

i prefer 1.1.1.1 the resolve times are usually a bit quicker

lament rock
#

cf goes down sometimes tho and that's alright. Caching dns queries are good tho

quartz kindle
#

google also goes down some times

lusty quest
#

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

lament rock
#

not everyone has a nas

lusty quest
#

you can run it on a RPI

lament rock
#

I want a pi

lusty quest
#

got a RPI 3B+ that does its job now for about 3 years

lament rock
#

or until you need more memory

lusty quest
#

it runs a Pihole, that doesnt need much ram. if i need more Ram i have my Self Build NAS

quartz kindle
#

setup a small linux machine as both router and dns server

lusty quest
#

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

lament rock
#

as long as you keep it clean

#

could probably survive a third

lusty quest
#

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?

quartz kindle
#

what kind of requests?

lusty quest
#

Discord bot to an Tensorflow instance. call on pretty much every message event

quartz kindle
#

isnt tensorflow slow af?

lusty quest
#

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

quartz kindle
#

go for http then

#

no need for websockets

lusty quest
#

thx

wintry terrace
#

any one know how to fix this

cinder patio
#

you should be doing that server-side

reef junco
#

how do u get a bot developer role in here...?

outer perch
reef junco
#

i did

cinder patio
#

It needs to be accepted

outer perch
#

is it verified?

reef junco
#

wait

outer perch
#

not by Discord

reef junco
#

its not verified yet

outer perch
#

waiting for approval

#

as soon as it's approved, u get the role

reef junco
#

oh okay

#

how do i see the queue..?

outer perch
#

if not instantly

outer perch
reef junco
outer perch
#

I think, don't remember

#

you'll know when the time comes, dw

cinder patio
#

You'll also get a PM from Luca

#

if you have those enabled

outer perch
#

yeah PM is for sure

reef junco
outer perch
#

what was the name of that guy developing an SDK for Geometry Dash?

#

Brace, yeah

tardy hornet
#

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

cinder patio
#

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

lusty quest
quartz kindle
#

what are you doing that needs to send every single message to tensorflow?

opal plank
#

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

outer perch
#

wat

opal plank
#

yes

outer perch
#

my teacher was right
One day programs will rewrite themselves while learning until full world domination

restive furnace
lusty quest
quartz kindle
#

including content, embed, image, link, everything?

lusty quest
#

only Text

#

images is way to heavy to do on a CPU

quartz kindle
#

ah

#

well that way you can at least ignore messages with no content

#

its already slightly better than all messages xD

lusty quest
#

yea i will filter stuff out, like command messages and empty messages, but it will be still a buttload of stuff

latent heron
#

@lusty quest my slash command API does so much shit in the background like that lol

lusty quest
#

lol

obsidian tartan
#

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

latent heron
crystal wigeon
#

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

latent heron
#

are you talking about regex?

quartz kindle
#

LIKE $1, ["%abc%"]

crystal wigeon
quartz kindle
#

how did you do it?

crystal wigeon
#

nvm this worked thanks

#

i put single quotes

outer perch
#

what's the difference between ts if(/*some condition*/) return /*some action*/; //logic and ```ts
if(/some condition/) { return /some action/ }
else { //logic }

earnest phoenix
#

none

#

logically, none

viscid gale
#

the syntax.. but logically, absolutely none

outer perch
#

cuz TS says not every path returns a value

earnest phoenix
#

there might be some tiny tiny tiny performance boosts by omitting the else but that's so small it's irrelevant

outer perch
#

so I might do else more often to avoid that warning

earnest phoenix
#

you have to return everywhere

#

in the tree

outer perch
earnest phoenix
#

you still have to return in the else

outer perch
#

cuz actually I don't need to return

#

do I?

earnest phoenix
#

if you expect a return value you do

outer perch
#

but I don't

earnest phoenix
#

thonk

outer perch
#

cuz it's a function to just answer in chat

earnest phoenix
#

can you show the method

outer perch
#

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
earnest phoenix
#

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;

outer perch
#

should close the process

#

without returns

steel arch
#

How can i do in the bot status he count all the members that are using the bot?

outer perch
viscid gale
#

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

cinder patio
#

First off, why do you want to deep clone an object? What do you need that for

earnest phoenix
#

This channel is for chatting about bot development

steel arch
outer perch
#

let me check

viscid gale
earnest phoenix
#

i dont think whatever ur doing is necessary

onyx hare
#

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

viscid gale
earnest phoenix
#

theres a better way to do whatever ur trynna do

outer perch
outer perch
#

so you can't get them all as soon as you bot starts

viscid gale
cinder patio
steel arch
viscid gale
#

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)

outer perch
#

ppl have to send one message at least after that to get in the counter xD

viscid gale
#

ok.. i was just checking to see if there was an obvious answer :{

#

ig i'll ask on stackoverflow then

earnest phoenix
cinder patio
latent heron
#

@lusty quest

outer perch
#

wat

#

k

lucid prawn
#

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
latent heron
earnest phoenix
outer perch
lusty quest
#

out of all the people here why do i get the ping?

latent heron
#

because

#

it's a followup conversation.

uncut swallow
latent heron
#

Soon™️

#

if it ever gets approved on top.gg 😂

lusty quest
# latent heron because

ahh ok. but the screenshot ive made where only like 10 prints. out of 1k ive made for testing the loadbalancer

outer perch
#

btw it isn't JA, it's JP @latent heron

lucid prawn
#

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
latent heron
#

JA you said?

pale vessel
outer perch
#

true

#

mb

latent heron
#

mhm

#

JA is for language, not country

#

people often mistake that anyhow

outer perch
#

ja Japanese
ja-JP Japanese (Japan)

quartz kindle
#

JAlapeño

modest maple
#

pornhub is responsible for alot of that confusion tbh

latent heron
#

just like

GB - German
DE - Germany

outer perch
quartz kindle
outer perch
#

xD

modest maple
#

Is GB german?

outer perch
#

DE stands for Deutschland

latent heron
#

GB is for german

#

i feel like i just broke people's brains saying that 😂

outer perch
#

yeah

outer perch
#

de German
de-AT German (Austria)
de-CH German (Switzerland)
de-DE German (Germany)
de-LI German (Liechtenstein)

quartz kindle
#

since when is gb for german?

drifting wedge
#

how can i just not cache anything
and not get any errors
like any erros are just ignored?
like command not found etc (DPY)

latent heron
#

depends on ISO @outer perch

outer perch
#

REEEEEEEEEEEE

latent heron
#

lmao

#

it's really bad

#

I think most people still use ISO-639

#

-1 to be specific

#

but others now use -2 or -3

modest maple
drifting wedge
#

ok

#

well i got how to not get errors

#

how do i not cache

quartz kindle
#

even in -2 and -3 there is no GB language code

#

GB is currently unassigned

latent heron
#

i swore GB is a used language code

pale vessel
#

no gb is great britain

quartz kindle
#

on wikipedia it says unassigned

latent heron
#

di

#

did you just say wikipedia

modest maple
latent heron
#

evil man

quartz kindle
#

yes, wikipedia is a reputable source

latent heron
#

you've used the source of reliability

#

angey

#

oh well, i'll admit my defeat then

drifting wedge
modest maple
#

members?

drifting wedge
#

i just dont need to cache

#

as its for my dashboard instance

modest maple
#

lmao you do

restive furnace
drifting wedge
#

just so i can access objects

#

like fetch_x

#

bc i dont want the bot to DO anything

modest maple
#

if you're doing it only for the http why use d.py

latent heron
#

you're a bit late to the convo bud

restive furnace
#

idc

latent heron
#

lol ok

quartz kindle
#

GB is the country code, not the language code

modest maple
#

litterally pointless exercise

drifting wedge
#

@modest maple bc i will still need to use some of the bots functionality

#

but i wont need caching for that

modest maple
#

just use ipc then with your actual bot

latent heron
#

GB is for country

#

UK is for language

quartz kindle
#

the language code for germany is DE in -1 and GER/DEU in -2 and -3

latent heron
#

well yes, like i said it's ISO specific

modest maple
#

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

drifting wedge
#

yea

#

look right i only need 2 things

modest maple
#

mixing webservers with a framework like d.py = bad idea

drifting wedge
#

its not

modest maple
#

it is

drifting wedge
#

theyres a lib for it

#

especially

#

it works fine

modest maple
#

FacePalm Please no

drifting wedge
#

:/

#

bruh

drifting wedge
#

i need to

  1. be able to send messages
  2. be able to use like fetch_whatever
#

but i wont need any cache for that

modest maple
#

so... just use raw http requests

drifting wedge
#

alr then

modest maple
#

instead of logging n amount of times per worker

drifting wedge
#

this is the thing imma use

modest maple
#

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

drifting wedge
#

im so confused

quartz kindle
#

unconfuse yourself

drifting wedge
#

IM TRYING to

#

@modest maple so would that work

#

or not?

modest maple
drifting wedge
#

YES

#

i know

#

so thats good?

#

cuz i dont want the bot instance for the dashboard to use like 500mb memory lol

modest maple
#

you never run another bot instance on the web server

#

the webserver sends a message to your bot

#

the bot responds to said message

drifting wedge
#

yea

#

thats what i mean

#

basically

#

i have a file that is webserver

modest maple
#

thats nothing like what you said lmao

drifting wedge
#

and another is the bot which is responding to the webservers request

restive furnace
#

rest > ipc

drifting wedge
#

so do i need to do anything or will it already not cache?

#

@modest maple

#

sorry for the confusion

#

thats what i mean

#

clarified

modest maple
#

pithink Bro your not running another bot instance

#

you run your main bot instance

drifting wedge
#

mhm

modest maple
#

and communicate with the main bot instance

#

you do not mess with cache n shit

#

your just use your main bot

drifting wedge
#

@modest maple but...

modest maple
#

no buts

drifting wedge
#

my "main" bot is clusters

#

its not one main bot

#

each cluster is a different proccess

#

with specific shards assigned to it

modest maple
#

Which one of your bots are over 15k guilds pithink

drifting wedge
#

@modest maple dude shh

restive furnace
#

me when i clustered at 20 guilds

drifting wedge
#

its not that tho

#

its cuz WHEN the bot gets to a lot of guilds

#

then ill implement the system

modest maple
#

bro

#

you litterally

drifting wedge
#

for now i only use one cluster

modest maple
#

you litterally dont need to cluster unless your in atleast 15k servers

drifting wedge
#

@modest maple its not a cluster rn

#

ok

#

i KNOW

#

its not clustered

#

but it supports the cluster

#

the system supports clustering

modest maple
#

blobpain Talk about preemptive

drifting wedge
#

lol

opal plank
#

my bot is clustered too

drifting wedge
#

so i would like to be able to do it supporting clustering

opal plank
#

onyl at 2k

drifting wedge
#

ye

#

see

#

like its one cluster

#

but its easy to add more

opal plank
#

cuz i dont wanna deal with porting or adapting code further down the line

drifting wedge
#

^^^^

opal plank
#

its clustered but only using 2 shards

restive furnace
opal plank
#

so its only 1 cluster, but it dynamically spawns more as needed

drifting wedge
#

^^

#

SEEE

#

so i would run antoher instance

modest maple
# drifting wedge ^^^^

bro ngl judging from your confusion in prior conversations your code is gonna need to be re-written wayyy before you need clustering

drifting wedge
#

for the dashboard

#

@modest maple shut

slender wagon
#

how do i get more information about a already registered domain name?

modest maple
drifting wedge
#

my spagetti code is my child

modest maple
drifting wedge
#

ok so what DO i do

#

what can i use

restive furnace
#

learn things

drifting wedge
#

?

slender wagon
restive furnace
#

and learn best programming practices

opal plank
#

i dont even know what was the question tbh

restive furnace
modest maple
#

anime_cry did you just ignore our conversation just now

opal plank
#

was it IPC related? if so i can give a help

slender wagon
#

I've been trying to get info about .al domain names but i just can't

drifting wedge
#

yes it is

fierce quarry
#

hello, i wanted to report an issue that i have been facing lately when visiting the site, the picture below demonstrates my issue

drifting wedge
#

ok lets start over

opal plank
#

what exactly you trying to accomplish?

drifting wedge
#

i want my dashboard to be able to use bot resources

fierce quarry
midnight blaze
drifting wedge
#

like to be able to use fetch_x

#

and etx

#

send messages

midnight blaze
#

CAN someone help me with this crap_

drifting wedge
#

and so on

midnight blaze
#

??

#

my shards stop working sometimes

opal plank
#

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 mmulu

fierce quarry
#

thanks for the information, because i was the only one facing this therefore it seemed strange to me

drifting wedge
#

so basically i thought i would run a bot instance FOR the dashboard

modest maple
#

site rn -> thisisfine

jovial ore
#

Anyone who can help me with this? https://prnt.sc/1003o3e It says Discord has blocked the access for the bot joining my server.

Lightshot

Captured with Lightshot

drifting wedge
#

and just have it be functions that respond to the dashboards calls

#

with ipc

opal plank
#

i'd recommend using a microservice to pool all your data from all your clusters or use prometheus instead

drifting wedge
#

@modest maple what do i do then?

opal plank
#

have each instance have a prometheus and a job assigned

opal plank
#

actually, no scratch that

#

even luka though prometheus was overkill

#

i need to stop recommending it for people

#

okay, lets go the normal route

modest maple
#

this we're getting slightly into the realms of too complicated for them

umbral zealot
opal plank
#

IPC, right

drifting wedge
#

yes

#

i could have a system to find what guild

opal plank
#

what you can do is spawn them all with Fork

drifting wedge
#

a cluster has

#

then just ask THAT cluster

jovial ore
#

What's Discord js?

drifting wedge
#

this is what im using

opal plank
#

that will create an IPC pipe between the spawner and the forked process

#

you can use process.send()

drifting wedge
#

wot

quartz kindle
#

spaghett

opal plank
#

yeah

#

when you fork a process