#development

1 messages · Page 1581 of 1

modest crane
#

there's google cloud free tier but you need a credit card

quaint wasp
#

can embed be replaced? Is it the name of embed? Or is it has to be embed?

earnest phoenix
#

message.channel.send(new Discord.MessageEmbed())

tulip wave
#

embed can be whatever

dusky sundial
#

Pinned messages has some info about free VPSs, I recommend Vultr or GalaxyGate as they're both pretty cheap

quaint wasp
#

alr.

tulip wave
earnest phoenix
#

Hmm

dusky sundial
#

You're gonna need some experience with Linux to set up a working VPS though

tulip wave
#

Something like this

earnest phoenix
#

this makes me crazy

tulip wave
#
  • reading the documentation helps
dusky sundial
#

You'd be surprised how little people actually use docs :)

tulip wave
#

True

#

The docs are my holy grail

#

I currently got 6 different docs open on edge tehe

dusky sundial
#

M-microsoft edge?

tulip wave
#

Yep

dusky sundial
#

But why?

tulip wave
#

Since the new update its actually not bad

#
  • I like their sleeping tabs
quaint wasp
#

I got this for this part:

#

But it sends this:

#

Why is there offline thing?

earnest phoenix
#

intent?

quaint wasp
#

yes?...

#

Also... why it says im offline when I'm online?

earnest phoenix
#

is the intention clear

#

Presence İntent

quaint wasp
#

but u can see im online...

earnest phoenix
quaint wasp
#

open is by looking to the right.... or to the left?

earnest phoenix
#

left

#

blue

quaint wasp
earnest phoenix
#

Could you please send ss

outer perch
quaint wasp
quaint wasp
earnest phoenix
quaint wasp
#

||(Changing it...)||

quaint wasp
earnest phoenix
quaint wasp
#

bruh

#

im a dumbass ok?

earnest phoenix
#

renew and try your token

quaint wasp
#

is it that hard to type left?

earnest phoenix
#

If it doesn't work the code has an error

quaint wasp
#

is this "open"?

earnest phoenix
#

yes

quaint wasp
quartz kindle
#

...why

#

are you using regex

errant perch
#

does quick.db allow for more than one connection

quartz kindle
#

it should

#

why are you writing js files

#

why lol

outer perch
#
const officialServer = bot.guilds.cache.get('738540548305977366');
```Am I getting right? Cuz `roles.cache` is undefined
quartz kindle
#

you want the disable to persist across restarts?

outer perch
#

and then cache the option

quartz kindle
#

well, editing the original js file sounds like a dumb thing to do

#

sure it works

#

but so many things can go wrong

#

just make a json file or something to keep track of disabled commands

outer perch
#

I have a collection in firebase called 'settings', then I cache the settings at startup, or if changes are made

#

in settings I have the prefix, automessages and language

outer perch
quaint wasp
#

WOOOHOOO! I after a whole fucking week of fixing and rewriting my whole bot, I AM READY to upload it to top.gg!

...

The question now... is how I do that.

odd stratus
quaint wasp
#

alright. Thanks,.

outer perch
odd stratus
#

How are you doing roles.cache?

tulip wave
#

First make sure roles is defined

#

Check what output you get when you console log roles

outer perch
#

yeah, I was about to do that

outer perch
tulip wave
outer perch
#

yeah, execute() problems

tulip wave
#

F

outer perch
# tulip wave F

wow, still a problem. Now execute() is right, but it passes undefined to the command

outer perch
#
try {
  command.execute(bot, message, command, db, lang, language, prefix, args, officialServer, serverSettings);
}
catch (err) {
  console.error(err);
  return message.reply(lang.error.cmd);
}
```I have this in the main file
#
execute(bot, message, command, db, lang, language, prefix, args, officialServer)
```and this in the command
tulip wave
#

Have you tried to log officialServer before command.execute()

outer perch
#

gonna do it

tulip wave
#

See if it's actually defined

errant perch
#

how do i check which shard a guild is on

#

like

#

yea

tulip wave
outer perch
delicate zephyr
#

so you dont have to send a request to every shard

tulip wave
outer perch
#

probably isn't in cache

tulip wave
#

All guilds are cached in d.js

#

Otherwise it breaks

delicate zephyr
#

@outer perch have you made sure you copied the right id

outer perch
#

738540548305977366

#

just did

delicate zephyr
#

hm

tulip wave
#

You don't need to await to get the value

#

So other than the bot not being in the server I have no idea

outer perch
#

it is

#

I am using the command in that server

delicate zephyr
#

try console.log(msg.guild.id)

#

oh right

#

just do

#

msg.guild

outer perch
#

OH WAIT, BIG BRAIN MOMENT

#

LMAO

#

AHAHAHA

delicate zephyr
#

the fact i figured out the issue without realising i did, jesus im tired

tulip wave
#

Lmao

tulip wave
#

Go to sleep then Luke

delicate zephyr
#

I cant

#

at work

outer perch
#

wait a min

tulip wave
#

Ah that's a F

outer perch
#

maybe it's L

delicate zephyr
#

i dont have a d.js bot anymore

#

So I cant test

tulip wave
#

Same

outer perch
#
const bot = new Client();
const officialServer = bot.guilds.cache.get('738540548305977366');
bot.once('ready', async () => { 'whatever is here doesn\'t matter' });
```🤣
#

