#development

1 messages Ā· Page 965 of 1

hallow lance
#

Glitch?

restive furnace
#

its not library

hallow lance
#

Literally what the.

#

I'd recommend you learning the language you're trying to code on.

dawn trout
#

??

#

I dont know anything

#

^_^

hallow lance
#

Then go learn how to code.

dawn trout
#

^>^

copper cradle
#

that's not a library

dawn trout
#

Idk what the subject

hallow lance
#

subject?

dawn trout
#

in codeacademy

#

have a lot

copper cradle
#

@dawn trout where are you from

dawn trout
#

idk

#

Cambodia

restive furnace
dawn trout
#

I know

#

its that code

#

but what subject

#

or what

restive furnace
#

wdym by "subject"?

hallow lance
#

Subject, what do you mean.

frigid cave
#

I am trying to make bot profile picture animated on bot page , but my code is not working , if someone can help I will really appreciate it !

.bot-img {
    -webkit-animation: mover 3.0s infinite alternate;
    animation: mover 3.0s infinite alternate;
    -webkit-animation-timing-function: ease-in-out;
    animation-timing-function: ease-in-out;
    -webkit-animation-iteration-count: infinite;
    animation-iteration-count: infinite;
}
</style>```
slender thistle
#

Did you create the mover

frigid cave
#

No

#

Well , is there a doc about it that I can read ?

restive furnace
#

google

frigid cave
#

mhm

stuck scaffold
#

I check with the snekfetch whether the user has voted

restive furnace
#

dont use snekfetch, use node-fetch or axios, snekfetch is deprecated.

stuck scaffold
#

this error didn't exist a few days ago

restive furnace
#

did you update some package

stuck scaffold
#

I moved the bot from x VDS to y VPS and this error started to appear

#

modules latest version

restive furnace
#

well when you did npm install, probably some package did get update

#

sometimes there comes breaking chamges

dawn trout
#

Who can help me make some commands

#

😦

pure lion
#

Ok so I made an oopsy

#

How do I pick from a map at random?

green kestrel
#

can anyone here remember which api endpoint it is to grant or remove a role from a user please?

#

i dont usually dabble in raw api endpoints, cant remember

mossy vine
#

@green kestrel DELETE /guilds/${guild}/members/${member}/roles/${role}

#

PUT for giving

#

DELETE for removing

#

also yikes i pasted twice

green kestrel
#

thanks! šŸ˜„

spice smelt
#

Hey there. I'm using a reverse-engineering API of my school's online service. On this service, there's a mailbox, but the thing is that all the message contents are encrypted or idk. Knowing the input and the output of the encryption, is there any way to get the encryption key? I suspect the encrypted code to contain the layout too. I noticed that the characters PHA are used a lot. Any ideas of how I could find the encryption key?

#

There's also the \n that isn't changed, so I can know where are the paragraphs

earnest phoenix
#

@stuck scaffold just try and see.

earnest phoenix
#

how do i define a channel that i want to send a message in?

glossy elk
#

Uh you can cache the channel

#

Or you cAn send it to the same channel the command was ran

earnest phoenix
#

how do i do that?

#

ok

#

yanks

glossy elk
#

You just send it via <message>.channel.send("text")

#

Sorry I’m on mobile so it’s harder to write

earnest phoenix
#

what is the text to set an embed to white?

glossy elk
#

.setColor

#

.setColor(put#fffftowhitefff)

#

Hold up

#

Nvm

granite girder
#

or .setcolor([255,255,255])

glossy elk
#

Yeah

#

I didn’t know what the #FFFF of it was

earnest phoenix
#

Is there a command to make a prefix changeable

glossy elk
#

You can use commando or you can setup your own

granite girder
#

you could make a mysql table where you can change the prefix with a command

earnest phoenix
#

How do I do that?

glossy elk
#

YouTube

earnest phoenix
#

Ok

glossy elk
granite girder
#

If you want to make it with mysql i recomend using phpmyadmin

earnest phoenix
#

Is there a way of making text go onto a new line?

granite girder
#

\n

earnest phoenix
#

Ok

granite girder
#

in a string

earnest phoenix
#

Might just be me being dumb but the status of my bot doesn’t seem to be changing or updating. Little help here? Here’s my code. Also, the console.logs are just for debugging to see if the code reached there. "were here" was printed but "here again" and "woooohoo" was not.

console.log("were here")
    setInterval(() => {
      console.log("here again");
      let botStats = JSON.parse(fs.readFileSync("./botStats.json", "utf8"));
      this.bot.editStatus({name: `raiding ${botStats.guilds} servers`});
      console.log("woooohoo")
    }, 3600000);
#

It was stuck being empty for hours.

granite girder
#

this.bot.user.setActivity()

earnest phoenix
#

wat

#

pretty sure it’s .editStatus

#

im using eris

#

not d.js

granite girder
#

sorry wrong programming language

#

i don“t know anything about eris

quartz kindle
#

the language is the same lol, both are javascript

earnest phoenix
#

^

#

its just a different library

granite girder
#

~į½ ~

opaque seal
#

I wanna create a website where there is like a 3d space ship that you can rotate and move around and when you click on a certain spots some interface pops up and show different info about my discord bot, but it seems really complicated and not doable only with html css and js. Anyone has any input, is there a preferred way to do this?

earnest phoenix
#

thats like creating a browser game

opaque seal
#

Kind of

quartz kindle
#

@earnest phoenix try .editStatus("online",{name:"your text here"})

earnest phoenix
#

šŸ‘ hold on

quartz kindle
#

if it doesnt work, maybe you need to specify the type as well

#

@opaque seal its totally doable with css and js

opaque seal
#

Whaaat

quartz kindle
#

css supports 3d transforms and animations

opaque seal
#

A whole 3d object

#

But it will be a pain

quartz kindle
#

yup

granite girder
#

@opaque seal i`ve seen this package but you need to setup a nodejs server

quartz kindle
#

check this out

earnest phoenix
#

its the same and it looks like it’s because the interval was not even reached somehow because ā€œhere againā€ was not logged in the console

#

imma try and see if botStats.guilds is even reachable because i got it from a JSON file

quartz kindle
#

@earnest phoenix do you run that code outside of the interval too?

#

because the interval will run for the first time only after the timer

earnest phoenix
#

what code?

#

let me try something i guess

quartz kindle
#

if you want to run something immediately, you need to run it once without the interval, then create the interval

earnest phoenix
#

intervals run in timeouts too right?

#

because i need time for all the clusters and shards to launch

quartz kindle
#

you mean creating an interval inside a timeout?

#

yes you can do that

earnest phoenix
#

alr lemme try

#

thanks i fixed it by putting the interval inside the timeout

opaque seal
#

