#development

1 messages · Page 1559 of 1

lethal trout
#
const client = new Discord.Client({
    disableMentions: 'everyone',
    fetchAllMembers: true,
    partials: ['REACTION', 'MESSAGE', 'CHANNEL'],
    ws: { Intents: Intents.All },
});```

Intents not defined
uncut river
#
const client = new Discord.Client({
    disableMentions: 'everyone',
    fetchAllMembers: true,
    partials: ['REACTION', 'MESSAGE', 'CHANNEL'],
    ws: { 
      intents: [
        "GUILD_MEMBERS"
       ]
    },
});```
lethal trout
earnest phoenix
#

more like bring Intents from Discord to the scope

uncut river
earnest phoenix
#

embed.add_field(name="User:", value='member.mention', inline=False)

what should i use instead of member.mention so it mentions the member in embed

#

'member.mention' and member.mention isn't the same thing please

#

ok

earnest phoenix
#

i am asking that bro

#

learn python

#

k

#

i will try different things

#

leave it

#

lol

silent cloud
#

yo guys

#
const { Command, MonikaEmbed, CommandError, MiscUtils, Constants, CanvasTemplates } = require('../../')

module.exports = class Instagram extends Command {
  constructor (client) {
    super({
      name: 'instagram',
      aliases: ['insta'],
      category: 'social',
      requirements: { canvasOnly: true },
      parameters: [{
        type: 'string',
        missingError: 'commands:instagram.noUser'
      },
      [{
        type: 'booleanFlag',
        name: 'nogrid',
        aliases: ['ng']
      }]]
    }, client)
  }

  async run ({ t, author, channel, language, flags }, user) {
    channel.startTyping()

    try {
      const embed = new MonikaEmbed(author)
        .setColor(Constants.INSTAGRAM_COLOR)

      const _profile = await this.client.apis.instagram.getUser(user)
      if (!_profile.graphql) {
        throw new CommandError(t('commands:instagram.notFound'))
      }
      const profile = _profile.graphql.user

      const images = profile.edge_owner_to_timeline_media.edges
        .map(edge => edge.node.thumbnail_src)

      const feed = await CanvasTemplates.instagramFeed(images, flags.nogrid ? 0 : 3)

      embed
        .setAuthor(profile.full_name || profile.username, profile.profile_pic_url, `https://instagram.com/${profile.username}`)
        .setDescription(profile.biography)
        .addField(t('commands:instagram.followers'), MiscUtils.formatNumber(profile.edge_followed_by.count, language), true)
        .addField(t('commands:instagram.following'), MiscUtils.formatNumber(profile.edge_follow.count, language), true)
        .attachFiles(new MessageAttachment(feed, 'feed.png'))
        .setImage('attachment://feed.png')

      channel.send(embed)
    } catch (e) {
      if (e instanceof CommandError) throw e
      else throw new CommandError(t('errors:generic'))
    }
  }
}
#

i have an error, but in console doesnt writed an error

#

why?

rocky hearth
#

any nextjs experienced guy here?

pale vessel
#

cra gang

earnest phoenix
#

what is difference between inline=True and inline=False in discord.py embed

#

i am confused between them

pale vessel
#

if you have two/three fields next to each other set to Inline, it will be in the same column in the embed

normal girder
#

It determines if a field is shown next to another.

pale vessel
normal girder
pale vessel
#

it's under different rows lol

#

it's column

#

wait idk

normal girder
#

Yep! It determines if your bot will use columns in a single row.

pale vessel
rocky hearth
#

consecutive inline fields will try to be in the same row, max 3 (I guess)

normal girder
#

The image that I just posted shows Inline field and Inline field 2 in two columns next to each other, and they are both on the same row.

earnest phoenix
earnest phoenix
#

can u tell me ?

#

🥺

#

or no ok then bye

normal girder
#

Inline=true will make them display "in the same line".

earnest phoenix
#

ok

pale vessel
#

i'm stupid af

earnest phoenix
earnest phoenix
#

see the difference

earnest phoenix
#

the dyno bot embed inline=True one have little space but mine don't why ?

#

see the space between joined and registered

#

because the content of the embed is larger

#

if you go into inspect element you'll see that those two boxes have different sizes

#

also

#

imagine cloning dyno features 🤡

#

Nope 😂

#

I just wrote that

#

So I thought I'll get more space

earnest phoenix
#

yes

orchid vortex
#

how does one match everything but a specific character, or nothing if no characters (line start)

#

(regex)

delicate zephyr
#

which character are you trying to match

delicate zephyr
#

when nothing is there

orchid vortex
#

im trying to match
*this should match*
\*this should not\*

#

but the \*th [...] part is bugging me up

#

how do i detect if theres anything but \ or detect [nothing]

delicate zephyr
#

@orchid vortex ^^ like this?

#

or do you want to match everything but \

orchid vortex
#

note that this should match would be a capture group

delicate zephyr
#

Oh

#

so you wanna match everything but \

orchid vortex
#

i want it to match, like /\*([^]+?)\*/g would

#

but

#

if it contains a \ before the first or second * then dont match

delicate zephyr
#

hmmm

sacred aurora
delicate zephyr
orchid vortex
#

it should also match anywhere in the string

delicate zephyr
#

yea

orchid vortex
#

blah blah *hello* hi

sacred aurora
#

oh

orchid vortex
#

ill test it out and give results, thanks

delicate zephyr
#

just remove ^

sacred aurora
#

nais

delicate zephyr
#

and it should work

sacred aurora
#

eh

orchid vortex
#

