#development

1 messages · Page 848 of 1

clear wraith
#

how do i make it a database?

spare goblet
#

look for hwere you opened the db file

#

it depends on which version of sqlite you're using

pallid marsh
#

who here can help me with ejs?

spare goblet
#

or what wrapper

stark terrace
#

It's been awhile, but I may be able to help @pallid marsh

elder vine
#

Sure, what do you need help with Byoe?

#

Don't ask to ask :p

pallid marsh
#

wait im trying smth if it wont work ill send here

#

sec

digital ibex
#

whats ejs?

stark terrace
#

Express.js

#

Wait no

digital ibex
#

ah

elder vine
#

It is used to code express in websites

stark terrace
#

Embedded JavaScript

#

Basically it's used to render webpages server side

#

@digital ibex

digital ibex
#

ok

pallid marsh
#

ok im building a leaderboard page and im using ejs to parse the data to the html.
thats my code:

            <%= data.forEach(user=>{ %>
                <%= if(user.type == "gold"){ %>
                <img src="gold.png" width="30"><span class="lead"> 1. <img src="<%= user.pfp %>" style="border-radius: 20px; width: 30px;"> <%= username %></span>
                <%= } %>
                <%= if(user.type == "silver"){ %>
                <img src="silver.png" width="30"><span class="lead" style="margin-top: 15px;"> 2. <img src="<%= user.pfp %>" style="border-radius: 20px; width: 30px;"> <%= username %></span>
                <%= } %>
                <%= if(user.type == "bronze"){ %>
                <img src="bronze.png" width="30"><span class="lead">3. <img src="<%= user.pfp %>" style="border-radius: 20px; width: 30px;"> <%= username %></span>
                <%= } %>
                <%= if(user.type == "else"){ %>
                <p class="lead">4. <img src="<%= user.pfp %>" style="border-radius: 20px; width: 30px;"> <%= username %> </p>
                <%= } %>
                <hr>
            <%= }) %>
``` im getting the error: `SyntaxError: Unexpected token ')' in /root/views/leaderboard.ejs while compiling ejs`
Any idea why?
elder vine
#

u missing something then

stark terrace
#

It's a syntax error

pallid marsh
#

ik

#

but what

#

ive checked everything

elder vine
#

<%=

#

why

digital ibex
#

add )

#

K

elder vine
#

last line

#

What version are you using?

pallid marsh
#

its the closing line if the foreach

#

of ejs/

#

?

elder vine
#

<% }) %>

#

<%= is only used for when you display something with the code

#

<% 'Scriptlet' tag, for control-flow, no output
<%_ ‘Whitespace Slurping’ Scriptlet tag, strips all whitespace before it
<%= Outputs the value into the template (HTML escaped)
<%- Outputs the unescaped value into the template
<%# Comment tag, no execution, no output
<%% Outputs a literal '<%'
%> Plain ending tag
-%> Trim-mode ('newline slurp') tag, trims following newline
_%> ‘Whitespace Slurping’ ending tag, removes all whitespace after it

pallid marsh
#

oh

#

ok

#

ill try

elder vine
#

Same goes for all other lines, except: your <%= username & <%= user.pfp

pallid marsh
#

worked ty

elder vine
#

No problem.

plush quail
#

for c# what's the best way to get a user response?

tired nimbus
#

is using multiple tables in one sql file better than having multiple files but one table per file?

earnest phoenix
pale vessel
#

use regex or something

tired nimbus
#

if message.content.includes()?

earnest phoenix
#

UnhandledPromiseRejectionWarning: FetchError: request to [URL] failed, reason: Client network socket disconnected before secure TLS connection was established

#

I get that error after I spam some requests

#

any ideas?

tired nimbus
#

dont spam requests

earnest phoenix
#

message content includes? I already done that

#

i have to dUH

#

And its sooo hard

tired nimbus
#

why do you have to

earnest phoenix
#

thats not the point

#

i do have to

tired nimbus
#

if its ratelimited you cant do anything about it

#

try to limit the amount of requests your bot sends

earnest phoenix
#

;-;

#

proxy time

tired nimbus
#

i dont know what youre doing

earnest phoenix
#

updating user info

#

from apis

tired nimbus
#

how much per minute

copper cradle
#

if you're getting rate limitied then you can't do anything about it

#

well I mean

#

lower the number of requests per minute

earnest phoenix
#

uh about 10,000 requests in a ten second span

#

LOL

#

its ok ill just lower it

#

or use the proxy api

quartz kindle
#

what the fuck

copper cradle
#

holy cow

stark terrace
#

Holy shit....

#

You definitely need to lower that

copper cradle
#

that's a humungus number of requests

earnest phoenix
#

yep

quartz kindle
#

thats basically DOSing

earnest phoenix
#

it would be dosing

#

its from a single place

stark terrace
#

Was gonna mention api abuse

earnest phoenix
#

i shouldnt have it autoupdate on an increment ig

#

lol

quartz kindle
#

what are you even trying to do?

earnest phoenix
#

it was scraping stats

#

but ill just like

#

not do it every 24 hours for every one at once

quartz kindle
#

from where?

earnest phoenix
#

some minecraft api

#

for a server

#

lol

#

i know how to fix it

#

rn it updates em all at once

#

every 24 hours

#

now ill just change it to do it in batches

#

throughout the day

#

with nodecron

#

or whatever

#

Ok I managed to do something

tired nimbus
#

why does the command include the prefix

earnest phoenix
#

Oh

tired nimbus
#

follow your command handler

earnest phoenix
#

else if (command === 'hug') {
^

ReferenceError: command is not defined

plush quail
#

else if (command === 'pb')?

#

without the ?

elder vine
#

You've not defined command

#

it might be cmd?

#

Show more of the code

earnest phoenix
copper cradle
#

...

#
if(message.content.includes('Replaced')){'please do not say that'}

what where you even trying to do

#

and ofc you didn't define command

earnest phoenix
#

I was trying to get him to reply to that certain word in the sentence

#

I've been working on that all day

copper cradle
#

well that's not how it works

#

I recommend you learn the language first

#

and then you make a bot

earnest phoenix
#

I am learning the language

#

But there's no way I can't find a certain area on discord.js

pale vessel
#

args.includes() works too

#

or just like snail said, message.content.includes()

earnest phoenix
#

Like this: ```js
bot.on('message', message => {
if (message.content.startsWith("!command")) {
//do stuff here
}
});

