#development

1 messages · Page 1135 of 1

torn ravine
#

whats a great a language thats not javascript to learn

fringe axle
#

What can I do now? D:

amber fractal
#

C++

thin turret
#

JavaScript 2

cinder patio
#

C#

#

typescript

fringe axle
#

I repaired my quick.db

solemn latch
#

👋

fringe axle
#

But

#

Permissions still won't work.

#

Any idea?

restive furnace
#

c++, c#, c, java, haskell, cloujre, rust, python, nim, go [@torn ravine]

fringe axle
#

discord.js v12 member need perms

torn ravine
#

discord bot in rust?

restive furnace
#

yes

#

use serenity on rust

sudden geyser
#

whats a great a language thats not javascript to learn
@torn ravine <insert favorite language> python

eternal flame
#

how do i check if someone has a role by the id

sudden geyser
#

<GuildMember>.roles.cache.has I think

eternal flame
#

like, the author of the message

#

if they have the role

sudden geyser
#

A message instance has the .member property, which is a GuildMember instance.

eternal flame
#

ah

#

so wait

#

that would me

#

be*

#

hold on

#

would

#

one sec

#

would

sudden geyser
#

do you want an example

eternal flame
#
if (message.author.roles.cache.has === 'id') return 
message.channel.send("u have that role or sumthin idk")
#

would that work?

sudden geyser
#

No, message.author is a User instance. message.member, however, is a GuildMember instance.

#

and .has is a method, so you need to call it with the id.

eternal flame
#

oh

#
if (message.member.roles.cache.has === 'id') return 
message.channel.send("u have that role or sumthin idk")
#

so that

#

but

#

i need to call it with the id right

sudden geyser
#

Yes.

and .has is a method, so you need to call it with the id.

eternal flame
#

example please

sudden geyser
#

call it like a function (has())

eternal flame
#

oh

#

so

#
if (message.member.roles.cache.has('id')) return 
message.channel.send("u have that role or sumthin idk")
sudden geyser
#

yeah now try it out and see

eternal flame
#

ok

fringe axle
#

Someone knows how to check if the message author has/need permissions to execute the command in discord.js v12?

sudden geyser
#

well we don't know what requirements there are to run said command

fringe axle
#
      async run(message, args, [target]) {
        let levelsystem = await db.fetch(`levelsystem_${message.guild.id}`);
        db.set(`levelsystem_${message.guild.id}`, 'off')
        const member = message.mentions.members.last() || message.guild.members.cache.get(target) || message.member;
        const userFlags = member.user.flags.toArray();
        if(!member.hasPermission("MANAGE_MESSAGES")) {
          return message.channel.send("You don't have the permissions to use this command!")
        }

        const embed = new MessageEmbed()
        .setDescription('The level-system turned off')
        .setColor('#ea6ef1')
        .setAuthor('| Level System')
        .setTimestamp()
        .setFooter(`Requested by ${message.author.username}#${message.author.discriminator}`);
        message.channel.send(embed)
        }
      }
sudden geyser
#

message.author is a User instance while message.member is a guild member instance if you need to check something that only applies to guilds

torn ravine
#

```if (message.member.hasPermission(EXAMPLE)) {
// your code here
}

eternal flame
#

and also

fringe axle
#

Yes

eternal flame
#

|| is or and && is and right

sudden geyser
#

yes

fringe axle
#

@torn ravine then the error undefined is coming

eternal flame
#

ok

#

thanks

fringe axle
#

Or a quick.db error

torn ravine
#

message.author

#

try

fringe axle
#

Not a function

sudden geyser
#

member can either be a guild member instance of undefined/null

fringe axle
#

Hm.

sudden geyser
#

like if6 said, you can use .hasPermission(the_permission)

fringe axle
#

Make sence

#

No

#

Then a quick.db error is coming

#

With undefined

torn ravine
fringe axle
#

But without the members code there is no quick.db error.

#

@torn ravine is it v12?

torn ravine
#

yep

fringe axle
#

And how you defined member?

solemn latch
#

you can get member from message

#

you already do this once in your code

fringe axle
#

Yes

#

Hm

solemn latch
torn ravine
#

message.member should be fine

fringe axle
#

Then the quick.db error is coming

honest perch
#

Tos go brr

solemn latch
#

does db.fetch even exist?

fringe axle
#

const { Command } = require('discord.js-commando');
const { prefix } = require('../../config.json');
    const { MessageEmbed } = require('discord.js');
    const fs = require('fs');
    const Discord = require('discord.js');
    const db = require('quick.db');
    
    module.exports = class HelpCommand extends Command {
      constructor(client) {
        super(client, {
          name: 'level-off',
          aliases: ['loff, levelsystem-off'],
          group: 'guild',
          memberName: 'level-off',
          description: 'Disable the level system',
        });
      }

      async run(message, args) {
        
if (!
message.member.hasPermission(‚ADMINISTRATOR')) {message.channel.send('You dont have permissions!');

let levelsystem = await db.fetch(`levelsystem_${message.guild.id}`);
        db.set(`levelsystem_${message.guild.id}`, 'off')

        const embed = new MessageEmbed()
        .setDescription('The level-system turned off')
        .setColor('#ea6ef1')
        .setAuthor('| Level System', 'https://cdn.discordapp.com/avatars/714745136122429491/e16289a6de8bd22fb433b1e029fe98e1.png?size=2048')
        .setTimestamp()
        .setFooter(`Requested by ${message.author.username}#${message.author.discriminator}`);
        message.channel.send(embed)
        }
      }
#

Will this work?

#

@torn ravine

honest perch
split hazel
#

why dont you test it

fringe axle
#

Good idea!

torn ravine
honest perch
#

I suggest trying and debuging your code

solemn latch
#

it got pushed away, but the quick.db docs mention nothing about fetch

honest perch
#

Instead of asking if it works on every edit

split hazel
#

i checked the source code, fetch is just an alias for get

solemn latch
#

weird, i wonder why its not mentioned

#

oh it is

#

just in get

fringe axle
#

IT WORKED

#

IT WORKED

#