When generating an ssh key from my windows pc it asks to replace the comment of the key with the username of the pc user, this has to be the username of my windows pc right? Not the ubuntu server I want to connect to

digital ibex
#

hi

#

how can i filter the guilds i have a certain permission with?

#

i only have the permission bit thingy, using js

granite girder
#

@opaque seal do you want to remote develop on a ubuntu server?

opaque seal
#

No

#

I need to connect using mobaXterm

#

And filezilla

granite girder
#

then i have no idea

radiant estuary
#

i dont want to advertise the site. so i dont't give a link, sorry

sacred oyster
#

how do u make it so it doesnt respond to other bots

granite girder
#

@sacred oyster which programming language?

sacred oyster
#

discord.js

granite girder
#

if(msg.author.bot) return

sacred oyster
#

ok thanks

#

@granite girder now when i do any command the bot says it 2 times

#

oh wat

#

now it isnt

dawn trout
#

Hello

#

Anyone can help me ? i will be appreciated

granite girder
#

yes

earnest phoenix
#

I'm having a token invalid error with my bot. I'm not quite sure what's happening as it only seems to have started happening this morning. I've rebooted, upgraded discord.js and upgraded all of my system packages. I've also changed my bot's token. I've also never had this issue before in the past. What's going on and how do I fix it?

digital ibex
#

keep on regenning it

earnest phoenix
#

Does Discord make your bot's tokens invalid after a certain amount of time?

summer torrent
#

no

white anvil
#

the only two cases where your bot token will be regenerated by discord is if you hit the identify limit or if you upload the token to github

digital ibex
#

yello

eternal adder
digital ibex
#

on my bots dashboard, it shows all the users guilds even which they don't have perms to manage. how can i filter it to only show the servers they have perms in?

#

using js

placid cobalt
#

does anyone know how to make a webdashboard for my bot?

tropic cedar
placid cobalt
#

how big is your prefix? one character?

tropic cedar
#

yes only one

#

and it reacts to everyhing

placid cobalt
#

i would assume you should just be able to delete .length and it should work

#

in theory anyway

tropic cedar
#

let me try it

placid cobalt
#

ok

tropic cedar
#

nah it didnt work

placid cobalt
#

then i have no clue. sorry

granite girder
#

if(msg.content.startswith(prefix)){}

pale vessel
#

more like return if it doesn't

tropic cedar
#

how can i make that message command

if(msg.content.startswith(prefix)){}

#

oh lmt

#

ill write back

#

thanks for suggstin

pale vessel
#

don't do that, it makes the code dirtier

tropic cedar
#

idk but i need a solution

pale vessel
#

make it return instead when the message doesn't start with the prefix

tropic cedar
#

hm

#

oh yes

#

thats a good idea 2

#

let me try to implement it then ill come back

pale vessel
#

so something like if (!<Message>.content.startsWith(prefix)) return;

tropic cedar
#

should i put that to near the first lines after if message

#

bruh

#

oh nvm

#

solved it

#

it was about

#

i forgot

#