#

How to User join position ?

elder vine
#

You could use a database and store joins.

slender wagon
#

return message.channel.send(`${message.author.displayAvatarURL({ format: "png", dynamic: true })}`); How do i change the size of the image let's say i want it 2048 px

earnest phoenix
#

Can't we do without using the database?

#
return message.channel.send(`${message.author.displayAvatarURL({ size: 2048 format: "png", dynamic: true })}`);
slender wagon
#

thank you!

elder vine
#

Or sort every members joinedAt date.

#

and you would find it.

earnest phoenix
#

Thank

slender wagon
#

oh worked pretty good

#

ty! ^

elder vine
#

Good.

earnest phoenix
#

Minimun size 8 or 16

pale vessel
#

docs

#

read them

gray pagoda
#

Good afternoon

#

😄

earnest phoenix
#

Where do I find the code to get my bot to detect a word in a setence? i searched everywhere in discord.js

slender thistle
#

regex

earnest phoenix
#

regex got it

#

Ok where's the regex at?

#

LOL

#

Damn

wheat jolt
#
let fstr = std::str::from_utf8(&bytes[0..length])?.to_owned();
#

how I can convert this rust line to node.js?

valid frigate
#

you mean to js

wheat jolt
#

It's the same thing

#

It would be the same code in node.js and js too

valid frigate
#

_>

#

dunno but iirc there's a few people here who know rust

idle mountain
#

anyone else who uses discord.net having an issue where your bot's process just stops?

#

like without an error or exit reason?

#

I'm having that issue and I'm wondering if it's related to discord.net or Discord's API

copper cradle
#

I wanted to get a look at rust's syntax and shit

#

but never did

valid frigate
#

i use jda and don't have that problem with sharding

#

it might be the library incorrectly handling close codes or something

copper cradle
#

maybe

#

don't they have a support server? @idle mountain

idle mountain
#

yeah but I wanted to know here first

#

since this server actually has like, all the devs who actually put effort into their bots and everything :p

copper cradle
#

well yes, but actually no

#

btw I already started to plan the 30000 line bot that only bans

idle mountain
#

very good

#

tell me how it goes

copper cradle
#

alright

cinder patio
wheat jolt
#

thanks, but there's another thing

#

that bytes[0..length]

copper cradle
#

that's just addressing every element in the bytes arr

clever radish
#

Has anyone noticed inconsistencies when awaitingMessages last week or two? Issue I'm running into is the bot no longer waiting for a response from a specific user (which has worked up until recently) with no code changes. Regardless of who sends a message, it just presses forward (using Discord.js)

wheat jolt
#

you have to use maxMatches instead max

#

at the options

#

I had the same problem

#

that's just addressing every element in the bytes arr
@copper cradle i still don't understand

cinder patio
#

0..length is from 0 to the length of the array

#

it returns an iterator over the values

#

Seems like bytes[0..length] is slicing the array

#

idk much about rust

pale vessel
#

it's a pretty toxic game

wheat jolt
#

what would be the line in node.js

#

i want the line NotLikeThis

tight plinth
#

What line

pale vessel
#
let fstr = std::str::from_utf8(&bytes[0..length])?.to_owned();
copper cradle
#
let output = "";
for (const b of bytes){
    //convert each byte into utf8 encoding and then append the output to output
    converted = //the conversion shit
    output += convertet
}
#

@wheat jolt

#

that's what I'd do

#

if js had list comprehensions it'd be easier

#

I swear to god, if you copy that and hope it works as it is then you're not even an amateur dev

earnest phoenix
#

Rainbow bot with delay 8 seconds is Accepted?

finite bough
#

nope

ember bluff
#

What is the reason that the number of servers in the bot is not visible on the site?

#

N/A

cursive dagger
#

You haven't used the API to post the stats

ember bluff
#

I don't know how I can

#

Can you help

barren swallow
earnest phoenix
#
const members = message.guild.members.filter(member => member.user.presence.game && /(discord|http|.com|.net|.org|invite|İnstagram|Facebook|watch|Youtube|youtube|facebook|instagram)/g.test(member.user.presence.game.name));
    const memberss = message.guild.members.filter(member => member.user.username && /(discord|http|.com|.net|.org|invite|İnstagram|Facebook|watch|Youtube|youtube|facebook|instagram)/g.test(member.user.username));

How can I do this according to discord.js v12

barren swallow
#

message.guild.members.cache.filter() I believe @earnest phoenix

heavy anchor
#

Anyone know why this is happening

execute(msg, args) {
        var api_ping = Math.round(bot.ws.ping);
        var bot_ping = Date.now();
        msg.channel.send('Checking ping...').then(m => {
            m.edit(`Pong! 🏓\nBot Ping: **${(Date.now() - bot_ping)}** ms\nAPI ping: **${api_ping}** ms`);
        });
    },```
barren swallow
#

Try just bot.ws.ping

heavy anchor
#

without Math.round?

copper cradle
#

console.log(bot.ws.ping) and see what you get

barren swallow
#

Yes And ^

heavy anchor
#

I get the same thing removing Math.round and in the log

barren swallow
#

Um

pale vessel
#

and now try debugging bot.ws

#

what even is your discord.js version

heavy anchor
#

The results are js WebSocketManager { _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined, gateway: undefined, totalShards: 1, shards: Collection [Map] {}, status: 3, destroyed: false, reconnecting: false, sessionStartLimit: undefined, [Symbol(kCapture)]: false

#

12.0.2

pale vessel
#

upgrade to 12.1.1

#

just in case

copper cradle
#

well then as you can see it has no ping property

pale vessel
#

i didn't see

#

/s

heavy anchor
#

Updated and still same thing

crimson vapor
#

what version are you on?

#

of d.js

pale vessel
#

read

heavy anchor
#

12.1.1

pale vessel
#

gateway undefined Thonk
is that normal?

heavy anchor
#

idk what that means lol

pale vessel
#

no it's not normal

#

everything is undefined

#

how did your bot even get connected

heavy anchor
#

here is all the code in my ping script

const Discord = require("discord.js");
const bot = new Discord.Client();

module.exports = {
    name: 'ping',
    description: "Says Pong 🏓 and gives the latency in ms ",
    execute(msg, args) {
        var api_ping = (bot.ws.ping);
        var bot_ping = Date.now();
        msg.channel.send('Checking ping...').then(m => {
            m.edit(`Pong! 🏓\nBot Ping: **${(Date.now() - bot_ping)}** ms\nAPI ping: **${api_ping}** ms`);
        });
    },
};```
crimson vapor
#