it should also
eufhu fhue \*this shouldnt match\*

delicate zephyr
#

yea

#

^ indicated strictly at line start

#

removing that just allowed it to match whole string

orchid vortex
#

best if i go test it myself

#

yes

#

ill tell you if it worked, thanks

delicate zephyr
#

np

orchid vortex
#

@delicate zephyr must have /g

#

to match more than one

#

but then, it matches \*this\*

delicate zephyr
#

Oh

orchid vortex
delicate zephyr
#

idk then, regex is weird

orchid vortex
#

it is

#

perhaps i should use something else to do what im trying to achieve?

#

actually, how does discord handle formatting?

modest maple
#

What r u trying todo?

delicate zephyr
#

Scroll up

orchid vortex
delicate zephyr
#

you'll see lol

#

he's trying to match only unescaped markdown

orchid vortex
#

yes

#

how does discord do it

#

im jealous

#

😂

modest maple
#

They dont... Its jusy how its rendered

delicate zephyr
#

e

modest maple
#

As in discord dont render it themselves directly

orchid vortex
#

yes

#

but the app probably needs to do something to detect if theres markdown and where

modest maple
#

So you want it to only detect *

#

And what it encases

orchid vortex
#

yes

#

and not escaped *

modest maple
#

But exclude *

orchid vortex
#

yes

delicate zephyr
#

\*

#

lol

modest maple
#

Mobile be pain

delicate zephyr
#

yep

sacred aurora
#

dunno why it got the space tho

#

eh nvm

modest maple
#

Cuz it putting a look ahead

#

Anything othwr than \

orchid vortex
#

@sacred aurora problem with that is when its at the beginning of string

#

*this wouldnt match*

sacred aurora
#

yea tho

modest maple
#

I mean it can just put a group n quantifier on it

#

I gotta outa bed

orchid vortex
#

found it

#

/(?:[^\\]|^)\*([^])+?[^\\]\*/g

#

this matches discord-like italic markdown

#

doesnt.

modest maple
#

dont worry about the whitespace match because the capture ignores it

orchid vortex
#

yep thanks ill test

#

doesnt match if upon beginning of line

modest maple
#

[^\\]?(\*[^\*\\]+\*) well that fixes that issue

#

and adds unicode support

#

but it does capture on * *

orchid vortex
#

(:?[^\\]|^)\*([^]+?)[^\\]\* does what i want, but it matches the character before the first \* and that causes me issues

#

perhaps i should just capture the [^\\] character and append it in the final replace result

modest maple
#

What is the end goal with this btw?

orchid vortex
#

implementing markdown in an omegle bot

#

note the missing spaces

modest maple
#

youll probably need to insert the spaces yourself

orchid vortex
#

yep thats what im doing right now

modest maple
#

that regex only captures the contents in the **

orchid vortex
#

yeah

cloud warren
#

Hello, I cannot take the number of people on all servers, 12 people show how to solve this as an example

for the total number of members on the servers where it is located

orchid vortex
#

@cloud warren enable MEMBERS intents

#

then try again

cloud warren
#

normally there should be more than 500 people

orchid vortex
#

also make sure that your client has fetchAllMembers: true the stuff if you really wish to get true results

modest maple
#

foo bar *foo *bar * foo *

cloud warren
orchid vortex
#

what kind of error

cloud warren
#

wait

modest maple
#

also that regex does match on a pattern it shouldnt

#

*abac* \*abc a* *asfaf ajsfasf*

#

matches

#

a* *asfaf ajsfasf*

orchid vortex
#

ok lemme see

#

true

#

hmm

modest maple
#

Low key this might be easier todo with a fsm

orchid vortex
#

whats a fsm?

modest maple
#

finite state machine

orchid vortex
#

and uh

#

what does that mean/do

#

like, manually replace the characters when needed?

#

(string iteration)?

cloud warren
sacred aurora
#

insert

#

is it?

cloud warren
#

not working

#

ı try

sacred aurora
#

lol

cinder patio
#

It's insert

#

"ins"

cloud warren
#

I click but it's still the same

cobalt spruce
#

@cloud warren close and reopen it

#

try everyhing

cloud warren
#

I try it too

cobalt spruce
#

RESTART THE MF PC

orchid vortex
#

lmfao

#

i dont use vsc

cobalt spruce
#

#SOLVED

orchid vortex
#

whats wrong with my d key

cobalt spruce
orchid vortex
#

i use atom KEKW

cobalt spruce
#

pro code NOTE PAD

orchid vortex
#

sorry but we all know pro developers use nano

cobalt spruce
earnest phoenix
#

if i want to add custom emoji in my bot message can i give emoji link and how ?

cobalt spruce
earnest phoenix
#

i cant i dont have nitro bro

sacred aurora
#

and add a if animated <a:name:id>

#

eh

#

hmm

cobalt spruce
sacred aurora
#

:v

earnest phoenix
#

TvT

cobalt spruce
earnest phoenix
#

can i put link instead

cobalt spruce
#

link. hmmm

sacred aurora
#

the link contain its id tho

earnest phoenix
#

oh yeah ty

#

got it lol

cobalt spruce
#

u can see

#

it works

earnest phoenix
cobalt spruce
#

so bot has all badges

earnest phoenix
#

lol

cobalt spruce
#

that means

earnest phoenix
#

ya

#

that is

cobalt spruce
#

it works in bot

cloud warren
earnest phoenix
#

it have all

cloud warren
#

ı neeed hepp

#

I did it open and close

#

pc

#

I pressed the insert button

