#development

1 messages ยท Page 1747 of 1

quartz kindle
#

do you want to return on error or not?

#

the first one is not returning

crimson vapor
#

fixed

green kestrel
#

new database server definitely worth it

#

this is latency graph

#

new db server is that tiny tiny area on the far right of the chart

#

have to zoom in to even see it lol

quartz kindle
#

i would go for the second one then, but keep the .catch on the same line

crimson vapor
#

ok thats what ive been doing, it is cleaner imo

quartz kindle
sage bobcat
#

One message removed from a suspended account.

green kestrel
#

some yes

sage bobcat
#

One message removed from a suspended account.

stiff lynx
#

hey everyone I'm back, I'm trying to change my data inside the database but doesnt work, works only for me and IDK why
https://srcb.in/ggVIUgFKyZ
This is the schema with my try in changing the guild ID

sage bobcat
#

One message removed from a suspended account.

cinder patio
#

oiscorda

earnest phoenix
#

not bad

copper cradle
sage bobcat
#

One message removed from a suspended account.

copper cradle
#

u writing it in c#?

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

Anyone knows any nsfw api?

solemn latch
#

a lot of people just use the reddit api with nsfw subreddits

lament rock
#

I just remembered that I'm not allowed to say that website here, but that one related to cat girls and reddit also works

earnest phoenix
#

I don't like reddite btw

#

Can you send me website in DMS?

solemn latch
#

just a heads up, using the api he is talking about will get your bot banned from discord ๐Ÿ‘€

#

if this is for a bot

lament rock
#

Oh really?

zenith terrace
lament rock
#

Yes that one

#

Why does it get your bot banned?

solemn latch
#

why everyone discussing anime nsfw api's ๐Ÿ‘€

#

loli's are against discord tos

zenith terrace
#

^

green kestrel
#

wait what

solemn latch
#

all of nekos life nsfw endpoints contain lolis

lament rock
#

Oh. I didn't realize it returned under aged

green kestrel
#

since when was that site against discord TOS

#

I thought it was just against top.gg rules

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

green kestrel
#

ah

solemn latch
#

loli's are against discord tos no?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

green kestrel
#

I don't get why people get the urge to even draw such things

earnest phoenix
#

in nsfw channels they against?

green kestrel
#

smh

#

yes

lament rock
#

Even in nsfw channels, yes

solemn latch
#

You may not sexualize minors in any way. This includes sharing content or links which depict minors in a pornographic, sexually suggestive, or violent manner, and includes illustrated or digitally altered pornography that depicts minors (such as lolicon, shotacon, or cub). We report illegal content to the National Center for Missing and Exploited Children.
https://discord.com/guidelines

earnest phoenix
#

So

lament rock
#

I guess that can be spun if the character isn't actually a minor

earnest phoenix
#

Bro it will work in nsfw channels so its against

solemn latch
#

any loli's will get you banned no matter if its a nsfw channel or not.

green kestrel
#

nothing to discuss tbh

#

its against TOS plain and simple

#

I don't have any image functionality like this in my bot so I had no clue, but woo is right

lament rock
#

I shall no longer suggest that api, then. Good to know it shows lolis

earnest phoenix
#

Pff

#

So i have to use reddit

#

Off

solemn latch
green kestrel
#

make your own api

lament rock
green kestrel
#

then you can control it's content

#

this is part why triviabot doesn't use e.g. open trivia db

#

that and OpenTDB doesn't support image questions

zenith terrace
solemn latch
#

I really need to finish my dog api pandasad

green kestrel
#

@solemn latch can I recommend cheweybot api

#

it has dog, cat, birb, tons more

#

and all sfw

zenith terrace
green kestrel
#

yes

latent heron
#

thighs are NSFW?

#

๐Ÿคจ

lament rock
#

pog you I know chewey

green kestrel
#

nsfw is such a wishy washy term

#

ask yourself is it nsfw in America

solemn latch
#

part of my api is having facts about the breeds and whatnot.
weight age size average litter size, etc.
and hard restrictions on image quality, size, and single dog requirements.

a lot of these api's will have 2-3 dogs in it of several breeds, etc.

latent heron
#

yeah, i get breasts and butts being NSFW, but thighs is debatable.

earnest phoenix
#

Library developer?

#

What it means

green kestrel
#

in some countries exposed ankles is nsfw and huge taboo

latent heron
#

yeah i made a top.gg api in Scratch

green kestrel
#

go with what Americans find nsfw

solemn latch
#

lol

earnest phoenix
#

Ohh

latent heron
#

no im the person who made this

earnest phoenix
#

still new to coding, so on some bots you can see how many servers the bot is in, how would i do that to my server
so people can see how many servers the bots in

latent heron
zenith terrace
#

php

latent heron
#

i'm actually going to send a PR to it soon

green kestrel
#

yeah American TV rule: so it's fine to show acts of horrid violence but don't show boobs..... nah I'm joking don't show either of those

latent heron
#

i was gonna hit up @green kestrel for stuff

#

im still not sure how to follow through a logger

lament rock
#

showing shoulders is forbidden!1!!

latent heron
#

does the lib itself need a logger?

green kestrel
#

I'm liking where your php API is going fl0w

#

no, the lib itself doesn't need a logger

latent heron
#

just support of one, aye?

green kestrel
#

just somewhere to pass in a psr compliant one

#

let the dev bring their own

latent heron
#

hmm

green kestrel
#

yup

latent heron
#

gotcha

#

yeah i think the new API looks 10X better now

green kestrel
#

I made the same choice of logging in my discord lib... other c++ discord libs have a hard dependency on the lib devs favourite logging API, I just expose an on log event and let the user hook on whatever they want

#

c++ doesn't have psr's etc

#

I guess closest it has is iostream and nobody likes iostream

latent heron
#

yeah kinda same here, i don't believe in forcing the dev to use a specific logger

crimson vapor
solemn latch
crimson vapor
#

ye

#

feelsbad

solemn latch
# stiff lynx pls ๐Ÿฅบ

you might run into some issues with ID's
each user can only have one serverID at a time because the way you are requiring uniqueness.

hidden anchor
#

hi
i have a special offer in Discord Bots Case...

#

its a bot like pastebin

#

but in discord

#

its 10x times faster

#

you can write, read thru servers

stiff lynx
hidden anchor
#

with the bot

solemn latch
#

you can make a joined key like
UserID-ServerID and make that the unique key.

stiff lynx
#

if the have the id of my testing server, they don't figure out in the leaderbord of their server

twilit geode
#

Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo

stiff lynx
solemn latch
#

it doesnt, it just prevents a whole host of other problems youll run into.

#

your issue seems your just fetching any user from a guild(the first one it finds from that guild), then not modifying it.

          let profile = await profileModel.findOneAndUpdate({
            serverID: message.guild.id,
          });