look at the order

#

the bot doesn't even have time to cache

#

xD

#

big F

tulip wave
#

You define the server before it's ready

outer perch
#

omfg

#

I'm crazy

tulip wave
#

When the issue is so simple we overlook it

delicate zephyr
#

mhm

outer perch
#

lmfao

tulip wave
#

We just take for granted that the code we run will be run after it's ready

outer perch
#

laughing hard af ✅
rolling on the floor ❎ (almost there)

tulip wave
#

Let me kick you off ur chair to get the last one

outer perch
#

🤣

tulip wave
#

Imma head to bed

#

Cya

outer perch
#

cya 👋🏻

outer perch
#

oh wow, now I can't add a role to a member, cuz the intents were disabled at 100 servers

quaint wasp
#

Why this?

#

How do I make a proper list?

#

I forgot..

#

I used to remember it..

dire obsidian
#

So i don't think this is about development but i think so

#

Someone knows how add ssl to subdomain?

mellow kelp
#

const tip = ['bru', 'hgfsdr', 'dasgrg']

#

yes, i copied all the letters and i don't know why

quaint wasp
#

oh, nice, thanks!

agile lance
# quaint wasp

You can do: ```let tip = [

"bru",
"hgfsdr",
"dasgrg"
];```

#

So replace { } with [ ]

#

Also let is better than const as you can change the value of a let variable

quaint wasp
#

alright,

#

thanks.

agile lance
#

no problem

#

Another way is to use a json file

quaint wasp
#

oh right...

#

wait

#

not config?

livid carbon
#

hey

quaint wasp
#

hi

livid carbon
#

do any of you use express for making an http server

agile lance
#

if you say wanted a long list of things

livid carbon
#

or is that just me

agile lance
#

a json file can be like

quaint wasp
#

uhh

#

I think I got a littile problem here..

#

I um...

agile lance
#
"tip": [
"bru",
"list 2"
]
}```
quaint wasp
#

got no json file..

#

or I mean I do..

#

but its..

#

empty.

#

litilary.

agile lance
#

and you can access that array by doing: let tip = require("./jsonName.json").tip

#

Thats package.json

#

Do npm init -y in the terminal

livid carbon
quaint wasp
livid carbon
#

ah yes windows user

agile lance
#
  let guild = await client.guilds.fetch(guildID)
  let guildMembers = await guild.memberCount
  let guildName = await guild.name;
  joinlogID.send(`Bot has been invited to **${guildName}**. This guild has ${guildMembers}.`)
})
#

Is there anything wrong with this?

#

No error but doesnt work

#
 global.joinlogID = joinlog.channels.cache.get("809622829322600490")``` is how I defined joinlogID
quartz kindle
#

dont use await for things that dont need it

#

only fetch needs await

#

and guildCreate gives you a full guild object

#

not an ID

agile lance
quartz kindle
#

yes

outer perch
agile lance
#

ohh.. thats easier

#

Ty tim again

outer perch
#

😎

quartz kindle
#

:^)

#

what if i want to sleep instead of lurking here at 3am

outer perch
#

true

quartz kindle
#

go slep

agile lance
#

"joinlogID is not defined"

quartz kindle
#

well i go, kthxbye

agile lance
#

Defined it previously

global.joinlogID = joinlog.channels.cache.get("809622829322600490")```
quartz kindle
#

you dont need any of that either

#

just do client.channels.cache.get("809622829322600490")

agile lance
#

I need to fetch the log in my server though for it to log it

#

do guilds stay cached after a reboot?

quartz kindle
#

guilds and channels are cached at login

#

before the ready event is fired

agile lance
#

Oh

#

I’m dumb

quartz kindle
#

kthxbye (for real now)

agile lance
#

lll

#

lol

#

Bot has been invited to undefined. This guild has 249 members.

crystal wigeon
#

hey umm

agile lance
#

returned undefined for guild name ...resolved

crystal wigeon
#

what does unknown message error mean? discordapi error

quaint wasp
mellow kelp
#

well you can't send an array to a channel

quaint wasp
#

wait... Doesn't it suppose to like..

#

You know

#

pick one from a list?

#

random one?

crystal wigeon
#

not icons

quaint wasp
#

wait a minute.... I dont remember putting icons..

crystal wigeon
#

the error says icon_url

#

you could also just join your array by comma, tip.join(", ")

pale vessel
#

it means that the message is deleted/you're looking for a message in the wrong channel

crystal wigeon
#

makes sense

#

also

#

i keep seeing the internal server error too often while editing embeds

#

even tho the embed is there

#

is discord outage that bad?

pale vessel
#

that's weird

crystal wigeon
#

ikr

pale vessel
#

internal server errors are usually server side

crystal wigeon
#

my whole error log file is filled with internal server error from discordAPI

#

once or twice is acceptable

#

but

#

this

#

like wtf

earnest phoenix
#

Is this the correct code?

if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.reply("Sorry, you don't have permissions to use this!");
 const deleteCount = parseInt(args[0], 10); 
if(!deleteCount || deleteCount < 2 || deleteCount > 100) return message.reply("Please provide a number between 2 and 100 for the number of messages to delete");
 const fetched = await message.channel.fetchMessages({limit: deleteCount}); message.channel.bulkDelete(fetched) .catch(error => message.reply(`Couldn't delete messages because of: ${error}`)); }```