sacred aurora
#

ctrl+shift+i?

orchid vortex
#

press it again

sacred aurora
#

dunno tho

cloud warren
sacred aurora
#

welp

cloud warren
#

ı try

#

i cry now

#

lol

cobalt spruce
#

if its normal skip it

cloud warren
#

i can't write code

#

I pressed all the keys I don't know what to do

earnest phoenix
#

OMG MY BOT GOT APPROVED

#

@quartz kindle

cinder patio
#

ok

cloud warren
#

how can I remove the chi square at the end

#

gray color one

#

please someone give an idea

cinder patio
#

??? chi square

#

what are you talking about

#

/ / this?

cloud warren
earnest phoenix
#

press insert

cloud warren
earnest phoenix
#

was your ide focused

cloud warren
#

yes

earnest phoenix
#

🤔

#

Hayes finally lol

#
    let antiraid = await db.get(`antiraid_${message.guild.id}`);

    if(antiraid === false) return;
    if(antiraid === null) antiraid = false
    member.send("Server In Antiraid Mode")
    member.kick();
})```
Will This Work (Kicks People When They Join) (JS)
#

b r u h

#

lol

#

Lol

#

LOL

cloud warren
#

how fined the currency of the bot this code shows very little

earnest phoenix
#

It says that it couldn’t find the I’d and then unban the person

split hazel
#

why does everyone have the same theme

earnest phoenix
#

No idea tbh

split hazel
cloud warren
#

I don't understand, he should normally show 700 but he shows 12

earnest phoenix
#

bots have a gender now 😳

#

enable server member intent

#

both on the developer page and in your code

split hazel
cinder patio
cloud warren
earnest phoenix
#

Bots don't cache all users by default

earnest phoenix
#

If you want accurate count, use Array.prototype.reduce() and add up all of the <Guild>.memberCount

cloud warren
#

Can't I get the total number of members on the servers with the bot?

earnest phoenix
#

Regardless, <Guild>.memberCount won't be accurate if you don't have the guild members intent

split hazel
#

I see two missing id errors

earnest phoenix
#

Wai 2?

#

Wtf

#

Lemme check

split hazel
#

line 7 and 17

#

you didn't specify exactly which one you got

earnest phoenix
#

Line 7 is for when they just say +unban

#

So it replies with specify a id

#

And if there is no I’d that is banned than the other line says that

royal laurel
#

why is my token not acutallly resetting

split hazel
stable thistle
royal laurel
#

i click the regenrate button in dev portal and its not regenerating

split hazel
#

did you double check the full token and see its the same?

#

some parts of the token will always be the same

placid iron
#

😩 nginx doesnt like cloudflare

#

thank you for my ted talk

#

ima try to fix it for 1 more hour

modest maple
#

wdym nginx doesnt like cloudflare

#

it doesnt care about it

placid iron
#

i wish it didnt care

misty sigil
#

If you configure your shit right

#

it doesn’t care

earnest phoenix
#

guys

#

i need help

#

so there is a module called discord-rpc

#

and i installed it

#

but when i start the console

#
Error: Could not connect
    at Socket.onerror (/home/allamjonas/node_modules/discord-rpc/src/transports/ipc.js:32:16)
    at Object.onceWrapper (node:events:486:26)
    at Socket.emit (node:events:379:20)
    at emitErrorNT (node:internal/streams/destroy:188:8)
    at emitErrorCloseNT (node:internal/streams/destroy:153:3)
    at processTicksAndRejections (node:internal/process/task_queues:81:21)
#

rpc is deprecated

#

use the game sdk

#

oooh bruh

#

i tried this for 2 hours

#

fml

modest maple
placid iron
#

i fixed it now

#

💪

royal laurel
#

ok im having this error

#

im trying to make an embed

#

which displays the current amount of members in the guild

#
Error: Cannot find module '@discordjs'
Require stack:
- C:\Users\fred\Desktop\Bots\Discord Bots\Mint\mint.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (C:\Users\fred\Desktop\Bots\Discord Bots\Mint\mint.js:1:17)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'C:\\Users\\fred\\Desktop\\Bots\\Discord Bots\\Mint\\mint.js' ]
#

is the error im getting

misty sigil
#

Try discord.js

royal laurel
#

wdym like import it as discord.js?

#

oh yeah

#

it was that

#

ty

cinder patio
#

As far as I know you have to parse the message for emojis yourself

earnest phoenix
#

Can someone gimme link so I can learn creating commands with json

placid iron
quartz kindle
#

wat

slender thistle
old latch
#

👀

viscid thistle
#

does anyone know how to make a webhook for top.gg on heroku because I'm hosting my bot there

quartz kindle
#

your webhook url is your heroku url

#

https://YOURPROJECTNAME.herokuapp.com/WEBHOOKPATH

tribal siren
#

Sorry for being off-topic and stuff

#

But what is a selfbot?

#

i don't quite understand

cinder patio
#

A selfbot is a normal discord account which is controlled by a bot

tribal siren
#

oh really

#

understandable thanks

earnest phoenix
#

-botinfo 776026443322490910

gilded plankBOT
#
Bot info
ID

776026443322490910

Username

DEVILx

Discriminator

7638

Short Description

IT IS A POWERFULL MODERANITION BOT WHICH CAN BE USE IN MANY WAYS.
ITS PREFIX IS ? TO GET HELP TYPE ?help TO GET HELP

Library

Other

Prefix

?

Total Upvotes

37

Monthly Upvotes

8

Server Count

No server count

Owner(s)

@vital harbor

cinder patio
#

@split hazel

split hazel
slender wagon
#

when should i consider sharding?

#

my bot is still -500

#

like

#

not more than 500 servers yet

cinder patio
#

Around 2000 servers

#

You must shard at 2.5k, though

lyric mountain
slender wagon
#

oh okay thanks

pale vessel
#

very simple and straightforward description i'd say

earnest phoenix
#

If someone does +ban skis LELE

#

It can crash the bot, is there a way I can make it say please mention a user

misty sigil
#

check if there isnt a user

earnest phoenix
#

What..

#

.catch error....

#

I’ll just do that

#

.catch(err => message.channel.send( { embed: { description: `I can't find this user ${args[0]}`}}));

