#development

1 messages · Page 1722 of 1

quartz kindle
#

imo its not worth it

lyric mountain
#

It is

#

People loved it

earnest phoenix
#

i did this in my ts code and it worked, thanks

quartz kindle
#

unless you have bandwidth issues

lyric mountain
#

Used to be slower, but I managed to speed it up a bit

quartz kindle
#

the time it takes to compress is bigger than the time you save on uploading

#

at least it was for me

lyric mountain
#

Can't send the full img below 8mb

lusty quest
#

would be fun if you could use LZMA2 for compressing images and sending them around, sadly its not really supported widely

lyric mountain
#

Well, I mean

#

I could try using jpeg compression

#

But that'd mean saving the file locally then uploading it

#

Instead of directly sending the bytes

lusty quest
#

cant you just edit it in the buffer?

solemn latch
#

👀 actually. I have a image host, is there an easy way to compress images server side?
its just me uploading, so time isnt an issue, but saving even 10-20% storage would be nice.

lyric mountain
#

The issue isn't manipulating it

#

It's sending

worn sonnet
#

are these good enough?

lyric mountain
#

Currently I compress it then send

worn sonnet
#

cloud hosting

cinder patio
#

How's that 0 bucks

lyric mountain
#

Free = bad

solemn latch
#

3 cores free pog lol

cinder patio
#

it looks good though

old cliff
lyric mountain
worn sonnet
old cliff
#

Lmao... dm me link... I'll verify

lyric mountain
#

Rule of thumb is: if a product is free then you are the product

cinder patio
#

I mean if they were lying then they would've probably been sued numerous times already

cinder patio
worn sonnet
lyric mountain
#

Maybe

lusty quest
fiery sun
#

hello

lyric mountain
#

Also oversold servers are a thing

#

You'd be amazed on how much users you can fit in a single server

lusty quest
#

yea if you overprovision hardware it starts to get funny.

fiery sun
#

what is the best language for a bot?

worn sonnet
#

well then i'll try test bot first

lusty quest
#

there is no best

worn sonnet
#

for some it Js, Py, Java

lyric mountain
#

That question again

cinder patio
#

the language you're the most familiar with is the best one

fiery sun
worn sonnet
#

here can u guys check it?

lyric mountain
#

The language that fills your need is the best one

worn sonnet
#

i mean not sure if it is oke

lyric mountain
#

Node isn't a lang

worn sonnet
lyric mountain
#

Like, you're going for heavy processing? Use js and you're up to a bad time

#

For web? Use js and you're walking in heavens

#

I'd say programming languages are like a carpenter's tools

#

You'd not use a chisel to tighten a screw

#

Nor use a philips to cut wood

worn sonnet
#

how do i set the permissions for bot?

#

like i can set permissions to use commands

lyric mountain
#

Either on invite creation page or through server's role config

worn sonnet
#

like i can check if a user has kick members permission to kick a member

opaque acorn
#

?

lyric mountain
#

Yes

worn sonnet
#

but how do i know if the bot has permissions to kick the member

lyric mountain
#

Most libs have some kind of member.hasPermission(permission)

lusty quest
lyric mountain
lusty quest
lyric mountain
#

I've seem people twist PS/2 connectors

earnest phoenix
#

Hey guys

modest maple
#

JS image editing just sucks lol

lusty quest
#

its ok, just a bit weird

worn sonnet
#

when i was checking out for VPS it asked me this but not for cloud hosting

#

any reason behind it?

lusty quest
#

yes. its required for some stuff you probably dont know about

buoyant pivot
#

can someone help me out with dealing with Missing Permissions error - it's not the source of the error that confuses me (like ik the bot needs to have permissions and be above any role it wants to manage) but rather how we deal with it. I searched it up and it said to use try catch (I'm using nodejs btw) but it doesn't seem to do anything

#

the only other way i can think of is just manually check permissions and the position of bot's role in comparison to the ones it wants to manage every time a function is called, but that's a ridiculous amount of editing on my end so just wondering if there's a better way to do it

quartz kindle
#

try catch only works for synchronous code or awaited promises

glass zodiac
#

wtop zoo

#

owo top zoo

quartz kindle
#

if youre not awaiting your promises, you have to use .catch() instead

buoyant pivot
#

ah ok that makes more sense - right now I'm using .then().catch() so I probably missed something somewhere - otherwise i'll try using async/await instead - thanks

#

yep i got it i think - thanks a lot man

earnest phoenix
#

;nitro

torpid otter
#

```const Topgg = require(@top-gg/sdk`)
const api = new Topgg.Api("Your Top.gg TOKEN Here ")

setInterval(() => {
api.postStats({
serverCount: client.guilds.cache.size
})
}, 1800000)
(edited)
[20:06]```

#

I have add this into my code and then save restart my bot and it won't show many sever is in but it keep saying n?A

#

await api.getStats('461521980492087297') do i need repalce with bot client id

#

ping me

grave haven
#

So i my bot cant use the message.auther.send('test'); and is giving the error ```C:\Users\wyatt\OneDrive\Desktop\IDK bot\index.js:76
message.auther.send('test')
^

