#development

1 messages · Page 1648 of 1

feral aspen
#

F

lyric mountain
#

don't u use git?

pale vessel
#

Just remove your package-lock.json and node-modules folder and run npm i

#

and don't modify package.json like that ever again

feral aspen
#

Soz.

pale vessel
#

Yeah

feral aspen
#

Ok.

#

👀

lyric mountain
#

and use git

#

or svn, mercurial, whatever

#

version it

feral aspen
#

I don't.

lyric mountain
#

then do

#

you're walking in a VERY narrow path

#

a single error and poof, bot's gone

fierce ether
#
message.channel.messages.fetch({ limit: number }).then(messages => { 
            const userMessages = messages.filter(m => m.author.id === member.id)``` is there a way of fetching only the usersmessages?
cinder patio
#

no afaik

fierce ether
#

well if number is 3 why is userMessages returning 1?

vivid fulcrum
#

because you filtered those 3 messages

#

and got a single one that matches your filter condition

fierce ether
#

how can i find 3 messages just from user?

vivid fulcrum
#

keep fetching until your total filtered collection/array gets the desired count

#

basic loops

#

you can also straight up fetch 100 messages to lay off the requests

#

the endpoint allows 100 messages per request

feral aspen
#

Nevermind

#

False alarm! 🤦‍♂️

pale vessel
#

that was a very fast never mind

feral aspen
#

😂

vivid fulcrum
#

no

sudden geyser
#

Just wondering, but do you have a github

unreal estuary
#

no

lyric mountain
#

professional, eh?
so it includes: source code, documentation, unit tests, license, training and 24/7 support?

#

suddenly it doesn't feels so professional eh?

vivid fulcrum
#

minimum wage = minimum effort

lyric mountain
#

no KEKW

vivid fulcrum
#

if you want quality, go to a qualified person

lyric mountain
#

just kidding

unreal estuary
#

oop

zenith terrace
#

hey cry how are ya

vivid fulcrum
#

and they got beaned

#

hiiiii

#

i'm exhausted lol, school is killing me

#

wbu

lyric mountain
#

imagine saying you'll make professional stuff

zenith terrace
#

feeling ded and bored

lyric mountain
#

then delivering a templated code without any doc KEKW

stark abyss
old cliff
gray cargo
#

hi, im trying to make a bot list and im using the oauth 2 code from the discord.js docs. However, it doesn't work and always goes to the else statement

crimson vapor
#

those are not the djs docs, https://discord.js.org

gray cargo
#

then its the "guide"

crimson vapor
#

yep

gray cargo
#

im not actually using djs i was just using the guide for oauth2

#

but the code doesnt work

old cliff
lethal ice
#

How can I create a readable stream from an image that is not on the hard drive?

vivid fulcrum
#

in which language

lethal ice
#

Js

vivid fulcrum
#

i'm guessing you want to get it from a url

#

you can use node-fetch

lethal ice
vivid fulcrum
#

right

#

what's the package you're using

lethal ice
#

discord-image-generation

#

I read that there was a way to do that, from buffer to stream but I dont find it

vivid fulcrum
#

why do i feel like that's some garbage package

#

anyway

#

give me a sec to look over

lethal ice
#

It does it job

#

Aight

vivid fulcrum
#

that package... already returns the buffer?

lethal ice
#

Yeah, the problem is this:

#

Im using axios to do the request, and the two params im using are the url itself and the readstream. It works great with local files, but when I try to fs.createReadStream(file) it throws the following error

vivid fulcrum
#

...well yes

#

it returns the buffer

#

nvm

lethal ice
#

When the file is the output, which logged is a buffer

cinder patio
#

a readable stream is just an interface which makes it efficient to deal with a large amount of data

#

did you try just sending the buffer

lethal ice
#

one sec

vivid fulcrum
#

also i suggest using node-fetch over axios

lethal ice
lethal ice
#

I looked that up and thats smth related to the buffer

cinder patio
#

kinda weird that axios doesn't allow you to send a buffer

lethal ice
#

Yeah, thanks for the help I'll try that

#

New problem

earnest phoenix
#

dm help me

umbral zealot
#

Why, so you can suck the help out of someone in private without being seen as a help vampire? lol.

exotic galleon
#

what is the error on my discord bot please help me

crimson vapor
#

install quick.db

exotic galleon
exotic galleon
umbral zealot
#

well it's clear the quick.db install didn't work then

crimson vapor
#

idk man ive never used quick.db

umbral zealot
#

What error do you get when installing quick.db?

exotic galleon
umbral zealot
#

Oh hold up. This is glitch. Glitch is not appropriate for bot installations. DO NOT USE GLITCH (especially not with a bot that has a database in sqlite!!!)

umbral zealot
# exotic galleon

Oh hold up. This is glitch. Glitch is not appropriate for bot installations. DO NOT USE GLITCH (especially not with a bot that has a database in sqlite!!!)

zenith terrace
#

glitch with quick.db is asking for your bot to die quickly out of memory

umbral zealot
#

glitch with quick.db is asking for your bot to die from a half dozen reasons, or your bot's data to be stolen by anyone, or both.

umbral zealot
#

Glitch is not appropriate, and it's basically against the terms of service to use a bot on it (it's definitely against the terms of service to keep it alive)

zenith terrace
#

I only know of its tos for using pinging services for bots

umbral zealot
#

yes which is what most people use to keep their bots online.

exotic galleon
#

Will you help me with my problem ?

umbral zealot
#

We cannot.

crimson vapor
#

I don't really understand the need to abuse systems

crimson vapor
#

a cheap vps is like 1 usd, or even google cloud or aws which is free for a year

zenith terrace
exotic galleon
crimson vapor
#

are you using glitch?

umbral zealot
#

You are if you're hosting a bot.

exotic galleon
umbral zealot
zenith terrace
#

yea

umbral zealot
# exotic galleon yes

Then yes you are basically abusing if you want to develop a bot there. Do not use glitch to host bots. You can use repl.it, and there it has a database system you can use, but you should not be using quick.db on there either.

exotic galleon
umbral zealot
#

Neither glitch nor repl.it are appropriate locations to host any application that uses sqlite storage

zenith terrace
#

yea quick.db takes up memory quickly, either use repls database or use mongo

umbral zealot
umbral zealot
#

or just marginally so

umbral zealot
exotic galleon
umbral zealot
#

I've mentioned it 3 times at this point

#

it should be pretty clear to you

#

If you bothered listening.

zenith terrace
#

lol

earnest phoenix
#

Hmmm

sterile lantern
#

it has no database unless you add a credit card

#

add a credit card (it wont charge you) and you also get access to mongo DB

viscid gale
#

oh hi guys.. if anyone remembers over the weekend I was trying to make a way to send script to client without user being able to see that script?
no it's not impossible
it was working since sunday and I just smoothed it out.. made my release.. since sending the repo would be advertising i'd send the example link
there are some limitations(even though it works)

  1. it doesn't work on some browsers apparently(i also heard that it definitely works on edge)
  2. you need to allow popup
    https://hidejs-example.paultaylor2.repl.co/
sterile lantern
#

idk what u mean but i dont see anything

#

cuz usually scripts show there

viscid gale
# tired panther use server sight/side?

well hosting is always from a server.. but what this does specifically(when u click the link) u should see an alert(the script to load that alert is hidden from the user to find it)

sterile lantern
#

found it

viscid gale
#

i remember the whole "that's impossible" talk and that's y i simply placed the link

sterile lantern
#

tbh

viscid gale
#

mb i realise that wasnt pointed towards me

sterile lantern
#
    else{toRun=false;while(true){let i="Required modules that MUST be in their DEFAULT form are compromised";try{alert(i)}catch(err){}}}
  }//basically, the window would halt all further processes(through infinite loop) if error occurs during this load process
  catch(err){toRun=false;while(true){
    let i="Unexpected Error.. Either you didn't allow popups, the dev had a non existing value for requiredModules, OR, required modules were compromised";
    try{alert(i)}catch(err){}}
  }
  })()```
sterile lantern
#

oh

dark totem
#

how to make multi activity for the bot

sterile lantern
#

have an array of statuses

#

and change it every minute or however you wish

#

idk the ratelimits

#

so i recommend a min

viscid gale
# sterile lantern oh

ok lemme tell you what the hidden code in that example is so that you can find it(if u can tehehhehe ;])

sterile lantern
#

yes

#

gimme a sec

dark totem
#

if i did it my bot ll get declined?

sterile lantern
#

wym

viscid gale
#

try{alert('HIDDEN SCRIPT >:D\nAt...\n/')}catch(err){}

sterile lantern
#
   const activities_list = [ 
    "f",
    `d`, 
    "c",
    "b",
    "aa",
    ];
 const type_list = [
   "WATCHING",
   "WATCHING",
   "WATCHING",
   "WATCHING",
   "WATCHING"
];
    setInterval(() => {
      const index = Math.floor(Math.random() * (activities_list.length - 1) + 1); 
      client.user.setActivity(activities_list[index], {type: type_list[index]}); 
  }, 40000);

})```
#

it updates every 40 seconds

#

40000 is the ms

#

= 40 seconds

#

i do not think that has an affect in verification, no

earnest phoenix
sterile lantern
#

yeah it was an example

earnest phoenix
#

oh wait it was an example

tired panther
#

its a bad practice to execute automatic; functions/ events on a certain time. The ratelimt is 15s so, make it to 1m

sterile lantern
#

1 minute

#

yeah

#

do 60000

#

for the status thing

viscid gale
#

pls say yes xDD

sterile lantern
#

i mean i could already access it

tired panther
sterile lantern
#

if it isnt prviate

dark totem
#

thanks a lot guys

#

thanks bro @sterile lantern

tired panther
sterile lantern
viscid gale
sterile lantern
#

i already found it

#

:)

viscid gale
#

it wasnt that.. the github repo.. the hidejs example is an example of something i call HideJS

sterile lantern
#

oh

#

sure

viscid gale
#

hm.. i should change the repl one to the newest version

#

anyway.. this was a fun week

earnest phoenix
#

lol

misty sigil
#

holy

boreal iron
#

Use code tags... god damn

viscid gale
#

suggested edit to just put ``` before and after that code