feral perch
#

Is there a way to check all the dms a bot receives?

#

Like we can redirect it to a particular channel on our server with the author id?

solemn latch
#

as in, an event for it?
just the regular event, and check the type.

feral perch
#

@solemn latch so I just check if the chat is in DM

#

And if it is

#

Then send the message content to a channel

#

Ri8?

solemn latch
#

I would suggest using a webhook rather than a message, for the higher ratelimit, but yeah.

feral perch
#

And the same goes for replying back using user.send(msg)

solemn latch
#

just a heads up, this should be a staff only channel. dms with your bot should be consider private information.

feral perch
#

Cool Thanks!!

#

@solemn latch Yeah It'll just be available to Me

#

On my private server

solemn latch
#

yep perfect

stiff lynx
feral perch
solemn latch
#
        let profile = await profileModel.findOneAndUpdate({
            serverID: message.guild.id, // this is what you are searching for. you are not setting anything on this line.
          });
stiff lynx
#

but when I use beg in different guilds It changes

solemn latch
#

nope, you're just not using it correctly.

#

please read the docs i linked to which explain it.

stiff lynx
#

but for other It doesnt work

stiff lynx
earnest phoenix
#

can i change scrollbar with css is it allowed?

solemn latch
#

yep thats fine

gritty ice
#

i could not do anything with quick.db it gives error like this. even when i just do const db = require('quick.db'). also it gives error

umbral zealot
#

you shouldn't be using any sqlite-based database services with repl.it

#

repl has its own database server, either use that, or use an external database server.

eternal osprey
#

hey how do i make a leaderboard of all the users in my mongodb, depending on their $$ count:

gritty ice
umbral zealot
#

yeah ok ? And?

eternal osprey
#
  guildId: reqString,
  userId: reqString,
  coins: {
    type: Number,
    required: true,
  },
})```
gritty ice
#

before past 3 days it workds

umbral zealot
#

I'm not worried about it working or not

solemn latch
umbral zealot
#

It's not about whether you can it's about whether you should. And in this case... you should absolutely not use sqlite on replit

eternal osprey
#

like, for loop the call function?

#

oowh mongo has a getUsers() property

#

okay one quick question, I actually already have a !leaderboard command for my leveling

#

what should i call this economy leaderboard?

gritty ice
umbral zealot
#

I literally just addressed that

#

are you ignoring me but just don't want to listen? But you still ping me to get my reply? Why?

earnest phoenix
#

better

#

or try to install quickdb again and again it will take time

gritty ice
umbral zealot
#

The reason you don't use quick.db or any sqlite-based database on repl is because the entire information is public

umbral zealot
#

same, bro

#

read

umbral zealot
#

your data is public

#

don't use repl with quick.db or sqlite or enmap or anything using files.

gritty ice
#

then how my another bot work

umbral zealot
#

...

earnest phoenix
#

but sometime it can't be install

umbral zealot
#

If you strip down and take a dump in the middle of main street, does your anus work?

#

Legit question here. It works but you shouldn't do it

umbral zealot
#

Well I guess the important thing is that they understand, I don't really care whether you do.

gritty ice
umbral zealot
#

But you should not

gritty ice
#

it install successfull

umbral zealot
#

do you not understand what I'm saying?

#

Am I using the wrong level of english?

#

sqlite bad on replit

#

no use sqlite

#

all can read your things

#

works but very very bad

gritty ice
#

any other free hosting

umbral zealot
#

none that are good

eternal osprey
#

Pretty cheap and good enough for a begin bot,

umbral zealot
#

There are a lot of cheap hosting. good "free" hosting doesn't exist.

gritty ice
#

i don't know about paid hosting

umbral zealot
#

a lot

gritty ice
#

okay

eternal osprey
umbral zealot
#

You have a few choices:

  • Ask on the replit server for help with their service
  • Use the internal replit database as is suggested by them
  • Use an external database like mongo or firebase
gritty ice
#

ok we can host and update our code

earnest phoenix
#

but my data are privet

umbral zealot
#

if you're not paying for repl, your data is not private.

gritty ice
#

i need choose vps pack right for discord bot host

umbral zealot
#

You can check the pins for a lot more details about how to choose a host.

gritty ice
earnest phoenix
umbral zealot
#

then why the fuck are you talking to me

#

I'm confused why you're even talking

eternal osprey
#

HWAHAHHA

earnest phoenix
zealous egret
#

Help pelase

umbral zealot
#

I legitimately do not understand how me helping someone else suddenly turns into some rando just butting in and saying irrelevant things and trying to bring the topic back on themselves.

zealous egret
#
async def on_command_error(ctx, error):
    if isinstance(error, commands.CommandOnCooldown):
      em = discord.Embed(title = "Spaming isn't cool my boi", value = 'You can use this command again in {}'.format(datetime.timedelta(seconds=int(error.retry_after))), color=0xf9b9ff)
      await ctx.send(embed = em)
    else:
      print('Ignoring exception in command {}:'.format(ctx.command), file=sys.stderr)
      traceback.print_exception(type(error), error, error.__traceback__, file=sys.stderr)

@tasks.loop(seconds=15)
async def change_status():
    await client.change_presence(activity=discord.Game(next(status)))```
umbral zealot
#

I'm going to take a wild guess and say... if isinstance(error, commands.CommandOnCooldown): is returning true

zealous egret
#

yeah

#

can you gyus help me with it?

umbral zealot
#

eeeeh no?

#

Just trying to push you to think in the right direction

eternal osprey
#

does anyone know how i can get all the users from my mongodb schema (so i can make a leaderboard): const profileSchema = mongoose.Schema({ guildId: reqString, userId: reqString, coins: { type: Number, required: true, }, })

#

trying to find something useful in their docs, but i can't find anything

sudden knoll
#

never used mongodb but that looks like what you want

fierce ether
drifting shell
#

i cant find out how to get okhttp to reconnect my websocket after it drops

eternal osprey
#

it just returns me a model query

fierce ether
#

should return all guilds with your id

sudden geyser
#

What are those troglodytes at stackoverflow doing

#

They're changing the font again!

blissful coral
#

Chat gonna be locked in a sec

#

@modern sable

#

or @rustic nova

rustic nova
#

oh true

eternal osprey
#

Not really what i want, I rather want to get all the users

shut nimbus
#

What is the recommended way to host a bot? seems like a weird question but im reaching the limits of one server, do I just upgrade it or is there a good way to have it work on multiple servers? maybe a load balancer?

solemn latch
#

you can just upgrade your vps as you need more.

shut nimbus
#

Ah I need to work on getting shared then, and I need to upgrade my VPS,

#

ive maxed out my ram and my VPS has been crashing

solemn latch
#

ah, yeah just upgrading the vps is fine. or try to limit how much you cache to only what you really need.

shut nimbus
#