TypeError: Cannot read property 'send' of undefined
at Client.<anonymous> (C:\Users\wyatt\OneDrive\Desktop\IDK bot\index.js:76:16)
at Client.emit (events.js:327:22)
at MessageCreateAction.handle (C:\Users\wyatt\OneDrive\Desktop\IDK bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\wyatt\OneDrive\Desktop\IDK bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\wyatt\OneDrive\Desktop\IDK bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\wyatt\OneDrive\Desktop\IDK bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\wyatt\OneDrive\Desktop\IDK bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\wyatt\OneDrive\Desktop\IDK bot\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (C:\Users\wyatt\OneDrive\Desktop\IDK bot\node_modules\ws\lib\websocket.js:835:20)``` Thanks, Gimmy!

steep drum
#

It's author not auther

grave haven
craggy root
#

good evening, is it normal that my discord bot does not display its status 1 out of 3 times?

vivid fulcrum
#

if you're changing it constantly

#

you're probably getting ratelimited

earnest phoenix
#

i have this board but when it sends it on discord it only has
☁️☁️☁️☁️
☁️☁️☁️☁️☁️
☁️☁️☁️☁️☁️

deft flame
#

@craggy root good night for us

deft flame
#

Well it sends correctly from what I see

trail breach
#

Hello all, trying to delete the embed posted, but it wont find it.

   client.channels.cache.get(`828812500039761930`).messages.fetch(db.get(message.id).then(msg => {
            msg.delete(10000)```

How its being saved 

```js
 db.set(message.id, embed.description)```
umbral zealot
#

You're fetching the return of the promise, lol.

#

Look at your parentheses

craggy root
#

@deft flame sorry i'm French

#

at the moment my bot does not display its status

trail breach
zenith terrace
craggy root
#

I don't have an error message

ancient gulch
#

@craggy root try to put the name in options

#
client.user.setActivity({ name: 'Nom', type: 'LISTENING' }) 
torpid otter
#

Do anyone get problems with api

ancient gulch
#

No everything work fine

#

To list all guilds, it's

client.broadcastEval('this.guild.cache')

?

torpid otter
craggy root
#

Ok thx Lemaa

ancient gulch
#

@craggy root come dm if you want I'm French

craggy root
#

Ah ok t fr?

ancient gulch
#

Hello, did someone know how can i get something like that with sharding

Expected Outpout with Client#users.cache.array()

[
  '825191974767820801' => User {
    id: '825191974767820801',
  },
  '242233306488373249' => User {
    id: '242233306488373249',
  }
]

Actual Result with Shard#broadcastEval("this.users.cache.array()")

[
  {
    id: '829304099921068043',
  },
  {
    id: '830961807296430120',
  }
]
waxen bough
#

How do you guys access v9 api

#

Is it some kind of opt-in thing

#

I know it's not for production yet

dense spire
#

is there a good way to detect DM'd messages/reactions in discord.py? Also is there a way to block commands coming from DM's

old cliff
#

If there is no guild linked with the reaction its a dm reaction

dense spire
#

ah ok

old cliff
old cliff
#

when I do it I get the expected result

#

Maybe because I cache all users

ancient gulch
lethal hill
#

how would i fix this to make it work? any ideas?

// broken guess command
      client.on('message', message => { 
          if (message.author.bot) return false
          if (!message.content.startsWith(`${prefix}`)) 
          return;
    if (message.content.startsWith(`${prefix}guess`)) {
        var guesses = ['1', '2', '3', '4']
            var guess = Math.floor(Math.random() * guesses.length)
        message.channel.send("Guess a number 1-4") 
           if (message.content.startsWith(guesses[guess]))
            message.channel.send('nice');
         } else {
       message.channel.send('no')
      }});```
umbral zealot
#

What's the problem with it though

earnest phoenix
#

I just ask one question how start bot and stop bot is visual studio

lethal hill
umbral zealot
#

Let's lint this and see why: ```js
client.on("message", (message) => {
if (message.author.bot) return false;
if (!message.content.startsWith(${prefix})) return;
if (message.content.startsWith(${prefix}guess)) {
var guesses = ["1", "2", "3", "4"];
var guess = Math.floor(Math.random() * guesses.length);
message.channel.send("Guess a number 1-4");
if (message.content.startsWith(guesses[guess]))
message.channel.send("nice");
} else {
message.channel.send("no");
}
});

earnest phoenix
#

Dead pls say na

umbral zealot
#

Are you... expecting someone to send another message after the first one? Because that's not how you get a second message after the first one.

umbral zealot
lethal hill
earnest phoenix
#

Soory but

umbral zealot
#

I don't speak squiggly lines

#

If you want to speak in your native language ask in #general-int

earnest phoenix
#

Bro I use replit so I don't know about

#

Vishal studio

earnest phoenix
#

It automatically host 24/7

lethal hill
#

thank you

earnest phoenix
#

Why everyone treat me like cringe person

umbral zealot
#

we literally don't know what you're writing your bot in, or why you don't know how to start your own bot

earnest phoenix
#

So I cnt know about visual studio

umbral zealot
#

if oyu're using repl.it you're not using vscode

#

if you're using vscode, learn the language you want to use before programming bots.

#

the way you start your bot has nothing to do with your editor, usually

earnest phoenix
#

I know language little bit

#

I make codes in visual studio

umbral zealot
#

If you don't know how to start a program in this language, you don't know enough to be self-sufficient

opal plank
earnest phoenix
#

And do host in replit

umbral zealot
#

learn the basics at least

opal plank
#

told you, you have 2 ways

#

integrated terminal or debugger

#

those are the only ways you can run ur bot with vsc

earnest phoenix
#

I know but is show error

opal plank
#

then fix it

earnest phoenix
#

It show error in my node

#

Pang

opal plank
#

WHAT error?

earnest phoenix
#

Not found node. J. s

opal plank
#

then install node

earnest phoenix
#

I do but my pc cnt support today I install

opal plank
#

also what command did you run?

earnest phoenix
opal plank
#

thats it?

#

the full thing

earnest phoenix
#

In terminal

opal plank
#

so you just typed index.js in the terminal?

earnest phoenix
#

No it say add language

#

I selected node because my codes or node

opal plank
#

you are making no sense

#

vsc doesnt have that

earnest phoenix
opal plank
#

the only thing it might ask you is to download something to open the file for you based on the extension

opal plank
#

dude you arent making sense, your english is barely enough to get you by a normal conversation

#

you better off asking in #general-int in your native language

earnest phoenix
#

I try to say

umbral zealot
#

someone can help in your native language

opal plank
#

most people use VSC either way, chances are quite high

next ferry
#
if(message.content.members.first()) {
   if(db.has(`afk-${message.mentions.members.first().id}+${message.guild.id}`)) {
       message.channel.send(message.mentiones.members.first().user.tag + " : " + db.get(`afk-${message.mentions.members.first().id}+${message.guild.id}`))}
   }
})
#

how can i define first

#

?

vocal oyster
#

The error is cannot find first of undefined?

zenith terrace
#

is message.content.members.first even a thing

#

there is so much wrong with that code

#

mentiones

vocal oyster
#