#

Which line should I add that in?

tired panther
#

Does anyone knows a package which converts String like this ones: "Sunday at 10 pm" in miliseconds ==> Date.now()?

earnest phoenix
#

module.exports = {
  name: 'ban',
         /**
     * @param {Message} Message
     * @param {string[]} args
     */
  run: (message, args) => {

 if (!args[0]) return message.channel.send( { embed: { description: `Please mention a user to ban`}});
   if (member.hasPermission('BAN_MEMBERS')) return message.reply(   { embed: { description: `You cannot ban this user!`}})
  if (!message.member.hasPermission('BAN_MEMBERS')) return message.reply( { embed: { description: ` You cannot ban members`}})
  
  const target = message.mentions.members.first();
  const reason = args.join(' ');

   if (!target) return message.channel.send(  { embed: { description: `please mention a user to ban`}});

  target
    .ban({ reason })
    .then(() => {
      const embed = new MessageEmbed()
      .setDescription(`**${target.user.tag} has been banned by ${message.author.tag}**`)
      .setColor('#ff0000')
      message.channel.send(embed);
    })
    .catch(err => {
      console.log(err);
      message.channel.send(`<@${message.author.id}> error while banning <@${target.id}`)
    });
  }
}```
#

Some reason isn’t working, responding, not banning, no errors

cinder patio
#
if (member.hasPermission('BAN_MEMBERS')) return message.reply(   { embed: { description: `You cannot ban this user!`}})

There is literally no way you're not getting an error on this line.

earnest phoenix
#

Target, dumb me..

#

Still nothing

cinder patio
#

send your code again

earnest phoenix
#

Sure

#

module.exports = {
  name: 'ban',
         /**
     * @param {Message} Message
     * @param {string[]} args
     */
  run: (message, args) => {

 if (!args[0]) return message.channel.send( { embed: { description: `Please mention a user to ban`}});
   if (target.hasPermission('BAN_MEMBERS')) return message.reply(   { embed: { description: `You cannot ban this user!`}})
  if (!message.member.hasPermission('BAN_MEMBERS')) return message.reply( { embed: { description: ` You cannot ban members`}})
  
  const target = message.mentions.members.first();
  const reason = args.join(' ');

   if (!target) return message.channel.send(  { embed: { description: `please mention a user to ban`}});

  target
    .ban({ reason })
    .then(() => {
      const embed = new MessageEmbed()
      .setDescription(`**${target.user.tag} has been banned by ${message.author.tag}**`)
      .setColor('#ff0000')
      message.channel.send(embed);
    })
    .catch(err => {
      console.log(err);
      message.channel.send(`<@${message.author.id}> error while banning <@${target.id}`)
    });
  }
}```
cinder patio
#

We talked about this literally yesterday

earnest phoenix
#

I know, but someone is changing my code....

#

It always changes when I wake up, lol

cinder patio
#

I'll let you remember

#

you already did this once, you should know how to fix it, then 🙂

earnest phoenix
#

Ok thanks lol 👍

opal plank
#

not the place to advertise, MUCH LESS hacker stuff

#

actually, im not a mod, ignore me

#

@slender thistle ping hehehehehe(100% not an excuse to ping ya <3)

stuck pike
slim heart
#

what's a good placeholder character that no one would ever type? i'm gonna .replace enforce it but i dont want it to get in the way

#

i plan on just using it to be able to set it as a character and then .replace(char, 'real character') after

quartz kindle
#

a placeholder for users to use?

slim heart
#

no

#

like something for my code to use internally

quartz kindle
#

use one of those special characters

modest maple
#

--FOOBARR-WHY-GOD-HELP--AHHH--™️

quartz kindle
#

or a combination of them

slim heart
#

previously i just replaced with whichever character i wanted to surround it with, but the original parsing messed with those characters

quartz kindle
#

like EOT

slim heart
#

what special characters?

#

o

quartz kindle
slim heart
#

how do i get these characters in js?

pale vessel
#

\x04 for EOT for example

earnest phoenix
pale vessel
quartz kindle
#

"\u0004" also works

zenith terrace
#

\x04 faster

#

less to type

quartz kindle
#

go fast

zenith terrace
#

hire a lazy person they say, they'll find an easier way to do work they say
lazy bot dev forks bots

grizzled raven
#

why many word when small do trick

quartz kindle
#

or \004 for octal

grizzled raven
#

what's the purpose for eot

#

end of transmission

#

what does it exactly do

pale vessel
#

read the name

earnest phoenix
#

to mark an end of transmission...

pale vessel
#

it indicates the end of transmission.............

earnest phoenix
#

you don't know when a packet ends when you're reading a raw memory stream

#

that helps you identify where a packet ends

grizzled raven
#

ah

#

lmao

quartz kindle
#

i use it as a string delimiter in my tcp lib

#

xd

slim heart
limpid gyro
quartz kindle
#

