#development

1 messages ยท Page 1126 of 1

pure lion
#

Or

#

promise().catch()

faint prism
#

Anyone familiar with Roslyn's CSharpScript? Trying to pass in a global variable but I can't seem to reference it

mild flower
#

it doesnt seem to be working

faint prism
#

For example, I am passing in a SocketCommandContext as context in the optional [globals: param]
(ERROR) (1,1): error CS0103: The name 'context' does not exist in the current context

earnest phoenix
#

it doesnt seem to be working
@mild flower you have to put your math code INSIDE the try {/*/stuff/*/}

mild flower
#
                evaluate(qtrim)
                } catch (err){
                message.channel.send('Please enter a valid math problem.')
                };```
earnest phoenix
#

that's correct

#

it IS correct

mild flower
#

but its not workin

earnest phoenix
#

does your bot turn off upon the error?

mild flower
#

yes

pale vessel
#

"evaluate"

earnest phoenix
#

but its not workin
show an image

pale vessel
#

what is evaluate

earnest phoenix
#

"evaluate"
i told himhow to use mathjs

mild flower
#

of code or error?

earnest phoenix
#

both

mild flower
earnest phoenix
#

and what it does when you run the command

mild flower
#
    ^

Error: Undefined symbol lmao```
earnest phoenix
#

bruh

#

that's because you used smth else

#

it is a problem with your own code

#

you can literally just freaking do:

#
case "math":
if (!args[1]) {
  message.reply("bruh enter smth");
} else {
  evaluate(message.content.substring(`${prefix}math `.length));
}
#

@mild flower allow me to explain

#

message.content returns the stuff that the user types

pure lion
#

undefined symbol lmao

pale vessel
earnest phoenix
#

smth from mathjs library

pure lion
#

LmAo

earnest phoenix
#

now shut up

pale vessel
#

what's evaluate

earnest phoenix
#

IT'S A FUNCTION

pale vessel
#

mathjs?

earnest phoenix
#

IN THE LIBRARY

pale vessel
#

it's big

pure lion
#

slice(prefix.length, 0)

#

Smh

pale vessel
#

substring works too

mild flower
#

bruh

earnest phoenix
#

Example:

User: <prefix>math potato
message.content will give <prefix>math potato
#

and the substring just cuts out <prefix>math

mild flower
#

yea

#

let qtrim = qmultiply.substring(5)

#

thats what this do as well

earnest phoenix
#

and then you run evaluate() on what it returns

pale vessel
#

where did you define evaluate?

pure lion
#

args.slice(1).join(' ')

earnest phoenix
#

thats what this do as well
what is qmultiply

#

why do that

pale vessel
#

where did you define evaluate?
@pale vessel

earnest phoenix
#

bro

mild flower
#

its something

#

doesnt matter

pale vessel
#

no it does matter

earnest phoenix
#
import {evaluate} = require("mathjs");
pale vessel
#

thank you

mild flower
#

oh wait

#

it worked

#

i think

earnest phoenix
#

it automatically throws when i insert algebra

mild flower
#

args.slice(1).join(' ')
@pure lion thank u

#

thats all i had to do

earnest phoenix
#

bruh

mild flower
#

...

pure lion
#

Lmao

earnest phoenix
#

remove qmultiply and the other q<smth>

solemn latch
#

Dice the pro

earnest phoenix
#

it is just unnecessary stuff

solemn latch
#

tim 2.0

pure lion
#

You should substring the prefix out in args tho

earnest phoenix
#

code913 gay 10000000.0 brain 1.5

mild flower
#

it is substringed

pure lion
#

Where from?

earnest phoenix
#

You should substring the prefix out in args tho
he already did

solemn latch
#

1.5 brains sounds amazing

pure lion
#

O

earnest phoenix
#

and used switches

solemn latch
#

I just have the 1

earnest phoenix
#

no

#

you have two

solemn latch
#

Oh snap

pure lion
#

I am Tim MK2

earnest phoenix
#

the two o in your name are two biggo brains just zoomed out

pure lion
#

When he gets sick of us I'll be the replacement jajajajajajaja

earnest phoenix
#

also

#

can i see what you replaced in your code?

#

@mild flower

solemn latch
#

Let's be real, no one can replace tim

mild flower
#

ohw ait

earnest phoenix
#

np

pure lion
#

Yeah tru

earnest phoenix
#

google intensifies

mild flower
#

it doesnt recognize the math problem now

earnest phoenix
#

bruh

mild flower
#

oh

pure lion
#

What's the error tho

earnest phoenix
#

i literallly explained you

mild flower
#

thats cus i substringed args[1]

#

wait

#

one sec

earnest phoenix
#

bruh

pure lion
#

Omg

earnest phoenix
#

can only me explain him cuz your solution just caused another error tbh

mild flower
#

forgot to remove that

earnest phoenix
#

and we both suck anyways

#

you know

pure lion
#

x)

earnest phoenix
#

you only need to substring the prefix and the math word out from the whole message

#

by this:

mild flower
#

ok is not working

#

wait

#

no need to

earnest phoenix
#

so

#

can i explain

mild flower
#

cus im grabbing from arg[1]

earnest phoenix
#
var substringed = message.content.substring(`${prefix}math `);
message.reply(evaluate(substringed));
pure lion
#

This is a sentence
args[1] = "is"

earnest phoenix
#

that's it

#

just two freaking lines of code

#

inside a try catch thing

pure lion
#

Lmao

mild flower
#

oof

earnest phoenix
#

@mild flower

#

so

mild flower
#

bruh

earnest phoenix
#

period

mild flower
#

i tried

#

still not workin

#

g

earnest phoenix
#

mine didn't work?

pale vessel
#

dude substring and slice only accepts numbers

earnest phoenix
#

can you temporarily add me to your glitch project

mild flower
#

not on glitch

earnest phoenix
#

dude substring and slice only accepts numbers
oh yeah

pale vessel
#