Looks like a few things copy pasted together

zenith terrace
#

it seems like it

opal plank
next ferry
#

oh

umbral zealot
#

Definitely because that is some horrible code duplication right there

gritty lintel
#

Is This Type Of Bot Description Okay?
ban <@user> Bans a member from the server. help Displays all the commands of the server. mute <@user> Mutes a user in the server. unmute <@user> Unmutes a user in the server. afk Set's an AFK message for a user. warn <@user> Warns a user. warnings <@user> Displays all the past warnings of a user. clearwarnings <@user> Clears all the warnings of a user. status Changes the status of the bot. report <@user>Reports a user. suggest Logs a suggestion to the server. invite Generates the invite link for the bot. kick <@user> Kicks a user from the server. say Broadcasts a message in the channel. addrole <@user> Adds a role to a User. removerole <@user> Removes a role from a User softban <@user> Soft bans a user from the server. purge <no. of messages> Deletes a number of messages in a channel. ping Gets the ping of the server and bot. Levels Commands level Displays your current level, rank and experience. level Your servers level leaderboard. Meme Commands memes Returns a list of meme templates. create_meme <#id> <quote1, quote2,> Creates a meme from a supplied template ID Custom Commands support Links For The Support Server name Creates A Random Name (Has A Little Chance To Get Name: Random Name) owner Owner Of The Bot xp Tells You About How Fast Chat XP Is dashboard Sorry No Dashboard For Now bot Describe The Bot premium Gives You The Information Of Premium Features

lyric mountain
#

Allowed? Yes
Readable? Absolutely no

#

Honestly, I'd quit the page the second I glanced at the description

delicate shore
#

yes

#

req returns an object

lyric mountain
#

That's late af

#

But anyway, try to navigate through that object

#

The headers should be somewhere

delicate shore
#

yes

#

but it doesn't have the api_key

solemn leaf
#

Which is better node fetch or request

blissful coral
#

node fetch tbh

delicate shore
#

someone said

#

that I need to do x-api_key

#

because it's a custom header

tribal siren
#

what's a message nonce?

solemn latch
tribal siren
#

oh i see

#

thanks

proven lantern
#

is it possible to edit an embed with a new embed? message.edit({embed:{...}})

earnest phoenix
#

Yeah

alpine hornet
#

Hey guys, I'm trying to set up my event handler. Is this right?

  module.exports = (Client, Discord) => {
    const load_dir = dirs => {
      const event_files = fs.readdirSync(`./events/${dirs}`).filter(file => file.endsWith('.js') );
  
      for (const file of event_files) {
        const event = require(`../events/${dirs}/${file}`);
        const  event_name = file.split('.')[0];
        Client.on(event_name, event.bind(null, Client, Discord))
      }
    }
  
    ["client", "guild"].forEach(e => load_dir(e))
  }```
#

I've gotten no errors, but when I run it, it doesn't to my ready.js event file.

earnest phoenix
#

Did you changed your main file?

alpine hornet
#

That is in my index after my command handler.

#

@earnest phoenix

old cliff
#

do other events get triggered?

round quiver
#

try logging the commands in the console and see where it breaks

old cliff
alpine hornet
#

Would i have to have something like this?

#

execute(client, message, args)

#

@old cliff

old cliff
#

no

#

depends on your event files

alpine hornet
#

Sorry, I'm new.

old cliff
#

show your event files

alpine hornet
#

I only have "ready.js"

#

@old cliff

old cliff
#

show your main file

#

index.js

alpine hornet
#

@old cliff

old cliff
#

oof

#

remove the module.exports = (Client...... {

#

and replace Client with client

#

in the module exports

alpine hornet
#

So remove this?

#

module.exports = (client, Discord) => {

solemn latch
#

you only need that if your exporting something.

#

you dont seem to be exporting anything, so no need for it.

alpine hornet
#

I see, other than that. Did I do it correctly?

earnest phoenix
#

Anyone pinged

fleet radish
#

hey

#

im getting errors bru

fresh verge
#

How would I create a uuid system?

lusty quest
#

i use crypto to generate unique ids

fresh verge
lusty quest
#

did you use js?

fresh verge
lusty quest
#

there are a few ways to get ids then

#

Node.js got a buildin module called crypto

opal plank
fleet radish
#

for someone

#

to reply

opal plank
#

dont, just post ur errors

fleet radish
opal plank
#

u using v11 syntax

fresh verge
opal plank
#

its guilds.cache now

fleet radish
#

oh

#

f me

#

ty

opal plank
#

np

lusty quest
# fresh verge How would I use it?
const crypto = require("crypto")
const id = crypto.randomBytes(8).toString("hex");
``` i use it this way in one of my bots, but its not a pure number id it also contains letters
#

creates a id with 8 digits

opal plank
#

you could also use timestamp to create an id

#

that would remove the very little chance of duplicates

#

its insanely improbable though

lusty quest
#

yea unix timestamps also work

opal plank
#

though that also has caveats

#

code runs extremely fast, microseconds

#

theres a chance you can generate the same timestamp twice

#

so make sure you wait at least a single ms

solemn latch
#

or do what discord does, have a process count and timestamp.

lusty quest
#

use a timestamp and a random number generator and add the random number to the timestamp

opal plank
#

that would be preferred, yes

#

that would completely rid of duplicates

#

do i have it still?

#

1 sec

solemn latch
#

I wonder, when does their increment reset. When it reaches the end? Or every minute or something.

opal plank
#

no clue

delicate shore
#

Hey guys
How to render multiple objects in EJS

#

using express

solemn latch
#

multiple objects?

delicate shore
#

yes

#

like

#

res.render('index.ejs', { data: JSONdata })

#

I want to render 2 objects

#

or you can say JSON data

#

but I think I found a way

#
  res.render('index.ejs', JSON.stringify({data2: arrayData, data1: JSONdata}))
solemn latch
#

or

res.render('index.ejs', {"data": arrayData, "data2": JSONdata})

delicate shore
#

ya

#

Thanks

earnest phoenix
#

how can i add hyper link at this code ?

brave geode
earnest phoenix
#

How I find out which server has got the failed permissions?

opal plank
#

