#development

1 messages · Page 1276 of 1

opal plank
#

like
name:
id:
nick?:
status?:
isOnline?:
hasCoronaVirus:?

#

you'd need to make a gigantic mess for it

restive furnace
#

i did make embed interfaces too and most of them are optional, yeah

opal plank
#

its a super pain

#

thats example i gave is a simple example

#

but there are times where they return countries for example

#

as the property

#

not as value

#

things that go that route will wreck your interfaces

undone carbon
#
var today = date + 7884008640
today.toISOString().substring(0, 10);``


TypeError: `today.toISOString is not a function` 

Am I doing this wrong?
opal plank
#

you need a date

#

a number+toString() isnt a thing

#

also stop using vars

#

use let/const

undone carbon
#

Ah gotcha

opal plank
#

new Date(today)

#

or just add it inside the new Date constructor

restive furnace
#

let date: string = new Date(today).toISOString()

#

or smth

#

that wont work yes

opal plank
#

we both evil geniuses

#

providing snippets in Ts so we can hear complaints afterwards about 'this code dont wqork'

#

and then reply in 'you werent suppose to copy it, but understand it'

restive furnace
#

yeah

opal plank
opaque seal
#

Do you guys ever reach a point where everything in your bot is theorically working pretty good but you forgot how everything is working inside it so you have this mental confusion and you don't know if your bot is actually great or not?

cinder patio
#

yes actually.

restive furnace
#

sometimes

cinder patio
#

I feel like I all my code is trash

slender thistle
#

I still somehow know how my bot works despite the code being a total clusterfuck

quartz kindle
#

every time i need to update something i need to study my own code again

opaque seal
#

^

sudden geyser
#

// and /* */ are your best friends

restive furnace
#

no

#

they're bullies :(

earnest phoenix
#

hot take but

opaque seal
#

// and /* */ are your best friends
you already know I ain't use them to describe my code but just to comment code out right?

earnest phoenix
#

comments are unnecessary if you write clean, readable and managable code

opaque seal
#

comments are unnecessary if you write clean, readable and managable code
which is why comments are necessary xD

restive furnace
#

comments are unnecessary if you write clean, readable and managable code
yeah, i do comment on public projects tho

sudden geyser
#

It may seem clean at the time, but it'll creep up on you later.

restive furnace
#

and my codebases are pretty manageable and readable IMO

sudden geyser
#

Even if you were to make your code as clean and readable as possible. Plus if someone else comes across your code comments will help

proven lantern
#

your code should be readable. if you need comments then the code is not readable

sudden geyser
#

You can have clean code and still have a use out of comments.

opaque seal
#

^

restive furnace
#

the fact is my comments are unreadable while code is readable

sudden geyser
#

There are cases where you should use comments, like if you're writing a library and document your public classes, methods, properties, etc.

proven lantern
#

like javadoc comments?

sudden geyser
#

Even outside that, for maintainability, I'd suggest using them.

#

Yes

#

or JSDoc, or Rust doc, or whatever

proven lantern
#

documenting is good

slender thistle
#

I use docstrings in my bot because the stuff I return is just way too fucking hard to be understood without proper explanation

#

(I am lazy to use dictionaries so I just return everything in tuples)

proven lantern
#

are you following the principles of functional programming?

#

every function is always simple with functional programming

slender thistle
#

I don't go by any principles and do everything however I want tbh

#

So please enlighten me with knowledge

proven lantern
#

chaos coding

slender thistle
#

Hey, it works just fine and I write the documentation for the most part 😂

sudden geyser
#

tuple programming

proven lantern
#

one rule is a function never uses global variables, only uses variable from input or locally.

#

the input variables are never modified. in fact no variables are ever modified

slender thistle
#

"modified" codewise?

proven lantern
#

mutated

slender thistle
#

Well yeah that's why I'm using tuples

proven lantern
#

every variable is immutable

#

the decorator pattern is banished

slender thistle
#

eh no that's the part I doubt if applies to my code

sudden geyser
#

It depends on what you're doing really. Is the global variable the only variable you'll be using (aka it's not passed as a parameter, so it’s unique rather than changed)? Then go ahead and use it if it doesn't make your code messy.

slender thistle
#

I don't specifically have any global variables. I only access the bot object through multiple files and rely on getting the tuple elements with it

#

that's about as global as my code is

proven lantern
#

do you have a functional that you can call twice with the same input and get a different result?

feral aspen
#
  console.log(`New User "${member.user.username}" has joined "${member.guild.name}"` );
  member.guild.channels.find(c => c.name === "welcome").send(`"${member.user.username}" has joined this server`);
});```

How can I make it find only in 1 specific guild, in a specific channel ID? and send a specific message?
slender thistle
#

🤔

#

No

#

Yeah, pretty sure no

feral aspen
#

Me or Ben is no?

proven lantern
#

then you probably are not breaking the rules too bad

slender thistle
#

Talking to Ben

feral aspen
#

Ahh alright

slender thistle
#

for a specific guild, check member.id against a string

proven lantern
#

you can memotize the functions to speed them up a bunch

sudden geyser
#

@feral aspen the 1 specific guild I assume is supposed to be the guild the member joined, correct? If so, you can find the channel ID with member.channels.cache.get(...)

#

I think your mistake was calling .find() on .channels when it's a manager and not a collection

feral aspen
#

My bot is in like 100 servers, but I want to make the guildMemberAdd only to 1 server

#

so I would find the id of the welcome channel I need

autumn aspen
#
const Discord = require("discord.js");
const ms = require("ms");

module.exports.config = {
    name: "mute", 
    aliases: []
}
    
module.exports.run = async (client, message, args) => {
let perms = message.member.hasPermission("KICK_MEMBERS")
if(!perms) return message.channel.send(":x: **You don\'t have permission to run this command!** :x:")

   let logchannel = message.guild.channels.cache.find(ch => ch.name === "log-channel")
   if(!logchannel) return message.channel.send("Cannot find a log-channel.\n\n:warning:`you cannot currently change to a custom channel`")
   
   let role = message.guild.roles.cache.find(ch => ch.name === "Muted")
   if(!role) return message.channel.send("Cannot find Mute role.")

   let user = message.mentions.members.first()
   if(!user) return message.channel.send("Please specify a user to mute.")

   let time = args[1]
   if(!time) return message.channel.send("Please specify a time.")

   let reason = args.slice(2).join(" ")
   if(!reason) reason = "Unspecified"

   let embed = new Discord.MessageEmbed()
   .setTitle("User Muted | " + `${user.user.tag}`)
   .addField("Muted by" , `${message.author}`)
   .addField("Time Muted" , `${time}`)
   .addField("Reason" , `${reason}`)
   .setFooter("Modicus | log-channel")
   .setColor(0x75ff58)


   user.roles.add(role)
   logchannel.send(embed)
   message.channel.send(`${user} was successfully muted by ${message.author} for ${time}
 with the reason of \`${reason}\``)

   setTimeout(function() {
  user.roles.remove(role)
     message.channel.send(`${user} is now unmuted!`) 
     
}, ms(time))
}