Currently I dont explicitly cache anything, only what discord.py caches by default.

#

I think sharding should help alot with the crashing though, il look into setting that up.

solemn latch
#

if your hitting ram limits, sharding will make the problem worse.

#

sharding inherently increases ram usage.

shut nimbus
#

ok, so upgrade AND shard, ever since I added logging my bot has crashed my VPS.

solemn latch
#

๐Ÿ‘€ are you logging to a single file? is that file getting really large?

shut nimbus
#

logging as in like audit logs,

#

as a feature

solemn latch
#

ah

prime mist
shut nimbus
prime mist
#

I'm not familiar with discord.py, but it is probably caching more than you think. Are you requesting all the members for each guild or something?

shut nimbus
prime mist
#

And how many guilds are you in?

shut nimbus
#

im in a little over 150 guilds

solemn latch
#

๐Ÿ‘€

prime mist
#

OK you don't need sharding

solemn latch
#

.9 gig on 150 guilds?

earnest phoenix
shut nimbus
earnest phoenix
#

9 gigs??

shut nimbus
solemn latch
#

possible memory leak?

prime mist
shut nimbus
solemn latch
#

๐Ÿ‘€ we have people here with 3700 guilds, and using less than .1 gb.

shut nimbus
#

ok there is clearly something I need to fix

prime mist
earnest phoenix
#

Well yes

solemn latch
#

yeah, your just caching every member

prime mist
#

OK I think that is the issue then.

shut nimbus
#

Okay, il look into fixing that then, I have no idea how as of right now

shut nimbus
#

thank you

prime mist
#

It will also mean if you are actually using the cache somewhere, you will need to refactor the code to use the REST api.

eternal osprey
#
const test = await profile_schema.find({ guildId: message.guild.id }).sort([['coins', 'descending']]).exec()
const user = test.map((a, b) => b.userId)```why is user returning undefined? Test returns me: 
``{
  _id: 609a7b24a1dca52fa0d87418,
  guildId: '838039757493764176',
  userId: '345138133429649408',
  coins: 162,
  v: 0
}
{
  _id: 609be2908126d347788d1f57,
  guildId: '838039757493764176',
  userId: '745253908275920986',
  coins: 0,
  v: 0
}``
prime mist
#

Unless the member object is sent with whatever event payload you are using.

earnest phoenix
shut nimbus
solemn latch
earnest phoenix
#

yeah but i am using d.js v12

#

ยฏ_(ใƒ„)_/ยฏ

solemn latch
#

๐Ÿ‘€ not bad for normal djs

prime mist
#

Well it is a trade-off between memory usage / performance / API limits.

solemn latch
#

^

#

still most features realistically dont need any caching

earnest phoenix
#

170 mb ram usage with 150k users

earnest phoenix
shut nimbus
solemn latch
#

i hear detritus might be a good option

#

the graph i used above was for discordjs lite

prime mist
#

High memory use isn't inherently a bad thing, especially if it makes your bot feel fast & snappy.

But the problem is that often the client is caching stuff you aren't even using / stuff that isn't in your "hot path".

shut nimbus
#

I think about every 10 seconds or so im fetching for any given guild the member count.

prime mist
#

member count is on the guild resource though right? Don't need to get all the members to work that out lol.

shut nimbus
#

maybe I should limit the caching of other things that I am not using often as well, just never crossed my mind that I needed to limit what discord.py cached

shut nimbus
prime mist
solemn latch
#

the built in py member count isnt always reliable

shut nimbus
#

Yea, I think it may be a good idea to write my own member counter, Although I am not exactly sure how to implement that, maybe fetch the guild members and get the length of that?

prime mist
shut nimbus
#

AH so create my own feature, okay, I can do that.

prime mist
#

It looks like discord.py will automatically update the count using member events, even if they aren't cached. So you could just use that.

shut nimbus
#

perfect il disable members caching then!

prime mist
#

I could be wrong though, do the research ๐Ÿ™‚

shut nimbus
#

Currently am reading the documentation and in a little while il take a look at the source and check out whats going on! thanks for the help!

gloomy quarry
#

Hi, why is this a problem?

2021-05-13 22:14:11,574:ERROR:discord.shard: Attempting a reconnect for shard ID 3 in 2.00s
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/discord/shard.py", line 151, in worker
    await self.ws.poll_event()
  File "/usr/local/lib/python3.8/dist-packages/discord/gateway.py", line 582, in poll_event
    raise ConnectionClosed(self.socket, shard_id=self.shard_id, code=code) from None
discord.errors.ConnectionClosed: Shard ID 3 WebSocket closed with 1000

How to solve it?

eternal osprey
#

hmmm wait i have an array that contains 2 ids. i tried for looping so it would fetch each users id:

for (const names of user) {
        console.log(user)
        
          
              client.users.fetch(names).then((user) => {
        finaluser =  user.name 
})

}```
why is it still not working( in the name of, returning undefined?).
user = [id1, id2]
kind thicket
#

Heya, I am trying to save some information on MongoDB but for some reason its only saving the guild ID

  Guild: message.guild.id
  }, {
    $push: {
      Info: [{
        Category: category.id,
        Channel: channel.id,
        Role: role.id
        }]
      }
    }, {
  upsert: true
});```
earnest phoenix
#

how can i get only 8.50 texts with cheerio?

solemn latch
solemn latch
kind thicket
onyx hare
#

I get this error everytime my bot thinks something is wrong but thereโ€™s nothing wrong as it only happens when the internet has a lag spike how can I stop my bot from having a false error?

#

And thatโ€™s referring to my channel create logger I think might be the member update one

sudden geyser
#

.guild is null

#

Either you want to check what channel really is or if .guild will always be available

onyx hare
#

Itโ€™s the exact same thing I have on my other bot I tested it on same version of node and d.js and it never threw that error but Iโ€™ll experiment with it in a few hrs if it doesnโ€™t hiccup again, Iโ€™ve been in a bad mental state to attempt to fix it due to a ongoing medical condition

solemn latch
onyx hare
#

Ohh

drifting wedge
#

hi

#

can someone fix my problems?

#

just do my bot for me?

#

and my dashboard?

#

thanks

onyx hare
#

Ok turns out when someone joins the server and the welcome message sends itโ€™s crashing the bot o.o i got some work on my hands

sharp ledge
#

how to add random words to your bot invite link?

opal plank
#

u dont

crimson vapor
#

its discord randomized

sharp ledge
#

i see

boreal iron
#

a happy little tree
yikes... Discord Bob Ross edition (tm)

near stratus
#

How to get rid of this error ?
It shows nsfw doesn't exist in TextChannel

pale vessel
#

You mean DMChannel?

#

Cast it to a TextChannel

#

if (!(<TextChannel>message.channel).nsfw) or if (!(message.channel as TextChannel).nsfw)

clear marlin
#

why don't you check weather the channel is a dmchannel if it is not then continue

pale vessel
#

doesn't work that way

#

TypeScript isn't that smart

rocky hearth
#

What actually does this error mean?
I want to dynamically set a function to behavior, so doSomething is the initial behaviour.

clear marlin
#

ahh

lament rock
#

wish TS wouldn't yell at checking truthiness for values that might not appear on all signatures for a type

#

Among other things, TS could be better

quick ridge
#

Warning: Accessing non-existent property 'sendMessage' of module exports inside circular dependency

#

When I try to pull my function in a defined class, I get this error.

#

It has never happened to me before

subtle river
opal plank
quick ridge
#

If I use it like this the problem goes away

near stratus
opal plank
#

might be worth checking early in development

near stratus
#

okay I'll see thank you

#
const token = '!';
const commandClient = new CommandClient(token, {
  prefix: '..',
});

commandClient.add({
  name: 'ping',
  run: (context, args) => {
    return context.reply('pong!');
  }
});

Too much simple, I repeat Too much simple

prime mist
near stratus
opal plank
near stratus
#

yea

opal plank
#

ratelimits? boom, we got em

#

aliases? got it

#

custom prefix? got it fam

#

ratelimits per guild/channel/user? you bet

#

anything u need is already there and its so much more organized

#

not to mention, well, its an ACTUAL typescript library, so types will be available for everything

#
<CommandClient>.clear();
<CommandClient>.addMultipleIn('./commands', {subfolders: true});```
boom, you now got your handler right there
#

