#development

1 messages · Page 1273 of 1

umbral zealot
earnest phoenix
#

i would've asked there but there's an outage apparently

stable nimbus
#

Oh yay

umbral zealot
#

works fine for me.

#

man that's a lotta members. heh

earnest phoenix
#

it's back up

umbral zealot
#

also tbh that video doesn't tell us what the code is, it's usually better to have the code, ideally in a codesandbox to reporduce the issue

earnest phoenix
#

it's just what you'd think it is

#

a small state container

umbral zealot
#

Well... yeah... but... the issue you have clearly relates to the code, and seeing that video only hints and what potentially the issues could be, there's no way to really know other than to poke at theories

earnest phoenix
#

i'm digging through the values right now to see what state is what at the time of selecting paths

umbral zealot
#

I'm so happy to be allowed to link to proper discord servers >.<

sonic lodge
#

how high or small does a number need to be until it gets expressed in scientific notation (in js)?

umbral zealot
#

I don't remember JS ever switching to scientific notation on its own

#

but core JS integers can only go up to 9007199254740991

#

if you need higher than that you need to use BigInt

stable nimbus
#

@umbral zealot How do I call for pm2 in my code?

umbral zealot
#

you don't. it's the other way around

#

pm2 is a process manager, it launches your code

pale vessel
#

never mind

umbral zealot
#

that's your browser doing it

honest perch
#

pm2 start file.ex --name processname

pale vessel
#

what am i dong

quartz kindle
sonic lodge
#

so >= 1e+21

umbral zealot
#

yeah but that's browser display, JS doesn't do that afaik

stable nimbus
#

Ah, okay.

pale vessel
#

js does

#

the browser console is literally js

quartz kindle
#

scientific notation is 100% display

umbral zealot
#

It literally can't see those numbers correctly anyway, you can see how it modifies the last number

stable nimbus
#

So I do

pm2 start `../../index.js`

?

quartz kindle
#

the code itself doesnt understand scientific notation

umbral zealot
#

@stable nimbus you can't use template literals in your command prompt, man.

#

in other words, RTFM

earnest phoenix
#

how can i delete element from a string in javascript?

rocky hearth
#

How do I make this regex /^([^\.].*)\.js(on)?$/ to also accept ts extension

earnest phoenix
#

${encodeURI(args.join(''))} the value entered here will be deleted if it is a açık

pale vessel
#

why not just [".js", ".json", ".ts"].some(x => string.toLowerCase().endsWith(x))

#

why regex

rocky hearth
#

I'm using a package called require-all

#

its options, requires a regex to be provided

#

I think I should do, /^([^\.].*)\.(j|t)s(on)?$/

sonic lodge
#

which allows .tson lol

rocky hearth
#

Haha, hvn't thought of that 😅

earnest phoenix
#

just take what require-all does and adapt it to use what flazepe said

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

module.exports.config = {
    name: "meme", 
    aliases: []
}
    
module.exports.run = async (client, message, args) => {
    const subReddits = ["dankmeme", "meme", "memes"]
        const random = subReddits[Math.floor(Math.random() * subReddits.length)]

        const img = await randomPuppy(random);

        const embed = new Discord.MessageEmbed()
        .setColor("RANDOM")
        .setImage(img)
        .setTitle(`Your meme sir/ma'am. From r/${random}`)
        .setURL(`https://reddit.com/r/${random}`)

        message.channel.send(embed);
    }

Code:

#

Error:

(node:10840) UnhandledPromiseRejectionWarning: ReferenceError: randomPuppy is not defined
    at Object.module.exports.run (C:\Users\admin\apemodicus\commands\meme.js:12:21)
    at Client.<anonymous> (C:\Users\admin\apemodicus\index.js:40:34)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\admin\apemodicus\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
(node:10840) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:10840) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
#

help anyone?

misty sigil
#

define it

#

like

#

why not read your fucking errors

autumn aspen
#

oh

#

I clearly see it

misty sigil
#

const randomPuppy = require('random-puppy');

#

its literally the first line on the npm page

earnest phoenix
#

reading what you copypaste is too much effort

misty sigil
#

im gonna say something

#

that i say a lot

#

whitenames.

earnest phoenix
#

I want the text of --koyu removed when the transaction takes place? how can I do

if (args.includes("--koyu")) {
const attachment = new MessageAttachment(`https://api.alexflipnote.dev/supreme?text=${encodeURI(args.join(' '))}&dark=true`,`Supreme.png`)
message.channel.send({files: [attachment]})
return
}
misty sigil
#

.replace?

earnest phoenix
#

leaves a gap

#

include the space

#

lol

#

replace('--koyu','') ?

blissful bridge
#

yes

#