an astrology bot

limpid gyro
#

Can you show me please

#

Dms

quartz kindle
limpid gyro
#

Ok

#

Which

#

@quartz kindle

earnest phoenix
#

Want to get your hands on the latest game?

limpid gyro
#

No

wind magnet
fluid basin
#

there is a problem with one of your packages

#

you can try removing the node_modules folder

earnest phoenix
#

no

fluid basin
#

then run npm install again

limpid gyro
#

Yes

earnest phoenix
crystal wigeon
#

hey guys

#

umm

limpid gyro
#

??

crystal wigeon
#

sometimes the message.guild property returns undefined

livid lichen
earnest phoenix
#

the message wasn't in a guild

crystal wigeon
#

i thought guild is a mandatory proeprty in the message obj?

umbral zealot
#

It would return undefined in DMS, @crystal wigeon

quartz kindle
crystal wigeon
#

ah i see

wind magnet
limpid gyro
crystal wigeon
#

message.type == "dm"

umbral zealot
#

There should be only one node_modules folder.

crystal wigeon
#

right?

earnest phoenix
livid lichen
#

Whoa Nerf This got a new role! Congrats!!

earnest phoenix
#

i hate when people who don't have a clue try to help 🙄

crystal wigeon
#

i get the "dm" type in message.type right?

umbral zealot
#

Yes, or you can just check if !message.guild

limpid gyro
#

I also made an basic economy bot

crystal wigeon
#

thanks!

limpid gyro
#

Wanna see

#

?

umbral zealot
#

not really

crystal wigeon
#

message.channel.type === "dm" ? ;-;

umbral zealot
#

economy bots are a dime a dozen

limpid gyro
umbral zealot
earnest phoenix
#

yes, you

crystal wigeon
#

just making sure xD since im using a message.channel.type === "news" somewhere

earnest phoenix
#

quick.db uses better-sqlite3

#

it's just a fancy wrapper

crystal wigeon
#

also, anyone know about distributed systems?

fluid basin
#

"distributed"?

#

elaborate

fluid basin
earnest phoenix
#

there aren't prebuilds afaik

fluid basin
#

there are

earnest phoenix
#

oh?

fluid basin
#

but only for LTS

earnest phoenix
#

seems it's available for only linux and darwin envs

#

yes

#

so you have to build it on windows regardless

fluid basin
#

ok thats unfortunate

tribal siren
#

how to get the mutual servers with the message author?

fluid basin
#

library?

tired panther
tribal siren
#

djs

earnest phoenix
#

reliably - oauth2
unreliably - go through your member cache

tribal siren
#

lmao

tired panther
#

xD , less code 1037_hehepepe

lyric mountain
#

boolean checks are better

tribal siren
#

well yes

tired panther
earnest phoenix
#

make it functional instead KEKW

#

message.guild.isDefined()

tribal siren
#

if(message.guild == null)

lyric mountain
#

if (message.guild && message.channel.type != "dm" && !isThirteen(message.id))

fluid basin
tired panther
#

1037_hehepepe me, I started , sorry my fault xD

crystal wigeon
#

my distributed systems i mean, all the scalability stuff, i trying to learn scalability things and my DB doenst seem to be co-oping well with the connections, i'd say around 2k concurrently, for some reason it drops, my max connections allowed on postgres is 20000.. and also has 7GB RAM both my VM and DB ;-;

#

my bot also reached 500 guilds

lyric mountain
#

damn, intellij's new official livecode plugin is freakin' awesome

fluid basin
#

don't use a relational database if you want to do distributed dbs tbh

crystal wigeon
fluid basin
#

postgres/mysql and the likes scale vertically

#

means you need a beefier server

crystal wigeon
#

can you elaborate?

#

i see

tired panther
#

Does somebody know, which api I should use for ai bots?

fluid basin
#

vertically means improving single node performance

#

API?

crystal wigeon
#

but 2k players should be handled well enough on a 7GB RAM DB

lyric mountain
fluid basin
#

depends on what type of "ai" you are doing

tired panther
tired panther
crystal wigeon
#

dialogflow

fluid basin
#

I'd recommend dialogflow then

#

or if you know how to use wit.ai

tired panther
fluid basin
#

or you can train your own using tensorflow

crystal wigeon
#

nah its free

#

dialogflow is free

tired panther
crystal wigeon
#

unless you want more than 3 concurrent connections

tired panther
crystal wigeon
#

not really

#

i've used it

tired panther
#

I just think to big lol

lyric mountain
tired panther
fluid basin
crystal wigeon
#

i do have 2 cpus

fluid basin
#

RAM only helps for caching and retrieval speed

#

yeah that could be why

crystal wigeon
#

2 cpu isnt enough?

#

;-;

fluid basin
#

I would recommend that you look into optimising your queries if you plan to stick with postgres/SQL

#

and ofc upgrading the node as a last resort

crystal wigeon
#

yeh, my queries dont take longer than 1.5s

earnest phoenix
#

2 cpus or 2vcpus

crystal wigeon
#

2vcpus

fluid basin
#

usually you might have some inefficient queries that are not very useful

lusty quest
#

just throw more hardware on sql/postgres

crystal wigeon
#

i presume v stanhds for shared?

earnest phoenix
#

virtual

crystal wigeon
#

ah

fluid basin
#

vcpus are really subjective to your provider

crystal wigeon
#

gcp

fluid basin
#

and for a 2vcpu 7gb you seem to be using gcp

#

yes

#

and they did mention each vcpu refers to 1 thread

#