and to reload

#

now just yeet ur commands in /commands folder and u good to go

near stratus
#

@opal plank can I use music commands with it ?
like this is the play function I'm using https://pastebin.com/zn0Me2xM
So I.m using things like channel dispacher reaction-collector etc.

near stratus
#

are they available in deritus ?

opal plank
#

natively no, but its pretty easy to setup

#

import lavalink, and dispatch the events to the manager

#

thats it

#

lavalink handles everything for you

opal plank
#

let me get the same one i use

#

1 sec

#

@near stratusimport { Manager } from 'lavaclient';

#

lavaclient is the one

#

needless to say, i attched my managed to the commandClient

#

for easy access

#

and this for the other event

#

and thats it, you got yourself setup with voice

#

now u just make a command play and setup a new player

#

you just use those 2 methods.
serverUpdate()
stateUpdate()

solemn leaf
#

Did I do this right?

var hosts = ['192.168.1.10', 'google.com', 'yahoo.com'];

async () => {
    await Promise.all(hosts.map(async (host) => {
    })).then(() => {
        console.log("Done");
    });
};
thin echo
#

I'm trying to make a command so that when the owner of the guild that the message is sent in, it does something

#
if (msg.author.id === msg.guild.owner.id) {
      const laicheckmark1 = client.emojis.cache.find(emoji => emoji.name === ("LaiCheckMark1"))
      
      const laix1 = client.emojis.cache.find(emoji => emoji.name === ("LaiX1"))
        
    if (msg.content.startsWith("Lai nuke")) {
      msg.channel.send("DO YOU WANT TO NUKE?!").then(msg => msg.react(`${laicheckmark1}`) & msg.react(`${laix1}`))
      
      if (msg => guild.owner.react === (`${laicheckmark1}`)) {
        msg.channel.send("It worked maybe?")
      }
    }
  }```
#

I have been testing all day and this is the closest I have gotten so far

#

This is a owner only command

solemn leaf
#

what are them variable names,

thin echo
#

I tried looking a websites

thin echo
solemn leaf
#

Well take it from the message event

thin echo
#

ok?

solemn leaf
#

get the user speaking's id

#

which you did

thin echo
#

Ummm....

solemn leaf
#

have it log

copper cradle
opal plank
copper cradle
opal plank
#

how is it not?

copper cradle
#

KEKW obj

opal plank
#

ist an object

copper cradle
#

fair

opal plank
#

its single named, so its lowercase only

#

cuz only idiots dont use pascal case

swift cloak
#

yoo i get this when i try to make / commands for my guild.
"(node:16391) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Access"

sudden knoll
#

does it have permission to add slash commands in the guild

swift cloak
sudden knoll
#

god I hate that

earnest phoenix
acoustic citrus
#

Not able to edit bot site

swift cloak
#

ohhh

acoustic citrus
#

Doesnt update and no idea where to report

#

damn im tired

sudden knoll
#

for more info

swift cloak
#

i fixed. thanks

#

but how would i edit the command?

#

and delete?

sudden knoll
#

it's in there

#

just read the docs

solemn leaf
swift cloak
# sudden knoll just read the docs

ight. well woulld this get me rate limited?

interaction.getApplicationCommands().then(e => {
        e.forEach(async r => {
          await interaction.deleteApplicationCommand(r.id, )
        })
      })``` im getting all the / commands and its returning Command[] and so then i mapped it and delete each Command
sudden knoll
#

idk

solemn leaf
sudden knoll
#

just use the sheet index

#

or id

solemn leaf
#

how

sudden knoll
#

idk how the js package organizes sheets

solemn leaf
#

thats what Im confused on

sudden knoll
#

look at the bottom

solemn leaf
#

okay thanks

opal plank
#

kinda afraid to ask if u using sheets as a database, cuz most people who refer to it here do just that

solemn leaf
#

@opal plank no Im not

#

anyways that is just geting an object of them all

#

I dont know how to get a already made sheet

#

could I get some helps

solemn quartz
#

Hey, how can i know if a user's status is online/offline/dnd/idle?

sudden knoll
#

user.status in python

#

probably something similar in js

solemn quartz
#

ty

#

im coding in js

sudden knoll
solemn quartz
#

i did a research and i found presence.status

sudden knoll
#

there's also presense status

#

yeah

solemn quartz
#

oh lol

sudden knoll
#

idk, I don't use js

earnest phoenix
sudden knoll
#

correct, Member

#

in js, ClientUser.presence.status

earnest phoenix
#

Doubt, they want users' status, not the bot itself

sudden knoll
#

ah that's true

#

hmmm

#

member.user.presence.status

#

or ig GuildMember.presence.status works

solemn quartz
#

i want the webhook to send a message when the bot is online/offline

#

and im doing it in a different code

#

also how to get a guildMember by it's id?

sudden knoll
#

probably fetch

waxen rose
#

Pls work

solemn quartz
#

i got an error

sudden knoll
#

well fetch isn't actually a method

#

there's just probably a fetch method or something in js

#

I don't code in js tho so I don't know the exact name

solemn quartz
#

if const client = new Discord.WebhookClient(process.env.id, process.env.token)
shouldn't client.guild be a thing?

sudden knoll
#

but why

#

what guild would it reference

solemn quartz
#

the webhook's guild

#

the same webhook hasn't multiple guilds