@earnest phoenix console log your error in a catch block instead of not handling your promises

#

also

#

it says the channelid right there

earnest phoenix
#

I mean Guild

opal plank
earnest phoenix
#

Do I can tell them

opal plank
#

you have the channel id

earnest phoenix
#

That’s no good

#

What’s that going to get me

opal plank
#

are you even listening?

earnest phoenix
opal plank
#

and you gonna do what with a guildId?

earnest phoenix
opal plank
#

you cant send a message to a guild

#

also

earnest phoenix
#

But, how I stop that errror

opal plank
#

as i was trying to say before you cut me

earnest phoenix
#

It ain’t my server, it has admin in my server

opal plank
#

with the channelid you can get the guildid

#

fetch the channel from your cache

#

and check which guild is its parent

earnest phoenix
#

How?

opal plank
#

also check for permissions BEFORE you run stuff

opal plank
earnest phoenix
opal plank
#

no shit

#

i saw that

#

i mean library

#

not language

earnest phoenix
#

Well that the fuck is that

opal plank
#

discord.js? detritus.js? eris.js?

earnest phoenix
#

discord.js!

opal plank
#

okay, now which command do you have deleting reactions?

earnest phoenix
#

Um, hold in

#

I think it is pruning

#

As you say DELETING reactions

opal plank
#

where did you copy this from?

earnest phoenix
opal plank
#

you would've known theres nothing here deleting reactions if you did

#

the only d.js function you using here is .send()

earnest phoenix
#

Okay

opal plank
#

i ask once again, where are you DELETING REACTIONS?

#

you're the one who wrote the code, i assume you at least know your own code, and not blidnly copy pasting stuff without knowing what it does

#

thats the minimum i expect

earnest phoenix
#

I did it many years ago, then gave up on it

opal plank
#

either way, look in your code for something like .clear() or .delete()

earnest phoenix
#

Okay

#

Stalk through all the files?

opal plank
#

yup

earnest phoenix
#

Think I may have found it, give me some time please

opal plank
#

ok

earnest phoenix
#

Oh

opal plank
#

there you have it

#

check if it has permissions beforhand

earnest phoenix
#

how can i remove all the roles from a person when a particular role is triggered

#

any bot

earnest phoenix
earnest phoenix
#

I hate auto correct

#

plss tl

opal plank
earnest phoenix
opal plank
#

huh?

brave geode
earnest phoenix
#

The. Catch

earnest phoenix
opal plank
#

the what now?

#

cache*

#

not catch

earnest phoenix
#

It’s my auto s

opal plank
#

check BEFORE you run that

earnest phoenix
#

Cache

earnest phoenix
opal plank
#

the removeAll()

#

thats whats erroring

earnest phoenix
#

which will remove all the roles from a person when a particular role is assigned

#

?

#

It’s the invite url oauth perms isn’t it?

#

i thought you were asking how to code it

opal plank
#

YOUR member

#

not whoever used it

earnest phoenix
#

man

#

i really want to write my bot in c#

earnest phoenix
opal plank
earnest phoenix
#

It’s seems that the bot does not have permission to do the deletion/ removing all f emoji

opal plank
#

thats literally what i've been saying

earnest phoenix
#

I

#

I will fix the invite

#

Link

#

To make it get the perms

opal plank
#

did u read what i sent you?

earnest phoenix
#

Just let me get on with it

opal plank
#

its not gonna fix your problem my dude

#

stop being stubborn, read what i sent you

earnest phoenix
opal plank
#

i give up

earnest phoenix
#

That’s obviously not the problem

#

I give up is my solution too

#

I will remove console.error

opal plank
#

well, if you know everything, fix it yourself

#

least you could do when asking for help is listen

earnest phoenix
long crow
earnest phoenix
#

I give up

#

I broke the entire bot now! 🙂

royal herald
#

Yo hello there,im getting this error on Android studio:

