#development

1 messages · Page 1095 of 1

delicate shore
#

like this ?

#

so if someone does @dreamy jacinth f df e fe f

#

it responds

solemn latch
#

Mentions can be
<@id> or <@!id>

zenith terrace
#

that seems about right

cunning gorge
#

Does anyone have a basic embed reaction menu for discord.js?

viral iris
#
const Discord = require("discord.js");
const db = require('quick.db')
const { default_prefix } = require('../../config.json')
module.exports = {
  name: "prefix",
  description: "Changing prefix",
  run: async (message, args, bot) => {
   if (!message.member.hasPermission("ADMINISTRATOR")) {
#

can any1 help ?

#

line 7 or 8?

#

same

#

but red x

bright dove
#

is
Date.now() - message.createdTimeStamp;
not the right code for an API "ping"? it keeps coming out negative

#

huh

viral iris
#

@earnest phoenix

#

can i give u the code on dm ?

bright dove
#

I fixed it

#

but thanks anyway

#

the only problem I have right now is with making a dynamic embedded help message, with different commands separated into categories

#

I have a dynamic help message, but it's just plain text and looks ugly

#

I don't know how to list the commands by their category

#

that wouldn't be dynamic

#

adds the new commands itself when they're created, so I don't have to edit the help embed everytime a command is added

earnest phoenix
#

hello guys

#

help me?

bright dove
#

for the plain-text one or the embedded one?

#

all I've done so far is set up the embed

#

lemme ss

earnest phoenix
#

@earnest phoenix Ok, what do you need?
@earnest phoenix Well, I have a bot, it has been under verification for a long time, I would like to know if anyone knows how long it takes to verify, does anyone know?

bright dove
#

3 weeks or more

earnest phoenix
#

@earnest phoenix Around 3+ weeks
@earnest phoenix 1 month then right, ok thanks for the help man!

bright dove
#

or does it search the entire commands folder, regardless if there's other folders in it

#

how can I edit this code to also search through the other folders? sorry I'm very new to this

cunning gorge
#

its a reaction menu

bright dove
#

ah thank you blu

cunning gorge
#

It just doesn't work @earnest phoenix ...idk if that's helpful lol

#

There isn't any error

clever vector
#

Yo @earnest phoenix

cunning gorge
clever vector
#

i thought you were building web

#

but you here

#

@earnest phoenix

#

;v

cunning gorge
#

I mean if anyone has a basic reaction menu that works it would rlly help for me to start

north silo
#
    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        logger.info('Received an upvote')
        print(data)

What all parameters does data have ?
I want to access user's name who voted.

clever vector
#

oo i see

#

Why Derku left

#

who knoe?

#

who know?

cunning gorge
#

@cunning gorge I can teach you something similar
@earnest phoenix Would be great!

#

awesome thx

north silo
#

Ping me if anyone helps.

clever vector
#

Ping for fun

solemn latch
#

Reaction menus are just a set of embeds in an array, when the author reacts with an emoji move forward a page.
When the author reacts back, move back

clever vector
#

its annoying right

solemn latch
#

Not really, its just editing an embed.

clever vector
#

Ya

#

I saw a bot have it

hazy sparrow
#
const command = args.shift().toLowerCase();
 
 


 client.commands.find(command => command.aliases && command.aliases).execute(message);

    if (!command) return;

I have only 1 command with alias which is bottleflip now every command will run the bottleflip.js . Any help?

lusty quest
#

well you tell your bot to only execute aliases

karmic compass
#

More of just a curious question but how do I make a !ping command to check the latency of the bot

lusty quest
#

client.ws.ping <- console.log this (d.js)

#

this shows the ping to the API. if you want the ping between user and bot create a timestamp on command execution and compare it with the message created timestamp of the command message

karmic compass
#

How? Can I have an example, I’m a little new to this :/

lusty quest
#

js?

karmic compass
#

Ye

#

Discord.js

hazy sparrow
#

oh shi

lusty quest
#
const botping = new Date() - message.createdAt;
hazy sparrow
#

im stoopid

lusty quest
#

message is your command message

low shard
karmic compass
#

Ty

lusty quest
#

you growed to fast. now you need to wait until you reach 250 Guilds

#

idk if it helps if you contact Discord Support

karmic compass
#

My bot has 11, rip

low shard
#

@lusty quest you lie

karmic compass
#

And half of them are weird dead set ers

low shard
#

How 250 servers

#

Lol

#

Lmao

earnest phoenix
#
2|Music-bo | - /root/Music-bot/index.js
2|Music-bo |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
2|Music-bo |     at Module.Hook._require.Module.require (/usr/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:61:29)
2|Music-bo |     at require (internal/modules/cjs/helpers.js:72:18)
2|Music-bo |     at Object.<anonymous> (/root/Music-bot/index.js:12:20)
2|Music-bo |     at Module._compile (internal/modules/cjs/loader.js:1138:30)
2|Music-bo |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
2|Music-bo |     at Module.load (internal/modules/cjs/loader.js:986:32)
2|Music-bo |     at Function.Module._load (internal/modules/cjs/loader.js:879:14)
2|Music-bo |     at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:32:23)
2|Music-bo |     at Module._compile (internal/modules/cjs/loader.js:1138:30) {
2|Music-bo |   code: 'MODULE_NOT_FOUND',
2|Music-bo |   requireStack: [ '/root/Music-bot/index.js' ]
2|Music-bo | }```
karmic compass
#

What does the bot do? I’ll consider

low shard
#

Im contact him

lusty quest
#

why do i lie? you Growed to fast to 75

low shard
#

No..

lusty quest
#

if this happens they flag you and you need to reach 250 Guilds

#

@earnest phoenix install the missing Module

earnest phoenix
#

I have done all

hazy sparrow
#

well you tell your bot to only execute aliases
@lusty quest

const command = args.shift().toLowerCase();
 
 


 client.commands.find(command => command.aliases && command.name).execute(message);

    if (!command) return;

this also has the same result. always runs bottleflip.js

lusty quest
#

make sure your require() stuff has the correct path

#

@hazy sparrow OR not AND

hazy sparrow
#

where

lusty quest
#

instead of && try ||

hazy sparrow
#

the && part?

#

ah ok

lusty quest
#
let command;
    if (bot.commands.has(cmd)) {
        command = bot.commands.get(cmd)
    } else if (bot.aliases.has(cmd)) {
        command = bot.commands.get(bot.aliases.get(cmd))
    } else return

    try {
        command.run(bot, message, args)
    } catch (err) {
        console.log(err)
    }

``` i used this in a older bot
hazy sparrow
#

now everything is running the 8ball.js

lusty quest
#

there is probably a way to do it in a single line but i never really cared about aliases

hazy sparrow
#

what do i do now

lusty quest
#

try the example i gave you 4 massages above

hazy sparrow
#

ok wait

earnest phoenix
#
/root/.pm2/logs/Music-bot-out.log last 15 lines:
/root/.pm2/logs/Music-bot-error.log last 15 lines:
2|Music-bo |   code: 'MODULE_NOT_FOUND',
2|Music-bo |   requireStack: [ '/root/Music-bot/index.js' ]
2|Music-bo | }
2|Music-bo | [Error: ENOENT: no such file or directory, scandir './events/'] {
2|Music-bo |   errno: -2,
2|Music-bo |   code: 'ENOENT',
2|Music-bo |   syscall: 'scandir',
2|Music-bo |   path: './events/'
2|Music-bo | }
2|Music-bo | [Error: ENOENT: no such file or directory, scandir './commands/'] {
2|Music-bo |   errno: -2,
2|Music-bo |   code: 'ENOENT',
2|Music-bo |   syscall: 'scandir',
2|Music-bo |   path: './commands/'
2|Music-bo | }```
#

Huh 😀

#

I have installed all modules

sonic lodge
#

you're trying to access a nonexistent directory

earnest phoenix
#

Huh

sonic lodge
#

./events/ and ./commands/ do not exist

earnest phoenix
#

It's exist

sonic lodge
#

what does the file structure look like?

torn ravine
#

@earnest phoenix uh can I see your folder settings in you programming application

#

(ex. VSC, Atom, etc...)

earnest phoenix
#

Umm I am new but I have a question

#

I'm having trouble adding bots to my server and was wondering if anyone here knew how to help me or at least explain why I can add them

#

-.-

#

Um ....

#

That didn't help nor did it make sense -.-

#

don't ask to ask, just ask your damn question properly

#

I did

#

;-;

#

i unfortunately do not have a crystal ball and cannot see what is inside of your mind so you'll have to put in a bit more effort to explain your problem

#

what error do you get, what exactly doesn't work

#

I'm having trouble adding bots to my server I have an Android so usually I have to open it in a browser but the browser won't open instead it brings me back to the homepage of that particular bot and it says something like they're making improvements but I wanted to know if the improvements will affect people making it so not everyone will be able to add bots.....is that better?( ̄ヘ ̄;)

#

then you cant add that particular bot

#

this also isn't development related

#

Oh I'm sorry

#

Thank you so much for your patience but I think it's best if I go ( ̄ヘ ̄;)

ember oak
#

Hey! How do I make people list by roles command? I don't know how to explain so there's example:

delicate shore
#

you growed to fast. now you need to wait until you reach 250 Guilds
@lusty quest my bot is in 217

#

guilds now

#

but i already applied

#

for verification

crystal socket
#

its fine

#

nothing will matter until oct 7th

lusty quest
#

it happens only if you get flagged @delicate shore

#

if you have normal growth you can apply at 75

delicate shore
#

ok

#

yeh

#

@lusty quest i gained over 120+ guilds yesterday

lusty quest
#

gg

cursive merlin
lusty quest
#

CSS @cursive merlin

cursive merlin
#

where ?

lusty quest
#

¯_(ツ)_/¯

crystal socket
cursive merlin
#

where I add the css

#

in the markdown/html area ?

pale vessel
#

the long description

cursive merlin
#

it was allowed ?

crystal socket
#

yep

pale vessel
#

it was and still is 😎

cursive merlin
#

thx

ember oak
#

Can anyone help me with that code? I asked above about it

crystal socket
#

Yeah could you please clarify it

#

do you mean like do -roleinfo @role and it will say who has the role?

ember oak
#

Yeah, but I want to make that it will show few roles in same embed

#

like in the pic

crystal socket
#

also what lang are you using?

ember oak
#

discord.js v12

crystal socket
#

one second

ember oak
#

oh u sent a link

#

thank u

#

Uhh, I'm still a bit confused. Could u send example code?

weak rain
#

I m using this guild for member count but it isnt working its saying undefined ${member.guild.membercount}

ember oak
#

Try:
${guild.memberCount}

weak rain
#

ok ty'

#

error

#

guild is not defined

#

@ember oak

ember oak
#

Lemme check

weak rain
#
  let chx = db.get(`welchannel_${member.guild.id}`);
  
  if(chx === null) {
    return;
  }

  let wembed = new discord.MessageEmbed()
  .setColor("RANDOM")
  .setImage("https://cdn.discordapp.com/attachments/718902845612621874/719226739061948477/unnamed.gif")
  .setThumbnail(member.user.avatarURL())
  .setDescription(`** Welcome <@${member.user.id}> To our Server** ${guild.memberCount}
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
**Make sure to**
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
**Read and Follow our Rules.**
**Be upto date with our announcements.**
**Make new friends in the chat and be active.**
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
**We hope that u have fun in the server**!`);
  client.channels.cache.get(chx).send(wembed)
})

client.login(token)```
#

this is my code

copper cradle
#

MEMBER.GUILD

#

holy fuck

#

it isn't that hard

#

c'mon

weak rain
#

Bro me learning

#

i m a begginner

copper cradle
#

bro

weak rain
#

message.guild?

honest perch
copper cradle
#

you don't have a message object there

#

what's message gonna be

#

you're getting a member object from the event callback

#

so you should use that member object

weak rain
#

but its giving error'

copper cradle
#

now, member objects have guild properties

#

console.log(JSON.stringify(member.guild))

torn ravine
#

I- Have no words

#

for that embed

delicate shore
#

Respecttt me

#

aaaa

honest perch
#

Oi boss man @quartz kindle explain to this guy in a human way what he's doing wrong

torn ravine
#

he’s offline

#

but tim carries this entire channel on his back

honest perch
#

Mhm

#

It will ring when mentioned

summer acorn
#

can I edit only 1 field of the embed, or do I have to edit the whole embed, in DJS

#

I've never really worked too much with message editing, and especially not embed editing.

earnest phoenix
#

discord offers no support to edit a single property of an embed

#

so yes you will have to reconstruct the entire embed

summer acorn
#

ok then,

earnest phoenix
#

i suggest having helper methods for something like this cause less effort in the longrun

summer acorn
#

But I'd suppose I would be able to fetch the embed from the message id

karmic compass
#

Anyone here know a lot about heroku and Dyno sleeping? If I have a randomInterval function running every 20 sec, does it use Dyno hours?

earnest phoenix
#

correct, aprixia

summer acorn
#

I suppose, editing a field from that would be difficult, so the closest thing I could do would be to copy the information, information which however I already have in my database in the object including the message id, hence it making it easier to construct a new embed.

ember oak
#

Please someone help me with this.

valid frigate
#

bruh

ember oak
#

I'm new to coding. I really need help with this.

unique nimbus
ember oak
unique nimbus
#

:)