msg.content.replace('--koyu, '')

#

or args.join(' ').replace('--koyu', '') what ever it is

vernal depot
#
await fillTextWithTwemoji(ctx, emoji, x, y + 8)

It's not writing anything :/

#

emoji = "❌"

quartz kindle
#

replace with '' instead of ' '

earnest phoenix
#

the difference

autumn aspen
#

a gid

#

f

#

.set what?

#

@misty sigil

misty sigil
#

??????????????????????????????????????????????????????????????????????/

autumn aspen
#

how do I add a gif

misty sigil
#

.setImage?

autumn aspen
#

no its a gif

misty sigil
#

but gifs are images

autumn aspen
#

oh lmao

#

SILLY

pale vessel
#

@earnest phoenix filter your args, args.filter(x => !x.startsWith("--")).join(" ")

vernal depot
#

loadImage isn't working

misty sigil
#

Canvas.loadImage()?

heavy pollen
#

Hello guys I'm using mongodb for my bot. But sometimes mongodb service is stopping automatically. So I need to open mongodb service manuall from Services -> Mongodb -> Start. How can I fix this or how can I start mongodb automatically?

#

I'm using Windows server 2019 with mongodb version 4.4.1

#

When its started mongodb works in my bot btw*

cinder patio
#

You can use the child_process module and the execSync function to start the mongod process, if that's what you mean

heavy pollen
#

im saying here, I need to start mongodb from here manually when its stopped

#

my database url is mongodb://localhost:27017?authSource=admin

earnest phoenix
misty sigil
#

@earnest phoenix there isnt any

opal plank
#

tryitand.see

earnest phoenix
#

Can someone please help me link to namecheap domain to my Hostwinds VPS?

#

I've bought the domain, and I believe i've set the nameservers, and the server is online so it should be good, right?

short siren
#

have u setup like apache or somthin

earnest phoenix
#

No but I have a server handling requests

#

Using expressjs

short siren
#

yeah

#

you also need like apache or nginx

#

ontop of that

cinder patio
#

You have to set up ngnix/apache to act as a proxy and forward requests to your express server.

proven lantern
#

in Squad there are different team voice channels and the team leaders in each voice channel can talk to each other via a team lead channel. would it be possible to create this feature in discord?

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

module.exports.config = {
    name: "serverinfo", 
    aliases: ["si"]
}
    
module.exports.run = async (client, message, args) => {
  const embed = new Discord.MessageEmbed()
    const serverIcon = message.guild.displayAvatarURL
  .setTitle("Server Info")
  .setColor(0xfff06e)
  .setThumbnail(serverIcon)
  .addField("Server Name", message.guild.name)
  .addField("Created On", message.guild.createdAt)
  .addField("You've been here since", message.member.joinedAt)
  .addField("Total Members", message.guild.memberCount);

  message.channel.send(serverEmbed);
}

Help?

#

@misty sigil

cinder patio
#

define serverIcon above your embed declaration.

misty sigil
#

Channel for chatting about (bot) development. If you have questions, ask the questions and wait for someone who can answer to help you. Do not ask to ask. Provide all possible information so people know what's up. Just saying "I get an error" doesn't give us enough information on your problem. Do not @mention people randomly.

cinder patio
#

You are technically doing serverIcon.setTitle.setColor....

#

And also displayAvatarURL is a function

misty sigil
#

please note the do not @ mention someone randomly

autumn aspen
#

please note the do not @ mention someone randomly
@misty sigil lmao k

earnest phoenix
#
const Discord = require("discord.js");

module.exports.config = {
    name: "serverinfo", 
    aliases: ["si"]
}
    
module.exports.run = async (client, message, args) => {
  const embed = new Discord.MessageEmbed()
    const serverIcon = message.guild.displayAvatarURL
  .setTitle("Server Info")
  .setColor(0xfff06e)
  .setThumbnail(serverIcon)
  .addField("Server Name", message.guild.name)
  .addField("Created On", message.guild.createdAt)
  .addField("You've been here since", message.member.joinedAt)
  .addField("Total Members", message.guild.memberCount);

  message.channel.send(serverEmbed);
}

Help?
put the serverIcon part on top of embed and it will work

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

module.exports.config = {
    name: "serverinfo", 
    aliases: ["si"]
}
    
module.exports.run = async (client, message, args) => {
  const serverIcon = message.guild.displayAvatarURL 
  const embed = new Discord.MessageEmbed()
  .setTitle("Server Info")
  .setColor(0xfff06e)
  .setThumbnail(serverIcon)
  .addField("Server Name", message.guild.name)
  .addField("Created On", message.guild.createdAt)
  .addField("You've been here since", message.member.joinedAt)
  .addField("Total Members", message.guild.memberCount);

  message.channel.send(serverEmbed);
}

@earnest phoenix like this?

misty sigil
#

uh

#

no

autumn aspen
#

bc that aint working

misty sigil
#

message.guild.displayAvatarURL isnt even a function

autumn aspen
#

:oooooooooooh:
@misty sigil ik but he told me to do that

misty sigil
autumn aspen
#

so what do I do?

misty sigil
#

read the docs

#

ffs

autumn aspen
#

man <i did

misty sigil
#

doubt

autumn aspen
#

message.guild.displayAvatarURL isnt even a function
@misty sigil but what do I do

misty sigil
autumn aspen
misty sigil
#

dont

#

thats what you do

#

thats the server icon

autumn aspen
#

yes

#

do I put it with all the other .ad

#

and .set?

misty sigil
#

yes

autumn aspen
#

bruuuuuuuuuuuuuuuuuuuuuuuuuuuh

earnest phoenix
#

iconURL

#

bro

#

not displayAvatarURL

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

module.exports.config = {
    name: "serverinfo", 
    aliases: ["si"]
}
    
module.exports.run = async (client, message, args) => {
  const embed = new Discord.MessageEmbed()
  const serverIcon = message.guild.displayiconURL
  .setTitle("Server Info")
  .setColor(0xfff06e)
  .setThumbnail(ServerIcon)
  .addField("Server Name", message.guild.name)
  .addField("Created On", message.guild.createdAt)
  .addField("You've been here since", message.member.joinedAt)
  .addField("Total Members", message.guild.memberCount);

  message.channel.send(serverEmbed);
}

@earnest phoenix

#

How
@obtuse jolt lmao how the hell

#

u developed it on a mobile lmfao

#

?

obtuse jolt
#

@autumn aspen what’s wrong with your code?

#

That’s not my bot

autumn aspen
#

oh

earnest phoenix
#

bro just edit it as message.guild.iconURL

obtuse jolt
#

It’s iconURL() now

#

They made it a function

earnest phoenix
#

Oh...

#

its v12

obtuse jolt
#

Yeah

#

In v12 it’s iconURL()

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

module.exports.config = {
    name: "serverinfo", 
    aliases: ["si"]
}
    
module.exports.run = async (client, message, args) => {
  const embed = new Discord.MessageEmbed()
  const serverIcon = message.guild.iconURL()
  .setTitle("Server Info")
  .setColor(0xfff06e)
  .setThumbnail(ServerIcon)
  .addField("Server Name", message.guild.name)
  .addField("Created On", message.guild.createdAt)
  .addField("You've been here since", message.member.joinedAt)
  .addField("Total Members", message.guild.memberCount);

  message.channel.send(serverEmbed);
}

@obtuse jolt still dont work

earnest phoenix
#

what's the error?

autumn aspen
#

brb

earnest phoenix
#

brb?

obtuse jolt
#

I found it

autumn aspen
#

yesok now

obtuse jolt
#

your embed is called embed

#

Not serverEmbed

autumn aspen
#
(node:14708) UnhandledPromiseRejectionWarning: TypeError: message.guild.iconURL(...).setTitle is not a function
    at Object.module.exports.run (C:\Users\admin\apemodicus\commands\serverinfo.js:11:4)
    at Client.<anonymous> (C:\Users\admin\apemodicus\index.js:40:34)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\admin\apemodicus\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
(node:14708) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14708) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
#

error

#

^^

misty sigil
#

put it above the embed

obtuse jolt
#

Oh my god

autumn aspen
#

lol

obtuse jolt
#

Yeah I think everyone knows why

turbid bluff
#

@proven lantern how can i put it as a service?

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

module.exports.config = {
    name: "serverinfo", 
    aliases: ["si"]
}
    
module.exports.run = async (client, message, args) => {
  const embed = new Discord.MessageEmbed()
  
  .setTitle("Server Info")
  .setColor(0xfff06e)
  .setThumbnail(ServerIcon)
  .addField("Server Name", message.guild.name)
  .addField("Created On", message.guild.createdAt)
  .addField("You've been here since", message.member.joinedAt)
  .addField("Total Members", message.guild.memberCount);

  const serverIcon = message.guild.iconURL()
  message.channel.send(Embed);
}
#

whyyy

#

doesnt it work

obtuse jolt
#
const Discord = require("discord.js");

module.exports.config = {
    name: "serverinfo", 
    aliases: ["si"]
}
    
module.exports.run = async (client, message, args) => {
  const serverIcon = message.guild.iconURL()
const embed = new Discord.MessageEmbed()
  .setTitle("Server Info")
  .setColor(0xfff06e)
  .setThumbnail(ServerIcon)
  .addField("Server Name", message.guild.name)
  .addField("Created On", message.guild.createdAt)
  .addField("You've been here since", message.member.joinedAt)
  .addField("Total Members", message.guild.memberCount);

  message.channel.send(embed);
}

@autumn aspen

autumn aspen
#

thx

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

module.exports.config = {
    name: "serverinfo", 
    aliases: ["si"]
}
    
module.exports.run = async (client, message, args) => {
  const serverIcon = message.guild.iconURL()
const embed = new Discord.MessageEmbed()
  .setTitle("Server Info")
  .setColor(0xfff06e)
  .setThumbnail(ServerIcon)
  .addField("Server Name", message.guild.name)
  .addField("Created On", message.guild.createdAt)
  .addField("You've been here since", message.member.joinedAt)
  .addField("Total Members", message.guild.memberCount);

  message.channel.send(embed);
}

@obtuse jolt still dont work

misty sigil
#

whats wrong

#

what does it

#

error

autumn aspen
#

can check

obtuse jolt
#