#

its just one

sudden knoll
#

hmm i haven't messed with discord webhooks before

haughty tundra
#

do y'all guys know a bot hosting site with reasonable price and performance?

sudden knoll
#

galaxygate

sudden knoll
#

but there is a Webhook class

solemn quartz
#

Any ideas on how to make a bot on/off message?

sudden knoll
#

that has a guildID property

solemn quartz
sudden knoll
#

you mean like turn your bot on and off?

solemn quartz
#

nono

#

im talking about the same thing

sudden knoll
#

ohh

#

the online thing

solemn quartz
#

when the bot is on the webhook sends a message

sudden knoll
#

yeah

#

hmmm

#

idk

solemn quartz
#

and when it's off it sends another

#

Do you have any ideas of where i could search an answer?

opal plank
#

whats the issue again?

solemn quartz
#

the webhookclient hasn't a guild object

#

so i cant get my bot user

opal plank
#

why is that an issue?

#

just send a request to discord's api with /users/@me

sudden knoll
#

big brain, make another bot for seeing whether your bot is online

opal plank
#

that'll return your user

#

if you mean MEMBER, thats a different sstory

sudden knoll
#

lmao

opal plank
#

send it to guilds/$guildId/members/#userId

#

just a single request will do

#

that'll get your user on that X guild

earnest phoenix
#

If you just want to notify if the bot goes offline, why not just send it on shardDisconnect or something?

opal plank
#

webhooks wouldnt work on dms

#

if the bot is offline, it cant dm someone

#

big brain

solemn quartz
#

i mean, i could do a online message in the bot's code by coding an embed, bot.on(), find the guild and the channel and send the embed

#

but the bot can't know when itself is offline

earnest phoenix
#

There must be a disconnect event