so its basically equivalent to 1 actual cpu

crystal wigeon
#

yep

earnest phoenix
#

well

#

not exactly

crystal wigeon
#

which should be good enough to handle 2k connections right?

earnest phoenix
#

the base clocks are heavily different

#

but it's not your vps that's bottlenecking

#

it's your code

crystal wigeon
#

possible

#

but its like basic crud operations

earnest phoenix
#

very

lusty quest
#

open htop and see what your current usage is. could help in identifying issues

fluid basin
#

yeah well, the easy way out is to upgrade your node, the more long term one will be to look at your queries

crystal wigeon
#

wym by upgrade your node? buy more cpu?

fluid basin
#

yeah scale up

earnest phoenix
#

i handled 2k guilds without a problem on a basic aws ec2 instance with regular database calls (i didn't even cache my prefixes at the time)

crystal wigeon
fluid basin
lusty quest
#

then its your code

crystal wigeon
#

my bot is growing

#

so

#

about 1.8k users rn

#

that are active

earnest phoenix
#

you should use connection pooling

crystal wigeon
#

with 500 guilds

#

i am

#

im using knex

lusty quest
#

did you cache database calls?

crystal wigeon
#

the required ones

#

like prefix

lusty quest
#

some stuff like prefixes should be cached

crystal wigeon
#

i got redis for that

#

yep

earnest phoenix
#

i'm guessing you're on node

crystal wigeon
#

i tried serializing the message and client to spawn my workers but simply cant

#

ye

#

js

#

shards took care of the multiple workers thing

earnest phoenix
#

notorious for shit performance

crystal wigeon
#

lel

fluid basin
#

lol

crystal wigeon
#

maybe node isnt using the RAM it should be

fluid basin
#

but it can't be that bad

#

with only 500 guilds

crystal wigeon
#

i read that node only uses lliek 500mb

#

its not that bad

lusty quest
#

wtf 500MB ram?

crystal wigeon
#

ye if you dont specify how much memory it should use

#

by default

#

its not that bad either

#

jsut that sometimes players come accross weird bugs

#

where

#

they got messages saying they got the rewards

#

but when they check

#

no rewards

#

not updated

lusty quest
#

recode the bot in C# or rust

crystal wigeon
#

i was thinking go, but thats a lot of learning curve

fluid basin
#

(thats quite the work, mind you)

crystal wigeon
#

ikr

#

so was thinking about spawning DB replicas

#

as distributed systems

#

makes this easier

lusty quest
#

what DB did you use?

fluid basin
#

postgres

lusty quest
#

idk then never used postgres

fluid basin
lyric mountain
#

didn't know postgres can run in shards

quartz kindle
#

if you have a database-intensive application, depending on the types of queries being run, it can translate to disk-intensive application, and if it is indeed disk-intensive, be aware that google compute instances absolutely suck at it

earnest phoenix
#

that's the benefit when your software is opensource mmLol

#

more companies need to start open sourcing their software/technologies

#

microsoft did it with .net and c#

#

and thanks to that

#

it's one of the most performant cross platform languages ever

#

and im still suffering the pain of splitting my react components into a bunch of smaller onces because of stateful rerendering 😭

umbral zealot
#

lol join me in using vuejs. come to the dark side, we have cookies!

quartz kindle
#

svelte > all

fluid basin
#

kek svelte

#

SSR is better for static stuff

cobalt spruce
quartz kindle
#

sure, blow up your server

cobalt spruce
#

i need help

earnest phoenix
#

me too, mentally

cobalt spruce
#

i want to make title and desc inline

fluid basin
#

convert to inline fields and profit?

earnest phoenix
#

they can't be inline

cobalt spruce
#

but when i add inline: true

earnest phoenix
#

fields can be inline

cobalt spruce
#

hmm

umbral zealot
#

Just convert your title and desk to fields. Problem solved.

quartz kindle
#

you mean you want js title: text instead of ```js
title:
text

cobalt spruce
#

yes

quartz kindle
#

you cant

#

not with fields

cobalt spruce
#

;-;

quartz kindle
#

only with description

earnest phoenix
#

well... technically...

#

zero width space as the title in two inline fields

#

and your content in the field values

cobalt spruce
quartz kindle
#

use description, not fields

#

easy to do with description

cobalt spruce
#

i tried to do a trick but nah

umbral zealot
#

just put it all in the description

#

with line returns

cobalt spruce
#

i type nothing in the title?

quartz kindle
#

descriptions have no titles

#

.setDescription

cobalt spruce
#

i see

quartz kindle
#

also, base64 is not a hash

#

its an encoding

cobalt spruce
#

ye

#

i just test

earnest phoenix
#

following your original idea, you can also do something like this

cobalt spruce
#

hmm

cobalt spruce
earnest phoenix
#

i know

cobalt spruce
#

but in embed you cant do more than one

earnest phoenix
#

you seem to be not reading any of our messages properly

cobalt spruce
#

ye i skip two words in every message

quartz kindle
#

we said to put everything inside description

#

with line breaks

umbral zealot
#

So maybe actually listen before we just block you and move on to people who have the listening skills beyond those of a 5 year old 😛

quartz kindle
#

do you understand what that means?

cobalt spruce
#

backward slash and n

#

lol

quartz kindle
#

yes

#

so you dont need multiple descriptions, only one

cobalt spruce
#

thanks boys

zenith terrace
#
.setDescription(`h\ni\n\nt\ni\nm`)```
cobalt spruce
#

tim i wonder why ur name is Nerf this !

#

lol

quartz kindle
#

joke

cobalt spruce
#

2 people

quartz kindle
#

also, you can put bold text in description

#

text: hello

cobalt spruce
fluid basin
#

^ to look better

cobalt spruce
#

time to go

zenith terrace
#

yes bold do look better in description

quartz kindle
#

bold move

zenith terrace
#

funny

umbral zealot
#

You can even make bold code.

earnest phoenix
#

now im playing around with this design and it doesn't look that awful tbh

fluid basin
#

make it bold

zenith terrace
#

so much add field

earnest phoenix
#

it's great for creating responsive content

pale vessel
#

so much AddField

zenith terrace
#

flaz..

earnest phoenix
#

gotta trick discord into rendering it well somehow mmLol

#

this is going to look horrid on mobile though

#

i can already tell

zenith terrace
#

do it

#

show on mobile

pale vessel
#

lowkey wanna be in that server

earnest phoenix
pale vessel
#

get your charger

zenith terrace
earnest phoenix
#

it's not even a meter away from me but im too lazy :(

zenith terrace
#

nice Samsung as well

cobalt spruce
#

i wonder

#

how i make text inside embed looks like this sds

#

while am already used them

earnest phoenix
#

the same way you did it in a normal message

pale vessel
#

I wonder...

#

ah damn it

cobalt spruce
earnest phoenix
#

embeds aren't anything special

#

they still use the same markdown parser

pale vessel
#

where are my headings 😡

#

MY TABLES

cobalt spruce
#
.setDescription(`**Text:**${b}`)```
#

how i do it this

earnest phoenix
#

remember when discord first introduced message quoting and it was just... markdown blockquotes

quartz kindle
#

hi

pale vessel
#

it was.... something

earnest phoenix
zenith terrace
#

when boredom hits

pale vessel
#

love discord's formatting

quartz kindle
#

a b **c** d

#

fail

fair axle
#

How can I use discord emojis as react such as ➡️

quartz kindle
earnest phoenix
#

escape with a backward slash and use the unicode variant you get from escaping

#

➡️ -> \:arrow_right: -> \➡️

zenith terrace
#

bold with backticks go brrr
.setDescription(`**\`Text:**${b}\`**`)