AFTER 3 HOURS

#

Thanks to everyone!

jolly wave
#

i fixed every commands

#

but a command is still not working

#

TypeError: Cannot read property 'send' of undefined

#

oof

#

the command is this

#
    let ucount = client.users.cache.size
    message.channel.send('I am currently watching ' + ucount + ' users.')```
#

ah

#

any help?

quartz kindle
#

where are you getting message from? show the full code

drifting wedge
#

await client.get_channel(741482536961835009).send(f"{welcomemsg}")

#

does the channel id need to be a integer?

#

can it be a string?

#

its a variablr

jolly wave
#

Wait

drifting wedge
#

hastebin?

jolly wave
#

yes

drifting wedge
#

?

jolly wave
#

just click on the link

#

it's like pastebin

#

but better

drifting wedge
#

its python

#

btw

#

not js

jolly wave
#

?

drifting wedge
#

.js

solemn latch
#

Your not the only one with issues in this channel

jolly wave
#

yes ik

drifting wedge
#

oh lol

#

lmao

solemn latch
#

Mention able name is also looking for help

jolly wave
#

oof

#

i thought you was talking to me

solemn latch
#

You know you have three message events

jolly wave
#

where

solemn latch
#

And every single time you get a message your building an embed

jolly wave
#

i don't understand

solemn latch
#

Client.on('message')
Every time you do that, your making a new event listener

jolly wave
#

yes

solemn latch
#

All of your commands can be in one

jolly wave
#

oh

#

your talking about my big elseif chain

#

or not

solemn latch
#

No, the three seperate events

jolly wave
#

oh

#

but that's not hte problem rn

#

the problem is the usercount command

#

it don't work

#

and idk why because servercount work

solemn latch
#

No, its not the problem, but it is a problem

#

Also, your loading command files but never using them anywhere

jolly wave
#

ah

#

how do i do to use them

solemn latch
jolly wave
#

yes but idk how to do it

#

i tried

#

can anyone help me still

eternal flame
#

so im stuck, and i need some help, here is my code

if (!message.member.roles.cache.has('my role' || 'head of staff')) //only me and my HOS are able to issue this command
            if (message.member.roles.cache.has('moderator' || 'admin'))
                message.channel.send('You do not have permission to execute this command. Please contact Christian if you believe somebody is flooding the database.');
            else {
                return;

            }

what im trying to do is make it to where if me or my head of staff issue the command, it goes through, but if a moderator or admin (on my support server) do it, it says 'You do not have permission to execute this command. Please contact Christian if you believe somebody is flooding the database.', and if a regular user with none of those roles do it, it just quits

#

but

#

whats happening

pure lion
#

Roles aren't cached

eternal flame
#

wait

#

rlly?

amber fractal
#

uh

pure lion
#

Not in member objects

amber fractal
#

that's not how you use OR

eternal flame
#

im dumb

amber fractal
#

and yes, they are

pure lion
#

They are elsewhere

amber fractal
pure lion
#

I'm getting error when compiling my C++ app:
Error: Screen Height / Font Height Too Big
I'm confused

#

@amber fractal member roles aren't cached

jolly wave
#

and me

amber fractal
#

you just are using the OR operator wrong

eternal flame
#

oh

#

then how

jolly wave
#

TypeError: Cannot read property 'send' of undefined

#

e

amber fractal
#

!message.member.roles.cache.has('my role') || !message.member.roles.cache.has('my role') || ! message.member.roles.cache.has('...'))

#

you cant just put OR in a function like that

#

because that's string OR string2

eternal flame
#

oh

#

okay

#

so would it be

amber fractal
#

it will always evaluate to string unless it's empty

jolly wave
#

can anyone help me?? ;-;

pure lion
#

No

amber fractal
#

You can use cache.some()

eternal flame
#
if !message.member.roles.cache.has('my role') || !message.member.roles.cache.has('my role') || ! message.member.roles.cache.has('...')) //only me and my HOS are able to issue this command
            if !message.member.roles.cache.has('my role') || !message.member.roles.cache.has('my role') || ! message.member.roles.cache.has('...'))
                message.channel.send('You do not have permission to execute this command. Please contact Christian if you believe somebody is flooding the database.');
            else {
                return;

            }
amber fractal
#

yes

eternal flame
#

would it be like that\

amber fractal
#

that would work it looks like

eternal flame
#

ok

#

thx

amber fractal
#

but not with the ... one obviously

#

Just make it fit your needs, which is 2 roles (I think)

jolly wave
#

can anyone help me now

pure lion
#

No

eternal flame
#

it says that it has to be like

if !message.member.roles.cache.has('my role') || !message.member.roles.cache.has('my role') || ! message.member.roles.cache.has('...')) //only me and my HOS are able to issue this command
            if !message.member.roles.cache.has('my role') || !message.member.roles.cache.has('my role') || ! message.member.roles.cache.has('...'))
                message.channel.send('You do not have permission to execute this command. Please contact Christian if you believe somebody is flooding the database.');
            else {
                return;

            }
jolly wave
#

bruh

eternal flame
#

ok

pure lion
#

Where is your error bro

eternal flame
#

@jolly wave

#

whats the prob

jolly wave
#

i fixed my commands but usercount don't work

#

TypeError: Cannot read property 'send' of undefined

#

and the code

eternal flame
jolly wave
#

?

eternal flame
#

give us the error output

#

screenshot of the console

jolly wave
#

and this

#
    at Client.<anonymous> (E:\Hi Bot(js)\index.js:45:21)
    at Client.emit (events.js:322:22)
    at MessageCreateAction.handle (E:\Hi Bot(js)\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (E:\Hi Bot(js)\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (E:\Hi Bot(js)\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (E:\Hi Bot(js)\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
    at WebSocketShard.onMessage (E:\Hi Bot(js)\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
    at WebSocket.onMessage (E:\Hi Bot(js)\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:310:20)
    at Receiver.receiverOnMessage (E:\Hi Bot(js)\node_modules\ws\lib\websocket.js:797:20)```
solemn latch
#

Whats at line 45 of your index

eternal flame
#