add .length after `

earnest phoenix
#

forgot that you need to put .length after the string

mild flower
#

bruh

earnest phoenix
#

yep

#

can i see the code

#

also we are literally spoonfeeding you...

pure lion
#

No

#

You are spoonfeeding

#

Stop it, get some help

pale vessel
#

nice meme

solemn latch
#

-development

pale vessel
#

hah imagine

earnest phoenix
#

ok

#

period

solemn latch
#

Period

earnest phoenix
#

@mild flower maybe try figure smth out on your own

mild flower
#

can u just tell me

#

why the try doesnt work

#

and detect the error

earnest phoenix
#

because

mild flower
#

thats all i want to know

pure lion
#

:l

earnest phoenix
#

you need to put the stuff INSIDE try{}

#

try{code}

#

period

mild flower
#

uh

#

i didd

pure lion
earnest phoenix
#

show the code then

#

and three people explained you one guy even spoonfeeded you but you still have errors :/

delicate zephyr
#

code, chill

mild flower
#
                evaluate(variable)
                } catch (err){
                message.channel.send('Please enter a valid math problem.')
                };```
pale vessel
#

and what's variable?

surreal notch
#

i wanted that if someone uses a !warn cmd in any server it should show in my server channel client.on('-warn', async (guild) => { const channel = client.channels.cache.find( ); channel.send(`cmd got used in **${guild.name}** This server is epic!`); });
can u help

pure lion
#

What is -warn

lusty quest
#

try/catch will still throw errors. just they are handled

earnest phoenix
#

yep

surreal notch
#

-warn is a cmd

solemn latch
#

Did you make a -warn event?

mild flower
#

bruh

#

@ me im going now

pure lion
#

client.ws.emit('-warn')

lusty quest
#

galaxy brain for making a new event for every command

pure lion
#

Jajajajajaja

solemn latch
#

I'm sure people have done it

earnest phoenix
#

@surreal notch just do bot.channels.cache.get(text channel id).send(stuff)

delicate zephyr
#

@mild flower
Try catch will only catch whats in try {}
So if the code in your catch {} block errors it will still be thrown

earnest phoenix
#

yep

delicate zephyr
#

try doing this

earnest phoenix
#

no

#

he's already been explained a lot

#

and he also went

#

looks like he's angry

delicate zephyr
#
try {
 // code
} catch (e) {
  console.log(e)
}
pale vessel
#

e

pure lion
#
try {
  throw new Error()
} catch (e) {
  console.log(e)
}
pale vessel
#

throw new Error()

pure lion
#

I can constructor

#

I swear

dire obsidian
#

is good idea use discord.js-commando? ill use it and idk if is a good idea

delicate zephyr
#

Its just a command handler

#

if you find it easier to use than making your own

#

then use it

solemn latch
#

^

earnest phoenix
#

if you find it easier to use than making your own
@dire obsidian if you follow the above and use the package then you are a verified non-dev

#

command handlers are the easiest thing in the world

delicate zephyr
#

sigh

pale vessel
#

that's not entirely true

earnest phoenix
#

using command handlers through packages is terrible

pale vessel
#

no.

solemn latch
#

Thats a big statement

earnest phoenix
#

*using a command-handler package is terrible

delicate zephyr
#

@earnest phoenix Thats the most condescending asshole statement ever

dire obsidian
#

tututu, well some of the things is allready configred in commando

earnest phoenix
#

ok purge my messages

dire obsidian
#

like help command, ping etc

#

you can disable it

#

and make your custom ones

delicate zephyr
#

@dire obsidian Use whatever you're comfortable with

dire obsidian
#

ok thaks

#

ill use my body pillow

earnest phoenix
#

@earnest phoenix Thats the most condescending ***hole statement ever
@delicate zephyr please stop swearing it makes me uncomfortable

delicate zephyr
#

Well telling someone that not doing something themselves makes then a non-dev is wrong and entirely objective. Learn to think before you speak :)

pale vessel
#

ugh

delicate zephyr
#

anyway

surreal notch
#

when a person use a particular cmd how to get server invite of that serveer

pale vessel
#

then why are you using a library then? JUST make your own

solemn latch
#

Doesn't djs kinda support commando anyway?

pale vessel
#

you can use fetchInvites()

delicate zephyr
#

Yes

solemn latch
#

I'm sure there's some rather high profile bots using commando ๐Ÿคทโ€โ™‚๏ธ

pale vessel
#

like xiao

delicate zephyr
#

discordjs-command was made entirely for discord.js

dire obsidian
#

well only is discord.js with some others things extra

earnest phoenix
#

when a person use a particular cmd how to get server invite of that serveer
@surreal notch you create an invite bro

pale vessel
#

the bot might not have the permission to

earnest phoenix
#

@.Ultron if you dont wanna create an invite then read audit logs and grab one

delicate zephyr
#

@surreal notch You can either fetch existing invites or create a new one

faint prism
#

can someone give me an example of a bulk delete event?

earnest phoenix
#

yep

delicate zephyr
#

msg.channel.bulkDelete(num)

#

max is 100

earnest phoenix
#

frik

pale vessel
#

in what? dsp?

earnest phoenix
#

too late me

surreal notch
#

@delicate zephyr How to make new one

earnest phoenix
#

you do

#

please let me type

delicate zephyr
#

@surreal notch should be msg.guild.createInvite()

faint prism
#

Not the command itself. What would cause the event to triggered (by someone else)?
@delicate zephyr

earnest phoenix
#
message.channel.createinvite({
  maxAge : 0,
  maxUses: 10000000000000000
}).then(invite =>{
  //do stuff to the invite by referencing the variable invite
})
#

oops

#

accidental shift enter

pale vessel
#

can't only bots trigger that event?

delicate zephyr
#

@faint prism only bots can trigger that event

#

and the ban bulk delete doesnt trigger it either

dire obsidian
faint prism
#