cobalt spruce
#
 .setDescription(`**Text:** \`${b}` \n **Hash:** \`${s}` `)
earnest phoenix
#

can you hyperlink backticks

fair axle
#

thanks

quartz kindle
pale vessel
#

i hate escaping backticks inside backticks

zenith terrace
earnest phoenix
#

omg you can

cobalt spruce
#
  .setDescription(`**Text:** \`${b}\` \n **Hash:** \`${s}\` `)
pale vessel
#

i guess im gay now

quartz kindle
#

yes you can

earnest phoenix
mellow kelp
quartz kindle
#

you can bold it as well afaik

earnest phoenix
cobalt spruce
zenith terrace
earnest phoenix
#

so you can get colored hyperlinks

zenith terrace
#

when code randomly adds the %60%7D%7D

cobalt spruce
#

now time to buy breads

#

byebye

earnest phoenix
#

too bad discord fixed being able to open any app that uses its own protocol

#

you used to be able to open word by doing ms-word:// or some shit like that

#

aw they disabled sending protocol hyperlinks entirely

mellow kelp
#

damn

earnest phoenix
#

probably because of that win10 bug that wipes your drive

pale vessel
#

can you send that one path that can crash your windows

mellow kelp
earnest phoenix
#

<file:///>

#

nope

mellow kelp
#

oof

pale vessel
#

wonder if that's fixed

earnest phoenix
#

discord removes all protocol hyperlinks now

pale vessel
earnest phoenix
#

except http & https

#

to prevent tricking users into accessing the directory i guess

delicate zephyr
#

sad times

pale vessel
#

i should delete that

mellow kelp
#

sad

delicate zephyr
#

pepelaugh://

zenith terrace
earnest phoenix
#

LMFAO

pale vessel
#

i wonder how it looks on mobile

earnest phoenix
#

also nevermind i realised i'm dumb, you need to have some text after the protocol in order for it to work

pale vessel
#

because of discord's consistency

zenith terrace
#

one moment, gonna send ss

earnest phoenix
#

<file:///C>

#

awh

#

they did remove file:///

delicate zephyr
#

that worked

pale vessel
#

for the greater good

earnest phoenix
#

yum consistency

pale vessel
#

figures

zenith terrace
#

yes

earnest phoenix
#

this should launch skype

pale vessel
#

csgo time

delicate zephyr
#

fuck csgo

pale vessel
#

LOL

delicate zephyr
#

glad I got rid of the game

pale vessel
#

i don't even play it

earnest phoenix
#

works

delicate zephyr
#

F

zenith terrace
earnest phoenix
#

i wish it would work

delicate zephyr
earnest phoenix
#

the protocol is only there to launch it apparently

mellow kelp
#

yomomma://sofat

earnest phoenix
crystal wigeon
#

also, on topgg i see that the voes get reset every month

#

is there a way to get total votes?

delicate zephyr
#

yes

#

When you fetch the bot from the api

#

you get sent the points value

earnest phoenix
crystal wigeon
#

which prop is it on

copper cradle
#

lmao it does open the calculator

crystal wigeon
#

client.user.votes?

delicate zephyr
copper cradle
crystal wigeon
#

thanks

earnest phoenix
#

awh

delicate zephyr
earnest phoenix
#

well

#

it launches... an error

copper cradle
#

it works for me

#

oh wait

#

damn

earnest phoenix
#