why are you creating a new client?

#

pass bot thought the execute event?

pale vessel
#

msg exists

#

msg.client

#

try msg.client.ws.ping

crimson vapor
#

wait is msg.client == client?

pale vessel
#

yes

crimson vapor
#

ima brb

pale vessel
#

i know because i've used it before

#

i don't know if it's msg.bot for him though

crimson vapor
#

I dont think so

pale vessel
#

yea

crimson vapor
#

it would be msg.client I think

pale vessel
crimson vapor
#

so should I

#

FUCK

#

its true

#

what else has a .client that I didnt know of?

#

does guild?

pseudo whale
#

No its just message

crimson vapor
#

ok good

#

ive been passing client through every function

#

guess I am just low IQ sometimes

pale vessel
#

guild too yes

crimson vapor
#

ok good

#

ima just not pass client

#

time to delete my event loaded function

heavy anchor
#

so it dose not make sense to me y bit it works when i put

  var api_ping = (msg.client.ws.ping);```
low bolt
#

I need help for bot. When bot is started, 1 hour later commands is working. Why?

pale vessel
#

client wasn't ready?

low bolt
#

events/ready.js is loading

#

But commands is working 1 hour later

pale vessel
#

i'm not sure

#

do you use some sort of database?

low bolt
#

No, I can send my events/message etc.

quartz kindle
#

@heavy anchor this is a new disconnected client, not the client your bot is running on, thats why

#

all objects in discord.js can access the client where they are running from

#

thats why message.client works

low bolt
#
  await fs.readdir("./commands/", (err, files) => {
    if (err) console.log(err)
    console.log(`${moment().format("ss:mm:HH DD/MM/YYYY")} | ${files.length} komut yükleniyor...`)
    files.forEach((f, i) => {
      let pull = require(`./commands/${f}`);
      console.log(`${moment().format("ss:mm:HH DD/MM/YYYY")} | ${pull.config.name.toUpperCase()} adlı komut yüklendi!`)
      client.commands.set(pull.config.name, pull);  
      pull.config.aliases.forEach(alias => {
        client.aliases.set(alias, pull.config.name)
      });
    });
  });

  await fs.readdir('./events/', (err, files) => {
    if (err) console.error(err);
    console.log(`${moment().format("ss:mm:HH DD/MM/YYYY")} |`)
    console.log(`${moment().format("ss:mm:HH DD/MM/YYYY")} | ${files.length} olay yükleniyor...`);
    files.forEach(f => {
      const eventName = f.split(".")[0];
      const event = require(`./events/${f}`);
      client.on(eventName, event.bind(null, client));
      console.log(`${moment().format("ss:mm:HH DD/MM/YYYY")} | ${eventName.toUpperCase()} adlı olay yüklendi!`);
    });
  });

client.login(ayarlar.token);
}

init()```
#

Here is the event & command loader

#
const ayarlar = require('../ayarlar.json');
const db = require('quick.db')
module.exports = async (client, message) => {
  if (!message.guild) return;
  if (message.author.bot) return;
    
    var ayar = ayarlar.Setting

  let prefix = db.fetch(`${message.guild.id}.Ayarlar.Prefix`) || ayarlar.prefix
  
  const embed = new Discord.RichEmbed()
    .setTitle(`${ayar} Invite System`)
    .setDescription(`**Prefix:** ${prefix}`)
    .setFooter(message.author.tag, message.author.avatarURL)
    .setTimestamp()
      
  if (message.content.includes(`<@${client.user.id}>`)) return message.channel.send(embed)
  if (message.content.includes(`<@!${client.user.id}>`)) return message.channel.send(embed)
  if (!message.content.startsWith(prefix)) return;
  
  const args = message.content.slice(prefix.length).trim().split(/ +/g);
  const command = args.shift().toLowerCase();
  const cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command));
  if (cmd) cmd.run(client, message, args);
};```
#

Here is the events/message.js

#

Maybe command loading is so slow?

#

But bot is starting after loading events & commands

quartz kindle
#

commands only work 1 hour later?

low bolt
#

Yes

#

When I use, I can't see any respond

#

But I can use i?eval

#

But no respond

crimson vapor
#

how long is it actually? one hour?

low bolt
#

Really 60~ minutes

#

yes

heavy anchor
#

@quartz kindle ok thanks for explaining that to me that makes sense

low bolt
#

Eval codes is working, but I don't get any respond

#

Message etc.

crimson vapor
#

any errors?

low bolt
#

No error

#

I'm starting bot now

#

I will send screenshots

quartz kindle
#

no need for await on the fs.readdir, its not a promise. but thats not the cause of the problem

crimson vapor
#

is this the first time you started the bot on this computer? or what CPU do you have?

earnest phoenix
#

How can I compare JSONs?

if (JSON.stringify(json.listOfSaves[json.listOfSaves.length - 1][1]) == JSON.stringify(jsonData)) { doesn't seem to work.

#

Hey
I'm making this db coins system
I tried to make an addcoins command and it wont work
Error: add is not a number
Line: coins.add(`${message.guild.id}.${pUser.id}`, parseInt(args[1]))

crimson vapor
#

what does coins.add do?

#

can you show its code?

earnest phoenix
#

add coins to the user (not pay command, adding)

#

do you need to see the code?

#

@crimson vapor

crimson vapor
#

I think so

earnest phoenix
#

dming

crimson vapor
#

no

#

why not here?

earnest phoenix
#

Actually ok

#

the coins.add part

crimson vapor
#

that is not the code I need

earnest phoenix
#

what code then

#

wait

crimson vapor
#

for coins, do you use someone's module or did you create a function?

#

im sorry, I dont know what you are doing, I always just did it a bit differently

#

so I cant really help

earnest phoenix
#

That's ok, thanks for trying!

crimson vapor
#

np

earnest phoenix
#

my bot can send a image without link/embed?

crimson vapor
#

yes

earnest phoenix
#

how?

crimson vapor
#

you can create a new MessageAttachment and send it

earnest phoenix
#

ok

agile orchid
#

Hey
I'm making this db coins system
I tried to make an addcoins command and it wont work
Error: add is not a number
Line: coins.add(`${message.guild.id}.${pUser.id}`, parseInt(args[1]))
@earnest phoenix so which package are you using for database

modest maple
#

@twilit rapids thoughts?

twilit rapids
#

@cinder geode how about we don't

modest maple
#

no timo

#

they ment

#

the bot has its invite for a diffrent bot

twilit rapids
#

o

earnest phoenix
#

quick.db

#

@agile orchid

#

the problem is how to use the coins.add

cinder geode
#

how about you fix it?

earnest phoenix
#

@cinder geode talking to me ?

cinder geode
#

no

earnest phoenix
#

ok

twilit rapids
#

@cinder geode It's not that we set all the pages, we do correct mistakes which I'm gonna do now.

cinder geode
#

ok thats why i wanted to let you know

modest maple
#

that bot was banned wasnt it

earnest phoenix
#

anyone know anything about adding to database with quick.db?

twilit rapids
#

I just misunderstood your report @cinder geode, sorry for that

agile orchid
#

the problem is how to use the coins.add
so tell me how did u import quick.db

#

like the variable name

earnest phoenix
#

const coins = new db.table("coins")

#

?

#

is this what you meant

agile orchid
#

well you tried to add coins to a guild id

earnest phoenix
#

each guild with its own system yeah

#

the problem is about coins.add

#
coins.add(`${message.guild.id}.${pUser.id}`, parseInt(args[1]))```
agile orchid
#