vague harness
#

how do i make a bot that sends a message every minute as me?

#

i think have an idea idk tho

vague harness
#

i want to be able to send a message every minute without actually typing it yk?

earnest phoenix
vague harness
#

damn okay

#

ty for trying to help

earnest phoenix
pale vessel
earnest phoenix
pale vessel
#

Yes

#

Catch your promise

earnest phoenix
#

ok

earnest phoenix
#

how long does it take to get a verified bot after releasing the bot on top.gg

pale vessel
#

Depends

paper surge
#

My help command dosent show up anymore i get a empty box ?

mild ivy
#

how do you make the bot DM the message author? message.author.send doesn't work anymore

quaint wasp
#

bruuhhhh... My bot is going to be reviwed soon and I just bought my VPS.. well.. in proces of buying it. They are checking it..

pale vessel
earnest phoenix
paper surge
#

i did

quaint wasp
#

uh... Is there a way... for me to create a command that will clear the terminal in VSC?

#

I did this...

earnest phoenix
quaint wasp
#
module.exports = {
    name: 'BrHfsvh',
    execute(client, message, args) {
    clearImmediate.console.log
    console.log("cleared the terminal..")
}
}```
#

wait

#

wtf

#

auto correct.

#

ill brb

paper surge
#

no error

#

just nothing shows

earnest phoenix
earnest phoenix
#

Im sending a POST request using axios with discord API to send a message. Im getting a 200 response but its not sending the message
anyone know what could be happening

pale vessel
#

Check your response body

#

If it sent properly then it should return a message object

#

Otherwise an error

earnest phoenix
#

Hey i want to code a chat with bot,But idk how?

#

i am getting a 401 now

#

not good but at least a clear answer

pale vessel
#

Did you provide your bot token?

#

401 means unauthorized

earnest phoenix
#

yes in header

pale vessel
#

Can you show?

earnest phoenix
#

ok

#
    const messageContents2 = { "content": content, "tts": false }
    axios.post('https://www.discord.com/api/v8/channels/' + channel + '/messages', JSON.stringify(messageContents2), headers2    
    ).then((response) => {
        console.log(response);
    });```
earnest phoenix
pale vessel
earnest phoenix
slow lichen
#

Hello

pale vessel
#

Mmmm hotdogs

slow lichen
#

Sorry

#

About that

#

But how do I get my bot online

#

Yes it’s anti spam

#

Sorry

#

I’m new to this

pale vessel
#

Man just dropped his hotdogs accidentally

marble juniper
#

you code it
you run the code
and it magically goes online

slow lichen
#

How

marble juniper
slow lichen
#

I’m sorry if I’m irritating you

#

I’m new to this

#

Ty

marble juniper
#

you gotta ruuuuun the code

#

ruuun the boot

#

lol

pale vessel
#

can I walk the code? catpleading

earnest phoenix
#

use nodejs or something

pale vessel
#

Use discord.brainfuck

marble juniper
marble juniper
slow lichen
#

It’s showing me weird stuff I need major help 😔

earnest phoenix
marble juniper
#

so just a normal discord bot

#

lol

earnest phoenix
#

No

slow lichen
#

How do I code the bot

unkempt ocean
#

why don't you check it

slow lichen
#

I’m on mobile not pc I wish I had a pc

earnest phoenix
#

Please tell me how

slow lichen
#

Aren’t you a bot dev?

earnest phoenix
marble juniper
#

lol

earnest phoenix
marble juniper
#

nope no idea

slow lichen
#

Can somebody help me I’m on mobile not pc so it’s not that ez

marble juniper
#

I don't make these kinds of bots because they are completely useless

#

and dumb

earnest phoenix
#

i keep getting 401s on a POST request with discord (using axios) to send a message

earnest phoenix
slow lichen
#

Thanks

marble juniper
#

wider screens are just better

slow lichen
marble juniper
#

that vertical height with the small width it doesn't help much

slow lichen
#

Well everyone don’t have the money for a pc and stuff like that

earnest phoenix
marble juniper
#

yeah but just sayibg

slow lichen
#

I hate my life

marble juniper
#

the experience on mobile is gonna be a lot worse

earnest phoenix
slow lichen
#

No

#

I’m new

#

I never made a bot

marble juniper
#

did you ever code before

earnest phoenix
slow lichen
#

No

#

I never did

marble juniper
#

start by reading thus

#

*this

#

will help you get started

earnest phoenix
slow lichen
#

Pain

#

It’s looks so hard

marble juniper
#

its not

#

just starting looking at the first few things

earnest phoenix
marble juniper
#

you don't have to do everything at once

marble juniper
earnest phoenix
marble juniper
#

im pretty sure they wont

earnest phoenix
#