MainActivity.java (at line 937)
	public static double eval(final String str) {
	                                          ^
Syntax error on token ")", ; expected
#

its on class btw

earnest phoenix
#

final String str BlobThinkGlare

royal herald
#

Wait wait i fixed it

stiff lynx
steep drum
#

You've spelled length wrong multiple times

stiff lynx
split hazel
nocturne field
#

bro kit bot not working

#

again what is this issuw pls fix this

lavish bramble
#

I think

waxen bough
#

does guild.fetchBans() throw error when no permissions or does it return null|undefined?

earnest phoenix
#

How can I fix this? My bot is about to get verified

waxen bough
#

why do they require IDs

earnest phoenix
waxen bough
#

okay thanks

hollow rose
#

how can i invite the bot in my server

waxen bough
#

please do not message to several channels

earnest phoenix
#

Does mongoose by any way prevent NoSQL injections? Lets say i have a string from user input. I save it to the database. Can mongodb potentially execute that? Or does the mongoose driver prevent such things?

lusty quest
keen turret
lusty quest
keen turret
#

Oh, didn't know that - good to know 👍

verbal summit
#

was that after you apply the verification form?

#

because i thought my bot was also rose kinda fast tho

#

but i apply the form without bump

signal estuary
#

when I want to save an emoji to mySQL i get this error.
[emoji is a MEDIUMTEXT in mysql]

lusty quest
earnest phoenix
#

Help meee

earnest phoenix
earnest phoenix
earnest phoenix
#

Its In the models folder

#

right??

#

its not in models

earnest phoenix
long crow
#

smh, I cant even see what is what on the SS

#

.. mean going backward from current file

earnest phoenix
long crow
#

. mean going forward

earnest phoenix
#

./ means the current directory, ../ means jumping a directory back

#

ok i try

#

folder in folder mh

#

../../embeding.js

#

oh yes

#

maybe

#

Also wrong name embedding not embeding

#

thx

#

Show code or the full error

cinder patio
#

You have all these files and you're stuck on an error like this :/

umbral zealot
#

guess who copied most of their code? ayy

earnest phoenix
#

just reversed two letters

median iris
#

which button should i press

cinder patio
#

Get it already compiled

lyric mountain
#

also if someone get banned for abusing bots it'll be impossible to verify with another account

signal estuary
#

I want to check if the bot can use an emoji (if he is on the server where the emoji is or if its a standart emoji, anyway he can use it)
but ```js
var searchEmoji = msg.guild.emojis.cache.find(emoji => emoji == args[1])

doesnt work. ' arg[1] = 👍 '
pale vessel
#

You're comparing an emoji object with a string

#

Compare the emoji name with the string

lyric mountain
#

technicaclly args[1] will be <:something:id>

signal estuary
lyric mountain
#

so you should compare that with the emote's mention not the name

#

if js has something like that

#

also don't use var

#

ah, and btw

#

it'll NEVER match an unicode emoji

#

msg.guild.emojis.cache only contains emotes not emojis

signal estuary
lyric mountain
#

no

signal estuary
#

how tf can I check if the bot can use an emoji?

#

so for e.g my command:
!check 👍

The bot has to check then if the bot can use this emoji

#

if you make
!check hAA

it should return: I cant use this emoji

lyric mountain
#

👍 is not :thumbsup:, it's actually \uD83D\uDC4D

orchid cave
#

...

lyric mountain
#

thumbsup is just a discord alias

pale vessel
lyric mountain
#

for emojis do what flaz said

orchid cave
#

whats the best database to store user data

#

for discord.js

lyric mountain
orchid cave
#

i can learn to use it

#

i dont know what datatbases are good

#

whats ur opinion?

lyric mountain
#

many are, there are no "best" database

#

depends on your specific use-case

#

and how proficient you are with them

orchid cave
#

im noob ngl

signal estuary
#

I just looked, and args[1] will save the emoji as a unicode character or object:id

lyric mountain
orchid cave
#

like money

lyric mountain
orchid cave
#

i tried mongoDB its hard to use

signal estuary
lyric mountain
#

it's not hard, it's just that you tried to use without knowing how it works

#

wait

#

you're using mysql?

lyric mountain
#

what are the length of your VARCHAR fields?

orchid cave
#

im not using any db rn

#

im asking...

lyric mountain
#

cuz you might face a serious problem if storing emojis in mysql

#

not u

orchid cave
#

okh

#

ohk

orchid cave
lyric mountain
#
MongoDB

Node.js and MongoDB is a powerful pairing and in this Quick Start series we show you how

#

both are relatively easy

orchid cave
#

mongo sux

#

sqlite hmm

lyric mountain
#

for mongo you treat data as individual entities, without necessarily having relation with other data

#

for sql you group data in tables, meaning data is related with eachother in the same table or with other tables

#

also in mongo you get, in sql you SELECT

crimson raft
#

Hi

pulsar void
#

i am trying to make it so my bot status states the number of server it is in but it gives me a TypeError cannot read property cache of undefined

#

gonna send the line in a hastebin

#

hastebin not working so

#

client.user.setActivity(`watching ${client.guilds.cache.size} servers`, { type : 'WATCHING'});

lyric mountain
#

guilds have no cache

#

they're always available

pulsar void
#

so should i remove cache

earnest phoenix
#

error while installing discord.js

latent heron
#

i have a painful confession to make

pulsar void
#

hmmm

latent heron
#

i've never used a logger module before blobpain

pulsar void
#

what is that

#

you mean the function to log the bot on?

pulsar void
lament rock
#

Put that code in the ready event

#

I suppose client.guilds is assigned post ready

pulsar void
#

what is wrong in it

lament rock
#

reset your token

pulsar void
#

i deleted it

lament rock
#

Still reset it. People could have screen shotted

pulsar void
#

fine

#

but still what do i do

lyric mountain
pulsar void
#

what i tried

lyric mountain
#

no

#

you tried to get the cache's size

pulsar void
#

well how do i do then

lyric mountain
#

ah nvm, discord.js DO store a cache of guilds

#

here's what I found

umbral zealot
#

Also the error is about client.guilds being undefined

lyric mountain
#

not exactly what you want, just as a reference

umbral zealot
#

Which can't happen.

#

So that's not an instance of Client

lyric mountain
#

I don't get it why djs uses a cache for guilds but whatever

umbral zealot
#

@pulsar void do a console.log(client)

pulsar void
umbral zealot
#

clients.guilds.cac ???

lyric mountain
#

he was probably re-typing it

pulsar void
#

oop

#

yeah

#

and it didn't display anything wrong when i did console log client

umbral zealot
#

show us the output?

#

There is no universe in which this code can possibly give you the error you're currently saying it gives you.

pulsar void
umbral zealot
#

Ok and can you show the actual exact error you get with the setActivity line

pulsar void
#

Sure

umbral zealot
#

I'd also point out on the other hand that the rest of your code will probably need updating, seeing as it's discord.js v11 code (as made evident by the fact that you have Discord.RichEmbed in there, which is v11 only)

pulsar void
umbral zealot
#

Ah I see

#

that's a different error

#

So right now the version of discord.js you have installed is v11. That's no longer a valid version. you need to update discord.js and update your code

pulsar void
#

let me update it to v12

#

done

umbral zealot
pulsar void
#

actually i just had to update discord.js

#

And it worked

umbral zealot
#

your changelog command won't though

pulsar void
#

I deleted it it was bad

#

actually the status won't show uppp

lyric mountain
#

did u fix the rest of the code?

pulsar void
#

i removed the command with rich embed

orchid cave
#

whats the prob here

pulsar void
orchid cave
#

BRO

#

YOU SHOWED THE TOKEN

signal estuary
#

I want to react with an emoji I meantioned with my second argument. But if the bot cant use the emoji it throws an error. So i did it in a try catch block. But instead doing the thing in the catch block it just throws the same error:

        try {
            var embed = new Discord.MessageEmbed()
                .setTitle('React with ' + emoji)
                .setDescription(description);
            var message = await msg.channel.send(embed)
            var emoji = args[1];
            message.react(emoji)
        } catch {
            msg.channel.send("``❌ Cant react with this emoji``")
            return
        }

ERROR:

DiscordAPIError: Unknown Emoji
    at RequestHandler.execute (C:\Users\Flo\Desktop\Discord_Bot\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async RequestHandler.push (C:\Users\Flo\Desktop\Discord_Bot\node_modules\discord.js\src\rest\RequestHandler.js:39:14) {
  method: 'put',
  path: '/channels/808771611070038049/messages/836217616871718932/reactions/hAA%3A745313572271161365/@me',
  code: 10014,
  httpStatus: 400
}
orchid cave
#

HIDE IT

pulsar void
#

fuck

orchid cave
#
  const args = message.content.slice(prefix.length).trim().split(/ +/g);;
  const command = args.shift().toLocaleLowerCase();

why using toLocaleLowerCase()

#

use toLowerCase()

pulsar void
#

reseted the token

orchid cave
#

nice

pulsar void
#

but in set Activity the server number won't show up

orchid cave
#

try removing cache

#

btw what Version of discord.js are you using

pulsar void
#

latest

orchid cave
#

latest wht

#

12?

pulsar void
#

yep

orchid cave
#

hmh

#

any errors?

#

just try removing cache and see what happens

pulsar void
#

let me try

#

still nothing

#

no errors but no status

signal estuary
orchid cave
#

...

lyric mountain
#

you didn't solve the major issue

#

which are those vars

signal estuary
lyric mountain
#

you have

signal estuary
#

let me use vars like i want

lyric mountain
#

use let/const instead of var

pulsar void
#

i don't understand i did a message channel send and it did fine with the same thing

signal estuary
lyric mountain
signal estuary
lyric mountain
#

an example:

signal estuary
#

tell me

pulsar void
#

but in set activity it dont work

lyric mountain
#
let a = 10;
console.log(a); //Outputs 10 normally

var b = 5;
console.log(b); //Outputs 20, which it shouldnt
b = 20;
signal estuary
#

it outputs 20 even if b isnt defined yet?

umbral zealot
#

var is archaic and by any logical definition, broken.

lyric mountain
#

like, var is hoisted

umbral zealot
signal estuary
#

Ah thank you. Leart sth new again

lyric mountain
#

vars create a shitton of weird issues

#

honestly, idk why it wasn't removed yet

pulsar void
#

help my set activity still not working

lavish bramble
#

Itz giving me link to my url but

#

Not showing

old bay
#

guys i mistakely turned off intents and now i cant turn it on what can i do?

cinder patio
lyric mountain
#

backward compatibility sucks

cinder patio
#

If they were to remove var completely I'm sure at least 50% of all websites are gonna stop working

lyric mountain
#

but is understandable

lavish bramble
lyric mountain
#

they should give some deadline tho, can't count how many people are going to find future issues because of that keyword

lyric mountain
wraith falcon
#

Привет всем

#

Hello

lyric mountain
old bay
wraith falcon
#

What?

lyric mountain
wraith falcon
#

Im Rushe

old bay
lyric mountain
#

ah

old bay
lyric mountain
#

you're not verified are you?

wraith falcon
#

Я не онимаю

old bay
lyric mountain
#

verified means verified

#

by discord

wraith falcon
#

I is Rushe

old bay
small sand
#

Does anyone know how to do dm, If so can you send me the code?

old bay
#

nor my bot is altho my bot is above 75 servers

#

i didnt verify it

lyric mountain
wraith falcon
#

Lol

old bay
wraith falcon
#

I what

lyric mountain
#

you can't turn it on again without verification AND intent whitelisting

old bay
#

RIP? i cant turn it on again

old bay
wraith falcon
#

Fuck

lyric mountain
#

then do it

#

but you'll need to wait about 1 month

wraith falcon
#

Loch You

old bay
lyric mountain
#

@wraith falcon can you don't?

lyric mountain
pulsar void
#

nvm i changed it to presence and it works thanks still

lyric mountain
#

although if you're minor you need your parents

old bay
stable eagle
pulsar void
wraith falcon
pulsar void
#

age limit on discord?

lyric mountain
old bay
lyric mountain
pulsar void
#

og

lyric mountain
#

for verifying is 16

pulsar void
#

oh

#

and what was that parent thing about

lyric mountain
#

to verify

wraith falcon
#

if you don't understand then could you stop sending random stuff?I'm from Russia, I don't understand you

#

I'm from Russia, I don't understand you

#

I'm from Russia, I don't understand you

#

I'm from Russia, I don't understand you

pulsar void
#

so if you are under 13 you need a parent permission to join discord?

lyric mountain
#

@scenic kelp please

scenic kelp
#

pain

wraith falcon
#

𝚡𝚘𝚣𝚊𝚞𝚗

pulsar void
#

ummmmm

lyric mountain
scenic kelp
#

@wraith falcon this is an english server, if you want to speak russian go to #general-int

pulsar void
#

it's for verifying bots that you need ur parents if ur under 16?

lyric mountain
#

yes

pulsar void
#

ohhhhhh

umbral zealot
#

no, for verifying bots you can just get someone else to verify the bot for you, not just your parents.

old bay
#

@lyric mountain so as u said this will require 1 month or so?

lyric mountain
pulsar void
#

i think they should allow underaged on discord but add a filter(but they're too lazy to do it)

old bay
#

btw tysm for your help

umbral zealot
#

but also have no idea what Discord is and how it works usually.

lyric mountain
old bay
umbral zealot
pulsar void
#

oh

#

anyway i am gonna go because i dont wanna get warned for off topic sooo

#

bye

umbral zealot
#

Go research COPPA for more info

pulsar void
#

k

#

it give me a result on food

lyric mountain
#

coppa not copa

pulsar void
#

oh

earnest phoenix
#

@old bay but it can't you need to get 50k member atleast

#

it's your bot

lyric mountain
#

what?

#

50k for what

opal plank
#

its 75 servers, and idk if anyone mentioned, you can get your guardians ID for verification

#

you dont need to use urs

slender thistle
#

You actually have to have them create an account and apply

opal plank
#

wait rlly?

lyric mountain
#

yep

slender thistle
#

I remember reading that somewhere

opal plank
#

hmmm interesting

lyric mountain
#

they gotta create an account, get the ownership of the bot and apply

#

or be the owner of the team

feral halo
#

I'm making an economy bot, and I wanna ask you guys for your input on my currency system.

The way I see it, I have three options:

Option 1: All servers share the same currency (makes it easier for leaderboards and the rest of the backend structure, but gives less per-server customization)

Option 2: All servers have their own balance, but there is also a separate global balance that does basically the same thing (same games, etc.) for leaderboards since it is not guild-specific (might make people not want to use the guild-specific balance, which could be bad)

Option 3: Have separate balances for each guild and then a bank/wallet system where users can deposit to the bank from any server and then withdraw from the bank to use in 1v1 multiplayer games on a different server, or maybe just ignore the withdraw/deposit altogether and just use the same balance per server.

Im thinking I should go with option 3, but if you guys were using a bot like this, what would you want?

eternal osprey
#

hey i am trying to set up my bot on my vps

#

however it is saying: fields.flat is not a function?

#

is that maybe because i am using discordjs v12 and node-js v10?

umbral zealot
#

12 or 14 is what you should use

eternal osprey
#

aha thanks evie

autumn rivet
#

can someone help me with my python bot ?

umbral zealot
umbral zealot
feral halo
summer trail
#

I know some stuff but I can't necessarily help what's up @autumn rivet

feral halo
#

But I guess they could make fake accounts and then purposefully lose games to transfer

umbral zealot
#

yeah, that`d be a way they do it

autumn rivet
#

i want to add a command so my bot dm the user

umbral zealot
#

honestly I've seen some pretty weird shit going on with global point systems and people just obsessed with fake numbers

summer trail
autumn rivet
#

yes

feral halo
#

Ive seen people do like a 10% tax on games to make it slightly more annoying to do that, or just have no multiplayer games so you only play against the bot and then you can't transfer coins, but yeah that makes it impossible to have multiplayer games

umbral zealot
#

Honestly, it's sort of really up to you, in the end? Like, probably all these systems exist in some bot or another, and they're all successful to a point

#

whatever you think would work for people

feral halo
#

ok yeah, thanks for your help

umbral zealot
summer trail
#

@autumn rivet ctx.author.send

#

The member class has a send method

#

That sends a DM

autumn rivet
#

ok

earnest phoenix
#

yo what i would use for making images with custom text like dank memer does?

umbral zealot
#

canvas / canvas-constructor for nodejs. For other languages I have no idea

umbral zealot
earnest phoenix
#

do i need to download canvas package or something?

umbral zealot
#

like... look at the 2 things I said, first off

earnest phoenix
#

kk

#

ty for helping

umbral zealot
earnest phoenix
#

canvacord doc i found hope it helps

cinder patio
#

That's sus

delicate zephyr
#

bots scrape the npm search for new packages iirc and bot downloads

earnest phoenix
#

hmm

cinder patio
#

20 million times in a week though...

delicate zephyr
#

ye

cinder patio
#

I doubt that

delicate zephyr
#

its not uncommon

cinder patio
#

20 million...

umbral zealot
#

Yeah my new module was scraped. That was 10k downloads. Not 20 million.

autumn rivet
#

can someone join my server i want to see if my bot Dm you you can leave after that

cinder patio
#

Use an alt account

#

or a friend

autumn rivet
#

ok

earnest phoenix
cinder patio
#

canvacord

fleet turtle
umbral zealot
#

Daily reminder to scroll down to the last message before hitting "reply" to someone

#

As this person has already been helped.

fleet turtle
#

hm alr

autumn rivet
#

is someone good with python ?

fleet turtle
#

was just trying to be helpful bc i primarily code in python

#

but my bad

fleet turtle
autumn rivet
#

oh

#

can i dm you ?

fleet turtle
#

sure

summer trail
#

I am also

earnest phoenix
sterile lantern
#

how would i make it so if someone provides ha it changes to Ha

#

aka just the first letter being capital

dusky sundial
#

In what language?

fleet turtle
#

like the bot editing the users message?

#

or sending it itself

sterile lantern
#

js

earnest phoenix
sterile lantern
#

and editing a user-provided msg, yea

earnest phoenix
sterile lantern
#

??

fleet turtle
sterile lantern
#

idk what ur talkingabout

sterile lantern
#

say i run

#

;test ha

#

it would log in the console

#

Ha

#

but i figured it out

earnest phoenix
fleet turtle
#

oh

#

ok

umbral zealot
sterile lantern
#

please dont ping me, i have no clue what you're talking about

#

nor am i able to help because i dont use top.gg's website

earnest phoenix
earnest phoenix
umbral zealot
#

up to 2 weeks or more

#

Now go re-do your bot description so it's not just character spam. thumbs_up

cinder patio
#

Waiting time may actually increase if you're not being nice 😢

solemn latch
#

2 weeks is a short time in the world of applications CB_eyes_squeezed.

#

I've had api access requests take months.

round quiver
#

😂

#

nice nice

lament rock
#

My Weeb.sh api access took over a year to get a response

fleet turtle
#

who wants to help me test out my anti nuke

signal flax
#

🥺

worn sonnet
#

Is mongodb a good database?

#

I'm switching from Sqlite to mongodb

#

So any advice or smth?

cinder patio
#

It depends on the data you're storing

#

since mongo is a document database

cinder patio
#

indeed

tardy hornet
#

how can i fix these 2 errors

worn sonnet
#

Would be helpful

tardy hornet
steep drum
#

There's not enough info, you haven't posted the code that throws the error

long crow
#

Abort error mostly related to your connection

quick willow
#

it's an api request

#

how could it take months

umbral zealot
#

They meant the request to get access to the API in the first place

solemn latch
#

^

umbral zealot
#

lol

opal plank
#

@long crow have u used the buttons feature yet?

tardy hornet
long crow
opal plank
#

hmm i see

onyx hare
#

i dunno why but i cant get this to work... (It has responses but removed em as not all of em are PG clean) i get no errors, and it refusing to listen for any message sent in the dedicated channel

client.on('message', async message =>{
    if (message.channel.id === '828315972972707851') {
     let webhookClient = new Discord.WebhookClient(webhookid, webhooktoken);
    if (message.author.bot){
      let args = message.content.trim().split(' ');
      const responses = ["test", "test"]
      const pepereply = responses[Math.floor(Math.random() * responses.length)]; 
     channel.setTopic(`Speak to pepe. (He can be mean.) | Responses: **${responses.length}** | Last Loser: **${message.author.tag}**`)
     webhookClient.send(`**[${message.author.tag}]** ${pepereply}`)
    }}});
umbral zealot
#

well it certainly wouldn't respond to you.

#

it only responds on the specified channel, and only to bots

#

and since you're not a bot...

onyx hare
#

actually it did error i was scrolled up, i couldnt get responses before initialization

#

it*

umbral zealot
#

the code above should not produce that error message.

earnest phoenix
#

lang.js file :

const data = require("../data/database.js");
const sql = require("mysql2");
const db = sql.createConnection({
    host: data.host,
    user: data.user,
    password: data.password,
    database: data.database
});
module.exports = async (client, message) => {
    
    db.query(`SELECT * FROM lang WHERE guild_id = '${message.guild.id}'`, function (err, result){
    
    let lang;
    if(!result[0]) lang = "fr";
    else if(result[0] && result[0].lang) lang = result[0].lang;
    
    const getLangue = require(`./${lang}.js`);
    const language = getLangue;
    });
};```

when i get x (lang.js file) in my message event, and i console lang x.language, he returned undefined, but why
amber wagon
#

Do we need to get 2 vps (instances/droplets) for database and hosting or can we host bot as well as database on just one instance

worn sonnet
#

hey

solemn latch
worn sonnet
#

how do i work with top.gg webhooks

solemn latch
#

realistically you can have as many things as the vps can handle.

worn sonnet
#

this thing

amber wagon
#

I'm trying to host mongodb in there as well

worn sonnet
#

oh oke

#

didn't knew they have docs

solemn latch
#

oh it has mysql too.

amber wagon
#

Oh ok thanks

earnest phoenix
fleet turtle
#

i need suggestions on stuff i should add to my economy bot's shop

novel jetty
#

Could someone help me with this please? I checked everywhere but couldn't find anything

stable eagle
#

It literally says in which file, which line the error is at

pulsar void
#

how do i make it so in my status it show the number of members the bot watchs from all servers

pulsar void
#

how do i do it and also you should show help.js

novel jetty
pulsar void
#

first of all u forgot the semicolon at the end of the line 408

late gull
pulsar void
#

yeah

#

and there is no name property in the line 408 so you must have changed something

rustic nova
#

-b 689802542850506775

gilded plankBOT
#

dblMod Banned MDZ#1691 (@fathom wadi)

rustic nova
#

fuck you telekom

novel jetty
#

It logged me out of discord when i clicked on his pfp

earnest phoenix
#

Who could help me I would like to do the same on my bot.

#

For me it gives that, the positions are strange reeee

If there is a person who can speak French speak French preferably please

torpid leaf
#

Does anyone know of any python modules or ways to make sure a link (generated via wikipedia scraping) is appropriate?

blissful coral
#

O raises a error and X doesn't

#

Same exact thing 2 different if statements

#

The data deletes but is throwing a error when doing so

#

@slim heart any idea?

slim heart
#

delete by x and y

blissful coral
#

kk

earnest phoenix
#

/home/runner/botlistgithubio/node_modules/express/lib/router/index.js:458
throw new TypeError('Router.use() requires a middleware function but got a ' + gettype(fn))
^

TypeError: Router.use() requires a middleware function but got a Object
at Function.use (/home/runner/botlistgithubio/node_modules/express/lib/router/index.js:458:13)
at Object.<anonymous> (/home/runner/botlistgithubio/routes/index.js:19:7)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at /home/runner/botlistgithubio/structures/app.js:35:21
at Array.forEach (<anonymous>)
at App.loadRoutes (/home/runner/botlistgithubio/structures/app.js:34:12)
at new App (/home/runner/botlistgithubio/structures/app.js:19:8)
at Object.<anonymous> (/home/runner/botlistgithubio/index.js:28:6)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
exit status 1

#

this error is coming

blissful coral
#

code?

earnest phoenix
#
const http = require('http');
require('dotenv').config();
//require("module-alias/register");
const config = require('./config');
var fs = require('fs');
const mongoose = require('mongoose');
var express = require('express');
var createError = require('http-error');
var app = express();
const colors = require('colors');
const App = require('./structures/app.js');
const bot = require('./client/bot');
const {MONGO_DB_URL} = process.env;

  let botname = "";

    //CONNECT TO THE DATABASE
    mongoose.connect(`${config.database.MONGO_DB_URL}`, {
      useCreateIndex: true,
      useNewUrlParser: true,
      useUnifiedTopology: true
    });
    console.log(colors.yellow(`Connected to the database on `) + colors.underline.green(MONGO_DB_URL));
    //Logged In The Bot
    let client = bot.init(config.discord.token);
    console.log(colors.yellow(`Logged in as `) + colors.underline.green(botname));
    //Listen To The Server Port

     new App(client).listen(config.port  8080);
    console.log(colors.yellow(Running on port ) + colors.underline.green(config.port  8080));
#

this

blissful coral
#

Where do you do anything with routers there?

earnest phoenix
#
const { Router } = require("express");
var express = require('express');

const bots = require("./bots/index");
const api = require("./api/index");
const theme = require("./theme");

const join = require("./join");
const login = require("./login");
const logout = require("./logout");
const user = require("./user");
const me = require("./me");


const route = Router();
const app = express();

route.use("/bots", bots);
route.use("/api", api);
route.use("/theme", theme);


route.use("/join", join);
route.use("/logout", logout);
route.use("/login", login);
route.use("/user", user);
route.use("/me", me);


route.get('/', (req, res) => {
    if (!req.query.q) res.render('index');
    else res.redirect(`/bots/search?q=${encodeURIComponent(req.query.q)}`)
});

module.exports = route;
#

this

analog imp
#

anyone have any issues with any rpi cluster using a dongle refusing to reconnect? i thought i configured the interface correctly but from time to time it still kicks it off FWB_PainedHarold

modest maple
#

Honestly doesnt suprise me

#

dongles are inherently unstable

blissful coral
#

Dongle isn't the best idea lul

analog imp