dark totem
#

sorry

viscid gale
#

no worries..

#

just dont do that again now that u know

quaint wasp
#

uh

#

how do I make a link in words?

#

I tryed but it didnt work..

viscid gale
#

nope.. epic fail

summer torrent
#

and webhooks

quaint wasp
#

oh

unreal estuary
#

whats the problem

dark totem
#

it must say pruning is off or on

#

it exports message pruning {result}

#

naaa please xDD

tulip ledge
#

Can anyone please tell me wtf this error means

0|Bot      | 21: 0x1021517 v8::internal::DescriptorArray::CopyUpTo(v8::internal::Isolate*, v8::internal::Handle<v8::internal::DescriptorArray>, int, int) [node /root/MM/index.js]
0|Bot      | 22: 0x100cf14 v8::internal::Map::EnsureDescriptorSlack(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Map>, int) [node /root/MM/index.js]
0|Bot      | 23: 0x100fceb v8::internal::Map::ShareDescriptor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::DescriptorArray>, v8::internal::Descriptor*) [node /root/MM/index.js]
0|Bot      | 24: 0x10101f9 v8::internal::Map::CopyAddDescriptor(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Map>, v8::internal::Descriptor*, v8::internal::TransitionFlag) [node /root/MM/index.js]
0|Bot      | 25: 0x10102d8 v8::internal::Map::CopyWithField(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::FieldType>, v8::internal::PropertyAttributes, v8::internal::PropertyConstness, v8::internal::Representation, v8::internal::TransitionFlag) [node /root/MM/index.js]
0|Bot      | 26: 0x101228b v8::internal::Map::TransitionToDataProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::PropertyConstness, v8::internal::StoreOrigin) [node /root/MM/index.js]
0|Bot      | 27: 0x1002a37 v8::internal::LookupIterator::PrepareTransitionToDataProperty(v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::StoreOrigin) [node /root/MM/index.js]
misty sigil
#

looks weird

dark totem
#

Agree

tulip ledge
#

here's the full thing if u need it

misty sigil
#

Looks like some node weirdness

tulip ledge
#

I agree

pale vessel
#

that doesn't look too full

misty sigil
#

I don’t think you should see that

pale vessel
#

try --lines 25 or something

tulip ledge
lament rock
#

Looks light it might be an error from a native dep or Node just got quirky

misty sigil
#

you’ve used too much heap bro

tulip ledge
#

heap?

misty sigil
#

JavaScript heap out of memory innit

tulip ledge
#

what is heap

#

is it memory?

#

processing power?

misty sigil
#

memory

tulip ledge
#

But the bot only uses 100mb/1gb