opal plank
#
bot.on('shardDisconnect', () => {
  axios.post(webhookurl, {
    content: 'bot offline'
  })
})```
#

that simple

#

just axios, request or whatever other http lib you want

#

webhooks dont need tokens whatsoever

#

no need to bloat ur code with clients

#

either way, back to coding

solemn quartz
#

what's axios exactly?

opal plank
#

fetch, request, axios, got, anything

#

request is deprecated iirc tho

#

so use anything else

solemn quartz
#

or just webhookclient.send ?

opal plank
#

why bother bloating ur app?

#

just send a raw request

#

use that snippet i sent above instead of all that stuff u doing with guilds or whatnot

#

too messy and bloated

solemn quartz
#

k

brittle hamlet
#

while doing the autoposter thing I am getting this error TopGGAPIError [Top.GG API Error]: 401 Unauthorized (You need a token for this endpoint) at Api._request (/home/runner/Shinchan/node_modules/@top-gg/sdk/dist/structs/Api.js:76:19) at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Api.postStats (/home/runner/Shinchan/node_modules/@top-gg/sdk/dist/structs/Api.js:96:9) { response: { error: 'Unauthorized' } } but I inserted the token there it was working this morning but now it is showing like this (I regenerated the token a few also but the same error )

#

Can someone help me please

eternal osprey
#

hey

#

Why is my embed sending undefined only?```js
let reke1;
let maka;
let reke2;
const profile_schema = require('../schemas/profile_schema')
exports.run = async (client, message, args) => {
const test = await profile_schema.find({ guildId: message.guild.id }).sort([['coins', 'descending']]).exec()
const coins = test.map(profiles => profiles.coins)
const user = test.map(profiles => profiles.userId)
const guildname1 = test.map(profiles => profiles.guildId)
for (const nguilied of guildname1) {
reke1 += client.guilds.cache.get(nguilied).name
}
const resultembed = new discord.MessageEmbed()
resultembed.setColor("RANDOM")
resultembed.setFooter("AwsomeCord || Games")
resultembed.setTimestamp()
for (const names of user) {
console.log(user)
client.users.fetch(names).then((user) => {
reke2 += user.username
maka += (**AwsomeCord's Economy Leaderboard!**\nUser: ${reke2}+ " " + Server: ${reke1} + " " + :coin:: ${coins}\n)

})
}
resultembed.setDescription(maka)
message.channel.send(resultembed)

    }```
#

I've done this as my for loop was sending all the messages apart from each other, wanted them all in one embed.

vivid fulcrum
#

use async/await

#

you're not blocking your code so the embed builds and the message gets sent before even the first fetch completes

#

ew you are mixing async/await and promise patterns

#

smells like copypasta

#

anyways

#

get rid of the then in the fetch, await the fetch instead

stiff lynx
#

https://srcb.in/VdouPQ6mR1
Good morning, I have a quesion about the change of the serverID (aka guild.id).
I have a leaderboard that take only the member in a server based on the guildID in the server, there is a way to change this? But I would like that peole that joined my server for testing the bot can appear in the leaderboard of their main server. How can I change this ID bcs changing it manually seem a little bit too long

opal plank
stiff lynx
rocky hearth
#

can I return the same anonymous function, it is in.
So I could do
funCall()()()

stiff lynx
#

I'm a noob in coding and also u know

opal plank
#

Hey guys, how do i log stuff in console? i ask ebcause my bot is in 8k servers and with 950K people, so i need to know.

stiff lynx
opal plank
#

the server count/membercount you provide is completely irrevelant to the question, thats my point

stiff lynx
#

I deleted it from the message

#

I'm desolated

opal plank
#

I do have eval's that i use for a discord bot, but my question is, is there a way to have it execute strings in code with a debugger?

The use case for this is when the bot is offline and it cant reply to discord, so im trying to figure out a way to use the debugger console to get variables from the code. The issue lies is that i could potentially use readline package to do it, but the debugger isnt technically a terminal from what i can see, more like a vm ish.
https://cdn.discordapp.com/attachments/746439312018505788/842686910182457354/unknown.png

#

there are workarounds i can do, like using an api and a bare bones website to send it strings to be evaled and return the results, but i'd like iff possible to do it this way since i can ssh into the bot and attach a debugger on the node
basically, in sum:

i ssh with vsc
i attach to the debugger
i want to be able to use the terminal to eval within the app, like the example above, trying to console.log(manager) which is in the code```
#

@clear marlin good luck

rocky hearth
# vivid fulcrum theoretically, yeah
const aFun = function () {
  return arguments.callee
}
aFun()()()() // As much as I want

// OR

(function () {
  return arguments.callee
})()()()()()()() // LOL

How to do same with anonymous function?

vivid fulcrum
#

this

rocky hearth
#

na na

cinder patio
#

Hmm..? How would that work

vivid fulcrum
#

that seems like hell though

cinder patio
#

the function returns nothing

clear marlin
opal plank
#

even anon functions have proto right?

clear marlin
#

doubt I'd understand either way

opal plank
#

that question is VERY vsc oriented, thats why i was asking if there was a VSC discord server, i doubt anyone here would be able to help with that

clear marlin
#

I use this VSC lame

cinder patio
#

Your snippet doesn't work erwin, anon functions do have a prototype but I don't see how that's related cause you're trying to call the return calue of an empty fuction, which is undefined

opal plank
#

isnt it the same frm what they sent?

opal plank
#

well technically, it would be this

#
(() => {return arguments.calee})()()()()```
cinder patio
#

Anon functions don't have access to arguments afaik

opal plank
#

thats what im not so sure baout

#

they might

#

well, easy to see

#

1 sec

rocky hearth
#

it's not possible with anon functions, i think then

opal plank
#

@cinder patiou right

#

anon functions dont have access to that

opal plank
quartz kindle
modest pagoda
#

small question, do you have to push Global commands again when the bot joins a server?
I added my bot to another server and suddenly the bot doesn't have slash commands in that server, while every other server that it is in, still has the commands

#

or did I do something wrong with the invite?

long crow
#

global cache up to 1hrs

opal plank
#

global commands are accessible everywhere, only guild specific commands would be needed to be passed/added

modest pagoda
#

yeah that's also what I expected, but for some reason it doesn't work for other servers

opal plank
#

did they enable slash commands?

#

it takes a bit to cache/load sometimes

modest pagoda
#

the bot role has permissions for that

long crow
#

Like I said, it can show up to 1hrs

eternal osprey
#
const economy = require('../schemas/economy')
const discord = require('discord.js')
const mongo = require('../mongo')
let reke1 = ''
let reke2 = ''
const profile_schema = require('../schemas/profile_schema')
exports.run = async (client, message, args) => {
const test = await profile_schema.find({ guildId: message.guild.id }).sort([['coins', 'descending']]).exec()
const coins = test.map(profiles => profiles.coins)
const user = test.map(profiles => profiles.userId)
const guildname1 = test.map(profiles => profiles.guildId)
for (const nguilied of guildname1) {
reke1 = client.guilds.cache.get(nguilied).name
}
for (const names of user) {
              
              client.users.fetch(names).then((user) => {
                reke2 =  user.username 
                console.log(reke2)
                const resultembed = new discord.MessageEmbed()
                resultembed.setColor("RANDOM")
                resultembed.setFooter("AwsomeCord || Games")
                resultembed.setTimestamp()
                resultembed.setDescription(`**AwsomeCord's Economy Leaderboard!**\nUser: ${reke2}`+ "  " + `Server: ${reke1} `+ "  " + ` :coin:: ${coins}\n`)
                message.channel.send(resultembed)
})
}
        }```this embed gets sent multiple times, with the correct info tho, but how would i put them all within 1 embed? I know this is because of the for loop, and I tried defining the embed outside the for loop but it sent me an empty embed
modest pagoda
rocky hearth
long crow
#

Global is not immediate

opal plank
#

that just enables users to use it iirc

#

not the bot

#

you need to scope on the invite for that

modest pagoda
#

aha, so I messed up the invite

quartz kindle
modest pagoda
opal plank
#

ur scope only has bot in it

#

add the slash commands scope too

#

in the portal

modest pagoda
#

oh wow I only just noticed that ๐Ÿ˜…

opal plank
#

before u ask

#

@quartz kindle hilp pls

#

dont think you might know this one though

quartz kindle
#

wut

#

about the vsc thing? no i dont know

opal plank
#

yeah that

#

i trust u when it comes to lang, but i guess we're on the same bot when it comes to specifics of that

#

why no VSC discord?

quartz kindle
#

i never even got vsc's debugger to work correctly

#

i always debug via chrome dev tools

opal plank
#

its the best thing ever

rocky hearth
#
// Using
(function (sign) {
  return arguments.callee
})(-1)(1)

// must be better than
[-1, 1].forEach(sign => {})

What u say??

opal plank
#

i only use chrome to profile

#

the ram profile and snapshot is amazing

#

but VSC is better in every other thing

quartz kindle
#

never worked for me lul

#

the debugger kept getting stuck

opal plank
#

press f5, add normal configs, gg ez

quartz kindle
#

it would get stuck on "waiting for debugger to disconnect"

#

every time i ran it

#

and do nothing

opal plank
#

thats odd, never had that

modest pagoda
opal plank
#

even when i just used js

opal plank
#

fuck

#

might have to resort to stackoverflow or their github

#

was trying to avoid to leave my footprint in those places

opal plank
clear marlin
#

:(

opal plank
#

only person who MIGHT know is xetera

#

xetera is notorious for knowing a lot of shit im in deep need for, almost like im following their trail of issues

#

proabbly gonna get pissed for the random ping, specially busy with the new translator thingy

#

might ping tomorrow

delicate matrix
#

.help

crimson pike
#

hi

#

why i get this error

#

if i try to download a module

earnest phoenix
#

@quartz kindle js message.guild.owner.user.tag is not working in my public bot. But it's working in my private bot.

#

Console is showing 'user' is undefined

vivid fulcrum
#

the owner is not granted to be in cache

#

fetch it

earnest phoenix
earnest phoenix
#

Ok

eternal osprey
#

how do i make a 1-10 count in my embed?

#

Like: 1. user
2. User etc

#
 var leaderboard = [];
        
        for (var profile of profiles) {
           var username = (await client.users.fetch(profile.userId).catch(() => false)).username
        
           var guild = await client.guilds.cache.get(profile.guildId)
           var coins = profile.coins > 0 ? profile.coins : 'No Coins'
          
           leaderboard.push(`User: **${username}**`, `Guild: **${guild.name}**`, `Coins: **${coins}**`)
        }
        
        
        embed.setDescription(`\`Economy Leaderboard\`\n${leaderboard.join("\n")}`)
        return message.channel.send(embed)
}```
earnest phoenix
#

For loop

eternal osprey
#

Hmm it stays the same!

#
 for (let i = 0; i < profiles.length; i++) {
               
        
                content =+ `${i+1}.` 
            }```
cinder patio
#

It's +=

#

not =+

#

@eternal osprey

eternal osprey
#

aha yeah i see

#

I did that, tho it sends me 1,2 now

#

not really what i want

cinder patio
#

what do you want?

#

You have to append the user and a new line character

crimson vapor
#

@dusky sundial

raven sigil
#

hello can I ask how can I set up reaction roles and how can I bind them in a message in aspecific channel?

opal plank
raven sigil
#

thanks my guy

pale vessel
#

dump