i'd recommed trying js db.add(`money_${message.guild.id}_${pUser.id}`, args[1])

#

you need to type money infront of other stuff

#

to define the table you want to add stuff to

earnest phoenix
#

i dont have to use it like that

#

i can use coins.add

#
const coins = new db.table("coins")```
#

do you know how to fix it maybe?

crimson vapor
#

he just did i think

low bolt
#

I started bot 23:36:30 31/03/2020

#

I can't use commands now.

finite bough
#

why time tho

low bolt
#

23:57:30 my time

crimson vapor
#

is it april 1 for you?

low bolt
#

21 minute

finite bough
#

yes

low bolt
#

I can't use commands, no respond.

finite bough
#

any errors?

low bolt
#

No

#

Eval command is working but not responding

#

When I try to change activity with eval

earnest phoenix
#

Help with the coins problem?

low bolt
#

Changing activity, but no responding

#

Like message etc.

earnest phoenix
#
coins.add(`${message.guild.id}.${pUser.id}`, parseInt(args[1]))```
crimson vapor
#

is your bot allowed to respond in the channel you are talking in?

low bolt
#

Yes %10000

crimson vapor
#

ok

low bolt
#

Because I always using my bot in this channel

crimson vapor
#

@earnest phoenix do you know how to use the db you are using?

earnest phoenix
#

not too much but kinda

crimson vapor
#

you should learn

earnest phoenix
#

idk how to add

#

i tried but i dont know how to add

finite bough
#

@low bolt r u using glitch

low bolt
#

no glitch

crimson vapor
#

im not sure how SQL databases work

hallow sandal
#

How can I host the bot on heroku?

finite bough
#

heroku?

#

@hallow sandal yes

#

I mesn

#

mean

crimson vapor
#

how - yes

finite bough
#

@crimson vapor I am blind

crimson vapor
#

LOL

#

same

#

but not really tbh

agile orchid
#
coins.add(`${message.guild.id}.${pUser.id}`, parseInt(args[1]))```

@earnest phoenix
dude add coins infront of the guild id

#

you need to do that

finite bough
#

@hallow sandal

low bolt
#

No help? :/

agile orchid
#

What do you need help with

finite bough
#

@low bolt do u get any errors

earnest phoenix
#

didnt work

hallow sandal
#

I git cloned my python file but idk what to do next

elder vine
#

Any errors?

low bolt
#

No error

earnest phoenix
#
coins.add(`coins_${message.guild.id}.${pUser.id}`, parseInt(args[1]))```
finite bough
#

@hallow sandal cloned to where

earnest phoenix
#

not a number

agile orchid
#

just args[1]

earnest phoenix
#

alrighty

agile orchid
#

parseInt is for html

#

script

elder vine
#

no

finite bough
#

parseint works in js too

#

wtf

elder vine
#

Ye

agile orchid
#

it is js

#

i know that

elder vine
earnest phoenix
#

Error: .add() data is not a number.

low bolt
#

Maybe Shard is doing this?

#

I'm using sharding

earnest phoenix
#
coins.add(`coins_${message.guild.id}.${pUser.id}`, (args[1]))```
agile orchid
#

then use db.add

earnest phoenix
#

alrigt

finite bough
#

@earnest phoenix can u log out the data

agile orchid
#

no () around args[1]

#

just args[1]

crimson vapor
#

would it matter tbh?

finite bough
#

^

agile orchid
#

¯\_(ツ)_/¯

elder vine
#

What is issue? @low bolt

low bolt
#

Bot commands is working after 1 hour

earnest phoenix
#

Error: .add() data is not a number.

elder vine
#

What?

low bolt
#

Ready event is loading correctly

earnest phoenix
#
db.add(`coins_${message.guild.id}.${pUser.id}`, args[1])```
finite bough
#

r u command files loading correctly

elder vine
#

Do you have a wait function?

#

Does your shard start right away?

agile orchid
#

Error: .add() data is not a number.
@earnest phoenix tell me how you write the command

low bolt
#

My bot started @ 23:36

My time 23:57

#

no respond

elder vine
#

How many guilds is your bot in?

hallow sandal
#