ember oak
#

thanks

earnest phoenix
#

do you think i should migrate my bot's database to mongodb?

#

I was undecided

#

i switched to mongo

#

and now i switched back to json

#

lmao

#

i prefer json because of its simplicity - but ima need a lot of files to make it scalable

#

im doing 1 file per guild

#

my friends say mongo.db

unique nimbus
#

Json is not a database and should not be used as one

#

Json is good to be used for static data

#

Many people uses MongoDB here and that should be used as a database

earnest phoenix
#

json isn't scalable

#

lmFao

unique nimbus
#

yes

#

and also can get corrupted

fluid basin
#

json is great for starting out, especially if you're new to databases and/or making a new bot, but going long term your best bet would be to use a database

unique nimbus
#

json again is not a database

#

but its good to learn how to use json

fluid basin
#

(I didn't say it was a database)

unique nimbus
#

you stated that its great if you are new to databases

#

and making a new bot

#

so I assumed json files

fluid basin
#

anyways let me rephrase that, if you only need to keep mostly long-term persistent data that doesn't need to be updated regularly, you could use json files

#

like server configs

earnest phoenix
#

Wassup, people

#

why tf is mongodb java driver so confusing

fluid basin
#

bad experience using mongodb on either c# or java using default drivers

earnest phoenix
#

i got it to work somehow lol

unique nimbus
#

There are other databases not just mongo

#

like fuckin sql

#

lmao

#

but

#

json is good for static data

#

it is not good for adding/changing/removing data constantly as that can make it corrupted

#

especially if you don't use it correctly

earnest phoenix
#

its not going to get corrupted smh

#

and it is scalable, you just need to separate it into many files so you can keep them under 4MB

#

1 file per guild or user in my case

#

dont need a database lmao

unique nimbus
#

@earnest phoenix can you please tell Rigi why its not a good idea

#

seperate files does not even make it scalable either

#

it just makes a mess

earnest phoenix
#

@unique nimbus how about you just let me write my DB however tf I want and back off

#

You know nothing about my code

unique nimbus
#

How about

#

We are helping you

#

not cry

#

when it fucknig corrupts

earnest phoenix
unique nimbus
#

Blocking someone because you don't want an opinion you don't want is laughable

earnest phoenix
#

nmp

void vale
#

I'm ready

restive furnace
#

Blocking someone because you don't want an opinion you don't want is laughable
^

unique nimbus
#

mmmmmm

earnest phoenix
#

i just cause a arguement- sorry-

unique nimbus
#

its not your fault

earnest phoenix
#

you didnt lol

#

its peter being an ass

unique nimbus
#

If you want to use a database

#

you mongo

#

json is not used for a database

#

its good for fixed data

earnest phoenix
#

its good for whatever i want it to be used for

#

and it shouldn't affect you

unique nimbus
#

its also good to get corrupted

#

when the bot grows

earnest phoenix
#

its also fine to shut the fuck up

unique nimbus
#

when the requests gets bigger

#

it will corrupt

#

I know this

#

as a fact

#

I did the same thing as you

#

then oh no

#

my data is unrecoverable

#

so please listen @earnest phoenix use a proper database like mongodb

#

sql, sqlite etc etc

earnest phoenix
#

"my data is unrecoverable"

#

i have 20 backups

#

and im not doing multiprocessed opening of the same file bs

unique nimbus
#

neither did I

honest perch
#

My json got corrupted

unique nimbus
#

It was a simple

#

open

#

read

#

close

honest perch
#

Trust me

unique nimbus
#

or

#

open

#

read/write

#

close

restive furnace
#

i have 20 backups
real db -> 1 backup max required, since they corrupt like in 1:82727828282882828828282882 or just something awful happens

earnest phoenix
#

o-ok

unique nimbus
#

its not your fault hayper

#

but use mongo

#

not json

#

for a database

honest perch
#

Mongo is very easy to use

#

And its good

unique nimbus
#

^

honest perch
#

Meanwhile json corrupts like its nothing

#

I've used both

#

And now I only use mongo

earnest phoenix
#

Normal mongo?

honest perch
#

Yeah mongodb

#

I use atlas but you can also self host

earnest phoenix
#

i use mongodb atlas

#

and i use mongodb default java driver

honest perch
#

I use mongoose for js as its more simple than the official one imo

earnest phoenix
#

what's good mongodb driver for java?

fluid basin
#

default?

wheat hornet
honest perch
#

I'm not even going to answer that

earnest phoenix
#

the embed is inside the else statement

#

while message.channel.send is outside it

#

sooo

void vale
#

@wheat hornet v12 or v11?

earnest phoenix
#

idk man i got mongodb from github education, that's why i use it

wheat hornet
#

srry my bad the bracket was fucking

honest perch
#

It doesnt matter

#

If its v11 or 12

#

Its basic js

void vale
#

v11: message.channel.send({embed})
v12: message.channel.send(embed)

restive furnace
#

in v11, <m>#<c>#send(embed) worked sometimes, and sometimes not :D

void vale
#

v11 uses RichEmbed

#

v12 MessageEmbed

earnest phoenix
#

v12 use a plain object lol

#

simpler

#
message.channel.send({
  embed: {
    color: 0xFF00FF,
    title: "This is easy",
    description: "Yayeet"
  }
});```
restive furnace
#

yes and not eating ram/cpu power for creating embeds ^

fluid basin
#

and it works in v11 as well ^

cinder patio
#

I'd say speed isn't a factor here use whichever you find easier to read / use

void vale
#

I use it

function emded(a, b, c) {
var _embed = new Discord.MessageEmbed()
.setColor('#fffffff')
.SetTitle(`${a}, ${b}, ${c}`)
return _embed
}
message.channel.send(await embed(1, 2, 3))
tight plinth
#

why tho

#

also

#

returnt _embed

#

yes

restive furnace
#

it was example

#

he did write it in hand (i think)

void vale
#

I need to recreate embed with different values several times

honest perch
#

v11: message.channel.send({embed})
v12: message.channel.send(embed)
Erm no?

#

They're both the same

void vale
#

Maybe I'm wrong

bright dove
#

working on an avatar command but it keeps saying the image part of the embed does not have a well formed URL?


module.exports = {
  name: 'avatar',
  description: 'Responds either with the avatar of the mentioned user (or the command user if nobody is mentioned)',
  aliases: [ 'pfp', 'profilepic', 'pic'],
  usage: '[user mention]',
  execute(client, message, args) {
    if (!message.mentions.users.size) {
      const avatarembed = new Discord.MessageEmbed()
      .setImage(`${message.author.AvatarURL}`);
      message.channel.send(avatarembed);
    }
  }
}```
earnest phoenix
#

avatarURL

#

not AvatarURL

bright dove
#

same result

earnest phoenix
#

Are you sure?

bright dove
#

yup

earnest phoenix
#

try displayAvatarURL then

#

if (!message.mentions.users.size) { 🤮

bright dove
#

still same

earnest phoenix
#

your code is wrong

bright dove
#

how so

earnest phoenix
#

if (!message.mentions.users.size) { why are u using this?

#

if you just want to show message author's avatar?

bright dove
#

haven't added the rest yet

#

I'm going to have it send the mentioned users pfp's if there are any

#

but

#

I wanted to get the embed out of the way first

#

and it's not working

#

lol

earnest phoenix
bright dove
#

cause apparently a URL isn't a valid url 😛

earnest phoenix
#

true i forgot

#

it's a function

pale vessel
#

and it's avatarURL() but you should use displayAvatarURL() so that it works with people with no profile pictures

void vale
#
.setImage(message.author.displayAvatarURL({ format: 'png' }));
bright dove
#

well that's definitely not right ^

#

lol

pale vessel
#

you're on v11, he's on v12

#

png is recommended

#

if you use jpg you might as well use webp, the default format

#

(imho)

bright dove
#

wait ok so what would the full line be

#

I got confused

#

lol

pale vessel
#

he sent it

bright dove
#

o

weak rain
#

I m using this code to create role but it is not making as the admin thinks text named role is created what to do?

const fs = require("fs");

exports.run = (client, message, args) => {
  
if (!args[1]) return message.reply("Please add a message");
  let text = args.slice(1).join(" ");

  message.channel.send(text);
};

exports.help = {
  name: "createrole"
};

exports.run = (client, message, args) => {
  if (!args[1]) return message.reply("Please add the name of the role");
  let text = args.slice(1).join(" ");
    const role = message.guild.createRole({
            name: "text",
            color: "RANDOM",
            permissions:[]
          })
    } 

exports.help = {
  name: "createrole"
};```
#

not role named by his message

#

Anyone?

earnest phoenix
#

V11?

weak rain
#

hm

#

i hve to update

earnest phoenix
#

:D?

weak rain
#

?

earnest phoenix
#

And why u using twice run?

weak rain
#

wt

earnest phoenix
#

and help

#

i see

weak rain
#

that arg one?

bright dove
#

it's just not even responding now... not even giving errors

earnest phoenix
#

I'd like to do spoonfeed, but i won't xd

weak rain
#

;-;

#

its create role not add

pale vessel
#

you exported run twice

#

that's just...

#

bad code

weak rain
#

got it

pale vessel
#

you really need to rewrite your code

weak rain
#

:/

#

can u tell me what to do

#

i want my code to make it named by The command author

#

but it is making text named role

#

Anyone?

pure lion
#

Is it a good time to connect to mongoose before an oauth req or after?

prisma frigate
#

Hello, can someone help me understand how to install and run darkbot ?

pure lion
#

What

prisma frigate
#

I'm trying to run darkbot and I'm extracting the files like it says but anything beyond that I can't seem to figure out on my own.

restive furnace
#

this isnt development based

#

i think

pure lion
#

How do I find shit from my mongodb?

#

I'm doing this in a separate workspace from my bot btw^

restive furnace
#

by finding

misty sigil
#

I'm trying to run darkbot and I'm extracting the files like it says but anything beyond that I can't seem to figure out on my own.
@prisma frigate ah, we don’t provide support for running code

pure lion
#

How find

misty sigil
#

It’s db.collection("name").findOne

#

or whatever

pale vessel
#

aren't you using mongoose? if so, you can use model.findOne(filter)or model.find() for all

pure lion
#

Whats db tho, just mongoose?

#

Also flaz, I don't have the models it's a different app

pale vessel
#

then you must be using mongodb then

night fiber
#

Can someone help me with webhooks?

#
const dbl = new DBL('secret', { webhookPort: 5000, webhookAuth: 'secret' }, client);
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});

//Logs:
//Webhook running at http://0.0.0.0:5000/dblwebhook

But this doesn't seem right..

misty sigil
#

it’s actually hardcoded into dblapi.js

night fiber
#
dbl.webhook.on('vote', vote => {
  let channelGeneral = client.channels.cache.find(channel => channel.id === "378181731867688962");
  channelGeneral.send(`<@${vote.user}> has voter for ZooBot!`)
});

It also doesn't send the vote..

#

Bc the webhook is wrong I think

misty sigil
#

and afaik vote.user doesn’t exist

night fiber
#
const DBL = require('dblapi.js');
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});
#

okay so my webhook is okay?

#
dbl.webhook.on('vote', vote => {
  let channelGeneral = client.channels.cache.find(channel => channel.id === "378181731867688962");
  channelGeneral.send(`<@${vote.user}> has voter for ZooBot!`)
});

This still doesn't work.

misty sigil
#

try getting channel instead of finding it

pale vessel
#

it's the same but .get is more cleaner

#

even though get uses .find

night fiber
#

that's not the point. logging it doesn't work either.

#

Something wrong here?

misty sigil
#

yes

night fiber
#

I really don't know

misty sigil
#

that’s not the webhook link

feral aspen
#

Hello, guys! I have a quick question, how can the bot count the total messages that was sent in a specific server?

misty sigil
night fiber
#

kk

#

ty

slow fable
#

@feral aspen You can loop over message.channel.messages.cache, i've never tested this before though so this method isn't guaranteed

summer acorn
#

I am trying to modify a object inside of an array inside of an object in mongo, and I log the result both before and after and show that it's saved, but the values doesn't update within the object I am modifying.

#

the path is just res.modCases[/*num*/]

feral aspen
#

@feral aspen You can loop over message.channel.messages.cache, i've never tested this before though so this method isn't guaranteed
@slow fable How is that?

#

Ofcourse it does require databases or stuff

slow fable
#

Nope

summer acorn
#
let index = res.modCases.indexOf(modCase);
console.log(index)
res.modCases[index].reason = reason;
console.log(res.modCases[index])
utils.saveDB(res).catch(err => console.error(err));
slow fable
#

Oh you were saying in a server? Sorry i don't know how to do that.

feral aspen
#

Oh you were saying in a server? Sorry i don't know how to do that.
@slow fable Yea, in a server. 😛

#

Ok.

slow fable
#

All in a server? lol

feral aspen
#

No

#

Like it will calculate the total messages that was sent in a specific server and save it into some file or something

slow fable
#

Idk how xd

#

srry

feral aspen
#

It's ok

summer acorn
#

@feral aspen are you trying to get the total amount of messages in a server?

feral aspen
#

@feral aspen are you trying to get the total amount of messages in a server?
@summer acorn Yes.

silver dust
#

i need your help

#

Cannot read property 'forEach' of undefined

feral aspen
#

Cannot read property 'forEach' of undefined
@silver dust Send code

silver dust
#

um

#

its too long

feral aspen
#

screenshot.

silver dust
#

okay

earnest phoenix
#

Hello, guys! I have a quick question, how can the bot count the total messages that was sent in a specific server?
@feral aspen

this is something that is theoretically possible but in practice impossible. you would have to spam GET messages endpoint until you hit the beginning of the channel for every single text channel in the guild. this can lead to an API ban or account termination.

TLDR; there isnt a way to do that

summer acorn
silver dust
#

okay

feral aspen
#

Oh jeez

#

@earnest phoenix why is there bots who does that

#

😛

#

Like giveaway bots or something

summer acorn
#

Try forEaching the channels, then fetch all the messages in each channel, then add their length up to a variable outside of the forEach @feral aspen

earnest phoenix
#

i doubt there are

feral aspen
#

i doubt there are
@earnest phoenix So.. why not consequences for them?

silver dust
#

i was just testing my friend's code

#

i cant code that much

earnest phoenix
#

which bots do that

#

because i certainly doubt those exist

feral aspen
#

A bot like Boat Bot

earnest phoenix
#

some might track messages after they're added (due to receiving the event) however backtracking is practically impossible without being api banned

silver dust
feral aspen
#

Frisky Tool Bot

earnest phoenix
#

which features

feral aspen
#

?

earnest phoenix
#

which exact feature is it that tracks messages like that

feral aspen
#

I actually don't know, but I see some servers sent messages having it track messages

#

and for the Boat bot

#

when you do a!server , it will send a statistics showing how many messages was sent

earnest phoenix
#

then it isn't backtracking, it's tracking new messages

feral aspen
#

in that server

#

then it isn't backtracking, it's tracking new messages
@earnest phoenix 😐 What's the difference.

summer acorn
#

@silver dust I am not an expert, but I don't think both reducing and forEaching an array is a thing, to be honest.

earnest phoenix
#

you receive MESSAGE_CREATE as long as you can see the channel

#

const $ = fn => {
    const path = [];
    const proxy = new Proxy(fn.bind(path), {
        get: (obj, prop) => {
            path.push(prop);
            return proxy;
        }
    });
    return proxy;
};

$(function(...args) {
    console.log(args, this);
}).hello.world.and.proxy(1, 2, 3);

// [1, 2, 3] ["hello", "world", "and", "proxy"]```
#

mm lol

#

MESSAGE_CREATE does not occur for past messages which is why you need to GET them in the first place

feral aspen
#

you receive MESSAGE_CREATE as long as you can see the channel
@earnest phoenix Oh.

earnest phoenix
#

spamming that GET request leads to an automatic API ban, hit the ban more than once and you'll experience account termination

summer acorn
#

@earnest phoenix you could make it not be against rate limits by adding your own rate limits to it

earnest phoenix
#

huh??

feral aspen
#

Yea, I see.

#

Okay, thanks!

earnest phoenix
#

oh you mean adding a delay between each request

stiff stream
earnest phoenix
#

yeah but that can potentially take days to finish

summer acorn
#

for example, limiting it to 1/10 of what is maximum allowed

#

Yes, but still

#

That would give them what they want

feral aspen
#

how to make an Embed that will look like that
@stiff stream Bro, Brainstorm Please.

earnest phoenix
#

after 24 hours

#

plus it's in cache

#

restart the bot and poof it's gone

summer acorn
#

Didn't they say they would store the amount in a txt file?

earnest phoenix
#

¯\_(ツ)_/¯

summer acorn
#

but then again

#

they'd have to store the id instead

#

an array of message ids

#

so that it doesn't re-do a lot of them upon restart

earnest phoenix
#

you would have to account for bot downtime, then refetch messages again

it simply isn't reliable and you cannot do that

summer acorn
#

I know it isn't reliable, though message ids would be the most reliable method

quartz kindle
#

if you simply want to count them, just store the delimiter id for each request

#

in a database or something

#

it will likely still take days

summer acorn
#

yes, Tim knows this

#

Tim knows best

quartz kindle
#

lol

summer acorn
#

I just realized, I had an issue myself

#

I am trying to modify a object inside of an array inside of an object in mongo, and I log the result both before and after and show that it's saved, but the values doesn't update within the object I am modifying.
https://cdn.discordapp.com/attachments/272764566411149314/737961797474189393/unknown.png
the path is just res.modCases[/*num*/]
this is the code I use

let index = res.modCases.indexOf(modCase);
console.log(index)
res.modCases[index].reason = reason;
console.log(res.modCases[index])
utils.saveDB(res).catch(err => console.error(err));
wheat hornet
earnest phoenix
#

they won't magically parse into images

wheat hornet
#

so what should i do

pure lion
#

Uh

#

Embed.setThumbnail()

summer acorn
#

or embed.setImage()

wheat hornet
#

ok let me try

pure lion
#

Thumbnail is generally cleaner imo

summer acorn
#

it's meant for larger displays

#

thumbnail is a square

wheat hornet
summer acorn
#

gotta be discord cdn, I believe, @wheat hornet

earnest phoenix
#

it doesn't

#

it just needs to be a valid image url

pure lion
#

@summer acorn how'd I find that without access to schema or models? Other people were kinda unclear

summer acorn
#

what

#

mongodb compass

earnest phoenix
#

i dont know what the api they're using returns though so can't help with that

pure lion
#

I mean through node

summer acorn
#

ah, I use mongoose

#

and I do have a schema and models

wheat hornet
#

so can i fix this or no hope

summer acorn
#

well I mean like, splicing it works fine, but modifying the reason apparently wont save.

quartz kindle
#

@wheat hornet probably... but we cant help if you dont give us more information

summer acorn
#

the place where the issue is occurring, is line 49 to line 53

mild flower
#

is there any way to make a database for a custom prefix command WITHOUT async?

#

@ me

summer acorn
#

@mild flower you don't need async for that

mild flower
#

how do i do it then

#

link ?

tiny plank
#

do what, a custom prefix?

mild flower
#

yes

tiny plank
#

for what

mild flower
#

?

summer acorn
#

I suggest first learning how to work with databases.

mild flower
#

do you have any links from where i could learn about databases without async?

summer acorn
#

Once you learn that, the answer will become very clear to you.

restive furnace
#

also node.js has top-level await, means you DONT need to use async with async db's :DD

#

(in 14.6.0)

summer acorn
#

Depends on what you'll use. I use mongoose, which connects to mongodb.

#

The response you get with it is pretty much JSON

mild flower
#

link pls

#

thats all i ask

#

i have mongoose db

summer acorn
#

I don't even know if there is any mongoose guides

mild flower
#

...

tiny plank
#

Their are tons of tuts on yt

pale vessel
summer acorn
#

it's extremely beginner friendly

mild flower
#

they all have async tho

#

the tutorials

summer acorn
#

literally just findOne and .save()

earnest phoenix
#

I tried this:

let sentMessage = message.reply("x");
setTimeout(function(){
sentMessage.edit("e");
});

But it is throwing the error:

TypeError: sentMessage.edit is not a function

Help

summer acorn
#

message.reply().then(msg => {})

earnest phoenix
#

ok thx

summer acorn
#

you can't use let, var, or const to get a message object when sending

earnest phoenix
#

smh

#

why the hell would someone use const ifthey are going to edit the message KEKW

summer acorn
#

because it's possible

restive furnace
#

or let m = await <m>#reply(pars)
and then m#edit(pars)

summer acorn
#

edit() is a method, not a value

restive furnace
#

wdym?

#

i did say m#edit(pars)

earnest phoenix
#

she's talking to me

summer acorn
#

I said that to code

earnest phoenix
#

@restive furnace

#

I said that to code
call me a gapple

#

g olden
apple

summer acorn
#

I eat gapples

viral iris
slender thistle
#

Template string

summer acorn
#

@viral iris use [] instead of ${}

#

${} is only for strings

restive furnace
#

what?

summer acorn
#

I mean, that's the only place I've found it work

viral iris
#
[${}]
restive furnace
#

<m>#<g>#id is string

summer acorn
#

no, john

viral iris
#

?

summer acorn
restive furnace
#

that doesnt work

summer acorn
#

that does work, yes

slender thistle
#

inb4 they create prefix_<id> collections

viral iris
#
let prefix = db.get(prefix[message.guild.id])
restive furnace
#

db.get(`prefix.${message.guild.id}`) yes spoonfeed sorry :((`~

viral iris
#

like this ?

summer acorn
#

that is better, john

viral iris
#

ok i;ll try

#

i'll*

#

this gonna work

#

thx

summer acorn
#

that is how you find a value in a object by using a variable

#

remember it

#

Object[variable]

viral iris
#

thx

summer acorn
#

I really need to solve that issue

viral iris
restive furnace
#

custom client?

#

eww

golden condor
#

Breathes in CLIENT MODS

summer acorn
#

@viral iris the prefix isn't stored for the guild

tight plinth
#

so i want a message to auto-edit every 5 seconds to display the new position in the song (its for music), but i dont know how to handle what happens when the message is deleted aka when the song ends. any idea?

golden condor
earnest phoenix
#

@viral iris these are your problems:
there is no template string so ${message.guild.id} is not stored as 457384563859 smth so it is global
there is no key defined so it returns nothing

golden condor
#

just getting the message

quartz kindle
#

if you are doing this let prefix = db.get(prefix[message.guild.id]) this is wrong lol

earnest phoenix
#

yeah

#

lemme type it out

viral iris
#
if(prefix === null)prefix = "-";
golden condor
#

I am trying to modify a object inside of an array inside of an object in mongo, and I log the result both before and after and show that it's saved, but the values doesn't update within the object I am modifying.
https://cdn.discordapp.com/attachments/272764566411149314/737961797474189393/unknown.png
the path is just res.modCases[/*num*/]
this is the code I use

let index = res.modCases.indexOf(modCase);
console.log(index)
res.modCases[index].reason = reason;
console.log(res.modCases[index])
utils.saveDB(res).catch(err => console.error(err));
```@summer acorn
slender thistle
#

@tight plinth You could rely on the messageDelete event to check if the message was deleted

golden condor
#

That only checks cached messages

slender thistle
#

...or even fetch the message in the interval?

tight plinth
#

i tried to do try/catch but it doesnt seems to work

quartz kindle
#

dont compare with null, just check if its falsey if(!prefix)

golden condor
#

what arev you tryna do?

earnest phoenix
#
if(prefix === null)prefix = "-";

@viral iris bruh then the prefix will get yeeted when your bot goes offline and it is global so it doesn't apply to a single server

#

read the docs

tight plinth
#

but why not i'll try

golden condor
#

i tried to do try/catch but it doesnt seems to work
@tight plinth what are u tryna do

tight plinth
#

its to display song position over time

golden condor
#

so i want a message to auto-edit every 5 seconds to display the new position in the song (its for music), but i dont know how to handle what happens when the message is deleted aka when the song ends. any idea?
@tight plinth you use lavalink so you can do it when player.on("end")

tight plinth
#

like 0:00/4:53 --> 0:05/4:53...

#

hm

earnest phoenix
#

so

golden condor
#

That might not be a good idea though

earnest phoenix
#

trim the song into clips of 5 seconds

summer acorn
#

@tight plinth you could kill the interval

earnest phoenix
#

it will destroy the music quality tho but use an insanely fast vps

summer acorn
#

there is a method for that

tight plinth
#

whats the method

earnest phoenix
#

idk

summer acorn
#

hold on

earnest phoenix
#

and that's spoonfeeding

tight plinth
#

and that's spoonfeeding
@earnest phoenix no

earnest phoenix
#

just link the docs

summer acorn
#

clearInterval(intervalname)

tight plinth
#

hm k

earnest phoenix
#

also should i add music commands to my bot which has average ping times of 2 ms

summer acorn
#

I used it in my osu! bot

earnest phoenix
#

one day it even went negative ms

#

and my code didn't have smth wrong

summer acorn
#
var timer = setTimeout(() => {
            try {
                this.code(lobby, queue, null, channel);
            } catch (error) {
                console.error(error);
            }
        }, 120000);
        lobby.on("beatmapid", beatmap => {
            clearTimeout(timer);

something like this @tight plinth

misty sigil
#

wtf

summer acorn
#

but interval

tight plinth
#

k

misty sigil
#

how can i make a blacklist command on my bot

earnest phoenix
#

umm

quartz kindle
#

when does quick.db ever work

misty sigil
#

good point tim

golden condor
#

quick.db is good but not scalable, you should use mongo db or proper sql they are much more scalable. There are wrappers for mongo that make it like quick.db, I have made one and so have many other people.

summer acorn
#

@golden condor any solution for my issue?

golden condor
#

I have never seen that before

summer acorn
#

ah

golden condor
#

But can you show your code?

summer acorn
golden condor
#

(sorry if you already did, I didn't see it)

tight plinth
#

@summer acorn so im trying to do your method but the try/catch dont seems to work, the "404 message not found" triggers before the catch can do smth

#

oh wait i have an idea

summer acorn
#

@tight plinth that code was just a direct copy from my osu! bot

golden condor
#

what is utils.saveDB ?

summer acorn
#

it doesn't work like that for discord bots the way you want it to

tight plinth
#

hm

summer acorn
#

uh ok hold on I'll send my functions file

tight plinth
#

i have an idea

golden condor
#

Also, that may be API abuse

summer acorn
earnest phoenix
#

quick.db is good but not scalable, you should use mongo db or proper sql they are much more scalable. There are wrappers for mongo that make it like quick.db, I have made one and so have many other people.
i use quick.db because i store everything on a single machine

golden condor
#

Mongo would be better as you can use it across multiple machins

summer acorn
#

yes

earnest phoenix
#

wdym discord uses it too i've never seen "Checking your browser" messages

golden condor
#

yes they are optional

#

That is under attack mode.

#

@summer acorn You never do newDB.save() which you have to do

summer acorn
golden condor
#

nvm

earnest phoenix
#

Mongo would be better as you can use it across multiple machins
@golden condor what if you use repl.it because you don't have any money to do that technical stufffffffffff

#

||or because you're lazy||

golden condor
#

MongoDB clusters my friend

summer acorn
#

mongo still works

#

with repl, mongo is a much better option

earnest phoenix
#

mongoose are not cool irl

#

with repl, mongo is a much better option
why

summer acorn
#

as on repl, you risk data getting lost when storing it directly

golden condor
#

why not use mongoose's built in functions? This just over complicates things

earnest phoenix
#

i make 100 backups

#

on 100 code hosting services

#

including github with the code archiver program

summer acorn
#

well, remember you only have 512 mb

earnest phoenix
summer acorn
#

and @golden condor because secure functions are good

earnest phoenix
#

well, remember you only have 512 mb
||yes||

#

that's the most formatting you can do

#

on a single piece of shit text

summer acorn
#

wrong

golden condor
#

did you... just make your entire bot's database public?

summer acorn
#

you forgot crossover

earnest phoenix
#

did you... just make your entire bot's database public?
i store the userIDS so no witchhunting and i'm gonna encrypt the files before uploading them

golden condor
#

but still.. not a good idea

earnest phoenix
#

also

restive furnace
#

uhh one file bot

earnest phoenix
#

potato

golden condor
#
const http = require("http");
setInterval(() => {
  http.get(`http://codecodiscordbot.glitch.me/`);
}, 280000);```This'll get ur project banned.
earnest phoenix
#

uhh one file bot
because YES

#
const http = require("http");
setInterval(() => {
  http.get(`http://codecodiscordbot.glitch.me/`);
}, 280000);```This'll get ur project banned.

oh yeah lol i forgot to remove it when i moved from glitch to repl.it

restive furnace
#

use LOC instead

golden condor
#

Anyway I'm gonna go code my own database

lusty quest
#

i still want to figure out what lib to use for a bot in C#. Discord.net or Csharp+

earnest phoenix
#

umm

#

read the pros and cons

slender thistle
#

There's also Disqord iirc

earnest phoenix
#

also i'm deleting every single comment in my files so noobs can't steal my source ||makes bot source intentionally public||

lusty quest
#

there is a small YT Tutorial series that uses Csharp+ and for now it looks pretty much braindead to use. like compared to JS its so easy to use

#

lol if you want to be evil just make it buggy AF

tight plinth
#

ty guys, it worked❤️

mild flower
#

how do i check if the person has their dms open or not

earnest phoenix
#

@mild flower do :

#

accidentally pressed shift enter before typing

mild flower
#

...

#

warned.send(Ewarn).catch(() => message.reply("Dms closed!")); this correct?

earnest phoenix
#
try {
message.author.send("the stuff you wanna send");
} catch (err){
message.reply("you don't have your dms open :/");
}
mild flower
#

is my statement correct?

earnest phoenix
#

warned.send(Ewarn).catch(() => message.reply("Dms closed!")); this correct?
show your code

#

we don't know what those variables do

mild flower
#

i know

#

what they do

#

and its correct

#

thank you anyways

#

and its correct
i meant the variables

earnest phoenix
#

so why you asking us if you know what you're doing is correct

honest perch
#

on that note

#

how do i export mongodb

earnest phoenix
#

idk

#

ask @golden condor

honest perch
#

@golden condor

earnest phoenix
#

he's a potato

digital ibex
#

what do u mean export mongodb?

golden condor
#

What I did, was I used compass

earnest phoenix
#

wait why second ping

honest perch
#

export the contents

mild flower
#

eh

honest perch
#

collections

golden condor
#

And exported it to json

mild flower
#

i just said the variables are correct

golden condor
#

Copy pasted the content

digital ibex
#

yeah, compass

golden condor
#

And the put it into my db

honest perch
#

how am i meant to copy paste it

mild flower
#

ew
copy paste?
cringe

honest perch
#

ive got a lot of data

digital ibex
#

are you have the retardness shadowblazer

#

why u wanna copy and paste it for?

honest perch
#

me?

pure lion
#

Lmao

digital ibex
#

yeah

mild flower
#

are you have the retardness shadowblazer
@digital ibex what did i do

honest perch
#

for backups as im stupid and i dont want to yeet a db again

mild flower
#

i didnt copy paste nothing

#

i was repelling it

#

get ur fax straight

digital ibex
#

nothing wrong with copy and pasting data

earnest phoenix
#

is it a good idea for me to use CryptoJS to encrypt my quick.db stuff and store the password in .env? it will slow down some stuff probably

mild flower
#

i did nothing tho

#

@digital ibex ...i repel copy paste

digital ibex
#

theres no need for u to encrypt stuff lmfao

#

good for u

lusty quest
#

it will slow down stuff since encrypting and decrypting takes some time

digital ibex
#

why do u wanna encrypt stuff @earnest phoenix ?

lusty quest
#

also you use a local db so no need for it

#

if you would use a external DB i would encrypt Names atleast

clever vector
#

hi guys

#

anyone help?

digital ibex
#

what do u need?

clever vector
#

lol i did wrong this

earnest phoenix
#

why do u wanna encrypt stuff @earnest phoenix ?
@digital ibex i made my bot code open source and licensed it under the MIT license and the json.sqlite file of quick.db is included in it...

digital ibex
#

use a gitignore

#

and in the readme

#

tell them how to make it using their own stuff

pure lion
#

What is a gitignore and what does it do

#

Also hi lost how long did it take for your LOC acc to be made?

earnest phoenix
#

@pure lion .gitignore prevents it from cloning specific files when someone git clones your repo

digital ibex
#

this is my gitignore

#

simpul

#

no it doesnt

slender wagon
#

gitignore ignores specified files to be uploaded in github

digital ibex
#

all it does is not allow you to commit the file/folders to the repo

earnest phoenix
#

ok

honest perch
earnest phoenix
slender wagon
#

u might need to ignore the .env file

#

yeah

earnest phoenix
#

why might

#

say OF COURSE

slender wagon
#

of course

earnest phoenix
#

lemme go make a .gitignore before i die

#
  • my bot dies
digital ibex
#

i havent added a gitignnore for the .env

#

only because its private

honest perch
#

i added it because gh desktop kept trying to push it to my dashboard

slender wagon
#

u can create one on the hosting site that u will use

digital ibex
#

hosting site?

slender wagon
#

the hosting provider

#

example heroku or glitch these are free

digital ibex
#

@pure lion oh. i thought i answered, ask there not here pls :)

#

glitch isnt a host tho

honest perch
#

my hosting provider is localhost smirk

slender wagon
#

yeah but people use it like one

digital ibex
#

yeah

sterile minnow
#

Heya.

I have a question:

If i try to do that: ```js
model.updateOne({'id' : userID}, {$set: {'url' : url}})


I get this error:
(node:3184) UnhandledPromiseRejectionWarning: Error: cyclic dependency detected 

But if i do anything else it works completely fine

If i try to set f.e. the Name it works fine
tight plinth
sterile minnow
#

Ratelimit i think

tight plinth
#

only executes once every 5 seconds so should be fine with ratemimits

sterile minnow
#

try every 30

tight plinth
#

context: this edits the "now playing" message to display the timestamp of the song (like 0:05/3:33)

#

so every 30 seconds would be too much

sterile minnow
#

Lemme google sth

tight plinth
#

i'll try every 10

pure lion
#

Wh-why do I have 2 pings?

sterile minnow
#

Each 5 secs u can do 5 things on the server

cloud pebble
#

Running the code for my bot on my PC seems to work fine but when I run it off my pi, all the event functions take hours to load. I'm guessing there's some sort of connection issue, any ideas?

sterile minnow
#

What code?

#

What is the error

digital ibex
#

shouldnt be a connection issue because its local, for the pi

#

not sure why thats happening, have you tried contacting your provider?

cloud pebble
#

There is no error message, the code is this bit:

async def on_ready():
    print("Bot is online")
    # update_bm.start()```
It will work if I wait long enough. I'm hosting it on my Internet so that's why im guessing something is blocking the pi
#

All the other bot commands work too but anything defined as @bot.event doesn't fire

slender thistle
#

Show your full code

tight plinth
#

@sterile minnow same thing if i try to edit it every 10 seconds

cloud pebble
#

It's 3k lines long, it's a full bot

slender thistle
#

single-file?

tight plinth
#

but there it inly edit once before stopping

slender thistle
#

You could just hastebin it blobshrug

earnest phoenix
cloud pebble
#

it's split into a few files but main is long anyway

sterile minnow
#

Hmmm. Try 15 or sth

digital ibex
#

thats not helpful......

earnest phoenix
#

is it still a bad idea to put those stuff

digital ibex
#

put what stuff?

earnest phoenix
#

the stuff i just took a screenshot of

tight plinth
#

it stops editing it after ~10 seconds so i dont think it would help

earnest phoenix
#

||(just tryna not get warned for posting that here instead of #memes-and-media)||

cloud pebble
#

I know it's definitely not an issue with the code since running the exact same code from my pc works fine

#

all the packages are on the right versions and all that too

earnest phoenix
#

but

#

are you sure they're installed

cloud pebble
#

phelp

earnest phoenix
#

when i run npm rebuild it gives a heckton of errors with quick.db but when i install everything individually no errors occur

#

smh

cloud pebble
#

ok i guess not here but even in #commands it's working ;-;

earnest phoenix
#

:SMH:

tight plinth
#

k so now it stops after 15 seconds for some reason

#

how can i check if a map is empty?

cinder patio
#

check the .size property

#

if it's 0

tight plinth
#

ah

#

am dumb

cloud pebble
#

so restarting the bot enough times seemed to get it to connect in the end okeh

earnest phoenix
#

yo

#

this sounds very much spoonfeeding but

#

is there anyway i can encrypt the data before saving it in quick.db

#

with the password as the variable password

digital ibex
#

you dont need to encrypt it, you've already been told

earnest phoenix
#

why

#

my source is visible to everyone

#

and i have cross server robbing users of coins

digital ibex
#

and we told you what a gitignore does

earnest phoenix
#

yes

digital ibex
#

add the file where it has sensitive data to the gitginore

earnest phoenix
#

i didn't upload it to github and added it to gitignore

#

what is better Quick.db or MongoDB ?

#

but the json.sqlite file is still visible on my repl.it

#

what is better Quick.db or MongoDB ?
quick.db for beginners and mongodb for advanced

digital ibex
#

use a .env, repl.it automatically hides the data from in that file who aren't the owner

earnest phoenix
#

???

#

huh

#

i thought we can only store variables

digital ibex
#

theres no correlation between mongodb and quick.db apart from it ofc storing data, afaik

#

and mongodb is better im sure in everyones opinion

earnest phoenix
#

lemme try :

JSONSQLITE=json.sqlite
digital ibex
#

it doesnt work like that

earnest phoenix
#

this is my current .env file:

TOKEN=HEY
digital ibex
#

yes

earnest phoenix
#

it doesnt work like that
so

digital ibex
#

and underneath add ur other data

earnest phoenix
#

./json.sqlite

digital ibex
#

no..

earnest phoenix
#

idk whatever you're saying i have only one brain cell

digital ibex
#

this should be ur .env: ```
TOKEN= UR TOKEN
JSONSQLITE= PASSWORD OR SOMETHING

earnest phoenix
#

huh

#

i thought you meant repl.it will hide the json.sqlite from everyone

digital ibex
#

moyai

earnest phoenix
#

???

digital ibex
#

i said the .env file

earnest phoenix
#

ye

digital ibex
#

not json.sqilite

earnest phoenix
#

lmao @silent socket why are you in #General and muted when there is no one else

delicate shore
#

yo

#

can anyone gimme link

cinder patio
#

An easy solution to your problem would be to use a VPS, nobody would be able to access any files you've got on there unless you tell them the password. I don't think there's a way to hide files in repl (other than your .env file which is automatically hidden)

delicate shore
#

which it says google your problem

#

something

#

i wanna say it to someone

#

the imgur link

earnest phoenix
#

but i made my bot's code open source

digital ibex
#

/tenor google

earnest phoenix
#

why

#

and me doesn't have muny to buy a good vps

digital ibex
#

i've told you...

#

use a gitignore

earnest phoenix
#

why
because yes

digital ibex
#

and the .env hides the data in the repl.it

cinder patio
#

It doesn't have to be on repl.it in order to be open source, you can use github / gitlab

knotty steeple
#

what is better Quick.db or MongoDB ?
@earnest phoenix not a question. mongodb

earnest phoenix
#

use a gitignore
and i said i added a gitignore on my github repo but i can still see it on repl.it

#

@knotty steeple wdym it is not a question

digital ibex
#

what did i say about the .env file?

earnest phoenix
#

that i can store private stuff