Interesting. So it would mean another bot is bulk deleting msgs if I get that event?

delicate zephyr
#

Yes

faint prism
#

Gotcha, ty!

earnest phoenix
#

@surreal notch

message.channel.createinvite({
  maxAge : 0,
  maxUses: 10000000000000000
}).then(invite =>{
  //do stuff to the invite by referencing the variable invite
})
#

if maxAge is zero then the invite will never expire

delicate zephyr
#

@earnest phoenix dont spoonfeed

earnest phoenix
#

if maxUses is zero then there is no max limit

surreal notch
#

oh

delicate zephyr
#

smh

earnest phoenix
#

@earnest phoenix dont spoonfeed
@delicate zephyr i only showed him the function

pale vessel
#

smh

earnest phoenix
#

*method

pale vessel
#

no

earnest phoenix
#

idk me not THAT good at JS

delicate zephyr
#

You fed him the exact code

surreal notch
pure lion
#

aa!eval msg

pale vessel
#

even with that .then lmao

delicate zephyr
#

^

surreal notch
#

maybe i m not gonna use that

pale vessel
#

good choice

delicate zephyr
#

I mean if you use async you can just await it

#

lmfao

earnest phoenix
#

yep

#

also

#

read the docs

faint prism
#

I had no idea C# has a scripting eval(string) via the Roslyn api ๐Ÿ˜„

earnest phoenix
#

and be a good boi

pale vessel
#

that's bold coming from you

faint prism
#

Now my C# bot can have an eval like everyone else lol

earnest phoenix
#

I had no idea C# has a scripting eval(string) via the Roslyn api ๐Ÿ˜„
no doubt you didn't know about an API

delicate zephyr
earnest phoenix
#

i sometimes hate APIs

surreal notch
#

ok

earnest phoenix
#

also

faint prism
#

CSharpScript.EvaluateAsync<string>(inputString).Result; = eval(inputString) in JS

delicate zephyr
#

Wow

#

just... what

solemn latch
#

The adverts

earnest phoenix
#

i almost always redirect users to my source

surreal notch
faint prism
#

Sharing repos isn't adverting

earnest phoenix
#

if they beg for spoonfeeding

surreal notch
#

i didnt

solemn latch
#

He didnt

surreal notch
#

beg

earnest phoenix
#

but you're a good boi Ultron

solemn latch
#

You just spoonfed him answers for no reason

pale vessel
surreal notch
solemn latch
surreal notch
#

Oof ok my bad leave it

earnest phoenix
#

yep

#

you could have also said period

delicate zephyr
#

You shouldnt just people your source code

#

You should try and teach them

pale vessel
#

damn that x didn't work

solemn latch
#

Also, you seem to be picking fights with people. Really no point

earnest phoenix
#

You should try and teach them
i do

delicate zephyr
#

Sigh

#

im just not gonna

earnest phoenix
#

die?

#

anyways imma go test my bot

pale vessel
#

i'm just going to lurk honestly

delicate zephyr
#

yea

faint prism
#

tests in prod

delicate zephyr
#

im done dealing with this dude

#

so

#

lurking time

earnest phoenix
#

also

#

what does "parsing JSON" mean?

faint prism
#

lel

#

JSON is a serialized object

#

Parsing mean deserializing into the object again

ancient nova
#

does anyone have stats api

faint prism
#

Also, google that exact question

pale vessel
#

define "stats"

solemn latch
#

Like bot stats?

faint prism
#

"statistics"

pale vessel
solemn latch
#

Doesn't dbl have a stats api somewhere?

earnest phoenix
#

they meant command usage thingies probably

ancient nova
#

server stats, displays how many people are in the server, how many are online etc.

pale vessel
#

what kind of stats is what i meant

delicate zephyr
#

Parsing json parses it into an object readable in JS,
for example:

{
  "message": "hello"
}

turns into

{
  message: "hello"
}
faint prism
#

But the latter is an object ^ in a running JS process, rather than the first. Which is a string.

pale vessel
#

you don't need an API for that?

misty sigil
#

@pale vessel i wanna do that

earnest phoenix
#

Parsing json parses it into an object readable in JS,
for example:

{
  "message": "hello"
}

turns into

{
  message: "hello"
}

so it just removes the " around message??? js is weird

earnest phoenix
#

guys u need uptime?

pale vessel
#

no

earnest phoenix
#

kk

quartz kindle
#