@finite bough To my downloads

agile orchid
#

like how you're supposed to use it

crimson vapor
#

@earnest phoenix are you checking to make sure that the args[1] is a number?

low bolt
#

1100

finite bough
#

@hallow sandal why

#

why did u

low bolt
#

I only have 1 shard

elder vine
#

Why shard then?

earnest phoenix
#

can i send the command or ?

low bolt
#

Because I need

agile orchid
#

yes

crimson vapor
#

yes

low bolt
#

Bot is laggy

finite bough
#

shard doesnt help

hallow sandal
#

is it suppose to be in Desktop?

elder vine
#

how much ram u using?

low bolt
#

130mb

crimson vapor
#

and send the message you sent to cause the error

agile orchid
#

can i send the command or ?
@earnest phoenix send how you typed the command

elder vine
#

CPU overload?

#

use hastebin please

finite bough
#

@earnest phoenix can u console log the data

low bolt
#

No, there is some laggy events

finite bough
#

@elder vine nah

low bolt
#

Like fetching all guilds

#

etc.

earnest phoenix
#

using hastebin

#

@finite bough wdym

hallow sandal
#

Shiemi, is it suppose to be in Desktop or-

crimson vapor
#

oh come on

earnest phoenix
agile orchid
#

this channel is a mess rn

elder vine
#

Why do you fetch all guilds?

low bolt
#

Because my bot is invite manager bot

earnest phoenix
#

its on hastebin now

low bolt
#

I'm fetching all invites

#

When start

elder vine
#

Oh, high cpu bot

finite bough
#

console.log(the stuff u adding)

elder vine
#

You should use database and store

low bolt
#