Yes what’s wrong now

autumn aspen
#
(node:10884) UnhandledPromiseRejectionWarning: ReferenceError: ServerIcon is not defined
    at Object.module.exports.run (C:\Users\admin\apemodicus\commands\serverinfo.js:13:17)
    at Client.<anonymous> (C:\Users\admin\apemodicus\index.js:40:34)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\admin\apemodicus\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
(node:10884) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:10884) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Error: ^^

obtuse jolt
#

change ServerIcon to serverIcon

#

e.e

autumn aspen
#

ok

#

change ServerIcon to serverIcon
@obtuse jolt thx

sudden geyser
#

If you're fine using throwing logic, you can wrap the thing in a try/catch or .catch() to ignore the error.

#

Sadly no, I've never worked with MongoDB.

toxic jolt
tight plinth
#

@toxic jolt learn js and how to read errors...?

honest perch
#

tf is that

toxic jolt
#

i fixing ssd

#
Error: Cannot find module 'm3u8stream/lib/parse-time'
Require stack:
- C:\Users\Administrator\Desktop\Cortex\KAPALI\cortexmuzik\node_modules\ytdl-cor
e\lib\info-extras.js
- C:\Users\Administrator\Desktop\Cortex\KAPALI\cortexmuzik\node_modules\ytdl-cor
e\lib\info.js
- C:\Users\Administrator\Desktop\Cortex\KAPALI\cortexmuzik\node_modules\ytdl-cor
e\lib\index.js
- C:\Users\Administrator\Desktop\Cortex\KAPALI\cortexmuzik\komutlar\devam-et.js
- C:\Users\Administrator\Desktop\Cortex\KAPALI\cortexmuzik\bot.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
    at Function.Module._load (internal/modules/cjs/loader.js:841:27)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\Users\Administrator\Desktop\Cortex\KAPALI\cortexmu
zik\node_modules\ytdl-core\lib\info-extras.js:5:21)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [```
misty sigil
#

defrags SSD

toxic jolt
#

here error

misty sigil
#

no

toxic jolt
#

...

sudden geyser
#

Pudochu the error is coming from a dependency of a dependency

#

For starters, you could try to rebuild your node_modules folder (npm install) or try manually installing the module.

toxic jolt
#

I've been getting errors like this for 1 month

#

i tried everything package.json is wrong

#

Couldn't find package.json for music bot from github

tight plinth
#

@toxic jolt do you even know js

sudden geyser
#

Did you make the bot?

opal plank
#

im gonan speak on their behalf and say no to both

autumn aspen
#
Server = [Here]()\nServers I'm in = \`${Client.guilds.cache.size}\``)

Why is the code at the end wrong?

opal plank
#

first off. what the heck is that?

autumn aspen
#

first off. what the heck is that?
@opal plank just care about the end

opal plank
#

second off, if you want help, dont cut the snippet in half

autumn aspen
#

code

opal plank
autumn aspen
#

ok chill

opal plank
#

you chill, post the whole thing

#

not the whole command

#

the whole variable/snippet

autumn aspen
#
            .addField('Support', `Invite me = [Here]()\nServer = [Here]()\nServers I'm in = \`${Client.guilds.cache.size}\``)
#

here

opal plank
#

there we go

autumn aspen
#

the end code is fucked

#

I got an error

#

why

opal plank
#

what is the error?

autumn aspen
#
(node:15532) UnhandledPromiseRejectionWarning: ReferenceError: Client is not defined
    at Object.module.exports.run (C:\Users\admin\apemodicus\commands\help.js:16:221)
    at Client.<anonymous> (C:\Users\admin\apemodicus\index.js:40:34)
    at Client.emit (events.js:315:20)
    at MessageCreateAction.handle (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\admin\apemodicus\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\admin\apemodicus\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
(node:15532) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15532) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
#

there

opal plank
#

upperCase

autumn aspen
#

oh!!!!!!1

#

lmao

#

c

opal plank
#

Client =/= client

#

2 different things

autumn aspen
#

yup

#

sorry

#

Im tired

#

ah

umbral zealot
#

Then go to bed. Tired programmers are dumbass programmers. And you're already a noob so double trouble there.

opal plank
#

unless you me. Drunk tired and productive

glad leaf
#

very random but anyone here familiar with geometry dash bot development?

autumn aspen
#

How do I

Then go to bed. Tired programmers are dumbass programmers. And you're already a noob so double trouble there.
@umbral zealot quiet

#

lol

#
 ${message.guild.owner}

Can I mention me bc Im the bot creator

#

I forgot the command

opal plank
#

huh?

autumn aspen
#

huh?
@opal plank I wanna mention me

earnest phoenix
#

so mention yourself

opal plank
#

but that wont mention you

autumn aspen
#

lmao

opal plank
#

that wont even mention anyone

#

ownerId

#

second off

#

thats the owner of the guild

autumn aspen
#

yes

#

Ik

opal plank
#

which is likely not to be you in most cases

autumn aspen
#

yeah

#

lol

earnest phoenix
#

toStringing a user resolves to a mention, no?

opal plank
#

then refer as the guild owner, not you

#

indeed

#

<user>.sostring resolves it

earnest phoenix
#

why do you want to mention yourself

opal plank
#

perhaps bot owner?

earnest phoenix
#

inb4 "to say im bot creator"

#

yeah

autumn aspen
#

yes

earnest phoenix
#

but that's a not-so-good idea

autumn aspen
#

but that's a not-so-good idea
@earnest phoenix bro why so rude

#

Im crying

#

lol

earnest phoenix
#

9/10 you're not going to be in another user's cache

#

the mention is just going to stay as an id and they aren't going to see your username

autumn aspen
#

wdym

#

oh

#

But my friend did that

earnest phoenix
#

your friend is in your cache

#

@marble oxide you can't see who this is, they aren't in your cache but they are in mine

#

hey would I get rate limited if my bot deletes a users message and a bot's message at the same time

#

depending on what's the interval of doing it

opal plank
#

your library should handle ratelimits

earnest phoenix
#

every endpoint has its ratelimits

autumn aspen
#

depending on what's the interval of doing it
@earnest phoenix u know Goodelad?

earnest phoenix
#

im using discord.js sooo

autumn aspen
#

He helping m

#

e

earnest phoenix
#

uhh what

opal plank
#

even though it rate limits, careful not to spam it too much

#

just good practice overall

earnest phoenix
#

hmm yeah

umbral zealot
#

discord.js does absolutely properly handle ratelimits but if you're asking the question, you should probably reconsider whatever you're doing that might constantly hit against them.

earnest phoenix
#

yeah i might reconsider what im doing

autumn aspen
#

@earnest phoenix u know Goodelad?
woorked good

tight plinth
#

@autumn aspen?

autumn aspen
#

@autumn aspen?
@tight plinth no he said smh I cant do a thing witch was me mentioning and cache and boom

earnest phoenix
#

again

#

you can see them because they're in your fucking cache

#

lol

autumn aspen
#

hehe

#

oh true

opal plank
#

2 different things

#

bot cache and your user cache

autumn aspen
#

nothing hehe

earnest phoenix
#

you're not going to appear as a proper user to people who don't have you in their cache

opal plank
#

for example

#

check this

earnest phoenix
#

just like you can't see who i mentioned above, they aren't going to see who's in the embed

opal plank
#

@native flicker

#

this is a user in Discord API

#

i share a server with them

#

therefore its cached on my end

umbral zealot
#

I share 7 servers with them 😂

opal plank
#