a better example would be ```js
obj = {
a:10,
b:20
}

JSON.stringify(obj) = '{"a":10,"b":20}'
JSON.parse('{"a":10,"b":20}') = { a:10, b:20 }

earnest phoenix
#

@earnest phoenix br mano

#

But the latter is an object ^ in a running JS process, rather than the first. Which is a string.
so JSON can be used for storing and sending objects in a human-readable format and parsing converts it into normal JS objects which the language can read and use?

faint prism
#

yeah. Pretty much

earnest phoenix
#

cool

#

๐Ÿ˜Ž

#

just learnt smth

#

also wtf is your pfp Auger

#

someone help me to leave my bot on

quartz kindle
#

json is the portable version of an object, because an object cannot be sent across the network nor shared with other processes

misty sigil
#

use a vps @earnest phoenix

quartz kindle
#

but you can convert it into a string, and sent the string

pale vessel
#

@earnest phoenix don't turn it off

earnest phoenix
#

ok now i get it Timmmmmmmmmmmmm

misty sigil
#

i've told you that about 3 times

pale vessel
#

and use a process manager

faint prism
#

@earnest phoenix
Imagine playing a game and clicking "Save". That's essentially serializing objects to a file (abet not in JSON). And Parsing when you reload

earnest phoenix
#

ok

#

Ok guys I tried hard, but I can't create a changing status someone pls help me i readed whole doc didn;t helped

#

@misty sigil like

#

JSON can be used for saving and sending around objects in a file and parsing converts it into normal objects that can be used in JS

misty sigil
#

like?

earnest phoenix
#

Ok guys I tried hard, but I can't create a changing status someone pls help me i readed whole doc didn;t helped
you freaking update it every <smth> seconds

#

use a vps @earnest phoenix
@misty sigil how do I do that

misty sigil
#

just look up vps hosting for bot or something lmfao

earnest phoenix
#

Ok guys I tried hard, but I can't create a changing status someone pls help me i readed whole doc didn;t helped

solemn latch
#

Djs?

earnest phoenix
#

me can

misty sigil
#

setinterval

earnest phoenix
#

Discord.js

#

yes

#

make different function

pale vessel
#

don't send your shitty source again please

solemn latch
#

Oof

earnest phoenix
#

Pls

#

Im trying hard

misty sigil
#

ow i feel like i've lost all my braincells

earnest phoenix
#

so stop

misty sigil
#

what do you want

#

do you want it to change on an interval

earnest phoenix
#

after a set amount of time run the second function which changes the status then again then at the last roll back to the start function

delicate zephyr
#

@pale vessel wait did he send it again

earnest phoenix
#

Changing status, so i need easy tutorial

pale vessel
#

i hope not

earnest phoenix
#

or help

misty sigil
#

WHAT DO YOU WANT TO DO

#

CHANGE IT ON AN INTERVAL?

earnest phoenix
#

yes

misty sigil
#

use setInterval

earnest phoenix
#

and how do i set multiple status

misty sigil
#

use an array

#

array of statuses

earnest phoenix
#

ok

faint prism
#

and iterate through them

earnest phoenix
#

like this:

function first() {
  //set the status
  //then use setINterval to goto the second
}
function second() {
  //set the different status
  //then use setInterval to goto the first
}
faint prism
#

eh, I'd use a for loop

earnest phoenix
#

you should call first() after your bot is ready

misty sigil
#

const status = ["status1", "status2"]
setInterval(function(){
client.user.setStatus(status[randomNumber])
},60000)

earnest phoenix
#

Ok

misty sigil
#

basically that

restive furnace
#

huh still same thing happening

misty sigil
#

its more psuedocode than actual code you still need to make the statuses and the numbers

earnest phoenix
#

Ok Ima try

pale vessel
#

just have a counter and reset it when it hits the limit

misty sigil
#

i'm thinking they want random

#

not in order

earnest phoenix
#

--- Truncated to last 15 messages, set outputCapture to 'all' to see more ---
(

restive furnace
#

use Math.random() for random

cunning ocean
#

Does anyone know a bot that in a channel it would delete messages if it didnโ€™t start with a certain word?

restive furnace
#

and multiple it by the array list's count and then floor it

solemn latch
#

That seems too specific for there to be a bot for it

earnest phoenix
#

now it haves no status

misty sigil
#

just make your own lmao

earnest phoenix
#

really weird

misty sigil
#

you need to set it first

earnest phoenix
#

const status = ["Hello", "Test"]

solemn latch
#

It won't have a status the first minute with that code

earnest phoenix
#

setInterval(function(){
client.user.setStatus(status[randomNumber])
},60000)

solemn latch
#

Which really isn't a problem, or you can set it once outside the interval if you want

earnest phoenix
#

Oh

#

now it crashed

solemn latch
#

F

earnest phoenix
#

ReferenceError: randomNumber is not defined

restive furnace
#

and theres definiently a stackoverflow question about that btw

misty sigil
#

did you

solemn latch
#

Lol

faint prism
#

lmaoo

solemn latch
#

Remember, pseudo code

#

You need to fill in some things

misty sigil
#

god every single fucking day i get closer to leaving

cunning ocean
misty sigil
#

use it

faint prism
#

ReferenceError: putYourVariableHereDontJustCopyAndPaste is not defined
Y no wrk?

misty sigil
#

its online

worn zephyr
#

Hello, I need help because if I use this string I have an error:

  return console.log("Credenziali non valide!".red); 
} ```
Error: 'return' outside the function
restive furnace
#

read the error

#

it is not inside function

worn zephyr
#

But why?

cunning ocean
quartz kindle
#

there is nothing to return

worn zephyr
#

ok

solemn latch
#

Do you have a language in mind @cunning ocean ?

cunning ocean
#

no

quartz kindle
#
return 10 // error

function bla() {
  return 10 // ok
}
solemn latch
worn zephyr
#

Thanks

cunning ocean
#

I have this coding that I want to use

#

if(!msg.content.startsWith("word") && msg.channel.id === "channel id")return message.delete()

restive furnace
#

and https://discord.js.org for documentation

misty sigil
#

lmao it wont work

#

you need to fill in some things

cunning ocean
#

I know

misty sigil
#

look, how about, uh, i make the bot

cunning ocean
#

Can you?

misty sigil
#

yes

#

its repl it

#

and its about 3 lines of code

restive furnace
#

you need to fill in some things
why ppl wont understand that, pseudo code

earnest phoenix
#

I made it

cunning ocean
#

Iโ€™m very new to coding but I know I need to fill it

earnest phoenix
#

OMG

#

It works

#

Tysm for your help guys

worn zephyr
#
return 10 // error

function bla() {
  return 10 // ok
}

@quartz kindle ok, but not work, the error not change

restive furnace
#

Iโ€™m very new to coding but I know I need to fill it
Learn a coding language BEFORE making an discord bot

tawny lava
#

the error explains what the issue is @worn zephyr

#

you can't use return outside of a function

earnest phoenix
#

How to code a bot with repl.it
you just dump your stuff on there DONE they are literally just giving you a computer read https://discordjs.guide to learn how to make a bot

restive furnace
#

^ and DONT start with making a bot

worn zephyr
#

Ok

lusty quest
#

you can but you need some braincells

earnest phoenix
#

@misty sigil I couldn't find free vps hosting for bot. could you give me a link in my private

misty sigil
#

you dont get free server space

solemn latch
#

Vps hosting isn't free

delicate zephyr
#