module.exports = {
  name: 'ban',
         /**
     * @param {Message} Message
     * @param {string[]} args
     */
  run: (message, args) => {

 if (!args[0]) return message.channel.send( { embed: { description: `Please mention a user to ban`}});
   if (target.hasPermission('BAN_MEMBERS')) return message.reply(   { embed: { description: `You cannot ban this user!`}})
  if (!message.member.hasPermission('BAN_MEMBERS')) return message.reply( { embed: { description: ` You cannot ban members`}})
  
  const target = message.mentions.members.first();
  const reason = args.join(' ');

   if (!target) return message.channel.send(  { embed: { description: `please mention a user to ban`}});

  target
    .ban({ reason })
    .then(() => {
      const embed = new MessageEmbed()
      .setDescription(`**${target.user.tag} has been banned by ${message.author.tag}**`)
      .setColor('#ff0000')
      message.channel.send(embed);
    })
    .catch(err => {
      console.log(err);
      message.channel.send(`<@${message.author.id}> error while banning <@${target.id}`)
    });
  }
}```
#

Yes, I know I asked before. But why isn’t this working, no errors..

pale vessel
#

Again, where did you define target?

#

You never fixed that

copper cradle
#

smort

cinder patio
cobalt spruce
#

BAK

pale vessel
#

i'm blind

copper cradle
pale vessel
#

but still, move that target down there ffs

#

not sure how they didn't get any error

copper cradle
#

^

earnest phoenix
#

Oh ah..

#

they did

#

I didn’t

#

but they don't handle their errors properly

pale vessel
#

check the console?

earnest phoenix
#

if run is unawaited and there's no catch attached to it, the error will get swallowed

#

nvm

#

i realised it's a sync function

#

oh they're thinking of syntax errors

earnest phoenix
copper cradle
#

...

earnest phoenix
#

nice they still didn't learn the difference between syntax and runtime errors even after being told to do so for a month straight

copper cradle
#

how can you not see it

crystal wigeon
#

client.user.points is undefined

#

@delicate zephyr

copper cradle
#

you tried to use target before defining it

earnest phoenix
#

Ohh so

delicate zephyr
#

console.log client.user @crystal wigeon

crystal wigeon
#

when it logs in right?

delicate zephyr
#

wait

earnest phoenix
#

message.mentions.members.first(); const target?

copper cradle
#

...

delicate zephyr
#

are you fetching this from top.gg

#

or disciord

#

lol

earnest phoenix
#

Sorry I’m confused..

crystal wigeon
#

djs

delicate zephyr
#

uh

crystal wigeon
#

on topgg im using that webhook which gives only the voter

copper cradle
#

do you not know basic js syntax?

crystal wigeon
#

in req.voter

delicate zephyr
#

you cant get the amount of votes from top.gg through d.js

#

oh

cinder patio
#

I literally told him the same thing yesterday...

crystal wigeon
#

figured hehe

#

so

#

req.client

#

should give me the client right?

copper cradle
#

why are you trying to develop a bot if you can't figure this out

#

I'm sorry but this problem is an easy fix and you just managed to make it worse

delicate zephyr
earnest phoenix
#

I don’t give up that’s why

copper cradle
#

just move the target variable to the beginning of the function

#

this is what your trying to do

#

console.log(samuel) //undefined

var samuel = 123;

console.log(samuel); //123
earnest phoenix
#

Ohh I get it like under const require.... like under the first line?

copper cradle
#

see the problem there?

#

you can't use a variable before defining it

earnest phoenix
#

Oh yes

copper cradle
#

the samuel variable exists for everything below it

#

you gotta define variables above everything that will be using them

pale vessel
#

won't the first line throw an error

copper cradle
#

yeah

earnest phoenix
#

Thanks you actually learned me something

copper cradle
#

but it's easier to explain this way

earnest phoenix
copper cradle
#

np

pale vessel
#

or cannot access x before initialization

copper cradle
#

it's just easier to explain

pale vessel
#

icic

copper cradle
#

I could've used var tho

pale vessel
#

uh oh

copper cradle
#

so it made more sense

earnest phoenix
#

But, what are those numbers about?

fair axle
#

What is the time limit for reaction collector?

copper cradle
#

those are just random numbers I chose for the samuel variable

earnest phoenix
#

But how would I know which numbers to use?

copper cradle
#

you don't have to use any numbers?

earnest phoenix
#

Ohh, what were those then

copper cradle
#

that was just an example of how variables work

earnest phoenix
#

Oh, ok

#

@copper cradle btw is there docs about these?

#

Would be appreciated if you could throw some to me

cinder patio
#
copper cradle
#

^^

cinder patio
#

We've been throwing those at you since you came here

formal maple
#

how do i get guild count with discordgo?

pale vessel
#

jay ass

stark abyss
#

is there a way to get your bot to post a spoiler image

#

in djs

earnest phoenix
earnest phoenix
stark abyss
#

possible to do with url?

earnest phoenix
#

nope

stark abyss
#

+embed

#

okay

cobalt spruce
#

what's rong ```js
if(!message.author.id('376064908317425677')) return message.channel.send("No")

earnest phoenix
#

you have to download it to your memory and reupload it

stark abyss
#

alright ty

copper cradle
#

@cobalt spruce everything

copper cradle
#

id is not a function

cobalt spruce
#

lol

copper cradle
#

and what you want to do there is compare the property id with the id you got there

earnest phoenix
#

mans got too far into functional programming

#

Sorry, didn’t really understand it but is it like this?

copper cradle
#

no