i have checked your shared guilds, you arent in DAPI

#

therefore you should see <@89172987319>

umbral zealot
#

@native flicker specifically

opal plank
#

nah

earnest phoenix
#

nah

#

yes

opal plank
#

there

umbral zealot
#

sorry, that was discord's autocomplete lol

opal plank
#

@autumn aspen

#

check example above ^^

#

your bot cache is the users your library has cached to you, thats unrelated to how a user see's the mention

#

just like the example above, its rendered on the client

autumn aspen
#

therefore you should see <@89172987319>
@opal plank whats that?

opal plank
#

a mention

umbral zealot
#

and ID of a user, as a mention, when you do'nt share a server.

autumn aspen
#

can eveyone see it from all servers?

opal plank
#

what do you see on this message?

autumn aspen
#

even them u not sharing one with?

opal plank
#

you completely misundertood what i said

earnest phoenix
#

have you not read anything that's just been said

#

lol

opal plank
autumn aspen
#

you completely misundertood what i said
@opal plank oh now i understand

#

u need a "!"

#

right

opal plank
umbral zealot
#

no

earnest phoenix
#

i

opal plank
#

! just means nicknamed

earnest phoenix
#

it doesn't actually

umbral zealot
#

@rough furnace see this? This a mention for someone you don't have a server in common with.

opal plank
#

has absolutely nothing to do with what i said

#

im fairly certain ! is nicknamed user

autumn aspen
#

@rough furnace see this? This a mention for someone you don't have a server in common with.
@umbral zealot wow

umbral zealot
#

100% <@!id> is for a user on the server which is nicknamed, yes.

autumn aspen
#

ok but how can ppl see ur name and tag from server u dont sharing with?

opal plank
#

you dont

#

if you are in a server with them, it resolves

#

if not, it doesnt

umbral zealot
#

Can you see @rough furnace ? Do you see the name and tag? that's your answer.

earnest phoenix
#

tldr <@!> used to indicate a nickname way back in 2015, now it's just leftover legacy behaviour and recently the official client switched to using <@!> all the time, while ios and android still have the inconsistent behaviour of switching between <@> and <@!>

opal plank
#

thats why you should avoid putting mentions in embeds of users not in the server

#

cuz you see that atrocity up there

autumn aspen
#

so u doing like this Endph#5742

opal plank
#

not <@!>

umbral zealot
#

Yeah just get user.tag and be done with it.

opal plank
#

^^

#

if they are in the same guild, might as well

umbral zealot
#

I usually do something like Hindsight#2020 (139412744439988224) so I get both

opal plank
#

otherwise, avoid using mentions

autumn aspen
#

so u <@id>

opal plank
#

not quite

autumn aspen
#

oh ok

opal plank
#

a better approach is <user>.toString()

#

you can build it manually if you want, but it doesnt hurt to use a more clean way

autumn aspen
#

yup

#

Im gonna do as u did

#

there

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

module.exports.config = {
    name: "uptime", 
    aliases: ["upt"]
}
    
module.exports.run = async (client, message, args) => {

    function duration(ms) {
        const sec = Math.floor((ms / 1000) % 60).toString()
        const min = Math.floor((ms / (1000 * 60)) % 60).toString()
        const hrs = Math.floor((ms / (1000 * 60 * 60)) % 60).toString()
        const days = Math.floor((ms / (1000 * 60 * 60 * 24)) % 60).toString()
        return `${days.padStart(1, '0')} days, ${hrs.padStart(2, '0')} hours, ${min.padStart(2, '0')} minutes, ${sec.padStart(2, '0')} seconds. `
    }

    message.channel.send(`I have been online for: ${duration(client.uptime)} |  :electric_plug:`)

}

Im little scared that when it comes to 1 day it wont keep counting

umbral zealot
#

you should worry about that when, and only when, your bot actually reaches that point where it actually stays online an entire day.

autumn aspen
#

aight

#

you should worry about that when, and only when, your bot actually reaches that point where it actually stays online an entire day.
@umbral zealot but what do u think?

umbral zealot
#

I think you should worry about that when, and only when, your bot actually reaches that point where it actually stays online an entire day.

autumn aspen
#

bruh lol

umbral zealot
#

Literally just exactly what I think.

autumn aspen
#

lmao

#
${client.guilds.cache.size}

I want to put it in setActivity but I got error and here is my code

#
client.on("ready", () => {
    console.log("Horray, I am online.")
    client.user.setActivity("the new commands", ({type: "WATCHING"}))
})
#

there

umbral zealot
#

you'd think after a few days you'd know how to properly describe your error MarioFP

autumn aspen
#

yes but I got 2 bracket wrong

umbral zealot
#

I don't see you using the size thing

autumn aspen
#

andI dont want to fuck up

#

wait

umbral zealot
#

You will, clearly, and we're still not going keep spoonfeeding you functional code

autumn aspen
earnest phoenix
#

excuse me, i am collect the channel id to array, can i send message to multiple channel with those ids?

umbral zealot
#

You can by looping over that array and sending for each. Note that you have to be careful about spam though

autumn aspen
#

You can by looping over that array and sending for each. Note that you have to be careful about spam though
@umbral zealot show an example

umbral zealot
#

No

#

you already have all the pieces

autumn aspen
#

no

umbral zealot
#

you just refuse to think for yourself and actually do things right

earnest phoenix
#

Google “looping an array” and “send message to channel discordjs”

#

And combine those solutions

#

thanks ^-^

#

@umbral zealot ngl I feel bad for Tim, he has to go through this shit daily

umbral zealot
#

So do I >.<

earnest phoenix
#

Yea lol

#

He does the morning shift and u do the night shift

umbral zealot
#

I've been doing this for years. it doesn't get easier to deal with entitled little tylers

earnest phoenix
#

It pisses me off so much

#

People in djs were much better

#

But i got banned there.. someone got a bit too offended by a meme i posted

umbral zealot
#

"but I don't have time to leaaaaaaarnnnnnnn!" "Just one more thing, I promise it's the last one" "will this work????" MarioFP

earnest phoenix
#

how can I give an error message if the user does not have activity.type === 'LISTENING' && activity.name === 'Spotify' activity in the forEach loop?

#

the forEach loop

#

??

thick gull
#

@umbral zealot give me tatsumaki full code no w w w w

earnest phoenix
#
user.presence.activities.forEach((activity) => {
        if (activity.type === 'LISTENING' && activity.name === 'Spotify') {
message.channel.send(`${activity.details}`)
}
})
#

what do you actually want to do

thick gull
#

check if it

#

doesn;t?

#

what

earnest phoenix
#

if you don't question me to write wrong? i have little knowledge of english.

#

what

#

i'm asking you what do you actually want to do

#

because this is an xyproblem

#

are you trying check if a user has a spotify activity?

#

yeah

#

but If not I want it to give an error message

#

then use some instead of forEach

errant perch
#
bot.on("message", message => {
  let PREFIX = ["s-", `<@${bot.user.id}> `];
  console.log(PREFIX[1])
  if (message.channel instanceof Discord.DMChannel) return;
  if (message.author.bot) return;
  if (message.content.indexOf([PREFIX[1]]) !== 0) return;

  let args = message.content.substring(PREFIX[1].length).split(" ");
 switch (args[0].toLowerCase()) {
    case "bruh":
      message.channel.send("pee fart")
    break;
  }
});
#

when i use the bot mention prefix it doesnt respond

#

bruh

umbral zealot
#

Does it have a nickname?

errant perch
#