@earnest phoenix there isn't free hosting.

solemn latch
#

I tried finding free gas for my car. Couldn't find any

misty sigil
#

I tried to find free tyres for my bike, couldn't find any

earnest phoenix
#

Vps hosting isn't free
repl.it kinda allows but they are like the BEST CHEAPEST AWESOMEST BEST FREE TRIAL service

delicate zephyr
#

sigh

solemn latch
delicate zephyr
#

if you want long term hosting then its going to cost money

misty sigil
earnest phoenix
#

me gonna use the donations for my bot to buy a better host on repl.it

#

@misty sigil I have no money to host. but I have the bot ready

delicate zephyr
misty sigil
#

then host on repl

earnest phoenix
#

because

delicate zephyr
misty sigil
#

not long term no

earnest phoenix
#

they're dumb enough to allow ping services

misty sigil
#

why would you make a bot if you didn't do research about keeping it online

earnest phoenix
#

repl.it is a good temp host
who wants to live with 512 mb of storage anyways i'll switch to self-hosting soon

digital ibex
#

doesn't make u dumb tho

earnest phoenix
#

soon

delicate zephyr
#

@earnest phoenix and it'll get big like glitch did eventually and they're start banning them

#

Bandwidth and server space isnt free...

earnest phoenix
#

who wants to live with 512 mb of storage anyways i'll switch to self-hosting soon

pale vessel
#

they said they're not going to ban them but who knows

earnest phoenix
#

so I think my bot will never go online

delicate zephyr
#

i mean unless they're making enough money from their premium then idk

misty sigil
#

no

#

it will

solemn latch
#

Honestly, glitch probably makes a buttload of money due to how they did it

misty sigil
#

you need to ping it

solemn latch
#

let a lot of users use the platform, then tell them to pay

earnest phoenix
#