eternal osprey
#
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: d:\\casino\node_modules\parse-ms\index.js
require() of ES modules is not supported.```
#

why isn't require supported? I know that i have to switch to import, just curious.

long crow
fair axle
#

What is difference between dotenv and a config.json file?

crimson vapor
#

@opal plank

#

dotenv is more a "standard"

worn sonnet
#

Do you guys know any free proxy providers??

opal plank
crimson vapor
#

config.json is a .json that you named config

crimson vapor
opal plank
#

.env is standartised, but even so, i absolutely hate it

#

it makes tokens and private stuff accessible throughout the whole process, which could make a privacy concearn

fair axle
#

Is there any performence difference or just a standart?

opal plank
#

.json can be imported dynamically by ts in one go, rather than having to dotenv() and cast everything to their proper times to be passed around

#

doubt it

#

.json might be a couple microseconds faster

crimson vapor
#

just use both smh

#

dotenv for secure stuff

cosmic forum
#

I tend to use json

opal plank
#

JusT uSE BOtH

crimson vapor
#

config for configurations

cosmic forum
#

haven't really tried .env

opal plank
#

.json is better

source: trust me, im a dev

lyric mountain
#

I use env vars

#

no files to tackle with

opal plank
#

unless you making it public, then people will talk about standardization, which i cant really bitch too much about

crimson vapor
#

im really liking using env actually

opal plank
#

but in terms of usability, i'd personally rate .json scales above

#

.env is limited to strings, in case you need arrays, objects, numbers, etc, you have to parse and/or cast them

#

its a pain and a half

#

say, a whitelist of users whitelisted in your bot

lusty quest
#

i dont really use .json directly, the important stuff is in a .env and then i have a default config for the guilds as fallback defined in a .js file where the rest is defined. the default config is also used to pass in as values if a guild dataset gets created

crimson vapor
#

@opal plank if someone fucked something up and left fucked up typings, is it fine for me to use @ts-expect-error?

opal plank
#

in json it'd be just ```ts
{
whitelist: ['123', 12],
}
import * as config from './config.json';

though in env it'd have to be
```ts
WHITELIST = 123,124

dotenv()
let config = {
  whitelist: process.env.WHITELIST.split(',');
}

i find the former much better. of course this is a single example, but for actual types and passing stuff around, specially not making tokens available in a whole process, which could be taken from a malicious code(since env's are teh first place you'd yoink stuff for malicious reasons) i find it much better

opal plank
crimson vapor
#

Erwin you gotta add as number[]

opal plank
#

string[]

#

and split() already returns that

#

but yeah, imagine if that was a number array

crimson vapor
#

o

opal plank
#

you'd be even more fucked

crimson vapor
#

sad

fair axle
#

As I see, there is seperate ideas

#

But generally I get the differences thanks a lot

opal plank
#

but you see what i mean?

#

json already compiles all that already

#

without having to map()

#

which is hella slow

#

map() is slow af

opal plank
#

personally, like i said, i'd go for .env for a public usage(if your code is going to be public) and .json for private

#

.json will give you more malleability and performance, while .env is standard practice in the ecosystem

crimson vapor
#

Erwin

#

speed doesn't really matter on startup

#

especially since .map is still faster than any ws connection

opal plank
#

kinda does, but this is negligible

#

the token parsing would happen BEFORE any ws connection million

#

you dont have a token parsed before you start the client

brittle hamlet
#

Can anyone help I want my bot to send a thanking message when it joins any server client.on('guildCreate', guild => { const channel = guild.channels.cache.find(channel => channel.type === 'text' && channel.permissionsFor(guild.me).has('SEND_MESSAGES')) channel.send("Thank you for inviting me") }) but it cant send a message if the first channel doesnot have messaging it perms so how do I make to see for a channel where it can send message and then send the required message?

opal plank
#

oh

#

nvm

#

i see what you doing

#

wouldnt it be better to use oauth for that?:

brittle hamlet
#

Ok I didnt understand you I am kinda beginner so..?

drifting wedge
#

gamers pls help me make a slider

#

in html

#

like a checkbox into a toggle switch

austere zealot
#
@welcome.command()
@commands.has_permissions(manage_channels=True)
@commands.guild_only()
async def channel(ctx):
    db = sqlite3.connect(db_path)
    cursor = db.cursor()
    cursor.execute("SELECT channel_id FROM welcome WHERE guild_id = ?",(ctx.guild.id, ))
    result = cursor.fetchone()
    print (result)
    if result is None:
        sql = ("INSERT INTO welcome(guild_id, channel_id) VALUES(?,?)",(ctx.guild.id, ctx.channel.id))
        await ctx.send(f"Welcome channel has been set to {ctx.channel.mention}")
    elif result is not None:
        sql = ("UPDATE welcome SET channel_id = ? WHERE guild_id = ?",(ctx.channel.id, ctx.guild.id))
        await ctx.send(f"Welcome channel has been updated to {ctx.channel.mention}")
    cursor.execute(sql)
    db.commit()
    cursor.close()
    db.close()
``` idk why this isn't working, but it wont insert the guild id and channel id in the table. any idea why?
lyric mountain
austere zealot
#

hm

lyric mountain
#

also is it fetchone or fetchOne?

austere zealot
#

fetchone

austere zealot
# lyric mountain

thats not the problem cuz if i remove that bit the whole command wont work

lyric mountain
#

how so?

#

you specified only 1 param in the query, it was supposed to error due to dangling commas

austere zealot
#

neither do i know ๐Ÿ˜‚

glass marten
drifting wedge
#

no

#

dpy best

crimson vapor
#

depends tbh

#

depends on what language you prefer

glass marten
#

Was thinking to use java, but i already comfort with dpy :/

lusty quest
#

py is quite known, but py is not the most efficent language out there, java has gotten way better with its resource usage over the past years, also got some stuff that is better than py

glass marten
#

aight

umbral zealot
#

I mean they're different languages completely

#

it's like asking if english is better than spanish

solemn latch
umbral zealot
#

The answer to both questions is : "It depends on your needs"

#

Is spanish better if you're in spain? yes. If you're in the middle of Arkansas? Probably not.

quartz kindle
#

you never know :^) there should be plenty of mexicans in arkansas

cold meteor
#

Sorry for bothering just having some issues- could someone help me out, on why this isnt working (no error code or anything)

#

Its python

solemn latch
#

in what way is it "not working"?

cold meteor
#

It should find a random song related to the previous one, instead- it doesnt play anything and when someone tries to play something, it queues it infinitly instead of playing it off.

#

you have to disconnect the bot and then reconnect it (since that clears what it is playing and the queue) to be able to play something agian

cold meteor
solemn latch
#

so it just keeps adding the same song to queue?

cold meteor
# solemn latch so it just keeps adding the same song to queue?

No- it doesnt add anything, what it is supposed to do is find a song related to it, in other words autoplay, just like on youtube if you leave it on, itll play the next video. instead it doesnt play anything at all. and prevents anyone else from playing anything

waxen snow
#

I Need A domain with a DNS records!!!

#

Cause I'm trying to set up the email

solemn latch
waxen snow
#

Using Mailjet

solemn latch
cold meteor
#

Lemme try