@compact oriole this a good tempMute.js command by me.

feral aspen
#

Bruh

proven lantern
#

doesn't guildMemberAdd require a oauth token?

sudden geyser
#

no

slender thistle
#

No

autumn aspen
#

lol

#

no

feral aspen
#

No?

slender thistle
#

It just requires the bot to be in a server with the joining user

sudden geyser
#

Maybe check if member.guild.id is equal to whatever guild ID

slender thistle
#

Why the living hell did I say member.id, oops

autumn aspen
#

lmao

proven lantern
#

oh, the event listener doesn't require oauth. the method to add a user to a guild does

feral aspen
#

member.guild.channels.get('channelID').send(`"${member.user.username}" has joined this server`);

#

Would this work? for only 1 specific channel in a server

compact oriole
#

@autumn aspen still not good

#

it still has settimeout LUL

misty sigil
#

yes ^^

opaque seal
#

In js how can I .catch() something and not do anything?
Putting only .catch() doesn't work, but if I put catch(err => console.log(err)) it works
(I don't want to use try {} catch {}

sudden geyser
#

Hamoodi are you using Discord.js v12

feral aspen
#

Yes

#

cache

#

I know

sudden geyser
#

@opaque seal pass a function that has no body

#

such as .catch(() => {})

opaque seal
#

ty

sudden geyser
#

You should handle the error though, or give the user some feedback

#

If you know you don't care about it, then go ahead and ignore it.

opaque seal
#

No I don't need to in this case

proven lantern
#

might as well do this .catch(console.log)

#

curry it

opaque seal
#

Nah I don't want my console to be filled with these errors

proven lantern
#

are they real errors? could you avoid the errors by adding more checks?

earnest phoenix
#

Hi, what do u think is better for developing a site, php or node.js ?

sudden geyser
#

Use the one you like (they both have their ups and downs). I'd prefer Node.js

earnest phoenix
#

Which one is cheaper to host, faster and secured ? This is what I want to know

quartz kindle
#

there is no difference in hosting

restive furnace
#

pins i misunderstood, but yeah ^

quartz kindle
#

unless you go for something like wordpress which basically does it for you

#

node.js vs php is debatable, but most benchmarks indicate node.js is faster, because it uses an event loop, while php spawns worker threads for each connection

slender thistle
#

Python or node.js :^)

restive furnace
#

i heard that you should use any other than php, since it's outdated and unsafe sometimes.

earnest phoenix
#

not so much anymore, php became decent in 7+ but too late to the party

#

php is way too slow in modern web dev

blazing portal
#
if(unsafe) {
makeSafe();
}
earnest phoenix
#

I saw that there are no web hosting services that support node.js, so you I need to buy a VPS that is more expensive

#

a vps is like 3 bucks a month

blazing portal
#

you can get good enough VPS for 2-3 bucks a month

quartz kindle
#

vps is not more expensive than webhosting

opaque seal
#

^

restive furnace
#

web hosting = 1 - 2 bucks a month, vps 2-3 bucks a month.

earnest phoenix
#

if anything, webhosting is more expensive than a vps

quartz kindle
#

^

blazing portal
#

most providers offer a cheaper webhosting pack than a vps tho

earnest phoenix
#

What vps would u recommand for a site ?

honest perch
#

hey @umbral zealot, im doing message.guild.ban(bannedUser); but for some reason its returning that its not a function

blazing portal
#

well

honest perch
#

@earnest phoenix galaxygate is pretty decent

blazing portal
#

it's not a function you can call on a guild @honest perch

earnest phoenix
#

What do u hink about contabo ?

honest perch
#

its bad

earnest phoenix
#

Why ??

honest perch
#

@blazing portal could you explain

blazing portal
#

it's good, if you are willing to get lower disk speed

honest perch
#

@earnest phoenix hidden fees, cheap, you get what you pay for, slow write speeds and read speeds

earnest phoenix
#

a ok.

blazing portal
#

what hidden fees? I've used contabo for over 3 years now, never paid any fee

honest perch
#

setup fees

blazing portal
#

slow write and read speeds are pretty irrelevant though unless you have millions of page views

fluid basin
#

If you're looking at static website hosting or simple web applications, PHP is a very mature language and has many frameworks and libraries to support it, not to mention along with flexible hosting providers and many options.

Other the other hand, if you need a large scale (web/otherwise) application or real-time applications, using NodeJS or more recent technologies with better support for realtime programs will be recommended.

blazing portal
#

@honest perch can you see a method ban here? https://discord.js.org/#/docs/main/stable/class/Guild

honest perch
#

no but i was told it exists

blazing portal
#

documentation > i was told it exists

honest perch
#

it was in v11

#

not in v12

#

so how do i do it in v12

fluid basin
#

oh v12

#

all member related operations are under GuildMemberManager

blazing portal
#

it has to do with members no? maybe check the property members of the guild 😛

fluid basin
#

GuildMemberManager#ban and GuildMemberManager#unban

compact oriole
#

I like the new system more

honest perch
#

but it isnt a member

#

a person that is not in the guild

compact oriole
#

it also forces you to make better choices

earnest phoenix
#

client.guilds.cache.sort((x, y) => y.memberCount - x.memberCount).first().name
this is my script. How can i get the first 10 servers?

blazing portal
#

you can't ban a non member?

honest perch
#

you can

slender thistle
#

You can

fickle sapphire
#

By id

blazing portal
#

oh?

slender thistle
#

The ban happens by an ID

blazing portal
#

nevermind then

honest perch
blazing portal
#

wow, now that is just rude 😛

earnest phoenix
#

client.guilds.cache.sort((x, y) => y.memberCount - x.memberCount).first().name
this is my script. How can i get the first 10 servers?

blazing portal
#

you will still use the same ban method though, and just provide the id then

honest perch
#

message.guild.members.ban(userid);?

blazing portal
#

yeah

pale vessel
#

@earnest phoenix use first(10), that will return the first ten biggest guilds

#

it's an array

#

you can map it to like first(10).map(x => x.name)

honest perch
#

ah yes that worked

earnest phoenix
#

@earnest phoenix use first(10), that will return the first ten biggest guilds
@pale vessel thanks

eternal osprey
#

hey how could i make a !command #channel command?

#

so i have a !tweet command

#

but i want to assign a !tweet #channel function to it

#

so the command will only send tweets to that exact channel?

autumn aspen
#

Guys is .setDescription = .setTitle?

#

Im new lol

#

@slender thistle sorry for the ping I need the answer quick

slender thistle
#

How do I end up being the chosen one

autumn aspen
#

lmao bc u best

slender thistle
#

and no, a title is different from description

autumn aspen
#

so what is it?

#

@slender thistle but is Description old or what can u use it?

slender thistle
#

sec

rocky hearth
#

what does this mean, why to do this?

import { xyz } from '.';