ok

marble juniper
slow lichen
#

Where do I even start it’s nothing but slot of links

marble juniper
earnest phoenix
marble juniper
#

youtube is not always the best place to learn

slow lichen
#

Where do I start

#

It’s nothing but links

earnest phoenix
marble juniper
#

most tutorials are just never up to date

earnest phoenix
#

Now i bet that coding is very easy

marble juniper
#

thats the problem

#

lol

slow lichen
#

Bruh

earnest phoenix
marble juniper
#

you can see in the "before you begin" section multiple guides

#

for javascript

slow lichen
#

Bro where am I supposed to start reading

marble juniper
#

just pick a guide and start reading

#

im not reading it for you

#

lol

#

ur supposed to be reading it

earnest phoenix
slow lichen
#

Because I want my own bot

earnest phoenix
slow lichen
#

Yes

earnest phoenix
#

First learn to code

#

By reading that tutorials above

marble juniper
#

you can also try this

#

if you want to

#

this time its big ass button

#

impossible to miss

slow lichen
#

Wtf is this

#

😐

#

I don’t money for a pc like you do

lunar lantern
#

Do you know how long it usually takes to get a bot approved

unkempt ocean
lunar lantern
#

Ah, thanks

earnest phoenix
slow lichen
#

Hm I don’t know a ten dollar pc

#

I’m on iPhone you can’t buy boost

#

Genius

earnest phoenix
#

Well depending on for how long you plan to have nitro, your pc will be paid quite fast

slow lichen
#

Bro

#

Are you really saying this

earnest phoenix
#

Then you have a pc

#

If you can't boost on iphone and own an iphone

marble juniper
#

if you can afford an iphone you can afford a pc

earnest phoenix
#

FACTS

slow lichen
#

No

marble juniper
#

its litterally an apple product

slow lichen
#

A pc is over 1k dollars

#

This is a iPhone 8

marble juniper
#

thats

#

bullshit

#

thats not true at all

slow lichen
#

No

marble juniper
#

my pc costs 600€

#

what the heck are you talking about

slow lichen
#

oh nice because I can’t fin

#

Pc under 509

marble juniper
#

you could even make a pc for 400$

earnest phoenix
#

So, how do you explain your boost? Since you said you can't boost on iphone

marble juniper
#

lol

slow lichen
#

Idfk

#

Idk how that happened

earnest phoenix
#

Yea yea ofc

#

I DoN't KnOw

slow lichen
#

Lol

marble juniper
#

you can make a pc for the price of a ps4 and you would get even better perfomance

earnest phoenix
marble juniper
#

saying that you need 1k dollars is just dumb

slow lichen
#

You need nitro to boost a server

#

Smart guy

marble juniper
#

not true at all

earnest phoenix
#

You have nitro

slow lichen
#

No

#

I don’t

marble juniper
slow lichen
#

I don’t have nitro

earnest phoenix
#

omfg

marble juniper
#

you can buy boosts individually

slow lichen
#

You know what

#

😤

marble juniper
#

you can buy boosts individually

#

smart guy

unkempt ocean
#

umm.. you might wanna take this to do #general

earnest phoenix
marble juniper
#

fine

slow lichen
slow lichen
earnest phoenix
#

I don't have nitro

slow lichen
earnest phoenix
#

Now stop lying and being cringe

slow lichen
marble juniper
slow lichen
#

Someone a little mad

#

Oh no

earnest phoenix
#

Says you

marble juniper
#

soooo

#

anyways

slow lichen
#

Nice

#

Idk

marble juniper
#

does anyone know what event I need to get member role updates

#

in discord.js

#

lol

#

I forgot

unkempt ocean
slow lichen
earnest phoenix
earnest phoenix
slow lichen
#

Huh?

#

It’s just a meme

#

Holy shit

earnest phoenix
#

And you have to realize that this isn't a meme channel

slow lichen
#

Oh no

#

What are you going to do

earnest phoenix
#

Nothing, I have no power.

#

@unkempt ocean thanks

marble juniper
#

I smell a mute coming

tight plinth
#

I have a string like <@_valid_role_id>.I know that there is a function in the <discord.js>.Util module that canvobvert it to a role object, but I forgot it's name. Anyone remembers it?

marble juniper
#
tight plinth
#

do you see it

#

is it parseString?

earnest phoenix
feral aspen
#
const { MessageEmbed } = require("discord.js");

module.exports = {
    config: {
        name: "balance",
        aliases: ["bal", "money"],
        category: "economy",
        usage: "!balance",
        description: "View your money balance!",
        accessableby: "Members"
    },
    run: async (bot, message, args) => {
        
        console.log("Hello!")
        
    } // <--- Why does it not allow me to put an ; as it errors.
};
#

Why does it not allow me to put an ; as it errors.

#

Is it supposed to be a ,?

tired panther
feral aspen
#

Oh.

#

Alright.

#

By the way

#

Last question.

pale vessel
feral aspen
#
const ms = require("parse-ms");
let time = ms(timeout - (Date.now() - data.daily));
pale vessel
#

It's not an assignment

feral aspen
pale vessel
#

But ms exports a function, no?