let ucount = client.users.cache.size

jolly wave
#

let ucount = client.users.cache.size

#

oh yes

#

so?

eternal flame
#

and also

#

@jolly wave

jolly wave
#

yes

eternal flame
#

you might want to make a handler that ignores all messages unless it starts with the prefix

#

because from what im seeing

#

your bot scans every single god damn message

jolly wave
#

yes and

eternal flame
#

its unnecessary

#

it also slows it down

jolly wave
#

welp it would not crash my bot too

#

oh

eternal flame
#

and its a lot less work on your part

#

so you dont always have to define the prefix

jolly wave
#

ok but that's not the problem

eternal flame
#

alr

#

yeah

#

lets fix

jolly wave
#

so idk why

#

because servercount work

#

and it's literally the same command

eternal flame
#

ok

#

so

jolly wave
#

so

eternal flame
#

try changing line 20

#

from

#

client.on('message', message => {

#

to client.on('message', (message) => {

jolly wave
#

why

#

it's not the command

eternal flame
#

change all lines to it

#

actually

#

first

jolly wave
#

done

eternal flame
#

change all client.on('message', message => {

jolly wave
#

i did

eternal flame
#

to client.on('message', async (message) => {

#

thats what i have at least

earnest phoenix
#

Hello, i do command handler but now, how to make an automatic ignore the dm message

eternal flame
#

oh

#

one sec

earnest phoenix
#

thanks

eternal flame
#

sorry

#

i dont know

jolly wave
#

dude

eternal flame
#

but azorix

jolly wave
#

it still don't work

eternal flame
#

@jolly wave hold on

#

it should automatically ignore dms, it does for me at least

#

but

#

better be safe then sorry

jolly wave
#

?

#

what are talking abt

eternal flame
#

anyways

#

ok now give me your code @jolly wave

#

the current code you now have

jolly wave
earnest phoenix
#

Someone answer me please please I just need that

jolly wave
#

wait wait

#

it work

eternal flame
#

told u

jolly wave
#

thxxx

eternal flame
#

ij @earnest phoenix

#

ok*

jolly wave
#

he's watching 228 user rn

#

in 4 server

eternal flame
#

whats the thing

#

u want

#

hel;p with

jolly wave
#

btw do you know how to make a xp system

eternal flame
#

i have not the slightest clue

#

but it prob involves a database

jolly wave
#

ah

#

idk how to make a database

solemn latch
#

generally, a few hours of playing around and you know the basics

#

sql is often considered a bit more difficult, but its really not.

#

like an array?

sudden geyser
#

You could learn the basics: what a database is, how to create tables, insert update and delete data

solemn latch
#

like 1 - 10
[1,2,3,4,5,6,7,8,9,10]

sudden geyser
#

do you want to get a random number in that range

solemn latch
#

you could just loop until you get to the largest number

#

and push each value into the array

eternal flame
#

woo

#

im having trouble, and i cant steamroll the bug out

#

one sec

solemn latch
eternal flame
#

this is the code thats giving me the issue

#
if (!message.member.roles.cache.has('my role') || !message.member.roles.cache.has('my head of staffs role')) { //only me and my HOS are able to issue this command
            if (!message.member.roles.cache.has('admin role') || !message.member.roles.cache.has('mod role')) {
                message.channel.send('You do not have permission to execute this command. Please contact Christian if you believe somebody is flooding the database.'); 
        } else {
                return;

            }
        
        } else {
then it continues to carry out the command
``` it always comes out as you do not have permission
#

even though i have the role\

solemn latch
#

.has() expects a key value, which would be an id, iirc

eternal flame
#

Yeah i put ids in there

#

i put my role id and etc

#

and it still comes out as you do not have permission

solemn latch
#

im not sure tbh

eternal flame
#

damn

amber fractal
#

You're executing it in the right guild right?

eternal flame
#

yeah

tranquil marlin
#

quick question

misty sigil
#

yes

tranquil marlin
#

how do i stop message collector

#

it waits until timer is done

solemn latch
#

docs

misty sigil
#

should stop itself

#

yes it will wait

solemn latch
#

you can stop them aswell

tranquil marlin
#

thats the problem

solemn latch
#

docs ;p

tranquil marlin
#

im literally in docs

#

using collector.stop

#

but it still waits for timer

solemn latch
#

.stop is a method

#

not a property

misty sigil
#

collector.stop()

tranquil marlin
#

bruh

#

problem is that collector.stop is not stopping it

solemn latch
#

so your using it as a method?

tranquil marlin
solemn latch
#

and your collector is named collector?

tranquil marlin
#

am i supposed to pass collector

cunning kiln
#

should a say command be availible for only those with manage messages or everyone?

tranquil marlin
#

ait i was supposed to pass filter D:
it doesnt say that in docs tho

jolly wave
#

i am trying to make a xp system with mongo db but the script don't work

misty sigil
#

Ok

jolly wave
#

bruh

tranquil marlin
#

maybe show the code

jolly wave
#

wait

misty sigil
#

You aren't giving us anything to like

#

uh

#

work with

jolly wave
#

and the xp data script

misty sigil
#

where are you connecting to the db

#

where is the db hosted

solemn latch
#

also, your code is kinda getting real hard to read

misty sigil
#

Yea

solemn latch
#

expect people to be confused when reading your code

misty sigil
#

I'd recommend adding a command handler

#

and as it grows and needs more dependencies it's better

#

as I have about 10 lines just dependencies

subtle kiln
#

I have ? How would I go about adding +nuke

solemn latch
#

🤔

#

what

subtle kiln
#

So once u activate it, it deletes all messages in the channel

solemn latch
#

you can only delete 100 messages at a time

subtle kiln
#

Really?

solemn latch
#

completely purging a channel isnt really possible unless you delete it

subtle kiln
#

Yes ik like BetterAntispam bot

#

How would i go about doing something like thag

#

That*

golden condor
#

Eris allows you to delete as many message as you want

sudden geyser
#

that's because it does it gracefully with a small timeout period

quartz kindle
#

good luck deleting all messages in a channel

#

imagine a channel with a million messages

#

it will take you days

strange trout
#

Why not just delete the channel

sudden geyser
#

might as well clone and delete the channel

quartz kindle
#

exactly

golden condor
#

TextChannel#clone

solemn latch
#

a lot of the nuke commands ive seen either do that ^ or have a cap of 1000(or less)

pure lion
#

:o

fallow steppe
#

syntaxError: Unexpected number
What does that mean?

honest perch
#

Unexpected number

sudden geyser
#

an unexpected number was found in your code which was a syntax error

solemn latch
#

typically, it means a number wasnt excpected

fallow steppe
#

I dont see anything wrong in my code

#

Im just trying to embed something

sudden geyser
#

well show it or run it through a linter

fallow steppe
#

Im on mobile so I just have to copy and paste

#

Or ill screenshot my evaling

#
title:"About",
description:"removed desc",
fields:[{
name:"Developers:", value:"Sandra#3781\nclient.users.cache.get("648451669671149588").tag"
},
{name:"Contributors:",
value:"client.users.cache.get("535508271474147330").tag - Bots fancy avatar artist\nclient.users.cache.get("614118045451026433").tag - Bot new name suggestion"
}]}})```
#

When I do this it runs unexpected number

quartz kindle
#

you're mixing variables and text

sudden geyser
#

Your issue is probably here

fields:[{
name:"Developers:", value:"Sandra#3781\nclient.users.cache.get("648451669671149588").tag"
},```
quartz kindle
#

you're basically doing this "Sandra#3781\nclient.users.cache.get("648451669671149588

fallow steppe
#

I see

#

So it goes like this?

name:"Developers:", value:"Sandra#3781\n" + client.users.cache.get("648451669671149588").tag
},```
quartz kindle
#

thats one way yes

fallow steppe
#

Okay

quartz kindle
#

another way is to use string templating

#
value:`Sandra#3781\n${client.users.cache.get("648451669671149588").tag}`
fallow steppe
#

👍

drifting wedge
#

hey

#

so basicly i have a welcome thing in my py bot

#

and i need the users to be able to set the channel in which the welcome message will be sent in

#

can the channel id be replaced with a placeholder/var which in this case would be {wc}

#

and would i need the {}?

#

thats the code if anyone wants to help! @client.event async def on_member_join(member): with open('wchannel.json', 'r') as f: wc = json.load(f) with open('welcome.json', 'r') as f: welcomemsg = json.load(f) channel = 'wc' await client.get_channel(741842774223224894).send("{welcomemsg}")

torn ravine
#

can anyone help me install node on a linux vm

earnest phoenix
#

Yep

quartz kindle
#

install nvm (node version manager)

misty sigil
#

Ok, so basically, I've started a MongoDB cluster, how would I add authentication via uname/pass to said database?

quartz kindle
#

from their github

earnest phoenix
#

leremy???

misty sigil
#

yes

torn ravine
#

I have node version manager what do I do with that

misty sigil
#

you can install node using that afaik

quartz kindle
#

nvm install node

#

(for latest)

#

else, nvm install 14.5.0 for example

torn ravine
#

thank you tim

#

stack overflow

quartz kindle
#

then nvm use yourversionhere

torn ravine
#

can nvm install npm aswell

misty sigil
#

yea

torn ravine
#

what's the command for it?

misty sigil
#

I think it does it automatically when you install node

#

Anyone know how to add auth to mongo?

solemn latch
#

add auth?

#

like the auth lib?

misty sigil
#

wait shite i meant mongo

solemn latch
#

npm install mongodb

#

?

misty sigil
#

No, I'm hosting my own mongo cluster

solemn latch
#

?

#

says to npm install mongodb

drifting wedge
#

hey

misty sigil
#

no no no, I'm setting up the cluster and I want to add username/pwd auth

drifting wedge
#

im having a little issue

misty sigil
#

I know how to connect read and write

drifting wedge
#

{'740715653295767562': 'Welcome (ping)', '666016790140157992': 'welcome (user)'}

solemn latch
#

that would be mongo side wouldnt it?

misty sigil
#

Yea.

drifting wedge
#

it spews out everything from the json file

solemn latch
#

not npms side

drifting wedge
#

how do i get it to only send one server's message

solemn latch
#

youd want to have a database

drifting wedge
#

i have a json fole

#

file*

solemn latch
#

and associate each welcome message with a guild's id

#

thats a bad idea

drifting wedge
#

why?

solemn latch
#

json databases are known to randomly corrupt

earnest phoenix
#

client.on('guildCreate', (guild) => { guild.leave() })``` guys idk why but this code makes my bot leave a server if it's invite, pls help me!!! will give hugs in return
solemn latch
#

for no reason other than they are unstable

#

lol

pure lion
#

'cannot set property "_cache" of undefined'

drifting wedge
#

how would i make a db?

solemn latch
#

step one, choose a database to use

misty sigil
#

theres mongodb clusters you can get for free

thick gull
#

client.on('guildCreate', (guild) => { guild.leave() })``` guys idk why but this code makes my bot leave a server if it's invite, pls help me!!!

@earnest phoenix your waiting for the guild to add the bot then your leaving...?

earnest phoenix
#

na im jk

thick gull
#

ohok:)

pure lion
#

client.on('guildCreate', (guild) => { guild.leave() })``` guys idk why but this code makes my bot leave a server if it's invite, pls help me!!! will give hugs in return

ctrl alt delete x)

thick gull
#

couldn't tell

misty sigil
#

lmao some people would acc do that

earnest phoenix
#

yeah its true

pure lion
#

but yeah

#

what the fuck do i do

earnest phoenix
#

i sent in them code channels and it got deleted

solemn latch
#

is that what you want?

#

the mongodb docs are pretty good

drifting wedge
#

ill do databases in the future

#

i mean is it like a MAJOR thing

#

or can i get by with json for a couple months?

pure lion
#

no

solemn latch
#

sure, just expect your data to get randomly reset for those months

drifting wedge
#

ok

#

welp

earnest phoenix
#

uhh json isn't a db

drifting wedge
#

but how can i make it only send the message for the specific server

#

the json file has the server od

#

id

pure lion
#

use a database

drifting wedge
#

i will

#

in the future

pure lion
#

just use enmap smh

drifting wedge
#

wtf is that

earnest phoenix
#

search it

pure lion
#

Enhanced Map

#

uses sqlite

earnest phoenix
#

sqlite is meh

hybrid roost
#

client.on('guildCreate', (guild) => { guild.leave() })``` guys idk why but this code makes my bot leave a server if it's invite, pls help me!!! will give hugs in return

@earnest phoenix perhaps enough internet for today

pure lion
#

nosql > sql > sqlite imo

drifting wedge
#

ill just do it in the futture

earnest phoenix
#

tf is that download

drifting wedge
#

but how can i make it not just send the enire json file?

pure lion
#

ah yes jpg_large my favorite file type

#

but how can i make it not just send the enire json file?
🗿

earnest phoenix
#

tf

#

what a question

#

json isn't a database

drifting wedge
#

i know

#

but it works for storing info

pure lion
#

json is a shitty poopoo thing used at frontend for sending data back to the back where it can be parsed into not json

misty sigil
#

you shouldn't be writing

earnest phoenix
#

^

misty sigil
#

just reading

drifting wedge
#

well id have to rewrite like 200 lines of code

thick gull
#

I use json for people who I whitelist to be able to run certain commands like dev commands

drifting wedge
#

so ill do that in the FUTURE

thick gull
#

but I don't write to it

pure lion
#

bitch listen to me

misty sigil
#

ok

earnest phoenix
#

ok

drifting wedge
#

ok

solemn latch
#

why is your json db 200 lines

pure lion
#

use a database or cry

solemn latch
#

HOW

hybrid roost
#

Hm, i am storing some guilds info in JSON files. Bout it ain't good solution

misty sigil
#

dont come crying to us when your "db" corrupts

solemn latch
#

json databases are like 3 lines of code

drifting wedge
#

its not 200 lines

hybrid roost
#

use a database or cry
@pure lion you make me cry :'(

drifting wedge
#

im new to coding

#

so ill just do simple shit for now

earnest phoenix
#

not an excuse

misty sigil
#

databases aren't that hard

solemn latch
#

json databases are more complex than regular databases

misty sigil
#

ADS banhammer

solemn latch
#

lol

earnest phoenix
#

i learnt mongoose in a day

misty sigil
pure lion
#

lmao

#

i saw a grey rectangle

drifting wedge
#

well ill do that next weekend then\

misty sigil
#

I learnt mongo in a few hours mmulu

pure lion
drifting wedge
#

just how can i make it not send eveything

earnest phoenix
#

@misty sigil frick

pure lion
#

i learnt mongoose in 30 mins

misty sigil
#

some1 poonged me

earnest phoenix
#

even more frick

#

uhhh defo not me

pure lion
#

@misty sigil haha funi ping mod

solemn latch
#

this will be super slow, but load the entire json db into memory, then parse it, and get the one guilds you want

drifting wedge
#

ok

earnest phoenix
#

me and the boys using fs to write in our jsons

drifting wedge
#

and if i were to use a proper db?

pure lion
#

this will be super slow, but load the entire json db into memory, then parse it, and get the one guilds you want
^^
TypeError: No

solemn latch
#

youll have to redo this every time a new guild creates a custom server message

earnest phoenix
#

and if i were to use a proper db?
@drifting wedge depends what db

drifting wedge
#

mongoose?

pure lion
#

mongoose best

#

all hail mongoose

earnest phoenix
#

in mongodb compass you can import json files

thick gull
#

you see I only use sqlite because I can't be bothered to setup a proper database hosting thing on my pc:)

drifting wedge
#

wait is is free?

earnest phoenix
#

fun fact

#

yes it's free

pure lion
#

also can someone help me

drifting wedge
#

ill check it out 1 sec

pure lion
#

nothing renders and there are no errors

solemn latch
#

databases are generally free

earnest phoenix
#

and you can edit data within compass

#

but only if u know what you're doing

solemn latch
#

is there any db that doesnt have a graphical interface where you can edit data

#

🤔

#

youd be hard pressed to find one imo

pure lion
#

sqlite

#

i think

earnest phoenix
#

yeah

thick gull
#

you need a sqlite reader

drifting wedge
#

wait woukd i have to rewrite the thing to store the messages?

#

also can i use json for prefixes?

solemn latch
#

please dont use it for prefixes

pure lion
#

also can i use json for prefixes?
n o

earnest phoenix
#

please no

thick gull
#

Your storing messages...???

drifting wedge
#

ok

#

welp ill try

solemn latch
#

your users will be so frustrated

pure lion
#

okay listen up 0Exe

earnest phoenix
#

wait u can use maps to store messages

#

btw

solemn latch
#

imagine users setting your bots prefix, and it resetting randomly

hybrid roost
#

is there any db that doesnt have a graphical interface where you can edit data
well, i am going to create db wIthout GUI

thick gull
#

is MongoDB like website thing generally okay to use? Or is it something to avoid

solemn latch
#

then not knowing how to use the bot, and bam

pure lion
#

you easybake oven, you chicken nugget. listen to what we're saying and get your head out of your ass

thick gull
#

he's gonna Create an DB

earnest phoenix
#

Imagine taking in raw SQL queries & having someone use SQL injection on ur boat

drifting wedge
#

welp i made a cluster

solemn latch
#

just looked it up, sqlite has a client

earnest phoenix
pure lion
#

welp i made a cluster
praise the lord

thick gull
#

Yeah but it's separate to the main thinf

drifting wedge
#

lmao

earnest phoenix
#

well u can use mongodb on desktop, inside your code editor (extension) or on website

drifting wedge
#

then how would i use it?

#

ill watch a yt vid

earnest phoenix
#

use it

#

that's how

solemn latch
#

not youtube

drifting wedge
#

but just simplify it pls

solemn latch
#

plox

pure lion
#

there is make user and connection string

earnest phoenix
#

DB Browser is for SQLite

thick gull
#

doesn't MongoDB have a limit on rows for free?

misty sigil
#

@thick gull no

#

just size

earnest phoenix
#

bruh who wants to write a whole essay for this guy but in json because he loves jsons

thick gull
#

oh

earnest phoenix
#

Thats on heroku, because heroku is shit

pure lion
#

doesn't MongoDB have a limit on rows for free?
me when the rows in nosql

thick gull
#

shush

solemn latch
#

heroku hosts it for free 🤔

pure lion
#

bruh who wants to write a whole essay for this guy but in json because he loves jsons
@earnest phoenix already did

misty sigil
#

Ok, so, what I've done is made my mongo database, but I'm still trying to make my auth system work

thick gull
#

I avoided MongoDB cause someone here said it had a limit

#

:(

misty sigil
#

every time I try to implement it it causes errors mmulu

drifting wedge
#

how would i like make it write to mongoose tho?

pure lion
#

Ok, so, what I've done is made my mongo database, but I'm still trying to make my auth system work
bitch stop copying me

misty sigil
#

bitch im not copying you

pure lion
#

bitch i made it first

earnest phoenix
thick gull
#

calm down ladies

pure lion
#

i get errors too tho

#

x)

drifting wedge
#

do i need to download it?

earnest phoenix
#

calm down lasses

drifting wedge
#

or like import it?

misty sigil
#

bITCh i'm using it for discord pereicvfxes and serber leaderbeorafds!

earnest phoenix
#

Calm down bros

pure lion
#

calm down ladies
is mtf trans<

earnest phoenix
#

aight guys on topic

pure lion
#

yes

misty sigil
#

how do i fix my mongo problem angrybirb

earnest phoenix
#

use the fix button

solemn latch
#

whats the errors

#

🤔

misty sigil
#

It just says connection refused whenever I try mongo in my ssh

earnest phoenix
pure lion
#

y-

misty sigil
#

Only after I've implemented my auth system

solemn latch
#

tell it not to refuse your connection

#

gosh

earnest phoenix
#

whitelist?

#

Maybe auth then 5head

#

on atlas

pure lion
drifting wedge
#

wait what do i connect it to?

misty sigil
#

No, I'm hosting my own cluster

earnest phoenix
#

oh ok

solemn latch
#

those with problems, and solutions

misty sigil
#

on my VPS

pure lion
#

o h

#

i should probably do that too

solemn latch
#

are you trying to connect remotely

pure lion
#

what

misty sigil
#

Nah, I'm trying to connect using the mongo shell

pure lion
#

are you do have ufw?

misty sigil
#

It works, until I break it with my account system

earnest phoenix
#

then don't break it

drifting wedge
#

like which one?

pure lion
#

It works, until I break it with my account system
then dont break it you grilled cheese sandwich

misty sigil
#

But then my data is accessable

#

and thats a big fucking no no

earnest phoenix
#

i choose the second one for nodejs

drifting wedge
#

i have python

earnest phoenix
#

Do you guys think it'd be worth the extra latency to use a remote DB for my sites multiple origin servers?

pure lion
#

Do you guys think it'd be worth the extra latency to use a remote DB for my sites multiple origin servers?
nyes

thick gull
#

nyes

#

?

misty sigil
#

nyes

earnest phoenix
#

nyess

#

wait shit im supposed to be fixing my bot

pure lion
#

same lmao

misty sigil
#

im supposed to be working on my mongo cluster

pure lion
#

im getting some weird ass _cache error

earnest phoenix
#

That code hurts my eyes

pure lion
#

:D

misty sigil
#

bUHT NOTHING WORKS

pure lion
#

my plraseet8hsdoah

#

bUHT NOTHING WORKS
@misty sigil DO YOU HAVE UFW

earnest phoenix
#

So much recursion

misty sigil
#

wtf is that

earnest phoenix
pure lion
#

wtf is that
firewall

misty sigil
#

No.

solemn latch
#

he is using the shell

#

ufw wouldnt affect that anyway

pure lion
#

Woo, excited for what im making yet AgAiN?

earnest phoenix
#

he is using the shell
the shell is using him

misty sigil
#

I'm telling you, I can connect from my PC to the database, UNTIL I add a user.

pure lion
#

the shell is using him
the shell was an inside job

#

I'm telling you, I can connect from my PC to the database, UNTIL I add a user.
well then dont add a use-

#

¯_(ツ)_/¯

misty sigil
#

But I have to, or I leak data everywhere

solemn latch
#

🤔

drifting wedge
#

so i go into my cmd?

#

like how to i connect it?

pure lion
#

mongosegedafhjgipdfhpoajerh

#

okay

#

get the connection stringf

#

asfgsa

misty sigil
#

thats atlas lmfao

solemn latch
#

your the one who suggested it

drifting wedge
#

i did

solemn latch
#

oof

drifting wedge
#

and i put it in my code?

solemn latch
#

how did i get on the atlas page

pure lion
#

mon🅱️oose.c⭕nnect

drifting wedge
#

wait wut?

earnest phoenix
#

If you've told ur DB to allow connections via ur local home IP, then 9 out of 10 chance its ur VPS firewall thats blocking it @misty sigil

drifting wedge
#

how do i connect it?

pure lion
#

If you've told ur DB to allow connections via ur local home IP, then 9 out of 10 chance its ur VPS firewall thats blocking it
my point exactly

misty sigil
#

wait i can do per IP?

earnest phoenix
drifting wedge
#

i have the code

pure lion
#

how do i connect it?
see example

misty sigil
#

I don't have a firewall.

solemn latch
#

unsecure vps

#

wow

earnest phoenix
#

Oh God

pure lion
#

lmao jeremy

misty sigil
#

At least a firewall that isn't blocking my mongo

pure lion
#

i have ufw installed you nut

earnest phoenix
#

I bet you use root as well with password login, right? @misty sigil

drifting wedge
#

sure

solemn latch
#

i mean, he said he can connect

drifting wedge
#

its just client?

solemn latch
#

until he adds a user

#

so it clearly isnt the firewall

pure lion
#

i use root but i have a firewall

#

also i cant be ASKED add any other users x)

solemn latch
#

using root is also bad security practice

earnest phoenix
#

I have root login disabled, smh

pure lion
#

why spam sudo when you can root

solemn latch
#

mines still enabled, but its keyed and passworded

earnest phoenix
#

Disable root login, disable password login, using a fresh user account, & using SSH will get you much better security

misty sigil
#

bigbrain

pure lion
#

mines still enabled, but its keyed and passworded
just like mine

solemn latch
#

you do understand that means any programs also have root privalges

earnest phoenix
#

The moment a bot or person gets ur root login, its gg for whatever project you had running

pure lion
#

:e

solemn latch
#

doesnt even need the root login, just get access to a program

earnest phoenix
#

^ That too

pure lion
#

npm i fuck-me-over-bot -g

solemn latch
#

my cat just bit my elbow pandasad

thick gull
#

my favorite npm package

solemn latch
#

for no reason

pure lion
#

ouch™️

earnest phoenix
#

Man this is making me paranoid, time to go check my VPS's security settings

pure lion
#

my cat is my elbow

solemn latch
#

fail2ban

#

ufw

#

proper security practicies

earnest phoenix
#

Someone else with common sense when it comes to basic Linux security

solemn latch
#

youll be fine

earnest phoenix
#

POGGERS

solemn latch
#

i obsess a bit over security

pure lion
#

i haaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaave uwufw

solemn latch
#

i reinstall windows from time to time when i get spooked.

#

just because i get spooked

pure lion
#

also go laugh at my code more but also try to help me

drifting wedge
#

wait

earnest phoenix
#

I OS reinstall every few months

quartz kindle
#

also using ssh keys instead of passwords

solemn latch
#

^

thick gull
#

i get panic attacks about my computers security mmulu which is why I make myself tired so I cna sleep without one

drifting wedge
#

what do i connect it?

#

im using py

#

and i dont get it

#

like do i add the connect thing to my code?

#

do i have to improt something?

pure lion
#

pip install mongoose? bruh

earnest phoenix
#

Linux basic security configuration:

  • Use & configure UFW correctly
  • Disable root login
  • Disable password login
  • Configure VPS to accept SSH only
  • Don't run programs as root
  • Use fail2ban
  • Don't configure SQL DB's to accept all IPs (a common mistake I see, for some reason)
  • Use different accounts for different projects/programs
#

Anything else I missed?

drifting wedge
#

i got it

#

but then do i import it?

pure lion
#

no

#

use pymongo

#

mongopy

#

whatever its called

drifting wedge
#

wut?!?

pure lion
#

ponogmy

solemn latch
#

different accounts for different programs when possible

pure lion
#
for i in range(1, 10):
  print(i)

i am a good programer

drifting wedge
#

wut?

#

like do i connect it?

#

i have the message

pure lion
#

idk

drifting wedge
#

what do i do

pure lion
#

i dont know

drifting wedge
#

i installed mongoose

earnest phoenix
#

Okay, so heres the updated list

pure lion
#

mongoose is js

earnest phoenix
#

Linux basic security configuration:

  • Use & configure UFW correctly
  • Disable root login
  • Disable password login
  • Configure VPS to accept SSH only
  • Don't run programs as root
  • Use fail2ban
  • Don't configure SQL DB's to accept all IPs (a common mistake I see, for some reason)
  • Use different accounts for different projects/programs
drifting wedge
#

so i cant use py?

pure lion
#

you can

#

with pymongo

astral yoke
#

anyone know why this says 404 not found var http = require('http'); var url = require('url'); var fs = require('fs'); const run = require('./mongodb.js') http.createServer(function (req, res) { var q = url.parse(req.url, true); var filename = "." + q.pathname; fs.readFile(filename, function(err, data) { if (err) { res.writeHead(404, {'Content-Type': 'text/html'}); return res.end("404 Not Found"); } res.writeHead(200, {'Content-Type': 'text/html'}); res.write(data); return res.end(); }); }).listen(8080); console.log('8080')

#

the error isss

thick gull
#

because it's 404 not found

astral yoke
#

no duh

thick gull
#

:)

astral yoke
#

thanks dude you found out

#

lol

thick gull
#

time to go back to my cave

pure lion
#

do you know how to read?

astral yoke
#
  errno: -4068,
  code: 'EISDIR',
  syscall: 'read'
}```
drifting wedge
#

wait wtf

#

ok bruh mongoose sucks

pure lion
#

sorry i only speak express

drifting wedge
#

its so fucking confusing

thick gull
drifting wedge
#

and it doesnt work with python well

#

i think anyways

pure lion
#

ok bruh mongoose sucks
for the last time use pymongo

drifting wedge
#

I AM TRYING

pure lion
#

dont make me ping shiv to explain it to you

drifting wedge
#

i have no fucking idea what im doing

pure lion
#

its ping shiv time

drifting wedge
#

i installed it with pip

astral yoke
#

its funny how yall shit on quick.db then when you switch to mongodb you shit on mongodb too

#

lmao

pure lion
#

its funny how yall shit on quick.db then when you switch to mongodb you shit on mongodb too
quick = shit

astral yoke
#

quick is shit

pure lion
#

quick = shit

#

mongoose / pymongo = less shit

drifting wedge
#

whats the easiest way to do it?

astral yoke
#

todo what

#

database the easiest is quick.db

drifting wedge
#

prefixes, and welcomne messages

#

and channels

#

with py

astral yoke
#

quick.db

#

ez

#

oh

#

idk

thick gull
#

just write it all down manually KEKW

pure lion
#

whats the easiest way to do it?
navigate to your windows folder and delete the system32 dir, you'll have a few errors but it'll run okay afterwards

solemn latch
#

quickdb i actually really dont like.
most other databases i think have a purpose

earnest phoenix
#

SQLite? @drifting wedge

drifting wedge
#

ok how do i do that

#

lmao

solemn latch
#

quickdb is a good learning db, other than that. no

pure lion
#

assuming youre on windows

drifting wedge
#

does sqlite work with py?

#

yep

earnest phoenix
#

Yes, SQLite3 is built into Python 3.x by default

drifting wedge
#

so how would i connect it?

earnest phoenix
#

Just get yourself an async library to run with it

#

Google

#

merhaba türk var mı

pure lion
earnest phoenix
#

@pure lion bir soru soracaktım developmentle ilgili

#

I like how the mods just can't deal with Turkish speakers, so they literally assign #memes-and-media to deal with it

solemn latch
#

yeah

pure lion
#

i dont turkish

solemn latch
#

its like that with any non English language

thick gull
#

British or American English?

earnest phoenix
#

Tends to happen when they lose their only Turkish speaking mod I guess

pure lion
#

@glass swallow🅱️aco my favorite mod

#

oops

#

British or American English?
british

quartz kindle
#

there are still turkish-speaking mods afaik

drifting wedge
thick gull
drifting wedge
#

this is like the perfect vodep

#

it explains how to do welcome messages with sqlite

pure lion
#

tim can you cpp

quartz kindle
#

barely

#

just enough to make bindings to c libs for node

earnest phoenix
#

YouTube videos about Discord.py are shit in nature, because kids who have no idea what they are doing get into it, & a lot of times get bad information

astral yoke
#

im getting this [Error: EISDIR: illegal operation on a directory, read] { errno: -4068, code: 'EISDIR', syscall: 'read' } on this var http = require('http'); var url = require('url'); var fs = require('fs'); //const e = require('./mongodb.js') http.createServer(function (req, res) { var q = url.parse(req.url, true); var filename = "." + q.pathname; fs.readFile(filename, function(err, data) { if (err) { console.log(err) res.writeHead(404, {'Content-Type': 'text/html'}); return res.end("404 Not Found"); } res.writeHead(200, {'Content-Type': 'text/html'}); res.write(data); return res.end(); }); }).listen(8080); console.log('8080') so why

earnest phoenix
#

If you really wanna get into it though, I suggest doing that but mixing in an actual Python course, so you can actually learn & not make stupid mistakes like using an on_message event to handle commands like an idiot, like a lot of the YouTube videos do

quartz kindle
#

you cant use readFile on directories

#

you have to use readdir

pure lion
#

just enough to make bindings to c libs for node
would you know about rendering and shit

quartz kindle
#

nope

pure lion
#

fuc

solemn latch
quartz kindle
#

what kind of rendering?

pure lion
#

all hope is lost

#

game engine stuff

#

raster to be precise

quartz kindle
#

you're trying to make a game engine?

pure lion
#

yup

#

second one, first was the ray caster boi

quartz kindle
#

awesome

pure lion
#

:D

earnest phoenix
#

pls

sinful belfry
#

@earnest phoenix really? you go do it in another channel?

misty sigil
#

rly dude

sinful belfry
#

last chance

#

you'll be banned next time

pure lion
#

what is this

misty sigil
#

do it one more time and beaned

earnest phoenix
#

no

#

pls

misty sigil
#

no ads

earnest phoenix
#

why

sinful belfry
#

then stop!!!

misty sigil
#

did you even read the rules

pure lion
#

i will personally bean you

sinful belfry
#

anyways, this is not development related

pure lion
earnest phoenix
#

i can't put it on the site invite him pls

pure lion
#

did you just advertise

earnest phoenix
opal plank
#

yikes some people dont learn

earnest phoenix
#

Just mute this kid already, hes obviously not the brightest blobcatban

sinful belfry
#

@earnest phoenix can you see what the channel description says?

earnest phoenix
#

ah

sinful belfry
#

or even the name of this channel?

pure lion
#

not the brightest is an understatement also off topic

misty sigil
#

can we not emoji spam its annoying af

earnest phoenix
#

ops.......................

misty sigil
#

so lmfao

#

i had to reset my vps to the backup

pure lion
#

what did you do?

earnest phoenix
#

Pls do tell

solemn latch
#

feels bad man

pure lion
#

horror stories with clacson

misty sigil
#

borked the mongo install so badly i had to reinstall

solemn latch
#

f

pure lion
#

borked

solemn latch
#

i have luckily avoided having to restore from a backup for my vps

#

im looking to buy some block storage here soon, spooked ill break something then

#

hopefully never so bad i have to reinstall tho

pure lion
#

how do i completely clear my vps?

solemn latch
#

install the os again

pure lion
#

\

misty sigil
#

heY i fixed it

pure lion
#

im trying to take off the enter keycap sorry mods

misty sigil
#

hey wait wtf

#

i restored it to a point that the mongo works

#

im the engineer

#

and that means i solve problems

opal plank
#

Exactly like the old grandmas. Slap it till it works again

faint prism
#

how do i completely clear my vps?
@pure lion or request it be reset/reprovisioned

earnest phoenix
#

Do you publish the code of your bots on github?

misty sigil
#

no

earnest phoenix
#

Why

thick gull
#

because I don't care if someone wants to copy my code(?)

earnest phoenix
#

mm

solemn latch
#

my code is on github, but in a private repo

drifting wedge
#

ok honestly

#

idgaf

#

im using json

#

for now

#

i just need it so not spew out the intire file

solemn latch
#

you kinda have to get the entire file

#

then parse what you want

drifting wedge
#

i have a welcome thing, how can i make it so it doesnt sent the enitre json file?

#

yep

#

sorry

#

it has the server ids

solemn latch
#

yeah, parse what you want from it

drifting wedge
#

...

misty sigil
#

you need to parse it

#

JSON.parse() afaik

drifting wedge
#

afaik?

misty sigil
#

as far as i know

drifting wedge
#

its set for 2 servers right

#

when someone joins it sends this

#

{'740715653295767562': 'Welcome (ping)', '666016790140157992': 'welcome (user)'}

misty sigil
#

idk dude

#

i don't use json databases

solemn latch
#

parse it

drifting wedge
#

its the server ids, and the message

solemn latch
#

i mean it takes 2 seconds to google

drifting wedge
#

yes, but what would i parse it as?

tranquil marlin
#

helo, im trying to create a channel and give it permission for specific user