solemn latch
#

I dont really know python, the formatting kills me when reading it pandasad

waxen snow
solemn latch
cold meteor
#

^^^got mine from there

waxen snow
#

Even cloudfare doesn't add my domain...

waxen snow
solemn latch
#

dns settings on your domains page

waxen snow
#

I can't find it

cold meteor
#

@solemn latch nah doesnt work-

solemn latch
#

as in song doesnt have source?

cold meteor
#

No thats the thing it does-

#

but its not playing it

solemn latch
#

hmm, ive looked through it a few times and cant find the issue.

#

I would just start using debugging tools

calm raft
#

Does anyone have any suggestions on how I would rate-limit users to prevent them from spamming my bot? Iโ€™m using discord.py

#

My bot uses APIs for some of its commands and I donโ€™t want those APIs to get rate limited if someone attempts to run the command 1000s of times in a short period

vagrant prairie
solemn latch
#

it may help to also add your own ratelimit prevention for those api's you use. the same way discord py does with the discord api.

calm raft
#

Will do. Afaik the rate limit for the API I use is like 100,000/day but I still would like to make sure people arenโ€™t abusing it

solemn latch
#

ah at 100k a day you realistically wont need anything api side for awhile the command cooldown should be plenty

runic gyro
#

hey can i know how to make panel similar to wickbot's?

#

just ping me if somebody knows..

vivid fulcrum
#

panel?

#

do you mean the styling

calm raft
#

Itโ€™s just custom css right?

vivid fulcrum
#

yeah

#

you can steal it from the inner html

crimson vapor
#

@opal plank pong!

#

am in need of help

cinder patio
#

you can just ask

crimson vapor
#

yea I am rn

cinder patio
#

ah

crimson vapor
#

how can I reassign a typed part of a class when extending it. Basically there is class Worker which I am extending and I am trying to change the Worker.commands to a new value but ts doesn't like when I do that, is there a way for me to force it to not care?

cinder patio
#

Can't you

class ExtendedWorker extends Worker {
   commands: ...
}

TS shouldn't be complaining here

crimson vapor
cinder patio
#

hmmm

#

makes sense that it won't work now that I think about it

crimson vapor
#

yeah

#

is there any way to overide it?

cinder patio
#

not without losing type safety

crimson vapor
#

hmm

trail finch
#

um can anyone help me in a javascript stuff?

crimson vapor
#

its strange because im just extending the old one

#

and the worker is always the correct worker

#

so I would think that it would let me just reassign the property with no issues

#

wait no im not

#

thats wrong

cinder patio
#

It won't because in the constructor of the old class assigns commands a different type

crimson vapor
#

I realized im duplicating the class and having it extend another

cinder patio
#

so it's unsafe

crimson vapor
#

ok

#

strange imo but ig

earnest phoenix
#

anyone have any ideas on how to create an xp system that goes across all guilds rather than one? Right now i'm thinking i have to make a database for each guild, but I'm wondering if there's other easier ways.

#

Using sqlite btw

cinder patio
#

don't store guilds at all

#

just store user ids

trail finch
#

I use quick.db as it is easy and I use creative ways to make it more than enough useful for my bot

crimson vapor
#

whats your issue tho

trail finch
trail finch
#

um ok then my question was that... how can I check if the message author got a role higher or lower than the user he/she mentioned

calm raft
vivid fulcrum
#

also

#

language tip

#

english has they/them

#

gender neutral

trail finch
#

... naniii

#

btw discord.js I mean ofc discord but js

vivid fulcrum
#

they have a nice smile etc.

#

anyway

#

back on topic

trail finch
#

sorry forgot to off ping

vivid fulcrum
#

message.member will return you the author's member object (this will be null if the command is in a dm)

#

now for both members you have to return their topmost role

trail finch
#

hmm

vivid fulcrum
#

and that object that i just linked

#

has a highest property

#

get that on both of your members

#

you'll get the highest roles

#

and after that just compare the role positions

#

so you'll have something like

#
...authorMember.roles.highest.position >= ...mentionedMember.roles.highest.position
#

if this returns true it means that the author has a higher or equal role position to the mentioned member

young void
#

yo

#

i have a quick question

vivid fulcrum
#

if it's false, it means the author has a lower position

young void
#

im trying to create a starboard

#

so i create an event messageReactionAdd

#

and i coded it and stuff

#

and when i react to a message

#

it doesnt do anything

#

im super confused

trail finch
vivid fulcrum
young void
#

yeah it isnt

#

i used console.log()

#

nothing

vivid fulcrum
#

are you using intents?

young void
#

what are those

vivid fulcrum
#

okay so you probably aren't

#

then you probably need to enable partials

young void
#

alright ill take a look at that

vivid fulcrum
#

make sure to read the warnings a bit further down the page

young void
#

this might be it

#

hm

#

still nothing

long crow
#

you didnt add the neccesary intents

calm raft
#

strange. ill look into it

#

discord.ext.commands.errors.CommandOnCooldown: You are on cooldown. Try again in 56.77s

#

says that in the console so that part works

#

cant get it to send it in a message tho

deep mantle
#

and check if the error is CommandOnCooldown

wooden shoal
#

Hello, i'm gonna try to make an economy system for my bot, it's gonna be using codes to gain currency, I just wanna know how I would check if the code is claimed. I'm storing the value claimed as a boolean.

const code = (Math.floor(100000 + Math.random() * 900000));

const data = await cooldownSchema.findOne({ Guild: message.guild.id })

.setInterval(() => {
  const dropEmbed = new Discord.MessageEmbed()
  .setAuthor(`New ${data.Currency} Drop!`, guild.iconURL())
  .setDescription(`Type ${prefix} ${code} for ${data.Amount} ${data.Currency}`)
  .setImage(data.Image)

  const channel = data.Channel

  channel.send(dropEmbed)
  
}, data.Cooldown);

if(data.Claimed === true) {
  const alreadyclaimedEmbed = new Discord.MessageEmbed()
  .setAuthor(message.author.tag, message.author.displayAvatarURL())
  .setDescription(`This drop has already been claimed.`)
  channel.send(alreadyclaimedEmbed)
}

if(data.Claimed === false) {
  const claimedEmbed = new Discord.MessageEmbed()
  .setAuthor(message.author.tag, message.author.displayAvatarURL())
  .setDescription(`You have sucessfully claimed the drop for a total of ${data.Amount}.`)
  channel.send(claimedEmbed)
}

lyric mountain
clear marlin
lyric mountain
#

ik

#

it's just that it's redundant

#

he didn't state the error

#

or the issue

lyric mountain
#

so, what's the error?

clear marlin
#

he's storing data as boolean

solemn latch
#

i feel like you asked the question, and gave the answer in the same message

wooden shoal
solemn latch
#

how do you check if its claimed? check the boolean value.

clear marlin