console.log(xyz);
export const xyz = 10;
autumn aspen
#

sec
@slender thistle what?

#

what does this mean, why to do this?

import xyz from '.';

console.log(xyz);
const xyz = 10;

@rocky hearth search it

rocky hearth
#

what

slender thistle
#

give me a second

karmic compass
#

is there a way to turn js "2,000,000" to ```js
"2000000"

slender thistle
#

one option is to use .replace

karmic compass
#

it only replaces once though

quartz kindle
#

replace with regex

karmic compass
#

so it would turn "2,000,000" to "2000,000"

#

how so?

#

*what regex

slender thistle
#

.replace(/,/g, "")?

quartz kindle
#

^

karmic compass
#

what does /g do?

quartz kindle
#

global

compact oriole
#

or replaceall

#

but that's for new es

karmic compass
#

oh thats sick asf

#

thanks!

slender thistle
#

I guess I'm more used to Python's way of implementing .replace

#
replace(self, old, new, count=-1, /)
    Return a copy with all occurrences of substring old replaced by new.

      count
        Maximum number of occurrences to replace.
        -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are
    replaced.
shy turret
#

someone told me making a (non-hard coded) text adventure bot would be hard, i finished the core in 2 days (today and yesterday) xD

earnest phoenix
#

@karmic compass String.split("").forEach(x => if (x == ",") this.splice(this.indexOf(x), 1)).join("");
haven't tested this yet so i wouldn't consider this spoonfeeding

karmic compass
#

the uh

#

regex is simpler

slender thistle
#

much as I try to recommend not using regex, why not do it in this case

earnest phoenix
#

regex is simpler
@karmic compass well you've been kinda struggling with it for the past half minute

quartz kindle
#

you can use for of... on strings

#

no need to split them

fast relic
opaque seal
#

I need to not merge the remote changes which were previously on github, I should select rebase if I don't want the remote changes to apply right?

quartz kindle
#

@fast relic but you have 32gb ram lol

fast relic
quartz kindle
#

higher end machines get faster disks

#

contabo's cheaper machines, ie the one with 4gb ram, have disk speeds of ~100mb/s

fast relic
#

well the one with 4gb ram is not ssd

honest perch
#

whats the install for the diskio test

fast relic
#

i took it out of a bench script

quartz kindle
#

the 8gb one then

#

the one thats 5 eur

fast relic
#

these were its disk speeds

quartz kindle
#

someone else posted their speeds as well some time ago, they were much worse than that

#

good for you then lul

honest perch
#

i took it out of a bench script
@fast relic hmm?

fast relic
hazy sparrow
#

Guys how the fuck should i choose a color for my embed

quartz kindle
#

random

faint prism
#

I match my bot's pfp color

fast relic
#

random/authors highest role color/bots highest role color

earnest phoenix
#

Or match the author's avatar dominant color

faint prism
#

someone else posted their speeds as well some time ago, they were much worse than that
@quartz kindle shouldn't ram be must faster than that?

quartz kindle
#

disk, not ram

faint prism
#

Ah

#

I was gonna say, my SSD shouldn't be faster than their ram

fast relic
rocky hearth
#

Has anyone used Commando here??

cinder patio
#

just ask

static trench
#

@rocky hearth best site around

rocky hearth
#

Can I have more than one commands in one file? leave....

honest perch
#

explain

autumn aspen
earnest phoenix
#

That's not how codeblocks work buddy

#

tr yetkili varmı

#

acil

#

pls

thick gull
autumn aspen
#

Help?

restive furnace
#

Can I have more than one commands in one file? leave....
@rocky hearth why use commando then?

autumn aspen
#

Veify.js command

restive furnace
thick gull
#

yea

umbral zealot
#

The hell is {max 1} supposed to be

#

Yay random button mashing from Endph

autumn aspen
#

The hell is {max 1} supposed to be
@umbral zealot lmao but Im not sure what should I put instead

#

?

umbral zealot
#

Learn JavaScript so you know how to actually write objects, maybe.

autumn aspen
#

Its super important pls help me out

restive furnace
#

Endph, have you tried to google before asking?

thick gull
autumn aspen
#

Learn JavaScript so you know how to actually write objects, maybe.
@umbral zealot pls bro

thick gull
#

learn js

slender thistle
#

forgot a colon there

umbral zealot
#

No, just learn JS.

autumn aspen
#

forgot a colon there
@slender thistle where

slender thistle
#

The hell is {max 1} supposed to be

thick gull
#

shiv its not his first time

earnest phoenix
#

<property>: <value>

slender thistle
#

max being key
1 being value

The way JS objects are displayed are {key: value}

#

do I look like I care

thick gull
#

no

earnest phoenix
#

at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
(node:20059) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1311)
(node:20059) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'send' of undefined
at Client.module.exports (/app/events/giriş.js:47:43)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
(node:20059) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1312)

#

HELP

restive furnace
#

code???

slender thistle
#

How do you use .send?

umbral zealot
#

You're doing send on something that's undefined.

earnest phoenix
#

ERROR

#

HELP

restive furnace
#

c.o.d.e

umbral zealot
#

Yes. Error. Undefined.

slender thistle
#

SEND YOUR CODE AND STOP USING CAPS LOCK

thick gull
#

HELP ERROR HELP

no code

earnest phoenix
#

how do i fix this error

thick gull
#

send

#

code

restive furnace
#

no code, no help.

earnest phoenix
#

Is there someone to help?

slender thistle
#

SEND YOUR CODE AND STOP USING CAPS LOCK

umbral zealot
#

@earnest phoenix give code

thick gull
#

yes

slender thistle
#

are you reading?

thick gull
#

send code

regal crypt
#

E-

earnest phoenix
#

help

umbral zealot
#

Maybe they thought we weren't taking to them.

restive furnace
thick gull
earnest phoenix
#

okey

#

help

rocky hearth
#

@rocky hearth why use commando then?
@restive furnace what do u mean?

thick gull
#

he put his error

#

in the

#

a) you are doing .send on something undefined

#

b) you are missing permissions

#

c) we cant help without code

earnest phoenix
#

help

rocky hearth
#

Unfortunately Commando is only registering the Commands which are exported default

earnest phoenix
#

Where should I fix in this code

restive furnace
#

yeah

#

why would you do many commands in one file?

#

its the idea of the commando

#

that your seperate your commands into different files

slender thistle
#

member.guild.channels.get(memberChannel) seems to be undefined

rocky hearth
#

Because some of them are really 5 lines, I dont want to keep scrolling in explorer

earnest phoenix
#

How can I fix it?

#

@slender thistle

slender thistle
#

What's your discord.js version?

restive furnace
#

well, one of my command is 1 line, but still its kept in different file (the command itself, not the logic - the logic is huge, like 50 lines only for that)

earnest phoenix
#

js 11

#

@slender thistle

proven lantern
#

i use v10

thick gull
#

what

slender thistle
#

oh man

earnest phoenix
#

v11

slender thistle
#

who here knows how to use d.js v11

thick gull
#

or

#

upgrade:)

misty sigil
#

upgrade better

slender thistle
#

man

restive furnace
#

please update to d.js v 12 k thx - v11 is deprecated.

thick gull
#

v11 will die in october shivvv

slender thistle
#

y'all wanna bother telling them to update?

thick gull
#

yea

slender thistle
#

Well mind helping them out actually migrate then?

earnest phoenix
#

If someone will help me tag it

restive furnace
#

why people even uses v11 anyways? 🤔

#

its not too hard to migrate

earnest phoenix
#

how do i make my bot v12 urgent

#

how do i make my bot v12 urgent

#

help

twilit rapids
rocky hearth
#

And why npm installs djs11, though djs12 is stable version

earnest phoenix
#

@twilit rapids

thick gull
#

it doesn't install 11?

#

it installs 12 default

earnest phoenix
#

How should I do? @twilit rapids

proven lantern
#

what version of node are you using?

umbral zealot
#

If it's urgent, you better be quick about reading that page!

restive furnace
#

And why npm installs djs11, though djs12 is stable version
@rocky hearth npm i discord.js@v11 exists

twilit rapids
#

Click the link I send and read the page

proven lantern
#

djs 12 doesn't support old versions of nodejs

restive furnace
#

yeah

#

but whats the problem?

#

12 is not the newest, theres 14.9 nowdays

thick gull
#

??

proven lantern
#

12.3.1 is the newest

#

not 12

thick gull
#

i think you mean node version

#

discord.js 12.3.1 is newest

restive furnace
#

node.js version..

#

but yeah

earnest phoenix
#

i don't know how to v12 my bot please help

thick gull
restive furnace
#

we were talking about that djs doesnt support older nodejs versions, so i were excepting that you thought i was talking about the ✨ node.js version ✨.

earnest phoenix
#

djs already has a guide on v12 changes

#

@thick gull My brother, it doesn't work by just sending the link, what is my inside

#

pls

umbral zealot
#

Interesting how people think their urgency needs to be our urgency.

restive furnace
#

learn to read pages hmm

thick gull
#

inside link is guide on upgrade

earnest phoenix
#

It tells you what to change in your code

#

i read but i didn't understand shit

#

@thick gull

#

For example
RichEmbed => MessageEmbed

#

It's simple

#

Will you talk to me in Turkish?

restive furnace
#

basically two major changes:
RichEmbed => MessageEmbed (i do use raw embeds tbh),
CacheManagers.

earnest phoenix
#

Main changes:
1- Class names
2- Managers
3- Parameters from normal to objects

restive furnace
#

eg.: js channel.messages.fetch({limit: 50}); // instead of channel.messages.fetch(50);

eternal osprey
#

hey guys

#

how do i make a !stop command?

#

i do have this:

#
else if(message.content.startsWith(prefix + "stop")){
    message.channel.send('The twitter feed has been stopped!')
return;

  }
  if (message.content.startsWith(prefix + "feed")) {
    if (message.channel.id == "735243676460253225") {
      const args =
        " " + message.content.slice(prefix.length).replace(/^feed/, "").trim();
      queueMessageText =
        "**The twitter feed has been searched and sent by this/these keyword(s): **";
      queueMessageText +=
        " " + message.content.slice(prefix.length).replace(/^feed/, "").trim();
        setInterval(function Myfunction(){
          console.log(Myfunction)
      T.get("search/tweets", { q: args, count: 1 }, function ( 
        err,
        data,
        response```