no

earnest phoenix
#

check for both <@> and <@!> formats

errant perch
#

ok

umbral zealot
#

Also PREFIX is an array. A string cannot contain an array.

earnest phoenix
#

that too ^^

umbral zealot
#

So really there's a better way to do this, with a simple loop

earnest phoenix
#

also, why do you use an array if you're just going to keep statically referencing an element out of an array just to check for it

errant perch
#

i know stupid

#

i was just messing around with it and was gonna change it later

earnest phoenix
#

ah

errant perch
#

i checked for both formats and it didnt work

umbral zealot
#

Well if we're stupid I guess you can handle it yourself, smart guy.

errant perch
#

what

#

i never said that you guys were stupid?

umbral zealot
#

i know stupid
@errant perch

errant perch
#

i know its stupid

#

ok

zenith knoll
#

client netwirk sockt disconnected before secure tls connection was established

umbral zealot
#

Anyway @errant perch you should debug by adding console logs everywhere and seeing what you get. Log the message, the prefix, the result of the indexOf, etc.

zenith knoll
#

uh

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

module.exports.config = {
    name: "report", 
    aliases: ["rp"]
}
    
module.exports.run = async (client, message, args) => {
    let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
  if(!rUser) return message.channel.send("Couldn't find user.");
  let reason = args.join(" ").slice(22);

  const embed = new Discord.MessageEmbed()
    .setTitle("Reports")
    .setColor(0xfff06e)
    .addField("Reported User", `${rUser} with ID: ${rUser.id}`)
    .addField("Reported By", `${message.author} with ID: ${message.author.id}`)
    .addField("Channel", message.channel)
    .addField("Time", message.createdAt)
    .addField("Reason", reason);

  //return message.channel.send(reportEmbed); //send msg in current channel
  let reportsChannel = message.guild.channels.find(`name`, "reports") //TODO: set reports channel
  if(!reportsChannel) return message.channel.send("Couldn't find reports channel.");

  message.delete().catch(O_o=>{}); //delete previous message (input command)

  return reportsChannel.send(embed);
}

Im trying to make a report command and got an error

#

I dont know how to do it in 12v

#

:/

#

anyone help?

earnest phoenix
#

maybe don't copypaste code

#

lol

umbral zealot
#

Yes more asking for sooonfeeding, that's what we need.

earnest phoenix
#

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

if (!message.guild) return;

if (message.content.startsWith('-warn')) {

 const user = message.mentions.users.first();
 
if (user) {
    const member = message.guild.member(user);
    if (member) {
        member
        .warn('Optional reason that will display in the audit logs')
        .then(() => {

            message.reply(`The user will be warned ${user.tag}`);
        })
        .catch(err => {

            message.reply('You cant warn a Moderator!');

            console.error(err);
        });
    } else {
        message.reply("That user isn't in this guild!");
    }

} else {
    message.reply("You didn't mention the user to warn!");
  }
}

});

#

it's a direct copypaste

#

prblem?

umbral zealot
#

Is there?

#

Does it work?

earnest phoenix
#

no

umbral zealot
#

Then what's the problem?

earnest phoenix
#

.warn('Optional reason that will display in the audit logs')

umbral zealot
#

That tells us nothing of the problem

#

Oh. Member.warn

#

That... Doesn't exist, buddy. Not a thing in Discord

earnest phoenix
#

lul

#

thx

autumn aspen
#

That... Doesn't exist, buddy. Not a thing in Discord
@umbral zealot what but how can u do it on other bots`?

earnest phoenix
#

lol

umbral zealot
#

There is no concept of warnings in the discord API

autumn aspen
#

oh lol

#

<i was confused

umbral zealot
#

Smh

autumn aspen
#

ehm

umbral zealot
#

You're always confused so that's not new.

autumn aspen
#

ye

earnest phoenix
#

I have coded a system where i can "Login" and "chat" as my bot

#

tr yetkili varmı

#

acil

#

not the first or the last time somebody's done that

autumn aspen
#

I have coded a system where i can "Login" and "chat" as my bot
@earnest phoenix tf

earnest phoenix
#

and no it isn't lol

#

tr yetkili acil.

#

tr yetkili varmı

autumn aspen
#

lmao

sinful belfry
#

-notr @earnest phoenix

gilded plankBOT
#

@earnest phoenix

İngilizceden başka dillerde sohbet etmek için #general-int kanalını, top.gg hakkında (Türkçe olarak da) destek almak için #support kanalını kullanın.
Bu kanalda Türkçe konuşmayın.

sinful belfry
#

and no need to keep repeating the same message zoomeyes

earnest phoenix
#

lol

#

Im a TikTok addict

zenith knoll
#

how do i sety an embed author? i try doing .setAuthor(message.author.user)
in the embed contruscter but the embed shows <@the user's id>

sinful belfry
#

@earnest phoenix 😩 this channel is for development

earnest phoenix
#

Every fuc%ing dog/cat vid i Cry -_-

sinful belfry
zenith knoll
#

hu

#

hi?

umbral zealot
#

@zenith knoll can you show a screenshot? That should be the way.

#

Oh wait.

zenith knoll
#

ok

umbral zealot
#

No it's message.author

zenith knoll
#

yea i did

umbral zealot
#

It's already a user.

zenith knoll
#

i tried both

#

message.author returns <@userid>

#

.user returns undefined obv

umbral zealot
#

Ok show the screenshot

zenith knoll
#

i wreote userna,e wrong

#

so it says undefined

#

lol

#

but i need help on wuthor one

umbral zealot
#

Are you SURE you're using setAuthor?

#

Show the whole embed code

zenith knoll
#
                .setAuthor(message.author)
                .setTitle(`${message.author.username}'s Profile`)
                .addField(`User Account Created Date:`, `${message.author.createdAt}`, true)
                .addField(`Username`, `${message.author.username}`, true)
                .addField(`4 Digit Discriminator`, `${message.author.discriminator}`, true)
                .addField(`Server Nickname`, `${message.guild.member.displayName}`, true)
                .addField(`Balance`, `Wallet: **${userinfo[message.author.id].coins}** coins\nBank: **${userinfo[message.author.id].bank}**/**${userinfo[message.author.id].bankmax}** coins\nTotal: **${userinfo[message.author.id].coins + 
userinfo[message.author.id].bank}** coins`)
                .addField(`Premium`, `**true**`)
            message.channel.send(pfp);
            return;```
umbral zealot
#

Ok your message.author doesn't exist

#

That doesn't look like a real user.

zenith knoll
#

how?

#

like

#

message.author is taken from var message from the index file

umbral zealot
#

I don't know but that's not normal. Message.author.username CANNOT be undefined.

zenith knoll
#

it gives the discriminator and name correct

earnest phoenix
#

how many times can a room name be changed in 1 minute? discord according to api?

zenith knoll
#

I don't know but that's not normal. Message.author.username CANNOT be undefined.
@umbral zealot i wrote it as Message.author.usename without the r accidentaly

earnest phoenix
#

Can I get an opinion on this please?

So, I own an entertainment API and all api endpoints will be sourced from different public API's.
I'm not restricting access to any of the endpoints, however, people can purchase more API calls per month.
Would this still count as copyright and selling access to the service?

zenith knoll
#

yea prob

umbral zealot
#

oh I understand.

#

setAuthor doesn't take an actual user account

#

it takes a name, icon, url

#

3 strings.

zenith knoll
#

oop

umbral zealot
#

@earnest phoenix don't try to guess at rate limits. follow the rate limit headers, or let your library handle it. If you think you're going to hit them too much, you should reconsider doing what you want to do. Channels shouldn't be used as timers or counters.

zenith knoll
#

it takes a name, icon, url
@umbral zealot wdym icon

#

like

#

message.author.icon?

umbral zealot
#

the first is going to be the username or the tag

#

the second would be the avatar url

zenith knoll
#

k

#

yea it says

#

.iconURL

#

.url

umbral zealot
#

how about you look at the docs on how to get a user's avatar instead of guessing 😉

earnest phoenix
#

i know the discord api is disabled if
Do you rename the room several times within 1 minute
and I don't know exactly how many times I can do it in 1 minute

umbral zealot
#

then don't do it several times a minute.

earnest phoenix
#

but I want it every half minute

zenith knoll
#

brah

umbral zealot
#

If you do something that is close to the rate limits, your bot risks being banned. If you care about being banned, don't do this. If you don't care, then the limits don't matter, your library will handle it.

earnest phoenix
#

Hey evie, could you check my question pls?

umbral zealot
#

I'm not sure what 'copyright and selling access' you're talking about

earnest phoenix
#

So if I only allow users to pay to lift their rate limits, but make endpoints free to be called to, is that allowed or does it count as copyright?

violet mesa
#
@bot.command()
async def dep(ctx, arg):
    print("idk")
    await open_account(ctx.author)
    print("ifj")

    
    
    users = await get_bank_data()
    print("eee")
    user = ctx.message.author
    print("rrrrrrr")
    arg = int(arg)
    

    
    if (int(users[str(user.id)]["wallet"]) > arg - 1):
        print("fish")
        users[str(user.id)]["bank"]
        print("dag")
        users[str(user.id)]["wallet"]
        print("cock")    
        await ctx.send("succesfully transfered the cash")
        users[str(user.id)]["wallet"] += arg
        print("chips")
    elif users[str(user.id)]["wallet"] < arg:
        await ctx.send("you dont have enough for that")


    with open("mainbank.json", "w") as f:
        json.dump(users,f)

async def open_account(user):

    users = await get_bank_data()


    with open("mainbank.json", "r") as f:
        users = json.load(f)

    if str(user.id) in users:
        return False

    else:
        users[str(user.id)] = {}
        users[str(user.id)]["wallet"] = 0
        users[str(user.id)]["bank"] = 0

    with open("mainbank.json", "w") as f:
        json.dump(users,f)
    return True

error:

#

can anyone help?

zenith knoll
#

holyt shpt

violet mesa
#

lol

#

sorry for flood

zenith knoll
#

dude

#

its .wallet

#

not []

#

iirc

violet mesa
#

?

zenith knoll
#

and

#

dont make the id a str

violet mesa
#

ok

#

what do i have to do

#

del str()

umbral zealot
#

@earnest phoenix if you make your own API for a service, and it's not the discord API, you can do whatever the hell you want with it man 😛

violet mesa
#

what else

zenith knoll
#

evie whats a user's url?

earnest phoenix
#

Yeah, but my service would be sourced from other third party API's

#

For example, i'd make my own 8ball endpoint, to call to another public 8ball API

umbral zealot
#

well then you'd have to talk to a lawyer to study those API's terms of service to know what you're allowed or not allowed

#

we're not laywers.

zenith knoll
#

how do you gert a users d/

earnest phoenix
#

I understand, just wanted to get some inputs

zenith knoll
#

url*

earnest phoenix
#

Thanks

umbral zealot
#

Users don't have a URL, man.

violet mesa
#

@zenith knoll do i remove "" aswell?

zenith knoll
#

Users don't have a URL, man.
@umbral zealot 3 strings, a name, a iconurl, and a url

umbral zealot
#

...they're optional

#

you don't need a URL

zenith knoll
#

oop

umbral zealot
zenith knoll
#
embed.author.icon_url: Not a well formed URL.```
earnest phoenix
#