misty sigil
#
0|Bot      |
0|Bot      | [11248:0x4aaea80] 133228079 ms: Mark-sweep 485.5 (502.6) -> 481.7 (501.9) MB, 621.7 / 0.1 ms  (average mu = 0.819, current mu = 0.757) allocation failure scavenge might not succeed
0|Bot      | [11248:0x4aaea80] 133229128 ms: Mark-sweep 485.0 (502.7) -> 483.3 (502.7) MB, 631.1 / 0.0 ms  (average mu = 0.700, current mu = 0.398) allocation failure scavenge might not succeed```
#

this says otherwise

zenith knoll
#

is it ok if my question is not discord bot based but general python based?

misty sigil
#

yes

pale vessel
#

yes, read the channel topic, they clarified it

#

it used to have "(bot)" which confused people

zenith knoll
#

So im making a simple typing race game in python and im packaging it/compiling it using pyinstaller. It wont run and when i click it it opens a window which says traceback waning and instantly closes

#

I believe its missing packages/cannot find the required dependincies

#

but i did move the .lock and .toml files into the same directory

#

I did the coding in repl and packaging on my pc

sour flame
#

for?

dark totem
sour flame
#

My Giveawaybot.

umbral zealot
#

Awesome bot. Best giveaway bot thumbs_up

sour flame
#

thx

#

lol

dark totem
#

i thought you got solve for my problem 🥲

crimson vapor
halcyon kite
#

Hi so um I am currently trying to make a stock market thing to where you can view the stock of a company (fake companies) and I dont know how to randomise + and - so im confused at that part

misty sigil
halcyon kite
#

my code so far: ```js
let stock = args[0]
if (isNaN(args[0])) return message.channel.send("Please put a number that works!")
if(stock === "1") {
let price1 = Math.floor(Math.random() * 5)

    let total = 1000000 +- price1 
    let embed = new Discoed.MessageEmbed()
    .setTitle('test1 Stock Value:')
    .setDescription(`Current Value ${total} per unit \n increase/decrease: ${price1}`)
    message.channel.send(embed)
sour flame
halcyon kite
#

i did the +- thing to show where it should randomize

#

lel

vestal stirrup
#

can someone help me solve this error?

the code:

let text = args.join(" ");
        if(!text) {
        const embed = new Discord.MessageEmbed()
        .setTitle('Wrong form of use:')
        .addFields(
            {name: "The problem:", value: "teste", inline: false},
            {name: "Exemple:", value: "teste", inline: false},
        )
        .setColor();
        message.channel.send(embed)
        };

the problem:

#

I think I should use "catch (error)"

halcyon kite
#

but ill check

vestal stirrup
#

I also think

#

lol

halcyon kite
#

try args[0].join(" ");

vestal stirrup
#

I'll redo the code

vestal stirrup
halcyon kite
#

args.slice(0).join(" ")

#

try

vestal stirrup
#

ok

halcyon kite
#

also

#

are u typing it or not

halcyon kite
#

the last one i sent btw allows you to type with space 4 example = hi am bot

vestal stirrup
#

the error still continues

vestal stirrup
halcyon kite
#

.catch(err)

#

that should work

haughty mirage
sour flame
#

I changed up the top of my client.js from Collect, Client, Collection. To what you see now.

#

This is for my GiveawayBot

vestal stirrup
#

i only use const Discord = require('discord.js'); i think simpler

sour flame
#

How to get npx nodemon

vestal stirrup
#

npm install nodemon

sour flame
#

cause I got Node.js but it still not working

umbral zealot
#

nodemon isn't necessary to run a bot

sour flame
#

kk

umbral zealot
#

It's just a facilitator to automatically reboot the bot on change

sour flame
#

so your saying it isn't neccesaary

umbral zealot
#

It's not, no.

sour flame
#

kk

vestal stirrup
umbral zealot
#

I can't help you with that.

vestal stirrup
#

OK thank you for the attention

halcyon kite
#

oh

#

so like chose one of those numbers

haughty mirage
#

Idk what you are exactly trying to do... Maybe you so something like.
Generate random number max 10
Generate your other number
If first number is less than 5 *-1 to make it negative else just use the positive #

#

Less complicated than it looks lol

sour flame
#

@umbral zealot I got my npx nodemon to work

umbral zealot
#

Good for you, I guess?

sour flame
#

yep

#

Oh wait I mixed up ` with ' damn

quaint wasp
umbral zealot
#

DELETE_MESSAGES is not a valid permission.

quaint wasp
#

it isnt?

#

isnt there this prommision called deleteing messages?

umbral zealot
#

MANAGE_MESSAGES is the one.

sour flame
#

uhh do you need parralel.js in a Giveaway bot

#

???

umbral zealot
#

why would you need that...

sour flame
#

idk

unreal estuary
#

lmao

sour flame
#

because it came in asynckit

#

So I'm asking if it needed

umbral zealot
#

Why would you need asynckit

#

A giveaway bot is an extremely simple affair, it's a couple of commands and a database, it doesn't need all the fluff you seem to be researching

unreal estuary
unreal estuary
#

your making it more complicated than it needs to be

sour flame
#

WELL anytime I try to start the bot it says

umbral zealot
#

well clearly it's missing a module you didn't install or doesn't exist.

sour flame
#

heres the module

umbral zealot
#

what is that even

#

where's it coming from

sour flame
#

idk

umbral zealot
#

don't use parallel.js it's not useful for you.

#

you shouldn't be messing with things you have absolutely no understanding of and aren't useful.

sour flame
#

k now anyway to start the bot tho?

umbral zealot
#

remove your reference to parallel.js

sour flame
#

how tho?

umbral zealot
#

by removing that line that refers to it

#

whatever you added recently that caused this error, remove it

sour flame
#

that would be either ms or discord.js

umbral zealot
#

could you show us your current file structure and code

midnight blaze
#

anyone here who is experienced in powershell scripting?

umbral zealot
#

Best to just ask your question and maybe someone can answer it ^_^

sour flame
umbral zealot
#

what about your folder structure

#

how are you importing this

sour flame
#

This is structure with client.js

umbral zealot
#

whoa there hold up

sour flame
#

kk

umbral zealot
#

why is there no node_modules folder here, did you even install anything?

sour flame
#

Yep

#

I installed it

umbral zealot
#

clearly something went wrong in your installation

#

node_modules should be there

sour flame
umbral zealot
#

... ns....

sour flame
#

one sec

umbral zealot
midnight blaze
#

is there an easy way to access certain settings in inetcpl.cpl with powershell and change the settings?

sour flame
#

I used code . to change it to code

umbral zealot
#

that does nothing except open vscode

#

running the bot should be done with node . not code .

earnest phoenix
#

or npm start

sour flame
#

It is node

midnight blaze
#

so, noone here who worked with powershell scripting

earnest phoenix
#

or node file.js

sour flame
earnest phoenix
sour flame
midnight blaze
#

nodemon file.js or node file.js

#

just do it like that and you ll be fine

sour flame
#

whats the dowland of ms

#

npm ms?

#

npm 1 ms

umbral zealot
#

npm install ms

sour flame
#

npm i ms

midnight blaze
#

npm -g -i ms

#

(kidding)

umbral zealot
#

don't kid with this guy he's bound to not understand sarcasm

midnight blaze
#

true

sour flame
#

kk now tell meh what is this

umbral zealot
#

MarioFP I just figured something out

sour flame
#

what?

umbral zealot
#

Your files ARE NOT SAVED.

#

SAVE YOUR FILES

sour flame
#

No worries did that

umbral zealot
#

Ok so can you show us your current index.js file?

#

could you also just copy/paste the code isntead of screenshots, it's a lot easier to read

sour flame
#

const Client = require('./structures/Client');
new Client().start(require('./config.json').Token, ./commands);

umbral zealot
#

```js
your code here
```

#

Anyways I can't possibly see how this would give you that error, it doesn't make sense.

sour flame
#
const Client = require('./structures/Client');
new Client().start(require('./config.json').Token, `./commands`);
umbral zealot
#

that really wouldn't give that error, it doesn't make sense.

sour flame
#

I have other code tho

umbral zealot
#

in your index.js?

sour flame
#

nah

#

in config.json

#

and other places

umbral zealot
#

no shit, of course you do

#

but the error stack specifically says the problem is in index.js

sour flame
#
const { Collection, Client, MessageEmbed } = require('discord.js');
class GiveawayClient extends Client{
    constructor() {
        super();
        this.giveaways = new Collection();
        this.commands = new Collection();
        this.ms = require('ms');
        this.fs = require ('fs');
        this.path = require('path')
        this.discord =require('discord.js');
    }
    commandHandler(path) {
        this.fs.readdirSync(this.path.join(__dirname, `..`, path)).map((f)=> {
            let File= require(this.path.join(__dirname, `..`, path, f));
            this.commands.set(File.nam, File)       
        })
    };
    start(token, path) {
        this.commandHandler(path);
        this.login(token);
        this.on('ready', () => {
            console.log(`${this.user.usrname} is now online!`);
        });
        this.on('message', async(message) => {
            if (message.author.bot || !message.guild || !message.contect.toLowerCase().startsWith(`g!`)) return;
            const args = message.contect.slice(`g!`.lenght).trim().split(/ +/g);
            const cmd = args.shift().toLowerCase();
            if(this.commands.has(cmd)) this.commands.get(cmd).run(this, message, args).catch(console.error);
        });
    }
    embed(data, message) {
        return new MessageEmbed(data).setFooter(message.author.tag, message.author.displayAvatarURL({ dnyamic = true }))
    }
}
module.exports
umbral zealot
#

I don't understand specifically why it doesn't point to that file

#

but...

#
message.author.displayAvatarURL({ dnyamic = true }))

This is exactly what produces this error

#

objects don't use =

sour flame
#

I'm running the code again

#
(node:5060) UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided.
    at GiveawayClient.login (C:\Users\ravi_\Desktop\Discord Bots\GiveawayBot\node_modules\discord.js\src\client\Client.js:206:52)
    at GiveawayClient.start (C:\Users\ravi_\Desktop\Discord Bots\GiveawayBot\structures\Client.js:20:14)
    at Object.<anonymous> (C:\Users\ravi_\Desktop\Discord Bots\GiveawayBot\index.js:2:14)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47
(node:5060) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, 
use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:5060) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

umbral zealot
#

your discord bot token was incorrect

#

Make sure it's correctly written in your config.json as "Token": "the token here",

#

Remember javascript is case sensitive. Very important.

sour flame
#

kk

#

It was token

#
undefined is now online!
#

Send meh the place to invite my bot

#

@umbral zealot

solemn latch
sour flame
#

no

#

uhh

umbral zealot
#

"places to invite my bot"? I don't understand

sour flame
#

Uhh

#

Ye

lyric mountain
#

The invite u mean

sour flame
#

Yes

umbral zealot
#

this should guide you through it

#

hmph. Ignore the screenshots though, the images are wrong. One more thing to go worry about. Gitbook is really failing me there.

#

Great. don't link it here, that's advertisement.

sour flame
#

got it

sterile lantern
#

forsome reason i keep loosing coins

sour flame
#

Its online but does nothing

sterile lantern
#

vs this 2 hours later

#

i use quick.db

#

idk why it randomly changes my balance

#

ykw

#

ill just change to mongo

#

mongo is 100% better

sour flame
#
const Client = require('../structures/Client');
const { Message } = require('discord.js');
module.exports = {
    name: `ping`,
    /** * 
     * @param {Client} client 
     * @param {Message} message
     * @param {String[]} args
    */
    run: async(client, message, args) => {
        const msg = await message.channel.send(`Pinging...`);
        await msg.edit(client.embed({
            title: `Pong`,
            description: `Websocket ping is ${client.ws.ping}MS\nMessage edit ping is ${msg.createdAt}MS!`

      }))
    }
}
sterile lantern
#

where do you login to your pot?

sour flame
#

I tried doing a ping cmd but it isn't working

sterile lantern
#

where does it look that this is a msg?

#

youre not properly looking if the cmd is run

slim heart
#

is there a way to make MAP a certain type?

sour flame
sterile lantern
#

ah wait

#

nevermind

#

i thought this was your index

#

other tha that idk

#

than*

sour flame
#
class Giveaway {
    constructor(client, options) {
        client.giveaways.set(options.id, options);       
    }
}
#

My Giveaway.js

sterile lantern
#

what do i do for this step with mongo

sour flame
#

or add a Differnt IP if idk your on vacation doing this

sterile lantern
#

why would i use my own ip

#

should i

#

idk

sour flame
#

You should

#

or just Allow Access from Anywhere if you keep moving

#

@sterile lantern

sterile lantern
#

what does allow access from anywhere mean doe

#

oh

#

wait

#

this is for access

#

i thought it was for connection

#

nvm

sour flame
#

lol

#
 this.mongoose.connect(``)
#

Use this if you click Attach to Application @sterile lantern

#

Change up stuff for name and password

sterile lantern
#

yeah i got the rest

#

thanks though

sour flame
#

np

sour flame
#
let Discord;
let Database;
if (typeof window !== "undefined") {
    Discord = DiscordJS;
    Database = EasyDatabase;
} else {
    Discord = require("discord.js");
    Database = require("easy-json-database");
}
const delay = (ms) => new Promise((resolve) => setTimeout(() => resolve(), ms));
const s4d = {
    Discord,
    client: null,
    tokenInvalid: false,
    reply: null,
    joiningMember: null,
    database: new Database("./db.json"),
    checkMessageExists() {
        if (!s4d.client) throw new Error('You cannot perform message operations without a Discord.js client')
        if (!s4d.client.readyTimestamp) throw new Error('You cannot perform message operations while the bot is not connected to the Discord API')
    }
};
s4d.client = new s4d.Discord.Client({
    fetchAllMembers: true
});
s4d.client.on('raw', async (packet) => {
    if (['MESSAGE_REACTION_ADD', 'MESSAGE_REACTION_REMOVE'].includes(packet.t)) {
        const guild = s4d.client.guilds.cache.get(packet.d.guild_id);
        if (!guild) return;
        const member = guild.members.cache.get(packet.d.user_id) || guild.members.fetch(d.user_id).catch(() => {});
        if (!member) return;
        const channel = s4d.client.channels.cache.get(packet.d.channel_id);
        if (!channel) return;
        const message = channel.messages.cache.get(packet.d.message_id) || await channel.messages.fetch(packet.d.message_id).catch(() => {});
        if (!message) return;
        s4d.client.emit(packet.t, guild, channel, message, member, packet.d.emoji.name);
    }
});
s4d.client.login('The token').catch((e) => {
    s4d.tokenInvalid = true;
    s4d.tokenError = e;
});

s4d.client.on('ready', async () => {
    s4d.client.user.setActivity(String((s4d.client.guilds.cache.size)));

});

s4d;
#

Where should I put this code?

graceful shore
#

hey can someone help me?
im getting a string from

var fs = require('fs');

var data = fs.readFileSync('banned.txt', 'utf8', function(err, banlog) {
    if (err) throw err;
});

but it wont work with

if(message.author.id === data)
#

yes it does log and it is there

#

i just dont know why it work work

umbral zealot
#

did you try to console.log(data) and see what you get?

#

I'm guessing it's not just one ID

graceful shore
#

@umbral zealot

umbral zealot
#

So it's not one ID then

graceful shore
#

ye

#

but same thing happens with 1 id

umbral zealot
#

It sounds like you're trying to use a txt file as a database. Don't. Get a real database instead.

graceful shore
umbral zealot
#

Doesn't matter, it probably has a space before or after, or a line return, or something.

#

It's pointless to help you fix something that's extremely bad to do as a programmer

#

don't store data you're changing inside a txt file. TXT and JSON are not proper databases, they're not to be used in this manner.

boreal iron
umbral zealot
#

while that might work for a single ID, I'm guessing that's not the point so I don't see how it's useful to mention it 😕

boreal iron
umbral zealot
#

It means you do not have access rights to the git repository you're trying to pull from.

umbral zealot
# boreal iron Yeah I know. At the end of the day these tips are always good and right but I be...

As we've had discussions in the past I know you're a very experienced developer and as such, you should know what's bad practice and know better than to even hint at how to execute bad practice. Using txt/json is harder than using simple key/value databases, and it's a horrible thing to do, so as experienced developers it's up to us to coax people in the right direction, not load the shotgun by which they will shoot themselves in the foot.

#

The whole "I know you're not supposed to be shooting people but here let me show you how to load this gun, but you really shouldn't shoot it, but let me show you how to aim it, but please don't shoot anyone, and here's the trigger but, again, don't shoot anyone!" spiel is so... annoying.

#

maybe you are actually logged in but literally don't have rights to that repository?

#

That error seems to say otherwise

shy gust
umbral zealot
#

I only get this when I forget to start my pageant with my SSH keys but of course that error happens in many different situations where you're not authorized properly

umbral zealot
#

But nedb is dead simple for simple key/value storage.

shy gust
#

dam nedb is basically sql for dummies i like this

umbral zealot
#

it's not sql, that's the reason it's so easy 😄

boreal iron
#

Yeah I fully agree with that but it won’t change the fact that people will probably ask over and over again about the same issue ignoring any tips just to solve their issue.
Even if I don’t support this kind of bad practice, too I’m unable to change the people and their decisions or force them to do things as they should be done.
But don’t get me wrong.
It’s sometimes easier to ignore the ignorance of somebody to learn something new.

unreal estuary
shy gust
#

Everyone is on different levels its how the world works.

unreal estuary
#

whats the best sql database package and non sql ?

umbral zealot
umbral zealot
unreal estuary
#

for sql databases

umbral zealot
#

There isn't really any specific one that's best for beginners, not in "real" databases.

#

You can use enmap or quick.db if you want something that's easy for beginners, though.

unreal estuary
#

yeah ive used quick.db

boreal iron
umbral zealot
#

Awesome, so we can agree to not ever help someone try to use txt or json as a database, then? Not even a little? 😛

boreal iron
umbral zealot
#

Because we know better 🙂

boreal iron
#

Due the fact I’m driving I couldn’t reply with such an amount of text like you anyways. But since you throwed that topic on me I must reply.

unreal estuary
#

i think im gonna check this out

#

tomorrow

#

cuz its nearly 1 am

boreal iron
umbral zealot
#

Sure but we're not dealing with babies and their 5/10/15minute tricks. We're dealing with teenagers that should know the meaning of "no" and require our guidance as adults.

boreal iron
#

I’ve actually no clue what that means

unreal estuary
#

like something to cover their mouths

sour flame
#
let Discord;
let Database;
if (typeof window !== "undefined") {
    Discord = DiscordJS;
    Database = EasyDatabase;
} else {
    Discord = require("discord.js");
    Database = require("easy-json-database");
}
const delay = (ms) => new Promise((resolve) => setTimeout(() => resolve(), ms));
const s4d = {
    Discord,
    client: null,
    tokenInvalid: false,
    reply: null,
    joiningMember: null,
    database: new Database("./db.json"),
    checkMessageExists() {
        if (!s4d.client) throw new Error('You cannot perform message operations without a Discord.js client')
        if (!s4d.client.readyTimestamp) throw new Error('You cannot perform message operations while the bot is not connected to the Discord API')
    }
};
s4d.client = new s4d.Discord.Client({
    fetchAllMembers: true
});
s4d.client.on('raw', async (packet) => {
    if (['MESSAGE_REACTION_ADD', 'MESSAGE_REACTION_REMOVE'].includes(packet.t)) {
        const guild = s4d.client.guilds.cache.get(packet.d.guild_id);
        if (!guild) return;
        const member = guild.members.cache.get(packet.d.user_id) || guild.members.fetch(d.user_id).catch(() => {});
        if (!member) return;
        const channel = s4d.client.channels.cache.get(packet.d.channel_id);
        if (!channel) return;
        const message = channel.messages.cache.get(packet.d.message_id) || await channel.messages.fetch(packet.d.message_id).catch(() => {});
        if (!message) return;
        s4d.client.emit(packet.t, guild, channel, message, member, packet.d.emoji.name);
    }
});
s4d.client.login('The token').catch((e) => {
    s4d.tokenInvalid = true;
    s4d.tokenError = e;
});

s4d.client.on('ready', async () => {
    s4d.client.user.setActivity(String((s4d.client.guilds.cache.size)));

});

s4d;
umbral zealot
#

You've been on Reddit, you know what a Karen is, don't let kids become karens.

sour flame
unreal estuary
#

?

boreal iron
#

Anyways I’m trying to be a better daddy lol

umbral zealot
boreal iron
#

I don’t even have Reddit

unreal estuary
#

i do

#

but everytime i forget my account

sour flame
#

thx

boreal iron
#

Or should I say im not using it, whatever is the right one

unreal estuary
#

both

#

OK IM GOING TO SLEEP

sour flame
umbral zealot
#

no, no no you do'nt know enough

#

go through a course. It's clear you don't understand enough JS to do any of this.

sour flame
boreal iron
#

nvm

quartz kindle
#

node version manager

boreal iron
#

Shh

quartz kindle
#

secure hocket hell

boreal iron
#

lmao

#

I see you’re imagining your code again

#

Which leaves a lot of time left to troll KEKW

quartz kindle
#

yes

#

i got rid of both yarn and pnpm

#

reorganized all my projects with regular npm

#

but setup a shitty mirroring system to autobackup without node_modules

sour flame
#

is JS the only language for coding discord bots

#

???

quartz kindle
#

no

surreal barn
#

no

sour flame
#

bruh

boreal iron
quartz kindle
#

and thats not even a complete list

#

thats just the "official" list

#

there are a lot more non-official discord libraries for many more languages

sour flame
#

oh kk

quartz kindle
#

which doesnt ignore node_modules

#

you can imagine the mess

#

lmao

#

one npm install and google drive sync is trying to upload 100k files

boreal iron
#

Yeah, horrible to watch the transfer times

quartz kindle
#

i ended up using a shitty app called FreeFileSync lul

#

to autosync my projects folder with the google drive folder without node_modules

boreal iron
#

I guess to do real backups I would probably zip the whole directory and back it up after

quartz kindle
#

ye but then you cant easily do realtime backups/sync

boreal iron
#

Yeah that’s always an issue.
I’m managing tons of dedicated servers and cloud servers and have a lot of trouble to backup services I can’t turn off or or such services using databases I can’t

#

I’m always risking a bit of data loss

sour flame
#

Dowlanding vscode and node takes time

boreal iron
quartz kindle
#

for that kind of data the only proper way would be raid mirroring

sour flame
#

can I use vscode to code on any coding language?

umbral zealot
#

Yes, it's an editor that supports many programming languages.

halcyon kite
sour flame
#

kk

halcyon kite
#

50/50

boreal iron
# quartz kindle for that kind of data the only proper way would be raid mirroring

These servers are all running raids of course. I wonder which provider nowadays offers servers without raids.
Just 2 of my servers have additional SSDs installed without a raid due the fact of hardware limitations. These two store my lookup database with ~800GB. That’s "impossible" to backup anyway but that’s not an issue due the fact it only contains generated data.
But even for all other servers backups are important no matter their SSDs are raids.

#

Even with a RAID10 if I would store personal data only, which is not the case, I would still do backups to external DCs or areas/regions.

#

But since you’re probably speaking about backing up a small server or just a few node projects etc. that might has gone a bit offtopic.

boreal iron
sour flame
#

When my bot glitches out

boreal iron
#

Stop abusing my name!

umbral zealot
#

lol I've seen that help menu so many times it's not funny anymore.

sour flame
#

bruh

boreal iron
#

I don’t get how it "glitches out"?

umbral zealot
#

I guess the glitch is that it's literally showing the botghost help command.

boreal iron
#

Dang sound like I should know that but nope. Nvm

#

But I got what u mean

umbral zealot
#

BotGhost is to bot making as what Lego is to building toys.

boreal iron
#

Yeah that’s what I expected it to be I got from the context. Shame on him I guess 👀

#

At the end one bot more which gets declined

sour flame
umbral zealot
#

That is the most beautiful Giveaway Bot help command I've ever seen. /s

sour flame
sour flame
umbral zealot
#

mmmkay

#

and did you have a question or something?

boreal iron
sour flame
umbral zealot
#

uhhhhh

#

Well, we'd have to see the code for your +commands command to know what's going on

#

is it the only command that does that?

sour flame
#

Ye I realised something

sour flame
#

Well I realized that I added something extra in the code that didn't work out and dam it was fixed

quaint wasp
#

hey

#

what does this mean?

#

RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.

river panther
#

its written there

#

Invalid bitfield flag or number.

green vale
#

Hey! I'm creating a Discord.js bot with a sharder and I want to share a variable between the sharder file and the main file (because I have a command handler and I want each process to share the same Collection for the sake of saving memory). I also have some other variables that I share between each file and I usually achieve this with process. However, since shards use different processes, I can't share these variables. How can I share my collections and other variables between each shard?

river panther
#

idk sharding tbh, how many servers are your bot in?

#

is*

green vale
#

Not many (only about a few hundred), but I'm future-proofing it; I've already gotten a way for the sharder to work but I'm rewriting my bot and I want to share variables and collections in the case of it growing to a point of needing another shard

#

But that's besides the point

river panther
#

ig erwin can help you, oh no, i am unable to ping him

#

wait

green vale
#

lol

river panther
#

@opal plank helo sir, big fan of detritus, this chap wants some help, if you may =)

#

he shall reply in some time

quaint wasp
river panther
#

btw, what is the name of your bot?

quaint wasp
#

I got this

river panther
quaint wasp
#
module.exports = {
    name: 'say',
    execute(client, message, args) {

        if (!message.guild.me.hasPermission("DELETE_MESSAGES")) return message.channel.send("Bot needs permissions to delete messages!") 

        let sy = args.join(' ')
        if(!sy)return message.channel.send("Please put something after ``say``.")
        message.delete()
        message.channel.send(sy)
        console.log("Say command had been ran..")
    }
}```
#

say

#

say

green vale
#

and that is why

#

It's MANAGE_MESSAGES

#

Not DELETE_MESSAGES

river panther
#

yes

quaint wasp
#

oh..

#

OOOHHHHH...

river panther
#

manage_message is required for deleting and pinning messages

#

and a few others

green vale
#

yep

river panther
#

how do you get docs so fast?

swift cloak
#

hi i have a next.js app and i want to run npm start when it runs node .

#

like for example

green vale
#

i have djs's docs already open lol

swift cloak
#

when it runs node . and runs index.js

#

it will also run next.js app at the same time

river panther
#

oh eh, hmm, is it possible?

green vale
#

yes

#

let me uh

river panther
#

tell tell

green vale
#
"scripts": {
  "start": "[next.js start command here]; node ."
}
#

for example if i was opening an electron app with a script

#
"scripts": {
  "start": "electron main.js; node ."
}
river panther
#

ooo

#

nice, thank you 👍

#

the more you know

green vale
#

npnp

#

yes

swift cloak
#

hi anyone here know next.js well?

river panther
#

what happens in it?

swift cloak
#

(node:62364) UnhandledPromiseRejectionWarning: Error: > Couldn't find a pages directory. Please create one under the project root

inland galleon
#

@round cove how to edit my bot after submiting ?

solemn latch
round cove
#

Man

#

Did you get it?

river panther
solemn latch
#

nope

river panther
#

ples

#

i will give you one star

#

because thats the most i can

inland galleon
#

how to make our bot paid ?

river panther
#

imagine having no name

#

what?

#

you want a paid bot?

old cliff
inland galleon
rigid sandal
#

so syntax error after login.bot();

#

any ideas?

#

because it has the closing tag

lusty quest
inland galleon
lusty quest
inland galleon
cinder patio
#

what

river panther
rigid sandal
river panther
#

show code

rigid sandal
#
const Discord = require('discord.js');
const bot = new Discord.Client();

const prefix = "!"

const TOKEN = process.env.TOKEN;
 client.on('ready', () => { 
  console.log('Bot is ready'); bot.on('ready', () => { 
  console.info(`Logged in as ${bot.user.tag}!`);
 const args = 
  msg.content.split(/ +/); const command = args.shift().toLowerCase();
 console.info(`Called command:
 ${command}`);
 if (!bot.commands.has(command)) return;
 try {bot.commands.get(command).execute(msg, args);
  } catch (error) {
    console.error(error); msg.reply('there was an error trying to execute that command!');
  }
});

bot.login(TOKEN);
#

my token is in a .env file

#

for security

old cliff
#

where

#

are

#

you adding your commands?

#

wait what

rigid sandal
#

its seperate but its also connected

old cliff
#

@rigid sandal you have to add that code in message event

#

not ready

#

ready event doesn't give the message object

rigid sandal
#

ready is the message it says when my bot is online

old cliff
#

no

rigid sandal
#

this user is ready

old cliff
#

ready event gives no message

#

yeah

river panther
#

yes

old cliff
#

it occurs when the bot is ready... not when a message is sent

river panther
#

you need event

rigid sandal
#

oh bot.on (ready)?

old cliff
#

oof

#

learn js

rigid sandal
#

I am a web developer

old cliff
#

here you are using client... there you are using bot

old cliff
rigid sandal
#

and i was actually learning something new

rigid sandal
#

but not many good courses

old cliff
#

start with a tutorial

rigid sandal
#

Where?

#

Ive looked

old cliff
rigid sandal
#

and no good ones lol

old cliff
#

its discordjs.guide

rigid sandal
#

nvm

old cliff
#

not discord.guide

rigid sandal
#

i clicked it too early

#

lol

old cliff
#

it will help you understand how discord.js works

#

also https://discord.js.org docs will help

rustic nova
#

@fickle magnet do you mind if i redirect you to the Javacord discord?

#

as they can help you better

rustic nova
#

they also have examples on how to work with it

fickle magnet
#

ty

brave scaffold
#

When it comes to private Discord bots, is it worth creating public documentation about their features and such for the sake of transparency? A server that I'm an admin of has a private bot that is currently developed in Python by 1 person on our staff team. We aren't planning to turn the bot into a public one that anyone can use outside of the server anytime soon. I hope this is the right place to ask this...

old cliff
#

dont

#

just make a help command

brave scaffold
#

Okay. The bot already has a help command.

slender thistle
#

Transparency is a resolved issue if you have a detailed help command, so

willow mirage
#
    <link rel="icon" href="https://cutiecat6778.github.io/cdn/universe_logo.png" />

ehm ... i dunno what is happening

#

the icon is not working

old cliff
#

do ctrl+f5

#

@willow mirage

willow mirage
#

not working

pale vessel
#

try adding the type attribute

#

type="image/png"

old cliff
#

my bot isn't even in here

lusty quest
#

did you use the API?

pale vessel
#

no it's not illegal

#

the API is public

old cliff
#

yes

lusty quest
#

it could be a privacy breach, since you can send informations without the consent of the owner of the server.

vivid fulcrum
#

...that information is public

feral aspen
#

What's this undefined, I'm so confused.

midnight blaze
#

it aint defined

feral aspen
#

What?

#

How can a server not be defined.

#

It literally works for others.

midnight blaze
#

the server is fine, you probably try to display an object that is empty or something

feral aspen
#

Should I make the check of if(guild.name === undefined) return; ?

#

and the guild.memberCount?

midnight blaze
#

yes, the first part is good to filter undefined stuff

#

that is a good start 👍

feral aspen
#

Alrighty.

eternal osprey
#

what type of color code is this?

#

it isn't a hex one, not a rgb one..

pale vessel
#

it's in decimal

#

(3447003).toString(16)

eternal osprey
#

aha okay!

outer trail
#

sa

lusty quest
old cliff
#

the event won't emit without info

feral aspen
vivid fulcrum
#

i think that's an issue with djs' internals

#

the object gets deleted prematurely

pale vessel
#

Erwin: anotHer ReasOn to SwitCh To DetriTuS

old cliff
lusty quest
lusty quest
#

strange, did you have partials enabled?

lusty quest
#

yea just follow Erwins cult will be better

opal plank
#

indeed, just give detritus a try.

west agate
#
const inviteCode = client.guilds.cache.get('819508298016882699').channels.cache.get('819508299014602764').createInvite()

When ever I keep doing this I keep getting invited to a random server

slender thistle
#

What server is that

misty sigil
#

🤔 is it the server with that id

west agate
#

nope

#

a completly random server

#

it should make a code for the server im in tho-

lusty quest
#

so the guild id you provide is not the one of the server you want?

west agate
#

no it is

#

the guild id and the channel id are correct

opal plank
#

you can get a channel direcvtly btw

#

also createInvite is a promise iirc

#

if you using discord.js, it should automatically cache all caches

#

if you REALLY wanna make sure

#

then fetch/get if not available

west agate
#

i tried getting it directly from the channel but the same thing happened

opal plank
west agate
#

is there a documentation on that? ._.

opal plank
#

on promises? yeah

west agate
#

thanks! much appreciated!

opal plank
#

np

loud nebula
#

Could someone help me testing something? Im working on a web dashboard. I need to test the server fetching but i need someone to help me cuz i cant do it solo

#

first to send something can help me :p

#

sad cricket noise .....

onyx hare
#

My Unban Command Doesn't Send The Unban Message Any Pointers To Why As Far As Im Aware i have It Correctly Coded

exports.run = async (client, message, args) => {
    if(!message.member.hasPermission("BAN_MEMBERS")) {
        return message.channel.send(`**${message.author.username}**, You do not have permissions to unban someone`)
      }
      
      if(!message.guild.me.hasPermission("BAN_MEMBERS")) {
        return message.channel.send(`**${message.author.username}**, I do not have permissions to unban someone`)
      }
      
      let userID = args[0]
        message.guild.fetchBans().then(bans=> {
        if(bans.size == 0) return 
        let bUser = bans.find(b => b.user.id == userID)
        if(!bUser) return
        message.guild.members.unban(bUser.user)
        if(unban)
        return message.channel.send(`**${message.author.username}**, I unbanned the target user`)
        
  })
};

west agate
#

is there any documentation for how to set up a mongodb?

onyx hare
vernal shell
#

is there a way to remove a bot from servers it is currently joined in without having access to that server with my non-bot account?

vernal shell
#

damn

nimble comet
#

hi

vivid fulcrum
#

you'll have to use the bot's token and leave the guilds that way

vernal shell
vivid fulcrum
#

which library are you using

#

if any

vernal shell
#

discord.js

vivid fulcrum
#

you want to leave every guild?

vernal shell
#

just some guilds that i have the ID of

#

specific ones

#

just want to know if it is possible

earnest phoenix
vivid fulcrum
#

don't spoonfeed them

vernal shell
#

ahahaha

vivid fulcrum
#

considering you got spoonfed, doesn't matter

vernal shell
#

ah i was missing the object part

#

thanks

earnest phoenix
#

dm me if you can use proxies or threads on discord py, help me in dms ill send u nitro ig

old cliff
#

is 100 message cache a good idea?

#

per shard

vivid fulcrum
#

ratelimits are per token

#

not per ip

tired panther
copper peak
#

And proxies are useless for discord

#

Unless you're asking for nitro gen in which case it's a big nope

lusty quest
#

he meant he want to reward the one who helps him with a free nitro gift

trim torrent
#

what should I do when my bot is being verified, does it tell the user when they click the invite link/does it affect verification of my top.gg if they can t add my bot at the time

#

with its growth rates the 5 day discord verification time will probs affect some people trying to add the bot

copper peak
#

But usually people who ask for proxies use them to bypass ratelimits on non-bot endpoints

#

Like bruteforcing nitro gift codes

copper peak
#

Note the "usually"

#

Proxies in general are useless for discord API endpoints since ratelimits are per token

#

I believe there's a proxy kwarg in the client constructor but that predates bot accounts themselves. iirc they're deprecated in 1.7 and gone in 2.0

copper peak
#

What part can you not test yourself?

#

Hint: alt

loud nebula
#

Yes but i dont want to use alts

copper peak
#

Why not?

loud nebula
#

I want someone to create a server. Invite the bot, invite me and then check if the dashboard locates the server cuz i dont have perms

#

Bc then my notification settings etc are gone again

copper peak
#

This is one of the few legitimate purposes of an alt

#

Private browsing. Cookies won't interfere.

loud nebula
#

I thought it was always illegal

copper peak
#

No?

loud nebula
#

lets use my phone then xd

copper peak
#

Alts aren't against anything

loud nebula
#

forgot i even had my phone lol

copper peak
#

Ban evasion is against community guidelines

#

But not alts themselves

loud nebula
#

Ohh yeh im stupid

viscid gale
#

this is the first time i woke up with so much.. look at that score :DDDD

west agate
#

wait is their a specific documentation for setting up mongodb in discord.js

opal plank
#

use built in OS module

#

then?

#

well there you have it though

#

just dont loop it

#

i update it every couple secnods

#

what?

#

you're using a package

#

then you need to check the pakcage

#

i said os

#

not node-os-utils

#

it shouldnt

#

@hoary hill

#

looks abosultely fine

small tangle
#

My bot has several answers available and is supposed to randomly answer with one of them. What would be the best way to save them? As a JSON file?

cinder patio
#

sure

small tangle
#

would you read the json file everytime the command is used? because i thought id be better to "preload" the json file and keep the object in memory to minimize the IO-Operations. Or is this a bad idea?

slender thistle
#

Pre-loading it is fine. Just make sure you have plenty of memory for that

small tangle
#

its running on my 4GB RAM Raspberry Pie FeelsSmartMan

#

and its the only process besides pihole

misty sigil
#

if you're using nodejs it'll keep required files in memory

small tangle
#

im coding in java with jda ASpeek

lusty quest
#

its not only a nodejs thing

small tangle
#

im saving the jsonarray in a map and read this if needed

lusty quest
#

file reads are way slower compared to directly in memory saved

#

yea this should be perfect

small tangle
#

tbh i im quite new to use maps but a friends keep suggesting i should use them and yeah they are really cool peepoHappy

quartz kindle
#

why bully me :(

slender wagon
#

OOF

opal plank
quartz kindle
#

xd

west agate
#

does anyone know how to make a rlly good filter like censor bots?

livid lichen
#

This is sick! This must be a new update.

earnest phoenix
#

Yes it is

livid lichen
#

10/10!

#

I thought the old one was cool... this blows it out of the water!

sour flame
opal plank
sour flame
earnest phoenix
#

Who wants a bit of help with their discord bots I can help with discord.py

earnest phoenix
#

I can help with the coding

dire obsidian
#

@earnest phoenix seems like @sour flame needs some, i guess

sour flame
#

I need to know how to start my economy bot

earnest phoenix
sour flame
lusty quest
#

i smell pull stack developers

earnest phoenix
earnest phoenix
#

Are you actually trying to help people or spoonfeed them?

mental cloud
#

Guys, I have a .db file that weighs 160MB and I need to transfer it all to a MySQL, but I don't know the best way... Could someone help me?

#

I have googled and tested several programs and none of them converted everything I wanted.

quartz kindle
#

do it manually

#

load the db file in a script, read all rows, write them to mysql

slender wagon
#
let channel = message.mentions.channels.first();
``` it says channels is undefined
unreal estuary
#

did u mention a channel in the message

slender wagon
#

no but it should throw an error if i don't

pale vessel
#

no it would be undefined

unreal estuary
#

thats weird

slender wagon
pale vessel
#

oh

quartz kindle
#

where does it say its undefined then?

pale vessel
#

log the channel

slender wagon
#

aight let me log it real quick

unreal estuary
#

ok

slender wagon
#
 message.mentions.channels.first();
``` channels in this is undefined
#

not channel

quartz kindle
#

whats the exact error

#

its likely not channels that is undefined

slender wagon
#

Cannot read property 'channels' of undefined

quartz kindle
#

there you go

#

channels OF undefined

unreal estuary
#

its mentions then

quartz kindle
#

meaning, your code is doing undefined.channels

#

meaning message.mentions is undefined