#

What will you destructure

feral aspen
#

Yea, I guess.

#

I thought I can just require part of the ms to do things for me but since it is ms(), I don't think things can work as I expected.

pale vessel
#

Yeah

feral aspen
#

Unfortunate.

pale vessel
#

I wouldn't call it unfortunate

#

You just don't need to do it ig

#

Unless there's ms.parse() for example where you could use const { parse } = require("ms");

feral aspen
#

Yes.

pale vessel
#

but there's none of that

feral aspen
#

Yeah, and I'm still trying to figure out why my client is having a memory leak where it is doubling in ram.

#

I am not sure what I am supposed to do to fix this.

tight plinth
#

discord.js - How to convert <@&ROLEID> into role object?

pale vessel
#

Just slice the mention part and access cache?

tight plinth
#

ig that works

south bay
#

i want to do my bots site like chance the prefix see all the commands who can help me :c

long mica
#

how can i make vote system

#

i cant make it

cinder patio
south bay
#

oh ok

#

my normal site is nice i know ok no need dashboard .d

delicate shore
#

Why won't reverse proxy work?

#

There are no errors being logged

delicate zephyr
#

are you 100% sure you're not accessing port 443

#

@delicate shore ^^

delicate shore
#

it's not

#

Here

cinder patio
#

inside / location

delicate shore
#

It's not

#

and it works

earnest phoenix
#

Hi, Can anyone here help me code a bot easily as I’m having trouble coding mine

#

@wise cave

#

can you please help?

unkempt ocean
#

You don't need to ping others, just ask what you need and I'm sure you'll get an answer

earnest phoenix
#

Okay sure!

wise cave
crystal wigeon
earnest phoenix
#

fyi you should probably use something like sentry so you don't have to ssh into the server everytime you want to see errors

crystal wigeon
#

its fine, im on windows and lazy xd if i was on my ubuntu machine i would just ssh from terminal

#

but the errors TWT

#

making me cry yowwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

modest maple
#

I mean it doesnt help that the terminal is escaping \n making the error pretty un-readable

long mica
#

how can i make vote command

crystal wigeon
summer acorn
summer torrent
#

i know this

summer acorn
#

how fix

#

it's somehow sending too many requests but I don't know what is sending too many requests

marble juniper
#

is there a way I can get any console output as an event in nodejs

#

for example if there happens to be something new in the console an event would be triggered

earnest phoenix
#

i just applied my bot in top.gg

marble juniper
earnest phoenix
marble juniper
summer torrent
#

try restarting

summer acorn
#

I tried restarting, and then I just got the first screenshot

earnest phoenix
#

i made command for ownership server only
and i put on permission
if(!message.member.hasPermission(message.guild.owner)) return message.reply("** You Don't have OwnerShip Permission **");

Is message.guild.owner defined or not?

#

anyone help

marble juniper
#

message.guild.owner is just the id

#

of the owner

summer acorn
#

no, that's ownerID

marble juniper
#

yeah but that still wouldn't work

#

lol

summer acorn
#

guild.owner is a member object

marble juniper
#

it still wouldn't work in his context

summer acorn
#

which also requires cache

#

ownerID doesn't

#

I know

earnest phoenix
#

so?

summer torrent
#

message.guild.owner is not a permission

marble juniper
#

I think there is a property to check if they are the guild owner

#

check the docs

#

maybe

summer torrent
#

compare author's id with owner's id

summer acorn
summer acorn
#

or member.isOwner