url is invalid

zenith knoll
#

message.author.avatarURL

#

uh

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

module.exports.config = {
    name: "random", 
    aliases: ["ra"]
}
    
module.exports.run = async (client, message, args) => {
    if(!args[0]) return message.reply("You didn't specify args 1!")
        if(!args[2]) return message.reply("You didn't specify args 2!")
        message.channel.send("Your random number is: " + Math.floor(Math.random() * args[2] + args[0]));
    }

cant still figure out what makes it (example:) 1 of 3 = 0?

zenith knoll
#

i tried iconURL too

earnest phoenix
#

Maybe you swapped name and icon url?

#

its .setAuthor(name, image)

umbral zealot
#
zenith knoll
#

.setAuthor(**${message.author.username}**'s Profile, ${message.member.avatarURL})

umbral zealot
#

What specific exact property of https://discord.js.org/#/docs/main/stable/class/User can help?

earnest phoenix
#

...

umbral zealot
#

the docs are really great you know. It's all there.

earnest phoenix
#

avatarURL is a function...

#

.avatarURL()

zenith knoll
#

ok

#

wat

violet mesa
#

@zenith knoll what u told me made more errors ;-;

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

module.exports.config = {
    name: "random", 
    aliases: ["ra"]
}
    
module.exports.run = async (client, message, args) => {
    if(!args[0]) return message.reply("You didn't specify args 1!")
        if(!args[2]) return message.reply("You didn't specify args 2!")
        message.channel.send("Your random number is: " + Math.floor(Math.random() * args[2] + args[0]));
    }
cant still figure out what makes it (example:) 1 of 3 = 0?

#

anyone?

earnest phoenix
#

You have to call that function in order to get the avatar url of said user @zenith knoll

autumn aspen
#

@earnest phoenix

umbral zealot
#

@autumn aspen you'd know if you took the time to learn javascript.

autumn aspen
#

oops

#

@autumn aspen you'd know if you took the time to learn javascript.
@umbral zealot Im not on javascript

#

Im on discord.js

umbral zealot
#

.. no

earnest phoenix
#

FFS

autumn aspen
#

wydm no

umbral zealot
#

you're using the discord.js library

earnest phoenix
autumn aspen
#

lmao

earnest phoenix
#

discord.js is a library FOR JS

umbral zealot
#

you're writing javascript you stale muffin.

earnest phoenix
#

im gonna commit leave

violet mesa
#

lol

earnest phoenix
#

my brain is hurting

violet mesa
umbral zealot
#

Welcome to every day of my life preaching to preteens that they should learn the language they want to use.

autumn aspen
#

Welcome to every day of my life preaching to preteens that they should learn the language they want to use.
@umbral zealot nothing was wrong hehe

umbral zealot
#

what?

earnest phoenix
#

ffs

umbral zealot
#

What's wrong is that you refuse to learn and continue to be a help vampire.

earnest phoenix
#

^^^^^

umbral zealot
earnest phoenix
#

learn js before making a bot

#

learn how to use arrays, learn how to generate random numbers

#

If you wanna generate a random num between x and y, Math.round(Math.random()*y)+x. Use that info for your command

#

I would have a problem that my bot prefix is ​​more than 1 character then it will not respond to anything
CODE:

con.query(`SELECT * FROM servers WHERE sid = '${message.guild.id}' `, (err, rows) => {
 if(err) throw err;
const prefix = rows[0].prefix;
    if (message.content.startsWith(prefix)) {
      if (panic == 1 && message.author.id === process.env.owner) {
      const [cmdName, ...cmdArgs] = message.content
      .slice(client.prefix.length)
      .trim()
      .split(/\s+/);
      const command = client.commands.get(cmdName);
      if (command) {
        command.run(client, message, cmdArgs);
      }
})```
zenith knoll
#

how do i get a nickname for a user? i tried going into the docs peepochonkslap

#

.nickname returns undefined

earnest phoenix
#

member.nickname

umbral zealot
#

users don't have nicknames, members do

zenith knoll
#

yea

earnest phoenix
#

not user.nickname

zenith knoll
#

i do .guild.member

#

.nickname

#

message.guild.member.nickname

earnest phoenix
#

.guild.members.resolve(userID).nickname

zenith knoll
#

bruh

#

lmao they said no to that

earnest phoenix
#

@zenith knoll user .username
@earnest phoenix he asks for a nick

umbral zealot
#

@earnest phoenix you're looking if the message rows[0] but you're slicing the message with the client.prefix.length

#

So I'll have to assume your client.prefix is 1 character.

zenith knoll
#
const Discord = require("discord.js");

module.exports.config = {
    name: "random", 
    aliases: ["ra"]
}
    
module.exports.run = async (client, message, args) => {
    if(!args[0]) return message.reply("You didn't specify args 1!")
        if(!args[2]) return message.reply("You didn't specify args 2!")
        message.channel.send("Your random number is: " + Math.floor(Math.random() * args[2] + args[0]));
    }

cant still figure out what makes it (example:) 1 of 3 = 0?
@autumn aspen ur flooring it to 0

earnest phoenix
#

Hes multiplying by a string

#

thats the issue

#

it shouldn't be a problem because you've never bothered using slappey since then it's not good
how this could be corrected
CODE mysql:

con.query(`SELECT * FROM servers WHERE sid = '${message.guild.id}' `, (err, rows) => {
 if(err) throw err;
const prefix = rows[0].prefix;
    if (message.content.startsWith(prefix)) {
      const [cmdName, ...cmdArgs] = message.content
      .slice(client.prefix.length)
      .trim()
      .split(/\s+/);
      const command = client.commands.get(cmdName);
      if (command) {
        command.run(client, message, cmdArgs);
      }
})```
autumn aspen
#

@autumn aspen ur flooring it to 0
@zenith knoll and?

earnest phoenix
#

that results in the result being 0

#

always

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

stackoverflow go brrr

umbral zealot
#

@earnest phoenix instead of slicing on the client prefix, slice on your row prefix. Ezpz

autumn aspen
#

that results in the result being 0
@earnest phoenix no for me sometime when I type 1 of 3 its pop up 1,2,3

earnest phoenix
#

and how because I have always used this so far?

autumn aspen
#

same with other

#

cumbers

#

n

umbral zealot
#

You've always used prefixes with one character, correct?

autumn aspen
#

yes

earnest phoenix
#

for this bot, the multi-character one worked for the old one

umbral zealot
#

It couldn't have if the client prefix was always one character

earnest phoenix
#

I didn't have more characters than the old one but I didn't use slappe at the time
this hiab has been around since slappey used

umbral zealot
#

Well I don't know how I can explain it more clearly

#

You're slicing one character.

#

Your prefix has 2

#

So slice with the row prefix length, not the client prefix length

zenith knoll
#

stackoverflow go brrr
@earnest phoenix stackover flow go brrrrr

autumn aspen
#

/updates

#

/h

zenith knoll
#

??

autumn aspen
#

oops hehe

#

I thought this was my server

#

lmfao

zenith knoll
#

Brub

umbral zealot
#

You wish we were in your server.

zenith knoll
#

Why

autumn aspen
#

You wish we were in your server.
@umbral zealot yeah..

zenith knoll
#

So we can see the error?

umbral zealot
#

That would significantly raise the knowledge level

zenith knoll
#

Of what

#

The sserve

#

Or like

#

As in

#

24/7 help

#

Idk

autumn aspen
#

24/7 help
@zenith knoll 4rd

#

3rd

#

imagine having 24/7 help

umbral zealot
#

imagine helping YOURSELF instead

autumn aspen
#

thats hard

sage bobcat
#

One message removed from a suspended account.

autumn aspen
#

lmao

shy turret
#

anyone know a quick and efficient way to get the spaces in front of a variable?

for example, pretend foo = " lol"... it has 5 spaces in the beginning of the variable and I want the code to detect that

umbral zealot
#

honestly the easiest way is to use regex

shy turret
#

i dont want to do for() looping

umbral zealot
#

like... /$( +).*/ match this (any number of spaces before any character) and then count the match

shy turret
#

idk how to regex too well but i know the very basics lol

zenith knoll
#

lol

umbral zealot
#

that's pretty basic actually. $ is the start of the string, ( ) captures a group, + is "one or more spaces) and then it's .* which is "anything"

zenith knoll
#

uh

#

i needa relearn my regex lmao

faint prism
#

A lotta great regex helper websites

umbral zealot
#

oh oops no it's ^ not $

faint prism
#

^start
end$

zenith knoll
#

// start and end

umbral zealot
#

... no.

faint prism
#

well that's a pattern

#

the ^ and $ specify the start and end.

zenith knoll
#

oop

#

oop

#

oop

faint prism
#

/pattern/ can be anywhere in between

autumn aspen
#

how do I add:

const moment = require("moment")

like moment reqs and stuff I only got 2 or smh

faint prism
#

not specifically the start or end

zenith knoll
#

tf is moment

#

explain pls

faint prism
#

some npm package ig

zenith knoll
#

ig so

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

how do I add:

const moment = require("moment")

like moment reqs and stuff I only got 2 or smh
@autumn aspen u just added it

autumn aspen
#

some npm package ig
@faint prism fuck

faint prism
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

zenith knoll
autumn aspen
#

how to add npm packages
@sage bobcat ik

faint prism
#

jk

zenith knoll
#

lol

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

oop

#

i mean

autumn aspen
#

yes but if I do it my VSC is gonna updates it?

zenith knoll
#

he knows what a const is

autumn aspen
#

with the pack?

zenith knoll
#

or a rewuire

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

zenith knoll
#

yes but if I do it my VSC is gonna updates it?
@autumn aspen uh

sage bobcat
#

One message removed from a suspended account.

autumn aspen
#

Holy shit
@sage bobcat answer yes ot no

zenith knoll
#

yea

#

duh

autumn aspen
#

oke

zenith knoll
#

just save the code

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

duh

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

o

#

thought u said die

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

died

autumn aspen
#

just save the code
@zenith knoll what code?

sweet ruin
#

Basically what im trying to do is create a command that allows server managers to set a level and a role that is given at a certain level.
ive made the setup so people can set it up themselves
but i do not know how to save it in the database
so that they can add multiples and also use multiples
how would i make that
https://paste.mod.gg/oyajokanul.js
currently i have this as my model code
so how would i save it and allow multiple levels and roles to be added?

zenith knoll
#

@zenith knoll what code?
@autumn aspen the CODE U R CODING

#

what else

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

zenith knoll
#

oop

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

i self learn js so im a noob too

#

lmao

#

i mean

#

i can code

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

js

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

i just needa memorize djs functions etc

sweet ruin
#

dont memorize

#

learn

autumn aspen
#

const mongoose = require('mongoose');

const newTest = new mongoose.Schema({
    guildID: String,
    guildName: String,
    level: Number,
    role: String,    

});
module.exports.model = mongoose.model('levelrewards', newTest);
module.exports.getLevelsGuild = async (guild) => {
    const guildID = guild.id;
    const guildName = guild.name;
 


    let guildData;
    try {
        guildData = await this.model.findOne({ guildID });
    } catch (err) {
        console.log(err);
    }

    if (!guildData) {
        const newData = new this.model({
            guildID,
            guildName,
        });
        guildData = await newData.save();
    }

    return guildData;
};

module.exports.getLevelsGuildByID = async (guildID) => {
    let guildData;
    try {
        guildData = await this.model.findOne({ guildID });
    } catch (err) {
        console.log(err);
    }

    return guildData;
};```
currently i have this as my model code
so how would i save it and allow multiple levels and roles to be added?

@sweet ruin copy?

honest perch
#

No you need to learn js

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

autumn aspen
#

I meant he copied

#

stop gay

#

srsly

sage bobcat
#

One message removed from a suspended account.

autumn aspen
#

I have

sweet ruin
#

i copied the code from my own command yes?

umbral zealot
#

No, you haven't.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

autumn aspen
#

Ok ask me smh

umbral zealot
#

It's horribly clear to anyone that knows JS that you don't.

sweet ruin
#

ill just come back later

faint prism
#

just ask them to explain what it does

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

autumn aspen
#

no

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

no
@autumn aspen u dont even know how math.floor(math.random()) works

autumn aspen
#

Im cody poppy Ik everything

#

@autumn aspen u dont even know how math.floor(math.random()) works
@zenith knoll yes

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

u dont

sage bobcat
#

One message removed from a suspended account.

autumn aspen
#

yes

zenith knoll
#

u obv dont know

autumn aspen
#

I got dejavu

honest perch
#

This channel is cursed

zenith knoll
#

bc u dont know itll always get 0

autumn aspen
#

2x

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

autumn aspen
#

bc u dont know itll always get 0
@zenith knoll haha man u wanna see? self?

zenith knoll
#

im so confused at that grammar

autumn aspen
#

lmao

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

zenith knoll
#

idk u might wanna try it

sage bobcat
#

One message removed from a suspended account.

umbral zealot
#

This channel is cursed
@honest perch no Discord is cursed by pretend 13 year old Tylers. like , the whole platform unfortunately.

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

even i knowjsa bit

autumn aspen
zenith knoll
#

somthing from copied code

umbral zealot
#

code copied from stackoverflow

zenith knoll
#

cause they HELPED YOU

#

^

umbral zealot
#

Hey @autumn aspen explain to me what an array is?

autumn aspen
#

somthing from copied code
@zenith knoll no stfu

zenith knoll
#

oop

#

whats a method in js

#

or function

#

tell me

autumn aspen
#

ima go eat brbr

zenith knoll
#

oop

sage bobcat
#

One message removed from a suspended account.

zenith knoll
sage bobcat
#

One message removed from a suspended account.

umbral zealot
#

the help vampire escapes with an excuse to not answer the question

zenith knoll
#

lmao

umbral zealot
#

anyone else need help >.<

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

the help vampire escapes with an excuse to not answer the question
@umbral zealot mission failed, well get em next time

autumn aspen
#

me!

zenith knoll
#

oop

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

done eating

#

alr?

umbral zealot
#

I'm procrastinating I need a smart question.

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

done eating
alr?

autumn aspen
#

yes it was a donut

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

@autumn aspen

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

tf

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

u dont needa leave for a donut

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

oop

sage bobcat
#

One message removed from a suspended account.

autumn aspen
#

yes

umbral zealot
#

Then explain what an array is. Go.

zenith knoll
#

^

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

autumn aspen
#

wait I need to take a shit

zenith knoll
#

LMAO

autumn aspen
#

real quick

sage bobcat
#

One message removed from a suspended account.

zenith knoll
autumn aspen
#

that donut was big

#

ngl

sage bobcat
#

One message removed from a suspended account.

umbral zealot
#

Heyyyyy everyone it's time to play "ignore this help vampire that's now trolling us"

zenith knoll
#

🧑‍🏫 js please

umbral zealot
#

No seriously I can either go back to writing my reactjs blog platform with graphql or help someone with a bot problem

autumn aspen
#

Im back

zenith knoll
#

tf

sage bobcat
#

One message removed from a suspended account.

zenith knoll
#

tf

#

tf

autumn aspen
#

so what questiom

zenith knoll
#

tf

#

tf

#

tf

umbral zealot
#

No need to spam, man.

zenith knoll
#

explain to me what an array is

sage bobcat
#

One message removed from a suspended account.

umbral zealot
#

Just ignore the kid, Topppat.

sage bobcat
#

One message removed from a suspended account.

autumn aspen
#

wait need to reach the moouse

zenith knoll
#

i dont get how mods here survive

umbral zealot
#

seriously feeding the troll is 100% pointless.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

autumn aspen
#

An array is a function

zenith knoll
#

"wHaToop

sage bobcat
#

One message removed from a suspended account.

zenith knoll
sage bobcat
#

One message removed from a suspended account.

umbral zealot
#

ok please can we stop.

zenith knoll
#

STARBOARD THAT

modern sable
#

@autumn aspen stop trolling ty

zenith knoll
#

starboard his msg

sage bobcat
#

One message removed from a suspended account.

autumn aspen
#

@autumn aspen stop trolling ty
@modern sable ok

zenith knoll
#

ok gtg

umbral zealot
#

yes yes, it's fine. can we get back on the topic of development now

autumn aspen
#

ok

thin turret
#

An array is a function
KEKW

faint prism
#

For the record: An array is a data structure

autumn aspen
#

If u take a code and split it can it still be a function with an array?

#

wait does it escos

faint prism
#

take a code and split it
waitWhat

autumn aspen
#

excist?

umbral zealot
#

I'm having an escosistential crisis

zenith knoll
#

escos?

autumn aspen
#

How can I do an normal userinfo command without npm any package

faint prism
#

Other than discord.js?

umbral zealot
#

You know how we think people are sometimes slow? This guy makes me think of a gear that's too small or too used up. Spinning super rapidly but achieving no traction.

faint prism
#

Awh man, lol

autumn aspen
#

You know how we think people are sometimes slow? This guy makes me think of a gear that's too small or too used up. Spinning super rapidly but achieving no traction.
@umbral zealot and u nerd or what?

faint prism
#

He's got the technical jargon down at least

autumn aspen
#

no offense

#

man I screwd up

umbral zealot
#

Yeah no shit I'm a nerd. I do programming all day, duh, kid.

autumn aspen
#

nothing

faint prism
#

We are all nerds here 🙂

autumn aspen
#

Im going at school

umbral zealot
#

... I'm going to step away because I was about to continue being really insulting and I don't want to keep being a superjerk

#

returns to udemy razzle course curriculum redaction

thin turret
#

Ive never met a programmer who isnt a nerd

#

Except those who bareass suck at it

#

ppl who still use var

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

thin turret
#

in js tho notlikenoot

autumn aspen
#

ppl who still use var
@thin turret u do

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

umbral zealot
sage bobcat
#

One message removed from a suspended account.

umbral zealot
#

What year is this, 2001?

thin turret
#

@thin turret u do
@autumn aspen i use const and let 😎

sage bobcat
#

One message removed from a suspended account.

autumn aspen
#

@autumn aspen i use const and let 😎
@thin turret man me too?

#

only same with @sage bobcat

thin turret
#

Ok?

sage bobcat
#

One message removed from a suspended account.

autumn aspen
#

Ok?
@thin turret bro u asked

#

stop

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

thin turret
#

When did I ask