to remove the old code :((

#

now it works and only reacts to my prefix thanks flazepe and others that helped!

earnest phoenix
#

I have a question. I have a bot which recently crossed 1k servers (1022 servers) and sometimes when bot is added to new servers, it restarts.
Does that mean i need to use Shards now?

#

if the bot is not added to new servers, the bot doesn't restarts...

modest maple
#

that seems more like a flaw in your code

#

you need to shard at 2.5k other wise the bot wont start

vernal vapor
earnest phoenix
#

hmm ok

tight plinth
#

so i did this code in my bot but when i add a reaction nothing appears in console wtf

tropic cedar
#

semicolons maybe

#

or try adding +' ' to the end of reaction and user console logs

earnest phoenix
slender thistle
#

Are you sure the message is cached

earnest phoenix
#

try this

tight plinth
#

how can i cache all messages from a server

#

(this bot is only for my personal server)

white anvil
#

you cant

#

you would need to recursively call getMessages on every restart or store them in a db

tropic cedar
#

use carlbot logs instead but they only notify you if a message deleted or edited

digital ibex
#

its not as simple as that

earnest phoenix
#

you will need to have a good knowledge of Html, css, js (for making website) and http requests (for requesting the data entered by user and adding them to bot)

digital ibex
#

you don't need to have good knowledge of html and css

quartz kindle
#

@vernal vapor those rectangles are text, some unicode character

#

@tight plinth discord.js v12 has partials for that, to enable reaction events on uncached messages

tight plinth
#

oh

digital ibex
#

with express, how can i make a url like servers/server-id with express?

mossy vine
quartz kindle
#

app.get("/servers/:id")

digital ibex
#

like ```js
app.get('/servers/server-id', () => {
// do sutff
});

#

oh ok

#

thank u

quartz kindle
#

example

#
app.get('/users/:userId/books/:bookId', function (req, res) {
  res.send(req.params)
})
#

req.params holds the url parameters used, ie req.params.userId = whatever the person wrote in the userId parameter

digital ibex
#

oh

#

in my middleware routes, what would it look like?

#

like app.use('/guilds/:id') too?

tight plinth
#

@tight plinth discord.js v12 has partials for that, to enable reaction events on uncached messages
@quartz kindle cant find them ;-;

quartz kindle
tight plinth
#

ok

quartz kindle
#

@digital ibex pretty sure that yes

digital ibex
#

ah, ok. thanks :)

torn ravine
#

I wanna get started on this bot ban system

digital ibex
#

o ok. thank u

digital ibex
#

@quartz kindle im confused with the middleware routes, it looks like: ```js
app.use('/guilds/:id', path);

#

how can i make the :id be the guild id?

earnest phoenix
#

when i use my clear command like example: -clear 44 but theres only lets say 6 messages in the channel, it will purge the 6 messages and then say 44 Messages Have Been Cleared! how do i make it say 6 Messages Have Been Cleared! even tho i typed 44? discord.py btw.

#

i want it to say the amount of messages that it actually cleared.

#
@commands.has_permissions(manage_messages=True)
async def clear(ctx, amount : int):
    await ctx.channel.purge(limit=amount)
    await ctx.send(f'**{amount}** Messages Have Been Cleared!', delete_after=5)``` thats my current code
#

is there a way to code a command that sets a log channel and it logs when a message was deleted

#

Use messageDelete event

slender thistle
#

@earnest phoenix fyi purge() returns the list of deleted messages

digital ibex
#

look for how many messages r in the channel (100 max), and if there r more than, lets say 44 in ur case, if its above 44 then just do nothing else and carry on with the command, otherwise u can maybe change the value of 44 to 6 ?

slender thistle
#

Get length of that list

earnest phoenix
#

@slender thistle what exactly do you mean?

earnest phoenix
#

do i take out amount

#

ok

slender thistle
earnest phoenix
#

ill read

earnest phoenix
#

@slender thistle its not working

slender thistle
#

Show your code

earnest phoenix
#
@commands.has_permissions(manage_messages=True)
async def clear(ctx, amount : int):
    await ctx.channel.purge()
    await ctx.send(f'**{}** Message(s) Have Been Cleared!')```
#

i dont even understand the docs tbh

slender thistle
#

Don't remove the limit argument from purge

#

You just assign it to a variable and then len() that variable

earnest phoenix
#

ye i dont understand never used len()

#

len() returns the length of the provided array or string

slender thistle
#

len(some_list) returns number of elements in that list

indigo flax
#

anyone?

slender thistle
#

Just ask your question

indigo flax
#

@slender thistle anyone who knows python and can help me do dm on join and activity set (changing)?

earnest phoenix
#

this is so confusing bruh

slender thistle
#

Activity changing every X minutes?

indigo flax
#

ys

#

yes

slender thistle
#
variable = .purge()
return len(variable)``` @earnest phoenix
indigo flax
#

?

earnest phoenix
#

where do i put that bro

slender thistle
#

You don't copy that

#

Try to understand what each line does first

foggy river
#

How do you test bots in this server?

slender thistle
#

Function purge() returns a list, which will be stored in variable
Then, you want to get a number of elements in a list under variable variable, hence the len(variable)

earnest phoenix
#

i dont understand at alllllllllllllll

#

then learn pythonnnnnnnnnnn

#

just nvm dude

indigo flax
#

um

slender thistle
#

I'm not sure how else to break it down for you

earnest phoenix
#

all good ill just leave it its wtv

slender thistle
#
def get_list():
    return [1,2,3]

my_var = get_list() # got [1,2,3] returned from function get_list
# to get the length of [1,2,3] returned in my_var, use len(my_var)
print(len(my_var)) # 3, because there's 3 elements in the list```
quartz kindle
#

@digital ibex if you define it as /guilds/:id then someone navigates to yourwebsite.com/guilds/123456789 you will get 123456789 in your req.params.id variable

#

if you define it as /guilds/:bla then you would use req.params.bla to get whatever the person wrote after /guilds/

earnest phoenix
#

how can i log when a message has been deleted

pale vessel
#

check out the message delete event for your library

indigo flax
#

how come this doesnt work?

#

await bot.change_presence(activity=discord.Game(name="."))

earnest phoenix
#

await bot.change_presence(status=discord.Status.online, activity=discord.Game("namehere"))

#

try that

#

@indigo flax

indigo flax
#

didnt work

#

@earnest phoenix

#

await bot.change_presence(status=discord.Status.online, activity=discord.Game("yeet"))

slender thistle
#

What's the error

earnest phoenix
#

hum

#

works for me

#

where are you putting this

indigo flax
#

AttributeError: module 'discord.ext.commands.bot' has no attribute 'change_presence'

earnest phoenix
#

hmm

indigo flax
#
2020-06-09T14:44:29.328841+00:00 app[worker.1]: --------
2020-06-09T14:44:29.328842+00:00 app[worker.1]: Bot is up and running.
2020-06-09T14:44:29.328910+00:00 app[worker.1]: Ignoring exception in on_ready
2020-06-09T14:44:29.330199+00:00 app[worker.1]: Traceback (most recent call last):
2020-06-09T14:44:29.330240+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/client.py", line 307, in _run_event
2020-06-09T14:44:29.330241+00:00 app[worker.1]:     yield from getattr(self, event)(*args, **kwargs)
2020-06-09T14:44:29.330289+00:00 app[worker.1]:   File "bot.py", line 22, in on_ready
2020-06-09T14:44:29.330290+00:00 app[worker.1]:     await bot.change_presence(status=discord.Status.online, activity=discord.Game("Hidden"))```
slender thistle
#

Everything but the error itself

#

Ah

#

What is bot

indigo flax
#

i use client

#

not bot

slender thistle
#

What's bot defined as

indigo flax
#

its not defined

#

client is

amber fractal
#

Did you copy paste something

indigo flax
#

let me try not

#

now

#

i change from await bot.

#

to

#

await client.

midnight blaze
#
 
if(cmd == 'ger'){
        let channelger = message.guild.channels.cache.find(channel => channel.name = userInfo8.channelname)
//userInfo8.channelname:This is a string from a database,it stands for the saved channelname by user.
        channelger.toString()
        msgchannel = message.channel.name
      if(message.channel.name.toString() === channelger){
message.channel.send("Test")
}

So, I dont get any error messages, nothing happens simply. In my console, I dont see anything going on that is weird, but the command still doesnt work.

#

What could be wrong thinKappa I am not sure how this doesnt work

quartz kindle
#

why the extra ) ?

midnight blaze
#

ah, just a typo

#

That isnt in my code, dont worry

indigo flax
#

still doesnt work

pale vessel
#

channel.name = userInfo8.channelname

#

===

quartz kindle
#

calling .toString() on a variable doesnt change the variable, just returns a stringified version of it

indigo flax
#
2020-06-09T14:50:21.315642+00:00 app[worker.1]: --------
2020-06-09T14:50:21.315642+00:00 app[worker.1]: Bot is up and running.
2020-06-09T14:50:21.315663+00:00 app[worker.1]: Ignoring exception in on_ready
2020-06-09T14:50:21.316861+00:00 app[worker.1]: Traceback (most recent call last):
2020-06-09T14:50:21.316935+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.6/site-packages/discord/client.py", line 307, in _run_event
2020-06-09T14:50:21.316936+00:00 app[worker.1]:     yield from getattr(self, event)(*args, **kwargs)
2020-06-09T14:50:21.316936+00:00 app[worker.1]:   File "bot.py", line 22, in on_ready
2020-06-09T14:50:21.316937+00:00 app[worker.1]:     await client.change_presence(status=discord.Status.online, activity=discord.Game("Hidden"))
2020-06-09T14:50:21.316937+00:00 app[worker.1]: TypeError: __init__() takes 1 positional argument but 2 were given```
midnight blaze
#

@quartz kindle oh, you are correct about this, completly forgot that
@pale vessel I should use === ah

#

ok

#

xD

#

thanks guys

quartz kindle
#

you should first check if channelger exists, since it might not exist

#

no need to call .toString() on anything

midnight blaze
#

yup, this is a better way to handle that

#

thanks

indigo flax
#

anyone?

#

my logs

slender thistle
#

Show your code

indigo flax
#

``await client.change_presence(status=discord.Status.online, activity=discord.Game("hidden"))

await client.send_message(member, "hidden")``
#

@slender thistle

slender thistle
#

uhhhhhhh

indigo flax
#

its

#

discord.py==0.16.12
asyncio

slender thistle
#

Can't you people use up-to-date versions...

indigo flax
#

python-3.6.4

#

@slender thistle what will the code be

slender thistle
#

Use game instead of activity

indigo flax
#

ok

#

what about the second one?

#

dm on join

#

@slender thistle

#

@slender thistle

#

@slender thistle await client.change_presence(status=discord.Status.online, game=discord.Game("hidden"))

#

like that?

slender thistle
#

You don't need to... mention me multiple times

#

Try it

indigo flax
#

ok

#

what about

#

second one?

#

the dm on join

slender thistle
#

Use on_member_join event

indigo flax
#

await client.send_message(member, "hidden")

#

what to change @slender thistle

#

cause it doesnt work

slender thistle
#

Show your event code

#

What are you putting under the event

indigo flax
#

WDYM

#

@slender thistle

slender thistle
#

What did I say about mentions

modest maple
#

1 mention a minute

indigo flax
#

?

#

but pls

#

ur not paying attension

#

attention

slender thistle
#

because I have a reason to not respond immediately?

indigo flax
#

ok

#

what to fix

slender thistle
#

What are you putting under the event

indigo flax
#

await client.send_message(member, ""

slender thistle
#

First of all, do you have a member variable?

indigo flax
#

await client.send_message(member, "hidden")

#

like this?

modest maple
#

thats outdated

#

like, 3 years outdated

indigo flax
#

await client.on_member_join(member, "Welcome.")

modest maple
#

thats outdated
like, 3 years outdated

slender thistle
#

What...

#

You don't send a message with on_member_join, logically speaking. Do you?

indigo flax
#

just tell me what to do

#

im just learning

#

i used to do java

slender thistle
#

logically speaking

indigo flax
#

how

slender thistle
#

I thought you were supposed to know that...

modest maple
#

first of, How much python do you actually know

earnest phoenix
#

is there a way of coding a command that turns on/off other features

modest maple
#

yes

#

its called a check

earnest phoenix
#

is there a website explaining that?

indigo flax
#

ITS DOENST WORK

#

:(]

slender thistle
#

aaaaaaaaand

modest maple
#

@earnest phoenix if active do this->

slender thistle
#

what's the error

indigo flax
#

await client.change_presence(status=discord.Status.online, game=discord.Game("hidden"))

#

u told me to change activity to game

modest maple
#

out of 100% Curosity

indigo flax
#

@slender thistle

modest maple
#

Where df are you getting these bits of code

indigo flax
#

people

slender thistle
#

I'm literally here

#

I said stop mentioning me

indigo flax
#

can u pls pls help

#

:(

slender thistle
#

Learn to be patient

modest maple
#

first of, How much python do you actually know

earnest phoenix
#

@modest maple what do you mean?

modest maple
#

@earnest phoenix Litterally just checking a value

austere gale
#

const queue = message.client.queue.get(message.guild.id);
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'get' of undefined

earnest phoenix
#

oh ok

austere gale
#

what do i do

slender thistle
#

message.client.queue is undefined

austere gale
#

oh

indigo flax
#

@edgy girdereco

modest maple
#

Bruh

austere gale
#

also how do i use multiple api keys in the same code

slender thistle
austere gale
#

as in the same music module

indigo flax
slender thistle
#

Multiple API keys?

austere gale
#

:blueshroom:

#

like more than one keys

digital ibex
#

@quartz kindle req.params is an empty object, how can i change that?

austere gale
#

for youtube

slender thistle
#

Store them in an array and choose one randomly if the same API

austere gale
#

oh ok

modest maple
#

i dont think you can have multiple API keys

austere gale
#

you can

quartz kindle
#

@digital ibex it shouldnt be empty if the used typed something in the url

digital ibex
#

wym?

quartz kindle
#

hmm

#

are you using a middleware router?

glossy elk
#

What are server member intents/prescence intents>

digital ibex
#

im doing res.send(req.params) btw

#

yeah

quartz kindle
#

check this

digital ibex
#

app.use('/guilds/:id', guilds);

glossy elk
#

What are server member intents/prescence intents>

digital ibex
#

uhhh, how would i do that?

quartz kindle
#

you probably want the second option

#

router middleware

digital ibex
#

oh

glossy elk
#

That isn't very helpful.

digital ibex
#

thats what it is, read it and it explains

glossy elk
#

Are those permissions?

digital ibex
#

no

quartz kindle
#

when you connect to discord, discord sends you EVERYTHING by default

#

all possible things that happen

glossy elk
#

Then what are they?

quartz kindle
#

gateway intents are a way to tell discord "send me only these"

#

that way discord will only send you the data you want and need, instead of everything

glossy elk
#

Thank you Tim cough

quartz kindle
#

for example, if you specify GUILD_MESSAGES in your intents

#

discord will send you only these

#

and nothing else

glossy elk
#

So if I don't need any of those events sent to me, I wont check intents?

digital ibex
#

tim, same thing

quartz kindle
#

yes you configure your intents with only the data you want

digital ibex
#

and that was what i was doing before btw

quartz kindle
#

did you add the router option?

#

express.Router({mergeParams:true})

glossy elk
#

What is data_retention_description ?

digital ibex
#

oh

quartz kindle
#

ah you're doing the verification form

#

you need to describe what kind of data your bot saves about its users

#

and what kind of security measures does your bot and database take

#

the part about intents is if your bot uses member and presence data

#

for example if your bot has welcome messages, or anything that uses memberAdd/memberUpdate/memberRemove, you need to enable the GUILD_MEMBERS intent

#

and if your bot uses presenceUpdate or checks for user online status, etc, you need the PRESENCES intent

digital ibex
#

ah ha

#

thanks tim

#

also, is there a way for me to delete it?

#

like, if its not a proper server id, send them to the 404 page?

pale vessel
#

try going to a proper guild

#

send me the result

glossy elk
#

@quartz kindle Can you dm rq?

digital ibex
#

its gonna be the same

pale vessel
#

what is the point of that then?

digital ibex
#

like {"guildId": "the id"}

#

wdym

#

how else would i do it then

pale vessel
#

if it has no way of detecting a real guild, then what is it for?

quartz kindle
#

yeah you should use that param to get data about the guild from some database or discord or whatever

#

if it doesnt exist then show an error

#

or a 404

digital ibex
#

uhh, idk any other way to do it

earnest phoenix
#
  async def amiadmin(self, ctx):
    if ctx.author.id in self.config.owners:
      return await ctx.send(f"Yes {ctx.author.name}, you are an admin. āœ…")```
digital ibex
#

oh

earnest phoenix
#

is anything wrong here

digital ibex
#

yes

pale vessel
#

just do something like {"guildId":null} if it's not a real guild

earnest phoenix
digital ibex
#

ur not checking anywhere if theres a message to be sent, so nothing is like triggering it to say it

#

or

#

its spamming it

earnest phoenix
#

can anyone help me ^

glossy elk
#

@quartz kindle I am not sure what to write for our data retention, may I have a n example/template?

digital ibex
#

tim, im so confused

quartz kindle
#

@glossy elk do you have a database?

#

or a json file?

glossy elk
#

Yes

quartz kindle
#

what do you save in it?

glossy elk
#

But it only stores stuff such as dadjoke responses, or just a list of responses.

quartz kindle
#

no users ids or guilds ids or user/guild configuration?

#

no custom prefixes?

#

no logs channels?

glossy elk
#

no custom prefixes?
@quartz kindle I think I handle those via discord.js commando

#

@quartz kindle And the bot is not mained for moderation nor does it have any moderation commands, a log channel wouldn't be necessary.

digital ibex
#

i think he's asking about ur guilds config

#

not specifically tho

glossy elk
#

I get what he means but I don't really store many things.

quartz kindle
#

discord is asking you want kind of information your bot saves. if your bot saves custom prefixes, then you need to explain what it saves and why

glossy elk
#

I see

quartz kindle
#

for example "this bot stores guild IDs in order to track custom settings"

#

they also want to know for how long you store them

#

for example "settings are stored only while the bot remains in the guild and are deleted once the bot leaves"

glossy elk
#

Our application store such things as Guild IDs, we may store guild ID to be able to track custom settings/prefixes. We may store track message-ids to be able to find the certain messages that has been ever posted.

quartz kindle
#

something like that yeah

glossy elk
#

It has to be 100 messages so brb

earnest phoenix
#

Anyone know any good programs to design dashboards in

#

Thanks in advance

digital ibex
#

u can use a pen and paper

#

thats what i use

quartz kindle
#

design which part? you mean the user interface?

#

or the backend?

earnest phoenix
#

Interface

golden condor
#

ejs

earnest phoenix
#

Go all the rest just wondering for the interface

digital ibex
#

vue

quartz kindle
#

well some people design websites in photoshop

golden condor
#

ejs is good

digital ibex
#

i recommend vue, but its kinda hard to interact the frontednw ith backend

quartz kindle
#

i mean, those are frameworks

digital ibex
#

hard for me anyways

golden condor
#

ejs is html

#

but easier to interact with backend

digital ibex
#

tim, what did u mean by "yeah you should use that param to get data about the guild from some database or discord or whatever"

quartz kindle
#

well

#

what do you want to happen when a user navigates to /guilds/someid?

glossy elk
#

@quartz kindle What about => HOW HAVE YOU SECURED ACCESS TO YOUR SYSTEMS AND INFRASTRUCTURE?

digital ibex
#

navigate them to the actual dashboard

#

like where u can change the config of the bot

quartz kindle
#

what is the dashboard supposed to contain?

glossy elk
#

I am officially lost

quartz kindle
#

@glossy elk where is your bot hosted and how is your hosting security

digital ibex
#

like, the prefix, logs channel, mute role, nickname of the bot, custom command thingy and the automod module

glossy elk
#

DigitialOcean?

quartz kindle
#

do you use ssh?

glossy elk
#

yes

quartz kindle
#

do you use ssh keys?

#

or username+password?

glossy elk
#

Yes

#

Obviously.

quartz kindle
#

which one?

glossy elk
#

Wdym which one

#

Oh ssh keys

quartz kindle
#

then thats your answer

glossy elk
#

Oh wow

quartz kindle
#

"the server is secured by ssh keys"

glossy elk
#

Can I send you my application after I completed everything so you can check it?

quartz kindle
#

alright

#

@digital ibex where is that data stored?

digital ibex
#

mongodb

quartz kindle
#

indexed by a guild id?

digital ibex
#

yeah

quartz kindle
#

then thats your answer

#

user nagivates to /guilds/bla
data = mongo.guilds.findOne(id === req.params.id)
if(!data) send(404)

digital ibex
#

oh

#

that owuld be in my guilds.js file right?

quartz kindle
#

whatever file has the router

digital ibex
#

ah, ok. thanks

#

hm, tim

#
router.get('/', (req, res, next) => {
    const guild = Guild.findOne({ id: req.params.guildId });
    if (!guild) {
        res.send('e');
    } else {
        res.send(req.params);
        next();
    }
});``` its sending `req.params`
#

any idea why thats happening?

earnest phoenix
#

if the role Muted is already created how would i make it not make another role? heres the code:
@client.command() @commands.has_permissions(manage_roles=True) async def mute(ctx, member: discord.Member): guild = ctx.guild await guild.create_role(name='Muted', color=discord.Color(0x5c6b6f)) role = discord.utils.get(ctx.guild.roles, name='Muted') await member.add_roles(role) await ctx.send(f'{member.mention} Has Been Muted')

digital ibex
#

ur not checking anywhere if there even is a role

#

@quartz kindle any ideas?

earnest phoenix
#

thats why im asking dude

digital ibex
#

check if the role exists, if it doesn't then create the role otherwise just add the role

slender thistle
#

You're creating the role and THEN checking if the role with named Muted exists

earnest phoenix
#

ye toe

quartz kindle
#

@digital ibex console.log(guild) and console.log(req.params)

digital ibex
#

kk

earnest phoenix
#

so how would i say if its made to not remake it

slender thistle
#

get the role first

#

use an if, check if the returned value of utils.get is None (role wasn't found)

earnest phoenix
#

@client.command() @commands.has_permissions(manage_roles=True) async def mute(ctx, member: discord.Member): role = discord.utils.get(ctx.guild.roles, name='Muted') guild = ctx.guild await guild.create_role(name='Muted', color=discord.Color(0x5c6b6f)) await member.add_roles(role) await ctx.send(f'{member.mention} Has Been Muted')

#

like that

slender thistle
#

use an if, check if the returned value of utils.get is None (role wasn't found)

digital ibex
earnest phoenix
#

@client.command() @commands.has_permissions(manage_roles=True) async def mute(ctx, member: discord.Member): role = discord.utils.get(ctx.guild.roles, name='Muted') if None: guild = ctx.guild await guild.create_role(name='Muted', color=discord.Color(0x5c6b6f)) else: await member.add_roles(role) await ctx.send(f'{member.mention} Has Been Muted')

#

like that?

digital ibex
#

and req.params logs: {"guildId":"null"}

slender thistle
#

if role is None

earnest phoenix
#

ok

#

changed

#

so it should work?

slender thistle
#

Try it

digital ibex
#

shivaco, what library did u make?

slender thistle
#

dblpy

digital ibex
#

oh nice

#

@quartz kindle any ideas?

earnest phoenix
#

doesnt do anything

#

i dont get errors either

#

it just doesnt create the role

quartz kindle
#

@digital ibex well mongo is returning something even if you pass null to it

#

maybe you're using the wrong way to get data, idk

digital ibex
#

oh

quartz kindle
#

how do you usually get data from mongo?

earnest phoenix
#

worked nvm

digital ibex
#

im doing it the same way i get it using the bot

#

uhhh

quartz kindle
#

wait did you console.log guild or Guild?

digital ibex
#
const Guild = require('path to model');
const guild =  Guild.findOne({ id: req.params.guildId });
``` and i logged `guild`
quartz kindle
#

ok

#

then idk, findOne is returning something else instead of the data

#

dont you need to await it or something?

agile oyster
#

what softwares do I use when making a discord bot?

quartz kindle
#

depends

#

do you know any programming language?

agile oyster
#

yeah, js

#

node.js

quartz kindle
#

then you can use node.js

agile oyster
#

k

#

thxs

digital ibex
#

i just added await but same result, and u only need await if ur gonna search for something specific, doesn't make a difference if ur not doign anything else with it i believe

quartz kindle
#

well i dont use mongo so idk

digital ibex
#

oh

quartz kindle
#

you have to figure it out

agile oyster
#

can someone giveme th ebasic code when making a bot go online

digital ibex
#

oki, thanks

quartz kindle
#

@agile oyster check out discord.js

agile oyster
#

k

quartz kindle
#
agile oyster
#

k thxs i got it

digital ibex
#

tf

#

now its not loading

#

oh, i thnki kn y

#

its logging but doesn't load šŸ¤”

#

i asynchronies the function and it doesn't load

#

wtf

earnest phoenix
#

@slender thistle

#

how do i change perms for all channels instead of the role perms?

slender thistle
#

channel.edit

#

Loop through all channels

earnest phoenix
#

thanks

#

ctx.channel.set_permissions(ctx.guild.default_role, send_messages=False)

#

this?

slender thistle
#

Uhh

#

Yes

earnest phoenix
#

where do i put the role name

#

?

slender thistle
#

Well

#

Which role do you want the bot to set permissions for

earnest phoenix
#

how can i set of a command if someone has only put part of a command

#

Muted

pale vessel
#

can you rephrase that please

slender thistle
#

Get the role like you did last time

#

Put it instead of the default_role thing

earnest phoenix
#

how can i detect and set off a command if someone has only put part of a command

#

like !play but without the url. i want to tell them to put a url

pale vessel
#

check args

earnest phoenix
#

how?

#
@client.command()
@commands.has_permissions(manage_roles=True)
async def mute(ctx, member: discord.Member):
    role = discord.utils.get(ctx.guild.roles, name='Muted')
    if role is None:
        guild = ctx.guild
        await guild.create_role(name='Muted', colour=discord.Colour(0x5c6b6f))
        ctx.channel.set_permissions(ctx.guild.Muted, send_messages=False)
        role = discord.utils.get(ctx.guild.roles, name='Muted')
        await member.add_roles(role)
        await ctx.send(f'{member.mention} Has Been Muted')
    else:
        await member.add_roles(role)
        await ctx.send(f'{member.mention} Has Been Muted')```
#

this make sense? @slender thistle

#

cuz its not working

slender thistle
#

create_role method returns the created role

earnest phoenix
#

so

#

where do i put it

slender thistle
#

You can just assign it to a variable and use it instead of searching for the role after you create it

#

Also, don't take me too literally when I say replace X with Y

#

ctx.guild.Muted doesn't make sense or exist

earnest phoenix
#

you told me to that that fuck

crimson jetty
#

@agile oyster Depends on what language you're comfortable with

earnest phoenix
#

how do i check args for 1 and then set off a command is it dosent exist

crimson jetty
#

Well if there is nothing : there is no url

earnest phoenix
#

what?

crimson jetty
earnest phoenix
#

no

crimson jetty
#

Ow

#

What language?

earnest phoenix
#

discord.js

copper cradle
#

discord.js doesn't have a built in command handler, so you should know if you made yours

#

unless you copied it

crimson jetty
#

On discord.py would be something like

@client.command(pass_context=True)
async def command(context, *,* arg):
  await print(arg)
earnest phoenix
#

helo, im having a little problem with json

#

Dont ask to ask

#

writing problem

copper cradle
#

just ask your question

#

don't ask to ask

earnest phoenix
#

bruh im typing it, so i can explain was going on

crimson jetty
#

Bruh @earnest phoenix

copper cradle
#

ok

#

go ahead

earnest phoenix
#
const idd = "myid";
const a = "asd";
config[msg.author.id].idd = {
    something: a
}
#

so basically

copper cradle
#

yeah?

earnest phoenix
#

it wont detect idd and a

copper cradle
#

you need to write to the file

#

and then re cache it

#

unless it's an object

vale python
#
const Discord = require('discord.js');
const client = new Discord.Client();
const botToken = process.env.DISCORD_BOT_TOKEN; 
const pinEmoji = process.env.DISCORD_BOT_PIN_EMOJI || ':pushpin:';
const wastebasketEmoji = ':wastebasket:';


async function dmPinnedMessage (messageReaction, user) {
  if (!user.dmChannel) {
    await user.createDM();
  }
  
  let text = `${pinEmoji} message by <@${messageReaction.message.author.id}> in <#${messageReaction.message.channel.id}>/${messageReaction.message.guild.name} ${pinEmoji}\n${messageReaction.message.content}`;
  let messageOptions = {};
  messageOptions.embed = {
    author: {
      name: messageReaction.message.author.username,
      icon_url: messageReaction.message.author.avatarURL,
    },
    timestamp: new Date(messageReaction.message.createdTimestamp).toISOString(),
  };
  if (messageReaction.message.attachments.size > 0) {
    messageOptions.files = messageReaction.message.attachments.map(attachment => attachment.url);
  }
  let dmMessage = await user.dmChannel.send(text, messageOptions);
  dmMessage.react(wastebasketEmoji);
}

function deleteDM(messageReaction, user) {
  messageReaction.message.delete();
}

client.on('ready', () => {
  console.log('I am ready!');
});

client.on('messageReactionAdd', async (messageReaction, user) => {
  if (user.bot) {
    return;
  }
  
  
        
  if (messageReaction.emoji.name === pinEmoji) {
    dmPinnedMessage(messageReaction, user);
  } else if (messageReaction.emoji.name === wastebasketEmoji) {
    deleteDM(messageReaction, user);
  }
  
});

client.login(botToken);```

Bot's purpose: Member reacts to a message and bot DMs the message to user

What I want: This bot to work for only members with certain role
copper cradle
#

bruh

vale python
#

would be glad if someone could help, trying for 2 hours im dumb smh

copper cradle
#

just check if the member has the role?

vale python
#

i couldnt manage to do it somehow

#

11.3.0 btw

crimson jetty
#

First thought: Just need to check the roles of the sender and if it's in the authorized list of roles do the stuff

earnest phoenix
#

see how its being ignored

vale python
#

First thought: Just need to check the roles of the sender and if it's in the authorized list of roles do the stuff
@crimson jetty do you have the code for that

earnest phoenix
#

legit just check if member has role

crimson jetty
earnest phoenix
#

one question

#

how can i make it so as long a the command someone typed starts with my prefix it sends a reply

#

how i can get number of ppl who has ADmin perms

vale python
#

Cannot read property 'member' of undefined

#

:(

earnest phoenix
#

@vale python show code

vale python
#
const client = new Discord.Client();
const botToken = process.env.DISCORD_BOT_TOKEN; 
const pinEmoji = process.env.DISCORD_BOT_PIN_EMOJI || ':pushpin:';
const wastebasketEmoji = ':wastebasket:';
  


async function dmPinnedMessage (messageReaction, user) {
  if (!user.dmChannel) {
    await user.createDM();
  }
  
  let text = `${pinEmoji} message by <@${messageReaction.message.author.id}> in <#${messageReaction.message.channel.id}>/${messageReaction.message.guild.name} ${pinEmoji}\n${messageReaction.message.content}`;
  let messageOptions = {};
  messageOptions.embed = {
    author: {
      name: messageReaction.message.author.username,
      icon_url: messageReaction.message.author.avatarURL,
    },

    timestamp: new Date(messageReaction.message.createdTimestamp).toISOString(),
  };
  if (messageReaction.message.attachments.size > 0) {
    messageOptions.files = messageReaction.message.attachments.map(attachment => attachment.url);
  }
  let dmMessage = await user.dmChannel.send(text, messageOptions);
  dmMessage.react(wastebasketEmoji);
}

function deleteDM(messageReaction, user) {
  messageReaction.message.delete();
}

client.on('ready', () => {
  console.log('I am ready!');
});

client.on('messageReactionAdd', async (messageReaction, user, message, member         ) => {
  if(!message.member.roles.cache.find(r => r.name === "Mods")) {
    
    return;
  }

  if (messageReaction.emoji.name === pinEmoji) {
    dmPinnedMessage(messageReaction, user);
  } else if (messageReaction.emoji.name === wastebasketEmoji) {
    deleteDM(messageReaction, user);
  }
});

client.login(botToken);```
earnest phoenix
#

r u looking for this

vale python
#

I added

client.on('messageReactionAdd', async (messageReaction, user, message, member ) => {
if(!message.member.roles.cache.find(r => r.name === "Mods")) {

return;

}

#

but it says member is undefined

crimson jetty
#

Yea it depends on how you called your sender's message

earnest phoenix
#

get role first

crimson jetty
#

Member here isn't undefined in your error

vale python
#

sorry I am not good at this at all

crimson jetty
#

It's message which is undefined

earnest phoenix
crimson jetty
#

"cannot read property something OF undefined"

vale python
#

so I need to add that line_

#

?

#

@earnest phoenix

restive furnace
#

.cache doesnt exists on v11

quartz kindle
#

@vale python you're trying to get properties that dont exist

#

you cannot make up stuff in events

#

messageReactionAdd gives you a reaction object and a user object

earnest phoenix
#
    const role = msg.guild.roles.cache.find(r => r.name === "some role");
    if (!msg.member.roles.cache.has(role)) {
        //yeah
    }
crimson jetty
#

messageReaction.message.member.roles is the sender's roles i guess

quartz kindle
#

you cannot magically add more things to it, you need to use what is given

crimson jetty
#

You named your message object as messageReaction

restive furnace
#

also .cache doesnt exists on v11, so use <memberRoles>#has instead.

digital ibex
#

if ur adding .cache on v11 might as well just update d.js

#

v11 isn't gonna be stable

vale python
earnest phoenix
#

glitch xd

restive furnace
#

there might be guys who might only come to steal yr token tho

vale python
#

i kicked the bot from my server

restive furnace
#

kk

vale python
#

3 people gang banging the code rn

restive furnace
#

regen the token after you recv the help and removed the user from yr project

#

or users

quartz kindle
#

and make your project private

crimson jetty
#

Bruh man

#

That's kinda risky to give everyone the permissions to edit your files

restive furnace
#

lol 2 ppl looking .env

quartz kindle
#

lmao

crimson jetty
#

lmaoooo

quartz kindle
#

you know what

crimson jetty
#

Bruuuuuh

quartz kindle
#

why not we all make a twitch plays discord bot

crimson jetty
#

someone deleted your app.js

quartz kindle
#

lmao

#

really?

crimson jetty
#

yea

#

just checked the file

#

it's blank

quartz kindle
#

i gotta see that

vale python
#

well ty for the help I guess guys

#

lmao

restive furnace
#

y gonna need rewind

crimson jetty
#

and someone wrote "jews deserved it"

quartz kindle
#

LOL

#

well thats nasty

vale python
crimson jetty
#

Why are people like that GWanimevilSachiscared

amber fractal
#

Never make projects editable without a backup or to people you dont trust

vale python
#

i have the backup dw

#

if anyone still wants to help I can send a new link

quartz kindle
#

imagine this

#

100 people coding a bot together on glitch

#

livestreamed on twitch/discord

amber fractal
#

100 people on one vscode live server with full terminal access

quartz kindle
#

yes

#

lmao

amber fractal
#

pc dies in seconds

crimson jetty
#

lmao

earnest phoenix
#

is there a ay of deleting only part of a message?

lyric mountain
#

you can edit the message

mossy vine
#

only your messages*

earnest phoenix
#

oh. delete the message someone typed and then send a certain part of it?

#

yes

#

how?

#

slice it

#

what?

vernal rivet
#

use the String.slice() method

earnest phoenix
#

ok

royal portal
#

is it just me or

#

httperror

#

name: 'FetchError'
code: 500
method: 'get'
path: '/gateway/bot'

crimson jetty
#

Internal Server Error šŸ¤·ā€ā™‚ļø

royal portal
#

my problem?

crimson jetty
#

nope if you are requesting from discord's api it's their server

earnest phoenix
#

im just looking for nothing, dont mind me.

royal portal
#

lagcord

#

why

#

it only happened to one of my bots

crimson jetty
#

When did it happen?

royal portal
#

just a few mins

plucky harness
#

Those who have their bots up and running, can you guys suggest good hosts for the bot and the database?

royal portal
#

i am the hosdty

#

host

plucky harness
#

Ofc i can't be. My electricity bill would kill me

crimson jetty
#

@plucky harness I personally use Heroku to host the bot and Firebase to host my database

#

Not really the best option but works fine for me

plucky harness
#

Firebase. Is it fast?

royal portal
#

so its not my fault

crimson jetty
#

Well it's from Google sooooo @plucky harness

plucky harness
#

šŸ’Æ šŸ’Æ

crimson jetty
#

Well yea normally @royal portal

plucky harness
#

Paid?

crimson jetty
#

Nope I use the free plan

royal portal
#

its fixed now

#

i just restarted bot

plucky harness
#

Oh hell yea! I'mma try it

royal portal
#

and its fine

plucky harness
#

Thanks

royal portal
#

discord problem i guess lol

crimson jetty
#

Though it's not a database like MongoDB or stuff like that (it's kinda JSON structure based)

earnest phoenix
#

how do i copy the text someone put into a chat

plucky harness
#

Would it host sql database?

crimson jetty
#

Hmmm don't think so @plucky harness

plucky harness
#

😫

crimson jetty
#

You could look at the new version (firestore)

plucky harness
#

Oh alright

crimson jetty
#

Don't know though

#

how do i copy the text someone put into a chat
@earnest phoenix Check at the arguments and send back

plucky harness
#

I don't know how to work with Mongo DB tbh. I already know sql so went with it

crimson jetty
#

Don't know SQL soooo

#

I'm all json based because never learnt another way of storing things

plucky harness
#

Json is cool too

agile oyster
#

I need some help, somebody my bot woont go online, can someone be my guide or teacher

crimson jetty
#

How do you host it? @agile oyster

agile oyster
#

what do you mean host

crimson jetty
#

Oh you still developing it?

plucky harness
#

What's your code? Is it the first time you're running the bot

crimson jetty
#

If so just run the program/script you wrote and it should go up

agile oyster
#

yeah, im using node.js, but on top of that

#

i tried installing the discord.js and it says this, hodl let me screenshot it

knotty steeple
#

@vague kite escape the \

#

\\n

vague kite
#

Ohhh okay

#

Thank you ā¤ļø

crimson jetty
#

??

vague kite
#

I deleted the question instead of editing šŸ¤¦šŸ½ā€ā™‚ļø

crimson jetty
#

Oh bruh

agile oyster
#

okay here is what it says

vague kite
#

Do npm init

agile oyster
#

k, then what should i do

crimson jetty
#

Yea you need to initialize it

agile oyster
#

how

crimson jetty
#

Go in your folder

agile oyster
#

k

crimson jetty
#

npm init

agile oyster
#

i did that right now, im just waiting for a response

#

k i got a response, now what

crimson jetty
#

well i would say npm install discord.js

#

But

#

It seems like it added it

#

You can still try to reinstall it though

agile oyster
#

k

crimson jetty
#

It worked? @agile oyster

agile oyster
#

aargh, im getting confused right now

#

hold up, i think i got it

earnest phoenix
#

can someone help, i don't understand how to check the arguments and send them back

crimson jetty
agile oyster
#

it now says description

crimson jetty
#

About what ?

agile oyster
#

cus right now im installing it

#

first it said package name, version, now description

crimson jetty
#

Hmmm

#

Sorry I don't use npm a lot so I don't know much about it

#

It asks you to give a description ??

agile oyster
#

yep

crimson jetty
#

Well give it a description then lol

knotty steeple
#

@agile oyster ur running npm init

agile oyster
#

yeah

earnest phoenix
#

how can i get a role from args[1]? like, with mention

knotty steeple
#

thats not how u install a package

agile oyster
#

then how do you do it

knotty steeple
#

<Message>.mentions puts all mentions in a collection

#

npm install

#

obviously

earnest phoenix
#

yes, but if i do message.mentions.roles.first() it won't work

knotty steeple
#

shrug

#

look at docs

crimson jetty
#

@knotty steeple Yea but he needs to initialize his directory before

#

So npm init

knotty steeple
#

u dont

crimson jetty
#

And then npm install discord.js

knotty steeple
#

but ok

agile oyster
#

k

crimson jetty
#

Well you don't have to but it was giving him warning messages

knotty steeple
#

u can install packages before and after u init

#

ok

#

warnings arent important

agile oyster
#

hold on ima delete node.js and reinstall it

knotty steeple
#

it installed

crimson jetty
#

Yea

#

But he was asking why there were warnings

knotty steeple
#

@agile oyster why

agile oyster
#

yes

#

like why does it say that

knotty steeple
#

cuz u dont have a package.json

#

read

agile oyster
#

k, sorry im still a beginer

crimson jetty
#

Yea ik but not to install packages

agile oyster
#

do i download package.json file

knotty steeple
#

@still merlin no?

#

what

crimson jetty
#

@still merlin And that's why we asked him to do npm init

#

@agile oyster Na

agile oyster
#

k, i have a json file in my folder now

knotty steeple
#

a package.json is only needed if u are publishing a package

#

u dont need it anywhere else

agile oyster
#

k thxs

knotty steeple
#

it isnt required to run a node project either

sudden geyser
#

I mean it's good to have one

#

Where are you going to store your dependencies? Am I missing something?

knotty steeple
#

yes but what they were saying is untrue

#

if u install without initialization npm should make a package.json

#

if u put the save argument

#

itll just have ur dependencies

earnest phoenix
#

Why after i use the command and set a value in data base, in my settings command i got

knotty steeple
#

cuz its an object

earnest phoenix
#

how can i solve that ?

lyric mountain
#

your json either got corrupted or you're acessing it wrong

earnest phoenix
#
        let role = await db.get(`ServerRole_${message.guild.id}`) ? await db.get(`ServerRole_${message.guild.id}`) : "None"

this is how i get

knotty steeple
#

no

#

objects dont go well with strings

sudden geyser
#

what does db.get(...) return

#

and you don't need to query it twice with ternary

earnest phoenix
#

i send

#

what it returns

lyric mountain
#

Object.values(yourjsonfile)

knotty steeple
earnest phoenix
#

@lyric mountain i'm using quick.db

lyric mountain
#

still json

knotty steeple
#

no

#

sqlite

lyric mountain
#

json stands for JavaScript Object Notation

#

so it's technically a json

#

anyway

knotty steeple
#

what

sudden geyser
#

quick.db uses sqlite under the hood but I don't remember if it also uses json somewhere

lyric mountain
#

you gotta print an object's property, not the object itself

knotty steeple
#

it doesnt

lyric mountain
#

all objects in js are jsons

knotty steeple
#

sir no

lyric mountain
#

...json is a js object

knotty steeple
#

json is json

lyric mountain
crimson jetty
#

JSON stands for JavaScript Object Notation. It is basically a text format that makes it easy to share data between devices such as Clients and Servers. Its Origin is based on how JavaScript object works so in that sense, it is related/close to but not completely JavaScript Object.

lyric mountain
#

technically a js object

knotty steeple
#

please stop

#

ok

sudden geyser
#

sort of, but not the exact same.

agile oyster
#

@knotty steeple what software do you use to make your bots

knotty steeple
#

sqlite returns an object on queries

#

containing the data

lyric mountain
#

you gotta get a property of that object