(I'm not using some shitty free codes)

hallow sandal
#

@finite bough whats wrong with putting in the downloads?

low bolt
#

I don't know how to save Map datas

#

client.invites = {}

invites[guildid] = fetch invites

#

im doing like that

finite bough
#

sharding is not a good way to decrease lagg that way

low bolt
#

how I will save this data ?

elder vine
#

Depends what db

finite bough
#

@hallow sandal it's ok but why did u

earnest phoenix
#

@agile orchid seeing any problem?

finite bough
#

I mean. u have to push them to heroku master

earnest phoenix
#

sry for tag

low bolt
#

I'm using quick.db data module

agile orchid
#

you didn't change anything in the code

earnest phoenix
#

um

hallow sandal
#

How do I do that then?

low bolt
#

But I don't know how to save this data to db

finite bough
hallow sandal
#

Im pretty ne to heroku,my apologies

low bolt
#

maybe same 🤔

elder vine
#

Idk about quick.db

distant sky
#

@earnest phoenix the hex code vs whatever code that is: #b22222 = 11674146

hallow sandal
#

new*

low bolt
#

Glitch > Heroku

elder vine
#

I use mongodb

earnest phoenix
#

so u telling me just to change it all to db and coins_guildid

low bolt
#

I only know Quick.db so using

#

this data

finite bough
#

mongodb is better

low bolt
#

I will write when commands is loaded

finite bough
#

try it

low bolt
#

Bot opened @ 23:36

agile orchid
#

the hex code vs whatever code that is: #b22222 = 11674146
@distant sky .setColor('#hexcode')

#

if you're using discord.js

earnest phoenix
#

@agile orchid this is the only thing i need to change

coins.add(`${message.guild.id}.${pUser.id}`, parseInt(args[1]))```
#

what else

distant sky
#

That's not what I meant, I just want to know what type of color code that is and if there is a translator for it online

earnest phoenix
#

@distant sky hex color ?

distant sky
#

I wish

earnest phoenix
#

@cosmic anvil wrong Discord Server lol

finite bough
elder vine
#

Hmm

earnest phoenix
#

lmao

elder vine
#

Have you read up on docs?

agile orchid
#
db.add(`coins_${message.guild.id}_${pUser.id}`, args[1])```
try that @earnest phoenix
earnest phoenix
#

its what i just tried

distant sky
#

Thx hope, I'll look into that page

earnest phoenix
#

oh wait actually there is a change i will try

agile orchid
#

well show the code where you create the db table and where you import quick.db if it won't work

#

nothing else

#

just quickdb stuff

earnest phoenix
#

it wont work

#
const coins = new db.table("coins")
 
 
 if(message.author.bot) return;
 
let usercoins = await coins.fetch(`${message.guild.id}.${message.author.id}`)
if(!usercoins) usercoins = 0```
#

@agile orchid

crimson vapor
#

saying "It wont work" and pasting code will get us no where

earnest phoenix
#

the thing he gave me before wont work, i posted what he asked

crimson vapor
#

Please show either an error or why you think it wont work

earnest phoenix
#

showed error

agile orchid
#

@earnest phoenix Try to change the db.fetch stuff

#

like how you did on the db.add one

crimson vapor
#

I dont use quickdb but why are you using new db.table? wouldnt it be db.table.find()?

agile orchid
#

no?

crimson vapor
#

ok

earnest phoenix
#

i asked someone for help with this one, he helped me start the code, he is responding

finite bough
#

findOne

earnest phoenix
#

i will try to get it to work

finite bough
#

@crimson vapor well same

crimson vapor
#

mongo uses a find function

agile orchid
#

mongo is different to quickdb

#

i think

#

idk tbh

crimson vapor
#

ye you are doing it wrong

agile orchid
#

i never used mongo

crimson vapor
#

new db.table should be creating a new table

#

right?

agile orchid
#

yes

crimson vapor
#

so why would you want to create a new table for an addmoney command?

agile orchid
#

huh?

#

he only created 1 table

#

for the coins

crimson vapor
#

ok im confused

#

ill brb

agile orchid
#

xd

crimson vapor
#

may I see your code for initializing the user's coins @earnest phoenix

agile orchid
#
 const coins = new db.table("coins")
  

  if(message.author.bot) return;
  
 let usercoins = await coins.fetch(`${message.guild.id}.${message.author.id}`)
 if(!usercoins) usercoins = 0```
.
#

that's his code

crimson vapor
#

what db do you use?

agile orchid
#

he uses quickdb

finite bough
#

I use better sqlite3 and mongodb

crimson vapor
#

Im asking you JDev

agile orchid
#

i also use quickdb

clear wraith
#

Is it good if i can see my bots name in #logs now? Because I wasnt able to see the name of it yesterday... it was invalid user

finite bough
#

@clear wraith it's normal

crimson vapor
#

ok

agile orchid
#

how is that related to development

crimson vapor
#

after reading a little

clear wraith
#

OK

crimson vapor
#

I have not learned if that is correct (I assume it is) but I see that they problem other than bad formatting is that the args[1] is not a number so that is the problem

finite bough
#

well how about

earnest phoenix
#

Error: .add() data is not a number. i cant fix it

crimson vapor
#

so a simple if(isNaN(args[1]) return message.channel.send(isntNumberEmbed) would fix it

earnest phoenix
#

im back btw

#

i added that million

#

added that already
the isnan

crimson vapor
#

can I see a screenshot of the code now

earnest phoenix
#

can i send it here and not use hastebin

finite bough
#

here

#

wait

earnest phoenix
#

?

finite bough
#

yes here

earnest phoenix
#
 if(command === "addcoins") {
    
    let nopermissionembed = new Discord.RichEmbed()
  .setDescription("You don't have the permission.")
  .setColor(config.Red)
    
    if(!message.member.hasPermission("MANAGE_GUILD")) return message.channel.send(nopermissionembed)
    
    let setlogschannelembed = new Discord.RichEmbed()
  .setDescription("Please set logs channel !setlogs #channel")
  .setColor(config.Red)
  
  const db = require("quick.db")
  var logs = await db.fetch(`logs_${message.guild.id}`)
  var Channel = message.guild.channels.find(c=> c.id === logs)
  if(!Channel) return message.channel.send(setlogschannelembed);
  
  let pUser = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);
    
    let nousermentionedembed = new Discord.RichEmbed()
    .setDescription("Please mention the user you want to add coins to.")
    .setColor(config.Red)
  
    if(!pUser) return message.channel.send(nousermentionedembed)
    
  
  
  let usercoins = await coins.fetch(`${message.guild.id}.${message.author.id}`)
  
  
  let noaddamountembed = new Discord.RichEmbed()
    .setDescription("Please specify the amount of money to add to the user.")
    .setColor(config.Red)
  
    if(!args[1]) return message.channel.send(noaddamountembed)
    
    let onlynumbersembed = new Discord.RichEmbed()
    .setDescription("Please only use numbers to add.")
    .setColor(config.Red)
    
    if(isNaN(args[1])) return message.channel.send(onlynumbersembed)
    
    
    coins.add(`${message.guild.id}.${pUser.id}`, args[1])
    
  
  ///coins[pUser.id] = {
  ///  coins: usercoins + parseInt(args[1])
  ///};
    
    
  
    let addedcoinsembed = new Discord.RichEmbed()
    .setDescription(`${message.author} has added ${pUser} ${args[1]} coins.`)
    .setColor(config.Green)
    
  message.channel.send(addedcoinsembed).then(msg => 
  Channel.send(addedcoinsembed) )
  
  }```
agile orchid
#

well i use

db.add(`money_${user.id}`, args[1])```
and it works just fine
earnest phoenix
#

but check it out on other servers

#

it will be the same amount

agile orchid
#

i'd recommend to put js const db = require('quick.db') at the beginning of your code

finite bough
#

I can see idf(!args[1])

agile orchid
#

not in the event

finite bough
#

oh nvm

earnest phoenix
#

it doesnt matter? @agile orchid

#

it wont error

finite bough
#

@earnest phoenix can u show where u have defined args

earnest phoenix
#

arg define?

finite bough
#

mhm

crimson vapor
#

yes.

agile orchid
#

yes

earnest phoenix
#

const args = message.content.slice(prefix.length).trim().split(/ +/g);

agile orchid
#

Shiemi is also a potato i assume

earnest phoenix
#

Well

#

Might be

warped ruin
#

imagine not using an actual ast for commands /s

finite bough
#

yes I am a potato

earnest phoenix
#

umm anyone know how to fix my thing lmao

crimson vapor
#

imagine not using an actual ast for commands /s
@warped ruin ?

warped ruin
#

nothing

earnest phoenix
#

imagine not getting its a joke

finite bough
#

ok so u get an error saying it's not a number

#

?

#

itay

earnest phoenix
#

yeah

crimson vapor
#

restart and it should work?

finite bough
#

and after that

#

console.log(args[1])

agile orchid
#

send the error text here

earnest phoenix
#

Error: .add() data is not a number.

#

i did !addcoins @earnest phoenix 1

finite bough
#

and did u console log args 1?

earnest phoenix
#

um no

finite bough
#

try it

earnest phoenix
#

doing it rn

finite bough
#

and see if it sends 1

earnest phoenix
#

sends 1

#

yeah

finite bough
#

:/

earnest phoenix
#

what do i need to do D:D:D:D:

agile orchid
#

try adding the coins to your id

earnest phoenix
#

wdym

agile orchid
#

copy your user id

#

and send it instead of ping

earnest phoenix
#

i did it at first so the thing will give u 5 coins
i tried adding more removing or paying but it will stay the same

finite bough
#

someone was called me potato

#

loo

earnest phoenix
#

so the problem is at coins.add

agile orchid
#

for example: instead of @agile orchid send 544580475952431104

earnest phoenix
#

im doing it worng

#

wrong

agile orchid
#

someone was called me potato
@finite bough because you are

earnest phoenix
#

it will say in console my id + serverid so there is no reason on why to

finite bough
#

^

earnest phoenix
#

im doing the add thing wrong i think

agile orchid
#

well then

finite bough
#

.add is the problem not the id

agile orchid
#

idk GWcmeisterPeepoShrug

finite bough
#

lol

elder vine
#

lol

earnest phoenix
#

coins.add(THE REST PROBLEM)

#

the rest there is the problem

#

how do i even use it

#

i tried but it didnt work

#

this is from their package site

db.add('userInfo.balance', 500)```
#

any ideas?

finite bough
#

yea ok about that

#

but

#

does putting an actual integer there works for u?

agile orchid
#

just try to add 500 instead of a custom number

earnest phoenix
#

will try

agile orchid
#

like instead of args[1] put 500 in there

#

and if it works then args is the problem

earnest phoenix
#

still a azero

#

a zero

finite bough
#

wdym

#

zero

earnest phoenix
#

im using the thing itself wrong then

#

when i do !coins

#

i have zero

#

even tho i just added

#

so im or doing the coins.add wrong or taking info wrong

finite bough
#

have u created a table with ur I'd and stuff? more than 2 times?

#

coz

#

quickdb uses sqlite

earnest phoenix
#

i didnt there is 1 table

finite bough
#

and if u dont sets. primary key it's no surprise-

#

ah ok

earnest phoenix
#

so im probably adding the coins wrong

#

ANYONE PLEASE

#

db

finite bough
#

can u see the table?

earnest phoenix
#

no

#

its not a thing i can see

#

atleast like that

finite bough
#

ye

#

try db.all()

earnest phoenix
#

i just wanna make this work

#

D:

agile orchid
#

@earnest phoenix did the add 500 work?

#

without args

earnest phoenix
#

no

finite bough
#

no one uses quickdb here

earnest phoenix
#

it didnt

#

still 0

agile orchid
#

i do use it

earnest phoenix
#

so its or im adding it wrong or im getting the info wrong

finite bough
#

ok u help then

agile orchid
#

i am trying to

earnest phoenix
#

i think i just didnt do the coins.add right

agile orchid
#

yes

earnest phoenix
#

how do i fix it

#

then

low bolt
#

Yeah, bot is responding 1 hour later

#

Opened @ 23:36
Respond Time 00:36

earnest phoenix
#

wth

finite bough
#

.,.

agile orchid
#

itay

low bolt
#

How can I contact to Discord or smh? About this problem

earnest phoenix
#

ha

finite bough
#

u just broke the record of highest ping in the entire history

agile orchid
#

how do you define args again

earnest phoenix
#

lemme get it

finite bough
#

discord is dying

agile orchid
#

wanna compare it to mine

earnest phoenix
#
const args = message.content.slice(prefix.length).trim().split(/ +/g);```
#

lmao discord is actually shi* this time

agile orchid
#

same as mine

earnest phoenix
#

it wont load sometimes

#

so

#

how do u think i should fix

agile orchid
#

go into package.json

#

and tell me the version of quick.db

low bolt
#

@twilit rapids how can I fix this error? Can you try to help?

My bot's commands is loading 1 hour later, why?
I opened my bot @ 23:36
Commands respond to my message @ 00:36

earnest phoenix
#

6.3.2

agile orchid
#

change it to "7.0.0-b22"

earnest phoenix
#

all of that?

crimson vapor
#

yes

agile orchid
#

yes

#

it's the latest version

low bolt
#

sry for pinging

earnest phoenix
#

ok now what

low bolt
#

but wth is this

#

always like that

agile orchid
#

reinstall packages

twilit rapids
#

@low bolt can you not ping a moderator for that? Just ask your question, provide the information they need to help you solve it and people will

earnest phoenix
#

wdymmmm

low bolt
#

I know so sry.

agile orchid
#

npm install

earnest phoenix
#

quickdb?

#

ok

agile orchid
#

no

earnest phoenix
#

?

agile orchid
#

just npm install

earnest phoenix
#

oh it will reinstall ?

#

the quick

#

kinda

agile orchid
#

yes

earnest phoenix
#

doing it rn

agile orchid
#

then start the bot

#

and try again

earnest phoenix
#

ok

agile orchid
#

i have used the latest version

#

you used an older one

earnest phoenix
#

Error: .add() data is not a number.

agile orchid
#

still?

earnest phoenix
#

it wont even respond with a 0 coins btw

#

it just wont respond

agile orchid
#

hm weird

earnest phoenix
#

if that helpes somehow

#

how did u use your quick.db money ?

#

u told me somthing about it

#

@agile orchid ?

#

D:

agile orchid
#
else if(cmd === "balance" || cmd === "bal" || cmd === "money") {
        let user = message.author;
        let subcmd = args[0];
        let money = await db.fetch(`money_${user.id}`)
        if(!subcmd) {
            if(money === null) {
                db.set(`money_${user.id}`, 0)
                money = 0;
            }
            message.channel.send(`${user} has got **${money}$**`)
        }
        else if(subcmd === "add") {
            let author = message.author;
            if(author.id == ownerid || author.id == config.bot.ownerid2) {
                var userid = args[1];
                var addmoney = args[2];
                if(addmoney < 0) {
                    return message.reply('please provide a number bigger than 0')
                }
                else if(isNaN(addmoney)) {
                    message.reply('please provide a valid number')
                } else {
                    db.add(`money_${userid}`, addmoney)
                    message.reply(`added **${addmoney}$** to UserID **${userid}**`)
                }
            } else {
                return;
            }
        }
    }```
#

that's how mine works

#

and it has no errors or stuff

earnest phoenix
#

ok so

agile orchid
#

works perfectly fine

#

try using this

earnest phoenix
#

i dont wanna use yours

#

help me fix mine

agile orchid
#

i mean like don't use it like that

#

try to compare

#

and maybe find some problem

#

because i can't really see a problem in your code

earnest phoenix
#
 db.add(`coins_${message.guild.id}_${pUser.id}`, args[1])```
#

trying this

#

same thing

#

ERROR

agile orchid
#

how do you define pUser

earnest phoenix
#

message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]);