summer torrent
#
if (message.guild.ownerID !== message.author.id) {
//code
}```
summer torrent
marble juniper
#

actually

earnest phoenix
marble juniper
#

yeah

summer torrent
#

yes

marble juniper
#

was about to say you don't need to check permissions

#

l9l

#

but there he sent it

#

well whatever

summer acorn
summer torrent
#

uhm

summer acorn
summer torrent
#

found in discord.js server

looks like your connection is getting reset when attempting to connect to the api
summer acorn
#

bruh

#

ok well, I am gonna attempt something real quick

summer torrent
#

reset token

summer acorn
#

I don't have access to the config.json file editing because I don't have sftp or ssh access

#

well, it's a private repo

#

time to make a temporary file that will hold the token

earnest phoenix
summer torrent
#

show code

earnest phoenix
#
   if (message.content.startsWith(prefix + "antibots off")) {
                if (!message.channel.guild) return;

                antibots[message.guild.id] = {
                        onoff: 'Off',
                }
                message.channel.send(`** ⛔ AntiBots Off**`)
                fs.writeFile("./antibots.json", JSON.stringify(antibots), (err) => {
                        if (err) console.error(err)
                                .catch(err => {
                                        console.error(err);
                                });
                });
        }
}
})
earnest phoenix
summer torrent
#

you don't check it

earnest phoenix
#

can i check total no of boosts in a server by a bot?

#

i have premsince

summer torrent
#

premium subscription count

earnest phoenix
#

will that work?

summer torrent
#

what lib

earnest phoenix
#

djs

summer torrent
#

guild.premiumSubscriptionCount

earnest phoenix
#

i see only premiumsince and premiumsinceTimestamp

#

in the docs

earnest phoenix
summer torrent
#

look at Guild class

earnest phoenix
#

one moment

summer torrent
hallow otter
#

!s

earnest phoenix
#

thanks

summer acorn
#

I JUST FOUND THE REASON TO THE ENTIRE ISSUE KEKW

#

I literally had an idea this might've been the issue earlier but thought "nah probably not"

earnest phoenix
summer acorn
#

running 2 functions in a message event was a nono, checking at the start of the message event if the message starts with the prefix, boom, issue fixed

#

I am stupid

earnest phoenix
earnest phoenix
#
       var prefix = prefixes[message.guild.id].prefix;
        var error = ":x:";
        var success = ":white_check_mark:";
        var loading = ":thinking:";
        var user = message.mentions.users.first() || client.users.cache.get(message.content.split(' ')[1]);
        if (message.author.bot) return;
        if (message.channel.type == "dm") return message.channel.send(new Discord.MessageEmbed().setTitle(error + " **You Can't Use This Command In DM!**"));
        if (message.content.startsWith(prefix + 'unban')) {
                if (!message.guild.me.hasPermission('BAN_MEMBERS')) return message.channel.send(new Discord.MessageEmbed().setTitle(error + " **I Can't unban members because i don't have Permission!**"));
                if (user === message.author) return message.reply('you cant unban ur self ');
                if (!message.member.hasPermission('BAN_MEMBERS')) return message.channel.send(new Discord.MessageEmbed().setTitle(error + " ** You need ban permission to use this command!**"));
                if (!user) return message.channel.send(new Discord.MessageEmbed().setTitle(error + " **Please type a user ID !**"));
                message.guild.owner.send(success + `**${user} Has been unbanned By **<@!${message.author.id}>`)
               message.channel.send(success + `**${user} Has been unbanned by** : <@!${message.author.id}>`) 
                message.guild.members.unban(user).catch(err => message.channel.send(`Sorry There's a Error`) )
        }
})

Problem is
like me on server and someone try unban me he send i got unbanned
Wheres problem i want say this user didnt banned sorry for bad english

earnest phoenix
#

and me already on server and he unbanned me

#

anyone?

#

.-.

delicate shore
#

🥺

earnest phoenix
summer acorn
#

@summer torrent now it's only responding to commands locally but not on dedi :sad:

earnest phoenix
delicate shore
#

I am gonna cry

#

Kill me

misty sigil
#

@delicate shore whats wrong with reverse proxy

#

and can i see your configs n shit

delicate shore
#

yes

#

Thank god

#

So I have a file bin.pgamerx.com just like my others in /etc/nginx/sites-available/

misty sigil
#

got it

delicate shore
wintry glade
#

yo

misty sigil
#

it looks good

#

does it have an a record

delicate shore
#

Yes I do

#

ahh

#

My net sucks

misty sigil
#

have you reloaded nginx

delicate shore
#

restarted it

#

thrice

misty sigil
#

any errors?

delicate shore
#

neither in nginx nor in my process

#

or wait

#

is it because Of cache

#

that I can't

#

open the site

misty sigil
#

it could be

delicate shore
#

can you open it?

pale vessel
#

404

misty sigil
#

i got nginx 404

delicate shore
#

Same

#

OH WAIT

#

I AM ALREADY LISTENING

#

TO PORT 6969

misty sigil
#

lol

delicate shore
#

LOL

#

lemme change it

#

the port isn't changing

slender wagon
#

close the editor

delicate shore
#

yaa

#

it worked

#

But now I need to check the domain

#

🤞

slender wagon
#

oop

delicate shore
#

IT STILL DIDNT WORK WTF

#

WHY

#

NO ERRORS

slender wagon
#

👀

modest maple
#

is that your public ip

#

or your private ip

#

and why not us 127.0.0.1 / localhost?

quartz kindle
#

your nginx config is wrong

delicate shore
#

Why?

delicate shore
quartz kindle
#

you're using an upstream

delicate shore
#

That's what I am using for everything else and it works Perfectly

quartz kindle
#

so it should be proxy_pass http://app_yourdomain

#

and the ip should be localhost

#

or 127.0.0.1

delicate shore
#

I tried that as well didn't work either

delicate shore
quartz kindle
#

because its inside the same server

delicate shore
#

I am using my Public Ip in the listening part

#

So that doesn't really matter

modest maple
#

i mean

#

it makes a massive difference to your security

quartz kindle
#

you have both nginx and node in the same server right?

#

so when you receive a connection in nginx

delicate shore
#

yes

quartz kindle
#

you want to pass it to "same server, different port"

#

not another ip alltogether

#

if you use another ip, you're giving more work to nginx

#

it has to go check where that ip is

delicate shore
#

🤔

quartz kindle
#

and validate it

delicate shore
#

That ip is of my vps

quartz kindle
#

still

modest maple
#

so just use localhost...

quartz kindle
#

^

delicate shore
#

That doesn't change anything

quartz kindle
#

using localhost or 127.0.0.1 is a fast path on the process

misty sigil
#

still use local host

modest maple
#

it also does make a diffrence

#