#

however, it kinda keeps going with the feed without stopping lmao?

cinder patio
#

Save the interval somewhere, and clear it via clearInterval in the stop command.

earnest phoenix
#

you are setting an interval

#

an interval without something to cancel it does not stop

eternal osprey
#

ooowh okay

earnest phoenix
#
// set the interval and save it to "interval"
let interval = setInterval(()=>{console.log("fired")},1000);
// set a timeout for 10 seconds
setTimeout(()=>{
  clearInterval(interval) // Cancel interval
},10000)
#

example

eternal osprey
#

uhhm that didn't work for me

#
else if(message.content.startsWith(prefix + "stop")){
    let interval = setInterval
    message.channel.send('The twitter feed has been stopped!')
    clearInterval(interval)```
whole echo
#

Hey! Need help with basic stuff. When a member types certain message I want my bot to respond with another specific one but delayed by a certain time

#

And I don't know how to add that delay

misty sigil
#

setTimeout

pure lion
#

Lang?

misty sigil
#

for js ofc

pure lion
#

For py

whole echo
#

It's for js

pure lion
#

sleep(time in second)

#

Okay

whole echo
#

Ty

#

Anyways

restive furnace
#

~~```py
import asyncio

asyncio.await_for()```or 🔥 something 🔥~~

pure lion
#

setTimeout(function(){code here}, milliseconds here)

#

@whole echo

whole echo
#

Ty guys

#

<3

slender thistle
#

No

#

Please don't assume also

pure lion
#

@restive furnace you can also
from time import sleep
sleep(uwuowo)

slender thistle
#

DON'T DO THAT IN DISCORD BOTS

restive furnace
#

yeah, since its not asynchronous

pure lion
#

Ok shiv sorry ummh

#

Oh makes sense

slender thistle
#

for async use asyncio.sleep
for sync use time.sleep

earnest phoenix
#

Can anyone make me a weather bot

#

._.

pure lion
#

No

earnest phoenix
restive furnace
pure lion
#

Dm me

restive furnace
#

and its not mine

pure lion
#

NoooOO I want money

#

:(

restive furnace
#

so im not adversiting ok

stark abyss
#

MongoParseError: URI does not have hostname, domain name and tld

#

help

#
const MongoClient = require('mongodb').MongoClient;
const uri = `mongodb+srv://P025:${dbPass}
@cluster0.dszlo.mongodb.net/plswork?retryWrites=true&w=majority`;
const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true });
client.connect(err => {
  const collection = client.db("test").collection("devices");
  // perform actions on the collection object
  client.close();
});
eternal osprey
#

isn't that dumb to put it here?

stark abyss
#

it is?

#

am I gonna get hacked now? nepheh

whole echo
#

And another dumb question

#

How do I make my bot @ the message author?

#

Don't ban me for spoon feed :(

eternal osprey
#

search on internet.

misty sigil
#

You can just stringify message.author

slender thistle
#

Be more helpful than just "search it yourself"

eternal osprey
#

I know

#

but he clearly could search for easy ways on the internet within seconds

restive furnace
#

user#mention on both, eris n djs

whole echo
#

but he clearly could search for easy ways on the internet within seconds
@eternal osprey that's what I was trying to do, but I don't really found anything useful that's why I came here

eternal osprey
#

owh okay sorry in that case.

whole echo
#

Npnp

eternal osprey
#

you could use message.author

whole echo
#

Ty guys

livid otter
#

i want premium user system in my bot (discord.js) can someone help me?

stark abyss
#

i want a database can someone help me or should i continue using json as db

misty sigil
#

json db?

eternal osprey
#

mongodb has great free options

restive furnace
#

@stark abyss no, go use ✨ PostgreSQL ✨ or 🔥 MongoDB 🔥, or ⬆️ MariaDB ⬆️

stark abyss
#

i tried using mongoDB but i just can't seem to understand on how to use it

#

i want a cloud db

opal plank
#

Posgtres >

#

cassandra pretty good too

stark abyss
#

don't wanna download no app

opal plank
#

then dont

#

its your code, feel free to ignore us

restive furnace
#

✨ PostgreSQL ✨ => Scalable and for high write/read rate
🔥 MongoDB 🔥 => Better JSON
⬆️ MariaDB ⬆️ => MySQL v2
🌟 Cassandra 🌟 => Is what Discord uses

stark abyss
#

which would be the easiest to use?

opal plank
#

if you asking for advice, the least you could do is listen

#

depends what your needs

stark abyss
#

Erwin I am listening I think you misunderstood me

opal plank
#

all of them will require you to downlaod something

stark abyss
#

or I didn't do a good job of conveying whta I wanted to say

opal plank
#

thats my point

#

you need to install the database before you use them

stark abyss
#

Well

#

How does mongodb atlas work

opal plank
#

i dont have experience on that so i cannot comment

stark abyss
#

Does anyone else know?

opal plank
#

ive seen plenty of example but never tried it myself, so i cant give anything solid

#

postgres offers me everything i need

#

relation tables, acid compliant, low latency queries and a TON of over the top SQL features, like types and the sorts

stark abyss
#

Okay

opal plank
#

though if you use something like elastisearch you could get even faster results

stark abyss
#

Is postgres fairly easy to use?

opal plank
#

easy? not quite

stark abyss
opal plank
#

it has a good GUI to give you an example

#

but you need a basic SQL knownledge

stark abyss
#

Erwin I was looking for something easy to use I clearly have no such experience

opal plank
#

postgres has some really advanced usages

misty sigil
#

quick.db

opal plank
#

its more use case

#

postgres IMO is good for everything

stark abyss
#

Well quick.db would be the most easiest but not the most efficient

opal plank
#

once you learn it its highly unliekly you'll need to change database

misty sigil
#

Mongo’s good for a lot of things

restive furnace
#

SQL is pretty ✨ easy ✨: SELECT * FROM users WHERE id = ? and yes i use prepared statements.

stark abyss
#

Okay

opal plank
#

unless you doint some over the top webscaling like what im doing for twitch, i could use cassandra or some master/slave setup to increase the queries efficiency

stark abyss
opal plank
#

im doing over 10k iterations a second

restive furnace
#

CQL has some diffencies compared to SQL tho

opal plank
#

min*

stark abyss
#

wow

opal plank
#

unless you getting that stupid amount of traffic you shouldnt worry about transfering to a faster database

#

postgres is my go to

cinder patio
#

What does the bot do

stark abyss
#

I see

opal plank
#

on webscaling you might wanna go for something with a faster speed due to the sheer amount of queries you're running per second

stark abyss
opal plank
#

if you getting on that level, do look for a different db

#

otherwise, postgres will most likely fit all your needs

stark abyss
#

It would fit all my needs if I can learn how to use it

opal plank
#

just for the love of god, dont fuck with JsonB tables

stark abyss
opal plank
#

i absolutely regret dicking with jsonb tables

#

its handy but hella complicated

#

yo'ure storing json in a table

#

its more reliable to stringfiy it and then save it

#

apart from that, i have no complaints with pg whatsoever

stark abyss
#

Okay I'll seen on youtube how to use it, if it seems something that I can use it then I will try

mystic tundra
stark abyss
mystic tundra
#

It is very simpler and easier than postgres

opal plank
#

like i mentioned, postgres is mostly good for everything, though some other db's have better advantages. if you want something lighter and more simple, there are better optionss. postgres is a good, reliable and efficient mid tier db. The example i gave you is the top tier end, where you get too much traffic and might wanna use something else. theres also the low tier where postgres is 'too advanced' for what you need

#

say, you only need a database to store prefixes for guilds

#

then postgres would be the incorrect tool for the job

#

can it do the job? absolutely

#

should you? likely not

#

unless you want to continuing developing the bot where you'1ll need more advanced tools

stark abyss
#

I plan to store quite a bit of information

opal plank
#

then go for postgres by all means

#

it will provide you with all the tools you'll need

stark abyss
#

I am planing to make a market kinda thing where people can add what they are selling (in game cards)

#

OKay

opal plank
#

postgres would be a reliable option in this case

#

if you plan to future-proof* your bot, use that

stark abyss
#

Alright sounds good thanks

opal plank
#

i put an asterisc there cuz like i mention, depending on the traffic you get you might wanna use elasticsearch or a quicker db

#

see @slender thistle ? i can offer good help while drunk mmulu

slender thistle
#

😂

#

I take my words back, okay

opal plank
#

i just cut more corners while drunk lol

faint prism
#

@slender thistle What library are you developing

slender thistle
#

dblpy

opal plank
#

im on the fence about releasing my code as a library type tbh

#

for caching in twitch-js

#

it should be an easy conversion but im still bug fixing it

slender thistle
flint warren
#

Commands Extensions

final path
#

..

earnest phoenix
#

@slender thistle what library did you develoo

slender thistle
#

I'm not sure if you are fucking around or actually serious

rocky hearth
#

when the bot joins a vc, what would be its speaking state?

obtuse jolt
#

how do I get the channel id from a channel mention

rocky hearth
#

@obtuse jolt Check <Message>.mentions. There should be a property to get that

honest perch
#

@earnest phoenix dblapi.js

obtuse jolt
unique patio
#

If anyone knows why a fetch "post" won't obtain a user/pass/hash cookie when the body is correct but all the other cookies needed. Writing a bot to log into a site and it works when I copy and paste the cookie but won't send it without replying bad statuses.

#

Not sure it's cors block either, or origins issue. Headers look right and are exactly identical to the sites header. Might be a cloud-front block or something odd.

sudden geyser
#

@obtuse jolt try logging message.mentions.channels

#

It doesn't show up in the log for message.mentions, but it's a non-null return type so it should exist.

obtuse jolt
#

it literally logged everything about the guild and now i cant see anything useful

unique patio
#

no?

sudden geyser
#

Then you probably got a collection of channels

#

So you can just get the first item from the collection and its .id

rocky hearth
#

How do I know, if the bot is playing music?

#

Is there any property to check if the dispatcher has ended or not?

obtuse jolt
#

whats the api abuse laws on webhooks

honest perch
#

40 per 3 seconds is rate limit

#

Approx

#

Don't ask how I know

obtuse jolt
#

thats ridiculous

earnest phoenix
#

Most things on discord don't have set ratelimits, they're dynamic

opal plank
#

^^

#

check request header

sudden tulip
#

lock a command to bot owner

#

in djs

obtuse jolt
#

cool

#

what about it

sudden tulip
#

how do i do it

#

shit thought i typed that part

obtuse jolt
#

we don't spoon feed code, have you tried to do it?

sudden tulip
#

yes

obtuse jolt
#

well what did you try

sudden tulip
#

using the admin tag

obtuse jolt
#

show me

sudden tulip
obtuse jolt
#

what you tried

earnest phoenix
#

That's not bot owner

obtuse jolt
#

yes

sudden tulip
#

for me it is

obtuse jolt
#

yes because its <Message>.member.hasPermission()

sudden tulip
#

bc i get my account banned alot

obtuse jolt
#

not member.hasPermission

earnest phoenix
#
if (message.author.id === "Your ID") {
// Do the command
}```
#

You said bot owner not guild admin

sudden tulip
#

can i do multiple ids

sinful thistle
#

I am trying to test my bot in #commands Why is it not working?

earnest phoenix
#

Your bot is not approved

sinful thistle
#

oof

obtuse jolt
#

@sinful thistle your bot is no approved

sinful thistle
#

O

#

Oh

obtuse jolt
#

@sudden tulip yes there is a way to do it

earnest phoenix
#

can i do multiple ids
@sudden tulip Put the ids into an array

sudden tulip
#

😐

obtuse jolt
#

no

#

you made arrays by doing ["id1", "id2", "id3"]

earnest phoenix
#
if (["ID", "ID", "ID"].some(id => message.author.id === id)) {
// Code here
} else {
// Do something if it's not the owner
}```
sudden tulip
#

kk thx 🙂

obtuse jolt
#

i need a new phone battery

sudden geyser
#

could go a step further: js if (["id", "id", "id"].includes(message.author.id)) {...}

obtuse jolt
#

THATS WHAT IT WAS

#

i was trying to remember that code for like an hour

sudden geyser
#

5head

earnest phoenix
#

That's not actually a step further, just smaller, but js Array.prototype.some() is more, advanced than includes()

obtuse jolt
#

we don't need confusing advanced code

#

either one does the same thing

earnest phoenix
#

"confusing" bruh

modest smelt
#

How can i code a bot where it can latexify a given expression? discordpy

sudden geyser
#

May I ask what latexify-ing is

modest smelt
#

basically converting a math equation to latex

leaden lake
#

does anyone have a host for the python bots ? I don't have a Raspberry, and I have a problem with heroku and github. My code perfectly works when I launch it from my PC but on heroku, it is doing some sh*t and not what I programmed

modest smelt
#

do u mean free?

leaden lake
#

yeah

modest smelt
#

where do u run it?

quartz kindle
#

@modest smelt you want the user to write latex code and the bot outputs the printed/formatted equation?

leaden lake
#

I ran it on heroku with github. But I added code, and now, nothing is working but all my code is correct bc it works when I launch the .py from my computer

#

@modest smelt

quartz kindle
#

Then you did something wrong or you have something missing

#

Its not herokus fault

leaden lake
#

no, I just copy and past the code lmao

quartz kindle
#

Yeah thats what i said

opal plank
#

yikes

#

dont copy paste code

modest smelt
#

you have to add some requirements

leaden lake
#

I copy / paste on github

modest smelt
#

look at some video

quartz kindle
#

Platforms like heroku often require specific configuration for your project to run on it

leaden lake
#

I added all requirements

quartz kindle
#

Check your error logs, read some heroku guides for using python

modest smelt
#

yes

leaden lake
#

heroku haven't any error

quartz kindle
#

In any case if you want to move out, i recommend a paid vps

modest smelt
#

vps?

opal plank
#

yeah

#

to put it simply, a 'server'/ 'computer' to run your code on

#

its 24/7

#

heroku, glitch and the sorts have plenty of limitations due to it being free

earnest phoenix
#

I need some help people.

opal plank
#

dont ask to ask

#

state your question

modest smelt
#

@modest smelt you want the user to write latex code and the bot outputs the printed/formatted equation?
@quartz kindle yes

earnest phoenix
opal plank
#

wrap safe?

quartz kindle
#

You will likely need a drawing library, and have latex draw on it

#

And send it as an image

opal plank
#

i'd have a wild guess and say thats either library or node error

earnest phoenix
#

Not sure.

opal plank
#

or your code

quartz kindle
#

Show code @earnest phoenix

opal plank
#

^^

#

what exactly you running on powershell?

earnest phoenix
opal plank
#

well thjere you have it

#

your linter is telling you

#

look in the bottom, you cant -/+ consts

earnest phoenix
#

Oaky.

#

I need those to be properties

opal plank
#

remove the -/+

modest smelt
#

w8 @quartz kindle how will i do that?

#

i can contact code dogs

opal plank
#

thought

#

that wont yowkr

modest smelt
#

but how will i do that?

quartz kindle
#

Also, you cant redeclare a const, you already declared config

opal plank
#

^^

leaden lake
#

Heroku is installing python version 3.6.1 but I need the 3.7.7. How to ask heroku to install the right version ? in the requirements ?

opal plank
#

why you even using config if you hardcoded your token?

earnest phoenix
#

@quartz kindle I'ma Dm you

opal plank
modest smelt
#

@quartz kindle ?

quartz kindle
opal plank
modest smelt
#

ok

opal plank
#

everyone relying on tim

modest smelt
#

lol

opal plank
#

trying to get an api hooked up with a proxy

#

ngl this shit hard

hushed axle
#

catsad can anyone have me how to make a dashboard

opal plank
#

same thing im working on

#

though im trying to move away from php to do it

#

and using an express like app

#

its hard when you dont rely on boilerplates

modest smelt
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: RuntimeError: Failed to process string with tex because latex could not be found

#

error

earnest phoenix
#

How can I get the participantId value of a person whose name is aproxthethat from a json file?

 {
            "participantId": 2,
            "player": {
                "platformId": "TR1",
                "accountId": "gKXPhNTNeYEttj-xV9AWziRs6eDCGyWfxvxDiar4j4FpxIW23KGn9GKc",
            --> "summonerName": "aproxthethat",
                "summonerId": "ug1XDV8d5Bh4M6CmTiQVfvT7Gi4953SOnDrnKpKByaq9ouo",
                "currentPlatformId": "TR1",
                "currentAccountId": "gKXPhNTNeYEttj-xV9AWziRs6eDCGyWfxvxDiar4j4FpxIW23KGn9GKc",
                "matchHistoryUri": "/v1/stats/player_history/TR1/2033771425100256",
                "profileIcon": 4655
            }
}
boreal iron
#

because latex could not be found That’s what he said. lel

sudden geyser
#

@earnest phoenix what language are you using

earnest phoenix
#

javascript

modest smelt
#

because latex could not be found That’s what he said. lel
@boreal iron then how can i fix?

sudden geyser
#

You could use Object.values to convert the object key/value into an array of the object's values, then call .find() on it, while passing it a function to see if summonerName is equal to whatever name. I don't know what the actual structure of the object looks like, so I can't provide an example.

earnest phoenix
#
let ahaha = data.find(uu => uu.summonerName === `aproxthethat`)
console.log(ahaha["participantId"])
#

like?

#

@sudden geyser

boreal iron
#

How about JSON.parse ?

unique patio
#

^

earnest phoenix
#

are you using json as a db

#

lol

modest smelt
#

w8 what should i do?

unique patio
#

That's json there, you'd JSON.parse()

#

Then you can call it like player.summonerName

earnest phoenix
#

Why am I getting the message, "Unexpected Token 'else' "

#

because it's unexpected

unique patio
#

Change that last else to if

#

You nested it wrong

earnest phoenix
unique patio
#

let me run it one moment,

#

put } else if

#

Then for your token, make sure that's set to your bot

#

You can just const Config = require("./config.json");

#

Then Config.Token it.

earnest phoenix
unique patio
#

remove the last }

#

well not last one but

#

if (first startment){

} else if () {

} else if() {

}

#

You have an extra }

#

Can't copy nor want to re-write the code, so spot that, and it should run no syntax error.

earnest phoenix
#

Still not working

unique patio
#

Paste the code on hastebin

earnest phoenix
#
const { prefix, token } = require('./config.json');
const client = new Discord.Client();

client.once('ready', () => {
    console.log('Ready!');
});
client.on('message', message => {
    if (message.content.startsWith(`${prefix}ping`)) {
        message.channel.send('Pong.');
    } 
else if (message.content.startsWith(`${prefix}beep`)) {
        message.channel.send('Boop.');
 } else if (message.content.startsWith('${prefix}serverinfo)') {
            message.channel.send(`This server's name is: ${message.guild.name}`);
        }
});
client.login(token);```
#

Theres the code

fickle sapphire
#

You used wrong quotes

#

At the last one

earnest phoenix
#

OH

fickle sapphire
#

‘${prefix}serverinfo’

earnest phoenix
#

Help in Command Handler

unique patio
#
const Discord = require('discord.js');
const Config = require('./config.json');
const client = new Discord.Client();

client.once('ready', () => {
    console.log('Ready!');
});
client.on('message', message => {
    if (message.content.startsWith(Config.PREFIX) {
        message.channel.send(`Pong.`);
    } else if (message.content.startsWith(`${Config.PREFIX} beep`)) {
        message.channel.send(`Boop.`);
    } else if (message.content.startsWith(`${Config.PREFIX} serverinfo`)) {
        message.channel.send(`This server's name is: ${message.guild.name}`);
    }
});
client.login(Config.Token);
#