agile orchid
#

hmm

earnest phoenix
#

IDK

digital ibex
#

wtf

earnest phoenix
#

wa

digital ibex
#

thats meant to be a user resolver?

earnest phoenix
#

to get a user

crimson vapor
#

yes

agile orchid
#

message.mentions.users.first() || message.guild.members.get(args[0]);

digital ibex
agile orchid
#

try that

finite bough
#

wait

agile orchid
#

you don't need message.guild.member infront of the mention

finite bough
#

"get"

agile orchid
#

a mention is a guild member

#

oh yes

earnest phoenix
#

Didn't work

agile orchid
#

it would be message.guild.members.cache.get

earnest phoenix
#

?

#

cache?

agile orchid
#

yes

earnest phoenix
#

wa

#

why

finite bough
#

@earnest phoenix ur discord js version

crimson vapor
#

are you on 11 or 12?

agile orchid
#

which discord.js version do you use

earnest phoenix
#

11.6.3

agile orchid
#

oh god

finite bough
#

then ignore him

crimson vapor
#

no cache

topaz fjord
#

quick.db

#

no wonder why the code isn't working

earnest phoenix
#

what

topaz fjord
#

quick.db is literal shit

earnest phoenix
#

lmao

finite bough
#

^

crimson vapor
#

LOL