cuz if your firewall is CORRECT it'll block that ip

delicate shore
quartz kindle
#

your code should be ```nginx
upstream somenamehere {
server 127.0.0.1:6969
}

server {
...
location / {
...
proxy_pass http://somenamehere
}
}

delicate shore
#

somenamehere is my domain?

quartz kindle
#

somenamehere is your upstream name

delicate shore
#

Oh

quartz kindle
#

you can give it whatever name you want

delicate shore
#

ok

quartz kindle
delicate shore
#

wait

#

does host has to be a string

#

or a number

#

I mean usually in express

#

it's a string or no

quartz kindle
#

what host? where?

delicate shore
#

The ip

#

when we do app.listen

quartz kindle
#

when you do app listen you use the port

#

.listen(6969)

delicate shore
#

This is what I do

quartz kindle
#

remove host

#

you dont need it

delicate shore
#

It will automatically take localhost as the host?

misty sigil
#

nah

delicate shore
#

or thr 127.0...

misty sigil
#

0.0.0.0

delicate shore
#

oh

#

so what do i need to enter in the uh
nginx conf

misty sigil
#

which can be accessed using localhost

delicate shore
#

Thanks

#

didn't work

fierce arch
#

How do you let a port through the firewall so that top.gg webhooks can go through?

delicate shore
#

Why am I still getting 404

misty sigil
#

Linux?

fierce arch
#

yep

#

Ubuntu

misty sigil
#

what firewall?

#

ufw?

fierce arch
#

i'm not sure but I think it's ufw

misty sigil
#

you can allow ports using ufw allow <port>

fierce arch
#

kk

fierce arch
#

Thank you very much my webhooks have finally worked

delicate shore
#

Am i still doing something wrong

cinder patio
#

console.log config.port

#

why are you using a js file for you config and not a json one?

delicate shore
#

I mean

cinder patio
#

you're not exporting anything from the js file, so config is most likely just {}

delicate shore
#

oh

cinder patio
#

and port would be undefined

delicate shore
#

no it isn

#

see this

#

and why port isn't undefined?
Because I am using ||

cinder patio
#

you're not in the snippet you sent

quartz kindle
#

you probably want config.json not config.js

delicate shore
#

Alr, I renamed the file

quartz kindle
#

also, do you even have any routes ?

delicate shore
#

wait

#

I didn't tell you guys

quartz kindle
#

like, an http server that doesnt have any routes will send 404 by default i think

delicate shore
#

how do we create routes

#

Also

#

I am using

quartz kindle
#

so you do have routes then

#

you're just running node server.js?

slender wagon
#

Can webhooks ban or kick people?

quartz kindle
#

no

slender wagon
#

Oh okay

quartz kindle
#

wait

#

what do you even mean by that?

slender wagon
#

Me?

quartz kindle
#

yes

cinder patio
#

discord webhooks can only send messages to a single channel (the channel they were created in)

slender wagon
#

I saw a server get nuked yest they said it was a webhook and i got confused

quartz kindle
#

wat

slender wagon
#

That's why i am asking lol

lament rock
#

Probably just a cover up for staff abuse

quartz kindle
#

no, that doesnt exist

#

a webhook is like "i allow this website to send messages on this channel"

#

thats all it can do, send messages to a channel

slender wagon
#

Yeah that's why i got confused

lament rock
#

either a staff member or a bot did it all

slender wagon
#

It prob was a bot

#

500+ members banned

lament rock
#

bots can create webhooks tohru_shrug

slender wagon
#

In 10 mins

lament rock
#

yeah. Bot

urban cape
#

I got a little problem with my bot. Its coded in node js and i dont know how to fix it.

slender wagon
#

Whats the problem

urban cape
quartz kindle
#

wat

urban cape
#

cmd: node bot.js
Bot is ready!
D:\path\New Bot Project\node_modules\scrape-yt\dist\index.js:108
if (query.trim().length === 0)
^

TypeError: Cannot read property 'trim' of undefined
at D:\aajie vps\dbm v2 met announcement\New Bot Project\node_modules\scrape-yt\dist\index.js:108:31
at step (D:\aajie vps\dbm v2 met announcement\New Bot Project\node_modules\scrape-yt\dist\index.js:54:23)
at Object.next (D:\aajie vps\dbm v2 met announcement\New Bot Project\node_modules\scrape-yt\dist\index.js:35:53)
at D:\aajie vps\dbm v2 met announcement\New Bot Project\node_modules\scrape-yt\dist\index.js:29:71
at new Promise (<anonymous>)
at __awaiter (D:\aajie vps\dbm v2 met announcement\New Bot Project\node_modules\scrape-yt\dist\index.js:25:12)
at Object.exports.search (D:\aajie vps\dbm v2 met announcement\New Bot Project\node_modules\scrape-yt\dist\index.js:103:12)
at eval (eval at Actions.eval (D:\aajie vps\dbm v2 met announcement\New Bot Project\bot.js:344:10), <anonymous>:5:33)
at eval (eval at Actions.eval (D:\aajie vps\dbm v2 met announcement\New Bot Project\bot.js:344:10), <anonymous>:9:3)
at Object.Actions.eval (D:\aajie vps\dbm v2 met announcement\New Bot Project\bot.js:344:10)

#

this is the problem

#

but it looks ugly now

quartz kindle
#

Cannot read property 'trim' of undefined

#

you're trying to trim() something that doesnt exist

urban cape
#

what does trim even mean

slender wagon
quartz kindle
#

did you copy paste it?

urban cape
#

its a node module so i just gave it a input and expected a output

#

var scrapeYt = require("scrape-yt");
const b = tempVars("input");

(async () => {
let videos = await scrapeYt.search(b);
const c = videos[0];
console.log(c);
Actions.storeValue(c, 1, "output", cache);
})();

#

this is my code

slender wagon
#

Most likely a copy and paste

quartz kindle
#

ah nvm

#

its from a module

earnest phoenix
#

😬

quartz kindle
#

its trying to trim() the input

#

but you didnt give it any input

urban cape
#

So i need to fix the input

slender wagon
#

Seems like it

urban cape
#

Ok im going to try that

quartz kindle
#

what is tempVars?

delicate shore
#

do I need to do something else as well?

quartz kindle
#

im looking at the source code

#

look at this

#

const configPath = process.argv.length <= 2 ? 'config.js' : process.argv[2];
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));

#

so they are expecting config.js indeed, and processing it with fs.readFileSync lmao

#

what a stupid way to load a file

#

jesus christ

#

but rename it back to config.js

delicate shore
#

I did

#

it

urban cape
#

so ?test 1 1

#

is working

#

and then it skipped the first 1 and only read the second 1

#

but its working now

#

so thx

delicate shore
#

that's what making me go freaking crazy

earnest phoenix
#

Hey how to make a top10 Leaderboard?Please tell me

quartz kindle
#

where did you put your nginx config file?

delicate shore
#

/etc/nginx/sites-available/

quartz kindle
#

did you copy it to sites-enabled?

delicate shore
#

I created a new file

long mica
#

how can i make a vote command?

delicate shore
#

/etc/nginx/sites-available/bin.pgamerx.com

earnest phoenix
delicate shore
#

is the file's exact location

long mica
quartz kindle
#

you need to make a copy

#

in sites-enabled

delicate shore
#

means?

#

I do every website like that

#

I never copied anything

quartz kindle
#

copy /etc/nginx/sites-available/bin.pgamerx.com
to /etc/nginx/sites-enabled/bin.pgamerx.com

delicate shore
#

oh

#

Oh

#

OH

#

I AM FREAKING DUMBO

#

I MADE A FILE IN SITESAVAILABLE

#

instead of enabled

#

😩

quartz kindle
#

dumfuk

delicate shore
#

ikr

quartz kindle
#

xd

delicate shore
#

xD

#

Thanks for help lol

#

and sry for making everyone go mad

earnest phoenix
# long mica yes
if(message.content === "vote") {
let embed = new discord.MessageEmbed()
.setTitle("VOTE")
.setDescription(`(VOTE)[Link]`)
message.channel.send(embed)
}```
long mica
#