Few syntax issues, your startsWith had a non closing )

#

Also you were using the ${} wrong they are wrapped in ``

earnest phoenix
#

Oh

unique patio
#

Config.???? may be wrong

#

but set that how you want

#

🙂

earnest phoenix
#

Thanks

unique patio
#

Easily caught, try building your nested statements slower

#

and running console.log, if things underline red check them immediately or know why they are.

#

Sometimes it can be a lack of closing brackets or a function.

earnest phoenix
#

Same error

#

What this is code?

unique patio
#

This file I sent back is run_main_module?

#

It errored there line 17

earnest phoenix
#

Wdym?

unique patio
#

Which if that's the case you need to pass the right token

#

The code I copied and pasted, was that the file I said?

earnest phoenix
#

No

unique patio
#

run_main_module.js
is this?

const Discord = require('discord.js');
const Config = require('./config.json');
const client = new Discord.Client();

client.once('ready', () => {
    console.log('Ready!');
});
client.on('message', message => {
    if (message.content.startsWith(Config.PREFIX) {
        message.channel.send(`Pong.`);
    } else if (message.content.startsWith(`${Config.PREFIX} beep`)) {
        message.channel.send(`Boop.`);
    } else if (message.content.startsWith(`${Config.PREFIX} serverinfo`)) {
        message.channel.send(`This server's name is: ${message.guild.name}`);
    }
});
client.login(Config.Token);
earnest phoenix
#

That was index.js

unique patio
#

Your error isn't there then

#

Look closely at your message

#

Where it starts, and gets caught up at

earnest phoenix
unique patio
#

Oh match those to the copy/paste I sent

#

or adjust the Config.Token -> Config.token

#

and Config.PREFIX -> Config.prefix

#

Your JSON is formatted just fine!

#

If it still errors, it's not generating from this part of the project.

earnest phoenix
#

Okay

unique patio
#

So what's your project tree looking like?

#

Error looks outside the discord module

earnest phoenix
#

One seccond please,

unique patio
#

gonna confirm too the library used is not bad-code.

#

Yup 🙂

#

discord.js changes so will confirm that too

#

Yeah the code sent as long as it matches JSON if ran alone, it should work no problem but you have issues at your djs/loader.js

#

cjs*

earnest phoenix
#

Okay.

boreal iron
#

if (message.content.startsWith(Config.PREFIX) {
message.channel.send(Pong.);
}

#

Missing )

unique patio
#

Fixed it

#

FaKe

#

but issues resides deeper project, that was caught

boreal iron
#

Wheeps

unique patio
#

errored way before that could go off

#

D:

boreal iron
#

Following on mobile is quite hard, sry

unique patio
#

No worries trying to see where this issue kicked in but seems maybe more issues in the code than one bit?

earnest phoenix
#

@unique patio If possible I can send the whole file over.

#

Or not sure.

unique patio
#

hastebin it

earnest phoenix
#

Pastebin?

unique patio
#

you can upload your loader.js file there

#

Sure

#

It may just be a syntax error

#

like found in the discord loader, hopefully not much more than the loader.js is broken

earnest phoenix
unique patio
#

If you read the error closely @earnest phoenix look at its lowest initiator, what ran before it all went stumbling down.

#

I'll peak the code but for reference read it sort of like this your error messages, bottom up.

earnest phoenix
#

Oh

unique patio
#

The green usually are ok, but the top red is your issue

earnest phoenix
#

So i need to reinstall the library?

unique patio
#

This can confuse you though big time if syntax/etc is all janked so go slow and run often.

#

let me look

#

In all honesty with the code you got

#

that runs, your addon is what is not running

gentle oxide
#
async def play(ctx):
    global queue

    server = ctx.message.guild
    voice_channel = server.voice_client

    async with ctx.typing():
        player = await YTDLSource.from_url(queue[0], loop=client.loop)
        voice_channel.play(player, after=lambda e: print('Player error: %s' % e) if e else None)

    await ctx.send('**Now playing:** {}'.format(player.title))
    del(queue[0])```
#

I don't know what the error is

unique patio
#

You may have it installed wrong or using it incorrectly.

#

Can't help with java fully

gentle oxide
#

Is Python

earnest phoenix
#

Okay.

unique patio
#

Yeah not my lingo

#

sorry D:

earnest phoenix
#

Thanks though!

unique patio
#

See what you can do port, the error is not with that new file you got and your config

earnest phoenix
#

Mkay.

unique patio
#

You can try those in a new project with the discord.js

#

and see for yourself! 🙂

earnest phoenix
#

Ill try to rewrite the script

stark abyss
#

Can someone explain what this means? This is quick.db

#
var economy = new db.table('economy')
economy.set('myBalance', 500) // -> 500
economy.get('myBalance') // -> 500
db.get('myBalance') // -> null```
opal plank
#

var

stark abyss
#

is table like an object?

opal plank
#

stop copying snippets from 2009

stark abyss
#

I am not copying them, it was an example in the doc

opal plank
#

thats what i mean

stark abyss
#

how rude

opal plank
#

var bad

sudden geyser
#

help = "me"

stark abyss
#

well it may be bad but right now i am just focusing on 22-24 members in my server

opal plank
#

var has some quirkyness to it, which you should understand before using it

#

there are very specific use cases for var

stark abyss
#

Well I do understand the basic variable in javascript

honest perch
#

var bad
@opal plank yes use const

opal plank
#

99% you should be using let/const

stark abyss
#

I am not sure about let or const

honest perch
#

I never use var

stark abyss
#

const is constant which you don't change

unique patio
#

All are fine

stark abyss
#

^?

honest perch
#

No

unique patio
#

EC6+ allows for it all

opal plank
#

dont get me wrong, there ARE use cases for var

sudden geyser
#

The rule for var is to rely on let usually

unique patio
#

Just use it appropriately.

honest perch
#

Eslint just tells me what to use soo

sudden geyser
#

Maybe you'd rather suffer and use var to support old JS

opal plank
#

fuck that

stark abyss
#

jeez you guys calm down I am trying to learn all works fine I don't need it to be like perfect as long as it works its okay

unique patio
#

Many adapters use it

opal plank
#

update your browser

unique patio
#

So it's very acceptable, but yeah old-support; let is newer but no issues in compliance

#

Lint will not call you a bad person

stark abyss
#

can you guys explain what table is or should i LEAVE

opal plank
#

table is a ordered storage for your stuff

stark abyss
#

is it like object?

opal plank
#

its a aglomeration of tuples, if that exaplains it

#

imagine a graph

stark abyss
#

okay

sudden geyser
#

Can someone explain what this means? This is quick.db
@stark abyss think of it like a key/value that can persist:

economy.set(...) sets the key as myBalance to 500.
economy.get(...) gets the key "myBalance", which returns 500 as that's what you just set.

I haven't used QuickDB but this is the concept behind it.

opal plank
#

x | name | nickname
1 | erwin | Lerwin
2 | p025 | Poh

#

thats a table

#

all the 'rows' take the same shape

stark abyss
#

ah I see

opal plank
#

usually you'd want an indexer on it

#

in this case, it'd be 1, 2....

#

its an unique identifier

stark abyss
#

so let's say if I don't want to include a nickname for someone I would have to since it's a table?

opal plank
#

your tables can take any shape you want

unique patio
#

To sum it in your mind, it can be seen like an object but it's fixed.

opal plank
#

you can have null values depending on your options

#

YOU create the table

stark abyss
#

object but it's fixed okay

opal plank
#

therefore you allow its shape

#

if you want a value to be permitted to be empty, so be it

honest perch
#

n.link

#

Scan

opal plank
#

otherwise, set it as NOT null

honest perch
#

Scam

stark abyss
#

I think i get it now thanks guys

opal plank
#

wdym scam?

#

you suppose to type in twitch chat

honest perch
#

Whats twitch

opal plank
#

and in a channel the bot has access to such as #commands

#

i assume you type n.link cuz of my stream

honest perch
#

Yes

opal plank
#

Twitch?

honest perch
#

Whats twitch

#

Idk

stoic stirrup
#

bruh

opal plank
#

you dont know what Twitch is?

honest perch
#

Nope

opal plank
#

just this

unique patio
#

sus

honest perch
#

Isnt it that website where that women threw her cat

opal plank
#

prob the biggest streaming website

unique patio
#

Bigger then the ornhub 😄

indigo flax
#

Do not use .json for a database

Using .json file for a database is not a smart idea. If you do use it as a database, trust me, you'll regret it.

First off, .json is a data format, and should not be used as a database. .json is usually used for configuration like your bot token or prefix.

Second off, .json is a way to represent data as a sequence of bytes, usually for transmitting as a message or storing in longer-term storage. A database is a way to organize data to make retrieval efficient. You can, at least in principle, store data in .json format then later read it in and extract out useful information. That would be using it as a kind of rudimentary database, but it wouldn’t be scalable or even practical for more than relatively small amounts of data.

Third off, if the ,json file gets updated frequently, then corruption may happen. The data in the file may be wiped out, and even if you make a backup every once in a while, you may still encounter the file being corrupt at an unexpected time. And you can save a lot of time just by using an actual database.

How do I prevent this from hapening?

I recommend you use an actual database such as MySQL, MongoDB, QuickDB, or other reliable databases.

Other Useful Resources:

https://discordapp.com/channels/264445053596991498/272764566411149314/756493131842584687

https://discordapp.com/channels/264445053596991498/272764566411149314/752260260672176221

honest perch
#

Jesus

opal plank
#

we alreayd got one austin

#

check pins

honest perch
#

@opal plank lmao never heard of it

opal plank
#

anyhow, check the docs for it

#

if you truly interested in it, there is documentation on it

#

as well as a visual tutorial

#

if you dislike reading

honest perch
#

How can i make a programming language in html

unique patio
#

If I can add, cause that was large. JSON is deserialized for fast search.

opal plank
#

are you trolling misly?

unique patio
#

Not ideal for DB but like XML; we'd not go storing info there either

opal plank
#

cuz this aint the place?

honest perch
#

Idk

unique patio
#

Good for static data, not necessarily updated often for fast sorting/etc.

opal plank
honest perch
#

Sorry human

#

I'll gi sleep

opal plank
#

i'd me more than happy to guide you for using my bot if you arent trolling, though keep this chat on topic

#

anyhow, back to api development

unique patio
#

I'm trying to sort the status block on my post response.

#

Can't seem to pass right data through headers/body to get a user/pass/hash r esponse from a server unless I'm in tab.

#

Thinking cloudfront got me beat or something.

indigo flax
#

how do u make ur bot online

unique patio
#

Me?

indigo flax
#

no i need help

honest perch
#

With a language

unique patio
#

You need to select a language most comfortable learning with an discord API to require.

indigo flax
#

@honest perch discord.js

honest perch
#

Mans messing

indigo flax
#

like online on a phonw

opal plank
#

@honest perch go sleep

honest perch
#

Ohhh

unique patio
#

Then through discord developer get your API key and use it.

#

Oh use astro

honest perch
#

Its a hidden api feature

unique patio
#

on your android

#

🙂

opal plank
#

undocumented, dont use it @indigo flax

honest perch
#

You can modify it in the node module

opal plank
#

you'd need to modifiy librayr identification payload

#

dont do it