topaz fjord
#

I would rather stab my eyes than use it

earnest phoenix
#

HAHAHA

agile orchid
#

give a reason for it being trash

topaz fjord
#

it's literally just a wrapper around sqlite

agile orchid
#

i use it without any problems

#

yea

earnest phoenix
#

LMFAO fr wtf

topaz fjord
#

There's no point

#

just use sqlite

earnest phoenix
#

he just went

finite bough
#

turtle uses json db

earnest phoenix
#

0 - 100% in a sec

topaz fjord
#

I use mongodb

crimson vapor
#

mongodb ftw

earnest phoenix
#

mango

finite bough
#

lies

earnest phoenix
#

UM BACK TO ME

#

WHAT DO I DO

agile orchid
#

well i'll get going now

topaz fjord
#

technically I use no db since my bot doesn't even work

earnest phoenix
#

NO

finite bough
#

@earnest phoenix go mongodb

agile orchid
#

and keep the caps use low

earnest phoenix
#

D:D:D:D::D:D:

finite bough
#

ok now literally

earnest phoenix
#

wa

finite bough
#

I copy pasted ur code in my bot

#

it works

#

wtf

earnest phoenix
#

WHAT

finite bough
#

bruh

earnest phoenix
#

wdym

agile orchid
#

itay

earnest phoenix
#

WA

agile orchid
#

upgrade to discord 12

#

please

finite bough
#

tf

crimson vapor
#

itay cant

finite bough
#

tftftftftf

crimson vapor
#

they would have to change so much

earnest phoenix
#

12.0 ?

finite bough
#

wtf

agile orchid
#

yes

finite bough
#

bro

digital ibex
#

bruh

earnest phoenix
#

did it

agile orchid
#

i had to do that aswell

digital ibex
#

wtf is going on

earnest phoenix
#

installing now

agile orchid
#

but i got used to it

earnest phoenix
#

npm install

digital ibex
#

K

finite bough
#

quick.db is even less reliable in 12v

earnest phoenix
#

now do i do npm install ?

#

@agile orchid

#

do i do npm install ?

agile orchid
#

what

crimson vapor
#

yes

earnest phoenix
#

will it change my code somehow

agile orchid
#

npm install discord.js

earnest phoenix
#

or do anything

crimson vapor
#

no

digital ibex
#

when you really want a star...

agile orchid
#

no

crimson vapor
#

I only have 2 stars

digital ibex
#

no

finite bough
#

I got like 20

digital ibex
#

@earnest phoenix dude

earnest phoenix
#

installing

agile orchid
#

this is getting out of topic

topaz fjord
#

lmao @earnest phoenix

agile orchid
earnest phoenix
#

cannot find moudle quick db

digital ibex
#

install it sir

earnest phoenix
#

do i reinstall it

#

?

#

@agile orchid

digital ibex
#

well

#

yes

agile orchid
#

can u like

finite bough
#

quickdb

agile orchid
#

not ping me all the time

earnest phoenix
#

SRY

agile orchid
#

it's getting annoying over time

earnest phoenix
#

D:

#

do i reinstall it then

#

npm install quick.db

zenith terrace
#

oof

agile orchid
#

if it says quick.db not found

#

then install it

earnest phoenix
#

yes

digital ibex
#

big brain thinking

#

🧠

agile orchid
#

this guy is so smart damn

finite bough
#

no one is perfect

#

so stop with the insults

digital ibex
#

it doens't take someone near perfect to know what to do with that error

#

lul

#

like

finite bough
agile orchid
#

i didn't insult anyone lmao

digital ibex
#

npm install thing

earnest phoenix
#

Error: Cannot find module '../build/better_sqlite3.node'

agile orchid
#

if it says module not found then u obviously have to install it

#

what

#

is that

earnest phoenix
#

idk

crimson vapor
#

what line?

digital ibex
#

dat error doesn't mean install it?

earnest phoenix
#

i installed quick again and boom

#

is that even a moudle??

digital ibex
#

sigh

#

yes

#

it is

earnest phoenix
#

/rbd/pnpm-volume/416fed7e-523f-432b-b564-8e522bc050ea/node_modules/discord.js/src/client/Client.js:41
} catch {

#

UM

topaz fjord
#

this channel is a literal meme at this point

digital ibex
#

}catch (e) {

agile orchid
#

^

crimson vapor
#

are you using commando or regular?

earnest phoenix
#

bruh moment

digital ibex
#

o

earnest phoenix
#

regular

digital ibex
#

thats a big yikes

#

use loc like

#

free host and they're amazing

agile orchid
#

loc?

digital ibex
#

mhm

agile orchid
#

what is that

digital ibex
#

library of code

earnest phoenix
#

what was my version of discord

#

before

agile orchid
#

11.6.4

topaz fjord
#

the fuck is library of code

finite bough
#

^

agile orchid
#

^

topaz fjord
#

The only loc I know is lines of code

crimson vapor
#

^

digital ibex
#

its not that big doe

topaz fjord
#

do you mean package repository

digital ibex
#

no

#

no

finite bough
#

no

digital ibex
#

they're not too big

#

but they;re amazing

finite bough
#

that happens when

earnest phoenix
#

im reinstalling the discord and quick back

finite bough
#

u use old node version

earnest phoenix
#

i will check it tommorow

digital ibex
#

filled with big 🧠 people

agile orchid
#

i believe v12+ might have issues with glitch
didn't experience any yet

#

i am using glitch for 1 year

finite bough
#

old nodr

agile orchid
#

and everything works fine

digital ibex
finite bough
#

@agile orchid 3 for me

#

:)