no not like that

#

when i write r!vote

#

the bot will vote for me

earnest phoenix
#

replace with r!vote in message.content

long mica
#

like this ill send a screen shot

earnest phoenix
earnest phoenix
long mica
#

the screen shot is Turkish but

#

when the guy use .vote

earnest phoenix
#

What is the meaning?

long mica
#

Can vote without going to the vote page when using the vote command

earnest phoenix
#

Oh

#

Sorry

#

Idk

long mica
#

ok np

delicate shore
#

wait

#

@quartz kindle how do I copy?

pale vessel
#

ctrl c

delicate shore
#

no like

#

it looks

#

a bit

#

messed up

frosty valve
#

do nodejs got a inbuilt way to cache or do I need to install a package?

pale vessel
#

Just use objects

frosty valve
#

I need to cache cooldowns

delicate shore
frosty valve
#

I dont think making a cooldown a object isnt a good idea KEKW

wind kayak
#

Lmao

#

Do it in a collection

cinder patio
#

Objects are the native and best way to cache... why are you searching for a npm package for everything

wind kayak
#

Objects are trash

frosty valve
#

I asked if caching stuff has a already inbuilt feature or if I need a package for caching

wind kayak
#

'best way to cache'

#

Did you learn about JS yesterday?

frosty valve
#

no

wind kayak
#

Not you

frosty valve
#

ok

wind kayak
#

You should cache cooldowns in a Collection

#

It's way more efficient than Objects and accessibility is better than in objects

cinder patio
#

Definitely not more efficient

wind kayak
#

Definitely

crimson vapor
#

imo it depends on your use-case

frosty valve
#

I just need to cache small cooldowns

cinder patio
#

Collections are a dumb-proof wrapper around the native Map class, so yeah

frosty valve
#

if it is a big cooldown will I just have it in a db

wind kayak
#

Collections are more efficient than Objects bro

#

Fact

crimson vapor
#

if you need lighter and more permanent cache with minimal effort, use an object, otherwise you can use a Map with a cooldown that altomatically removes things after being set/updated

wind kayak
#

Especially for something that changes a lot