:(

misty sigil
#

ping services are free

earnest phoenix
#

what is "ping" for?

misty sigil
#

to keep it alive

pine aspen
#

Hey, I've recently updated my Schema for mongoose.
How can I update all existing files in the database.

delicate zephyr
#

how drastic was the change

#

or did you add a value

earnest phoenix
#

an example of a free ping site?@misty sigil ๐Ÿ‘‰ ๐Ÿ‘ˆ

solemn latch
#

Wouldn't you just .find() and then edit each one?

pine aspen
#

I just removed and added a few things.

misty sigil
#

uptime robot

pine aspen
#

Woo, will all the current data stay though?

delicate zephyr
#

@pine aspen you'd have to use: ```js
mongoose.updateMany({ thing: { $set: { foo: "bar" } } })

#

for adding

pine aspen
#

hmm

#

ok

#

So wait

#

Guilds.updateMany({ autoRole: { $set: { : "bar" } } })

#

Wait no.

delicate zephyr
#

and removing you should just do

const documents = await mongoose.find({})
documents.forEach(async doc => {
  delete doc.foo
  await doc.save()
})
pine aspen
#

ok

solemn latch
#

Ay I was half right.

pine aspen
#

wait what does the foo stand for?

delicate zephyr
#

@pine aspen what do you wanna set autorole to

#

its just variable placeholders

#

its not functional code

pine aspen
#

Oh. so it doesn't matter?

strange trout
#

Does mongodb have migrations?

pine aspen
#

``Guilds.updateMany({ autoRole: { $set: { : [] } } })`

#

So if I do something like this it does work?

delicate zephyr
#

Guilds.updateMany({}, { autoRole: { $set: [] } })

pine aspen
#

Oh.

#

Ok

#

Then I assume it's the about the same if it's an obeject.

delicate zephyr
#

yes

#

i mean

#

if you wanted to do it all in one

pine aspen
#

Yeah that's fine.

delicate zephyr
#
// Because we're looking for {} it will return every document in the collection
const documents = await mongoose.find({})
// Iterate through the documents
documents.forEach(async doc => {
  // Set autorole to array
  doc.autorole = []
  // Delete foo from doc (EG { foo: "bar" } ==> {}
  delete doc.foo
  // Save document
  await doc.save()
})
pine aspen
#

That also works?

#

Ok

#

Thanks!

#

I'll do it.

delicate zephyr
#

ive added commenting

pine aspen
#

Thanks!

#

Makes it easier to understand.

delicate zephyr
#

No problem!

pine aspen
#

Thanks a bunch!

earnest phoenix
#

Guys u are legends

#

u helped me a lot

#

Luke u helped me a lot

#

Woo Helped me a lot

delicate zephyr
earnest phoenix
#

it dont' detect when i am mentions users

#
 if (!message.mentions.users.first()){

}else{

}
solemn latch
#

What do you mean?

#

Like its always going to the if, not the else?

earnest phoenix
#

I mean such as if i type !!ma -> reply Hello
but if !!ma @earnest phoenixz -> reply Hi

pine aspen
#

Luke for a boolean it's just true/false right?

lusty quest
#

yes

#

or 1 and 0

pine aspen
#

Wait

restive furnace
#

it is true n false in most of languages, and some languages print them as 0 n 1

pine aspen
#

I think my schema might be outdated on my server.

delicate zephyr
#

@pine aspen yea, true and false

pine aspen
#

Ok.

#

It wasn't popping out.

#

I was confused.

#

Alright.

#

๐Ÿ‘

#

Working.

delicate zephyr
#

๐Ÿ˜„

pine aspen
#

Yeah.

#

Might be a bit slow on 32k files.

#

;p

faint prism
#

Eval works: mmLol

+eval "\x40\x4D\x61\x67\x6E\x65\x73\x23\x38\x35\x38\x33 \x69\x73 \x67\x61\x79\njk lel"
restive furnace
#

o-one file b-bot?

digital ibex
#

32k files???

#

tf

pine aspen
#

user files

restive furnace
#

he meant lines

digital ibex
#

user files?

pine aspen
#

database lines.

#

yeah

digital ibex
#

oh

pine aspen
#

it's to cache data

#

seems like it crashes my bot lmao

#

overloading

viscid scroll
#

um so like how do i even start

pine aspen
#

What?

#

Developing.

#

I recommend watching handy youtube videos.

#

That's how I learnt.

viscid scroll
#

oh okay ty dad

winter basalt
#

dad pog

faint prism
#

Make sure to use a coding keyboard mmLol

digital ibex
#

?

pine aspen
#

yes

#

control c

viscid scroll
#

tf is a coding keyboard

pine aspen
#

control v

#

oh wait

soft gorge
#

I know bot developers

pine aspen
#

thats the stack overflow one.

solemn latch
#

programmer socks too

soft gorge
#

Hello

digital ibex
#

whelp, im not a programmer

soft gorge
#

I know bot devs

digital ibex
#

i dont have coding soks

solemn latch
#

awh man feels bad

faint prism
#

Programmer socks v5
Look up SOCKS5 mmLol

solemn latch
#

probably why you dont have developer role

digital ibex
#

my bad ๐Ÿ˜“

#

dk how i missed them

pine aspen
#

How'd I do to get like 10% of mongodb files

#

first 1000

#

/100

digital ibex
#

u mean documents, syn?

pine aspen
#

IYes.

#

I should rly get used to the name.

digital ibex
#

<Collection>.find().limit(1000);

solemn latch
#

holy crap, this is stuff people actually google

solemn latch
#

also, how do people reccomend keyboards without a numpad as the best programming keyboard

faint prism
#

number row is closer to fingers??

digital ibex
#

i dont use the numpad cuz idk how to make it actually work

#

like

#

one time it works, the other time it doesn't

solemn latch
#

numlock

#

lol

faint prism
#

arrow keys

digital ibex
#

yeah, still dont work lmao

faint prism
#

Numpad are redundant bulk|| (that I can't stop using)|| prove me wrong

solemn latch
#

numpad is faster if you need to type more than 3 or 4 numbers

digital ibex
#

agree or else

#

๐Ÿ”ซ

strange trout
#

I've doing a lot of programing on my laptop

#

No numpad

solemn latch
#

so sexy

strange trout
#

My desktop keyboard doesn't have a numpad either

faint prism
#

numpad is faster if you need to type more than 3 or 4 numbers
@solemn latch Citation needed

solemn latch
#

true

pine aspen
#

If i just use find({ blacklist: null })

solemn latch
#

if im typing 100 i use standard number keys
if im typing 1027 ill use numpad.
it really depends on the numbers.

restive furnace
#

actually i write like 8 numbers easily withlut numpad

pine aspen
#

Wait how can i check if a line in a document doesnt exist.

#

like that yeah?

solemn latch
#

i also use a my desktop calculator a lot

#

so i guess its just normal for me to switch

#

spreadsheets numpads amazing too

#

๐Ÿคทโ€โ™‚๏ธ

earnest phoenix
#

LETS GOOOOOOOO!!!!

strange trout
#

What

delicate zephyr
#

uh

#

@modern sable

solemn latch
#

well, ill be back when thats gone

faint prism
#

@solemn latch it's gone

solemn latch
#

ty

delicate shore
#

I hat fucking copy pasted

#

Pasters

delicate zephyr
#

what

sudden geyser
#

have you destroyed the control/command key on your keyboard yet

faint prism
#

NO BUT MY CAPS IS BROKEN

delicate shore
#

A guy had been fucking asking me one singlr command code I gave him
But I use command handler he doesn't
He just copy pasted that in index.js and said code is not working
And then I tell him he has to change code how he uses command and he had been spamming my DMS saying how how how and his code is
if(msg.content === "ping") {msg.channel.send('pong')}
He uses this and says his bot is super cool

sudden geyser
#

first time?

delicate zephyr
#

I mean

sand anchor
#

Hi

faint prism
#

Sounds like you need to tell him to "Read the docs, kthx bye"

delicate shore
#

I am so fucking tired I'm turning off my DMS

#

He is still spamming

faint prism
#

mute

delicate shore
#

Mute whome ?

#

Oh

faint prism
#

whoever id DMing you

delicate shore
#

I blocked him XD

solemn latch
#

if its someone from this server, probably should inform a mod

delicate shore
#

if its someone from this server, probably should inform a mod
@solemn latch
No he isn't

digital ibex
#

its not really relevant to this channel den

earnest phoenix
#

So i've got this message collector for my music command, the thing is that, the sPass and timerP variables are saved in the collect event but they're converted back to what they were before the collect event, this happens in the end event
https://hastebin.com/ipadigucey.js

plucky harness
#

my postgres running on docker suddenly changed password?

#

not changed

#

rather its giving me password authentication failed for user

#

it was running

lusty lintel
#

I blocked him XD
@delicate shore why block

#

I need teh code still give me it my first time nabs

delicate shore
#

@digital ibex he is here @solemn latch

lusty lintel
#

I need teh code

#

you guys bully me

digital ibex
#

?

delicate shore
#

U need to tell your porblem

digital ibex
#

just report him or something

delicate shore
#

We can't Spoonfeed

lusty lintel
#

;-;

#

wh athe fuck you mean report

#

reprt for what asking question

digital ibex
#

e

#

whats your question?

lusty lintel
#

teh thing sis

digital ibex
#

which thing?

lusty lintel
#

how to see your bot that howmuch server bro gtdopdsuf

#

oops sry wrong spelling

digital ibex
#

what library u using?

faint prism
#

What dictionary u using?

lusty lintel
#

how to see that how much server in it that my bot

#

discord.js

#

how to see my bot states I mean

delicate shore
#

I told him guys

digital ibex
lusty lintel
#

what

digital ibex
#

what do u mean "states"

delicate shore
#

He wants whole code

lusty lintel
#

I mean pl do this !states and bto states come @digital ibex

solemn latch
#

youd have to make that yourself

digital ibex
#

i've never heard of it

faint prism
#

That's a command. Implemented by the developer

earnest phoenix
#

So i've got this message collector for my music command, the thing is that, the sPass and timerP variables are saved in the collect event but they're converted back to what they were before the collect event, this happens in the end event
https://hastebin.com/ipadigucey.js
Any ideas?

lusty lintel
#

.-.

solemn latch
#

the djs library doesnt make commands for you

#

you make commands yourself

haughty igloo
faint prism
#

It allows you to interface with the API

lusty lintel
#

No I copy and past

delicate shore
haughty igloo
#

What i want

delicate shore
#

I told him everything lmao

#

But he still asking

pale vessel
#

oof

solemn latch
#

we dont provide copy paste code

digital ibex
#

pgamer, you're really not helping ๐Ÿ˜ฉ

faint prism
#

What i want
@haughty igloo Import discord.js properly

lusty lintel
#

what command hadler I never heard it?

faint prism
haughty igloo
#

Bro

#

but have module

delicate shore
#

Bruh

digital ibex
#

you've not installed it

lusty lintel
#

bruh wtf

faint prism
#

Well it can't find it. Check your directories and file paths

dire obsidian
#

npm i discord.js

#

xd

lusty lintel
#

you guys wree going this site and I go this the otehr site

delicate shore
#

npm I discord.js --save

haughty igloo
#

Look have

digital ibex
#

why do people still use the --save

delicate shore
#

npm I discord.js --save
@delicate shore

lusty quest
#

glitch is shit

digital ibex
#

its literally useless

#

glitch isnt shit

haughty igloo
#

@delicate shore Where to write

lusty lintel
#

I usa npm install py.js

delicate shore
#

I have premium membership

lusty lintel
#

?!

delicate shore
#

Of glitch

#

But I agree

#

Glitch is bitch

digital ibex
#

why is glitch shit?

haughty igloo
#

i need hell

#

Pls help

#

bro

lusty quest
#

glitch is overpriced and blocks additional ports

lusty lintel
#

what is glitch

delicate shore
#

Yes

faint prism
#

It costs to host now and everyone is angry ||ive never used glitch||

digital ibex
#

you use glitch as a host gamer, ofc you'd find it shit

delicate shore
#

I use glitch

digital ibex
#

its not a host

delicate shore
#

But I'm shifting to a VPS

dire obsidian
#

waht

haughty igloo
#

PLEASE HELP

digital ibex
#

still shit

haughty igloo
#

i need because bot offlined

delicate shore
#

Wym

lusty quest
#

glitch is maybe fine for hosting a Website but there it ends

lusty lintel
#

aaaaaaaaa @delicate shore said this is command if(command === "servers") {
msg.channel.send(${client.guilds.cache.size})} but no work

digital ibex
#

@haughty igloo use glitch if u want, its not bad. everyone here is just saying stuff without any context

lusty quest
#

@lusty lintel remove ${}

#

or add ` infront and after them

delicate shore
#

Bruhhh

sudden geyser
#

Officially it depends on the use case really.

haughty igloo
#

i need help

delicate shore
#

You haven't defined

haughty igloo
#

Pls help

delicate shore
#

Command

#

How the fuck will it work

dire obsidian
#

@sudden geyser

sudden geyser
#

Yes this is Lite

lusty lintel
#

wot

dire obsidian
#

ups wrong ping

digital ibex
#

well i mean, in madara's case, it seems the best fit

dire obsidian
#

@haughty igloo what kind of help?

sudden geyser
#

Glitch is meant for small websites, but can also run Node apps. If you're just running a small bot, it'll probably be fine (I did it myself too), but still not the right tool for the job.

dire obsidian
#

open the console and write npm i discord,js

delicate shore
#

@lusty lintel send your ping command code here

haughty igloo
lusty lintel
#

No

haughty igloo
#

@dire obsidian where is console?

dire obsidian
#

tools/console

haughty igloo
#

i have discord.js module

dire obsidian
#

no you dont

#

opne tools

solemn latch
#

error says you dont

digital ibex
#

have you ran npm install discord.js ?

dire obsidian
#

then open console

sudden geyser
#

can you show your package json

dire obsidian
#

have you ran npm install discord.js ?
^

sudden geyser
#

it'd be pnpm* on glitch

haughty igloo
#

?

dire obsidian
#

ahh this broooo

sudden geyser
#

what

digital ibex
#

no

dire obsidian
#

tools

haughty igloo
#

Where is it?

digital ibex
#

you run it in the terminal/console

dire obsidian
#

push the button called tools

sudden geyser
#

show us your package.json file pls

dire obsidian
#

and pres console

haughty igloo
#

Look

sudden geyser
#

oh god

haughty igloo
#

have discord.js

dire obsidian
#

THIS BROOO, LOGS SAY NO

faint prism
#

And then some lol

solemn latch
#

so many libs

honest perch
#

bruh

earnest phoenix
#

So i've got this message collector for my music command, the thing is that, the sPass and timerP variables are saved in the collect event but they're converted back to what they were before the collect event, this happens in the end event
https://hastebin.com/ipadigucey.js
<Help lol>

honest perch
#

did you just download everything

haughty igloo
#

THIS BROOO, LOGS SAY NO
@dire obsidian what do u mekan?

#

Mean*

dire obsidian
#

maybe need help on dm

sudden geyser
#

Madara try setting the name field of the package json to something like osmanli-bot

dire obsidian
#

well dm are open

#

dm me

#

ahh

sudden geyser
#

rather than Osmanli Bot, I've had issues with that in the past

haughty igloo
#

Bro bot name Osmanlฤฑ

sudden geyser
#

still not how it should look

digital ibex
#

you guys need to chill man, i feel like most people here when starting out was just retarded

dire obsidian
#

no, im that

digital ibex
#

like retarded, and ur wayyy up

haughty igloo
#

Again have lag

#

Bug

dire obsidian
#

well dm me, maybe i can explain you, i used glitch on my first bots

sudden geyser
#

alright now try opening your console and typing refresh

dire obsidian
#

ah yes

haughty igloo
#

where is console?

faint prism
dire obsidian
#

config.json that is that

haughty igloo
#

1 min

sudden geyser
#

I've no idea from that screenshot, I don't code on mobile. Another option would be to click on your watch.json file and typing something to "refresh" it sort of

earnest phoenix
#

How do i get bot developer

haughty igloo
#

@dire obsidian config.json where is it?

sudden geyser
#

you make a bot and submit it on dbl

lusty lintel
#

I need help still @digital ibex

sudden geyser
earnest phoenix
#

Ty

haughty igloo
#

Neo

#

Bro

#

ฤฐ delete?

#

@sudden geyser

sudden geyser
#

try typing one character then deleting it so it's still valid json. I'm not sure if it'll force a refresh but you can try it

haughty igloo
#

Ok

#

1 min

lusty lintel
#

pls help

earnest phoenix
#

I added my bot to top.gg i still have to wait

haughty igloo
#

Oj

#

Ok

#

Leye

lusty lintel
#

what do command guild with zipd o

haughty igloo
#

Lets thx @sudden geyser

sudden geyser
#

what

dire obsidian
#

well no

sudden geyser
#

I added my bot to top.gg i still have to wait
@earnest phoenix it takes 3-4 weeks at the moment

earnest phoenix
digital ibex
#

ah yes

dire obsidian
#

what

digital ibex
#

doesnt look too bad

#

but

dire obsidian
#

ntro generator

#

kind illegal

digital ibex
#

i love the pornhub-logo command man

earnest phoenix
#

No its a joke

#

Oh

#

I should remove it

haughty igloo
#

@sudden geyser working thx bro

earnest phoenix
#

Oops

sudden geyser
#

oh

#

np

earnest phoenix
#

Alr removed

faint prism
#

How gay am I

honest perch
#

make an embed

dire obsidian
#

-3%

delicate shore
#

i love the pornhub-logo command man
@digital ibex
Porhub comment is better XD

sudden geyser
#

The help manual is okay but I think having the command (!command name here) on the left is easier to read

earnest phoenix
#

LMAO

digital ibex
#

99%

faint prism
#

Add an eval command mmLol

sudden geyser
#

compiled languages PepeHands

earnest phoenix
digital ibex
#

pornhub comment is just stupid imo

delicate shore
faint prism
#

compiled languages :PepeHands:
@sudden geyser I have an eval in my C# bot

delicate shore
#

pornhub comment is just stupid imo
@digital ibex
Me: Broken inside as I worked hard on it

dire obsidian
#

youre using dbd?

sudden geyser
#

isn't C# interpreted or run in a VM

earnest phoenix
#

Dbd?

#

@earnest phoenix I think you must use embed

delicate shore
#

Discord bot developer

faint prism
#

isn't C# interpreted or run in a VM
@sudden geyser waitWhat

earnest phoenix
#

What that

#

nvm

dire obsidian
#

discord bot designer

#

i think thats the name

digital ibex
#

well its just my opinion

faint prism
#

C# is a compiled language. It uses JIT though.
They added a C# scripting api with Roslyn

earnest phoenix
#

Bo

#

No

#

But is it good?

haughty igloo
earnest phoenix
#

Ok????

sudden geyser
#

compiled = languages like C, Java, Rust, etc.
interpreted = languages like python, javascript, etc.

I see interpreted to bytecode and run in a VM

earnest phoenix
#

Il try using embed

dire obsidian
#

const embed = new Discord.MessageEmbed()

now can kill me

faint prism
#

It compiles to an intermediary language that the JIT further compiles on targeted arch and platform
@sudden geyser

sudden geyser
#

Ah so it's similar to Java

earnest phoenix
faint prism
#

Maybe, JVM != JIT iirc

earnest phoenix
#

I use an app that helps me build my bot

#

Its really cool

faint prism
#

It outperforms Java

earnest phoenix
#

But its not discord bot builder

#

Or something

sudden geyser
#

they both have similar principles imo. I know JVM is not the same as JIT

lusty lintel
#

@delicate shore dude how to use command handler

#

I give up

dire obsidian
#

need me

strange trout
opaque eagle
#

How do you guys recommend "scheduling" timed mutes

#

so that they unmute on time

#

I want it to work even if my bot restarts, so a setTimeout may not work

#

(JavaScript btw)

earnest phoenix
#

HOw i can send embeds in Webhooks

#

: /

opaque eagle
#

Pass in an embed object

earnest phoenix
#

use a database

opaque eagle
#

How would my bot process know when to unmute tho

#

will it query the database on an interval or smth?

sonic lodge
#

store the time when the mute should end

#

when the bot restarts, calculate the ms left to the end and set a new timer with that length

opaque eagle
#

for every single mute?

#

shouldn't there be a more elegant solution

sonic lodge
#

there probably is

digital ibex
#

thats how every bot does it

#

there isn't

#

there is no way, none that i know of anyways

sonic lodge
#

o

#

that's how my bot does it too

digital ibex
#

i've looked quite a bit into this too

lusty quest
#

someone else with Discord API issues?

digital ibex
#

nope

lusty quest
#

(900ms ping)

strange trout
#

Yes earlier today

digital ibex
#

wouldn't that be ur bot?

#

i've had no issues :p

faint prism
#

I'm at 48ms

strange trout
#

No, ping from Discord API

#

Mine is stable now

faint prism
#

I had that issue recently though.
It was sitting at 500ms for some reason

lusty lintel
#

@digital ibex fukcing fixed

digital ibex
#

?

lusty lintel
#

teh thing

worn zephyr
#
const LoginFind = Login.findOne({
credenziali: loginanswer
})
if(!LoginFind) {
return;
}```
If the credentials isn't in the database not stop the action, but continue... Pls help me
digital ibex
#

??

#

uh