#development

1 messages ยท Page 1015 of 1

small prairie
#

It can be a problem with glitch tho :/

opal plank
#

clearly

small prairie
#

i really dont understand what you mean

opal plank
#

if your code is fine, and your token is fine, then there should be no problem

small prairie
#

And here we go again

#

Its Not Logging In

opal plank
#

ew

small prairie
#

Test bot

opal plank
#

dont use glitch or heroku

small prairie
#

My internet is shit

opal plank
#

run it locally

#

its a test bot

small prairie
#

My internet is shit

opal plank
#

unless its on 100+ servers you wont be struggling on internet

small prairie
#

It dies like 10 times in 1 sec

#

Whats wrong with test bot on glitch?

opal plank
#

Test bots you run on 1 or 2 servers max, i cant see you capping your internet at all regardless of how shit it is

small prairie
#

Ah glitch just blocked my project

opal plank
#

cuz its shit

small prairie
#

Rip

#

Everyone has their own views

opal plank
#

bottom line, dont use heroku or glitch

small prairie
#

You cant force them to do anything

#

Bottom line is im using it for testing purposes

opal plank
#

im not forcing you to use anything, im telling you a fact. glitch is shit

lyric mountain
#

Everyone has their own views
@small prairie glitch is aggressively trying to stop people from hosting bots on it

low phoenix
#

Whats "client.user.setPresence({game:{name:status}});" for v12?

lyric mountain
#

that's why it blocked http pingers

digital ibex
#

you can't host bots on glitch. the app isn't crashing cuz "its shit"

opal plank
#

clearly its working out for u, using glitch

lyric mountain
#

glitch is for SITES. Period

#

heroku is for WEBSERVICES. Period

opal plank
#

^^

summer torrent
lyric mountain
#

both clearly state in their introduction that they aren't for bots

solemn latch
#

^

#

if your bot doesnt need a lot of ram or cpu power, google has the f1 micro free thingies

opal plank
#

1 year for free on google

solemn latch
#

and im still not sure if anyones used one yet

opal plank
#

you could just stop before a year and renew it

solemn latch
#

the f1 micro is always free

opal plank
#

havent seen that

#

might give a check

solemn latch
#

lol

#

28 free hours a day

prime cliff
#

Wait wait but theres....

solemn latch
#

hours are calculated off resource usage i think

#

so maxing a cpu for an hour, probably counts as more than an hour

prime cliff
#

Thonkeng but there's only 24 hours in a day how do you get 4 extra hours lmao

solemn latch
#

seems they run off traffic.
if you have a lot of traffic, it might spawn another instance and start handling requests

#

which is bad for bots

low phoenix
#

and whats change "message.reactions.get" to v12 i dont find it in Documation.

prime cliff
#

which is bad for bots
Not really Discord intents exist to cut traffic by a lot

solemn latch
#

running your bot twice

#

someone doing a command, would give you two command responses

#

im wondering if the 9 hours a day for the b instances applies to all their instances

opal plank
#

@low phoenix message.reactions should already list all reactions

#

in the reaction manager

vernal vapor
#

Hey guys on discord.py how would I set a command which means that owners can set their own prefix + Also set the bot in a specific channel of choice

opal plank
#

prob need a database to save configs and do a per/guild check

prime cliff
#

You would have to code that yourself and use a database to keep track of guild data

vernal vapor
#

Aight tnx

low phoenix
#

@opal plank "message.reactions.get" i find not it for the v12

opal plank
#

@low phoenix its much easier if you tell me what you want to do with that get

#

you want to filter?

low phoenix
#

@opal plank i have a Vote Bot and it get the reactions for the winner

summer torrent
#

reactions.cache iirc

opal plank
#

i just dont see why you would use cache instead of a collector

#

reaction collectors would be much better for what you are trying to do @low phoenix

low phoenix
#

@summer torrent @opal plank thanks

opal plank
#

๐Ÿ‘

low phoenix
#

for vote is work only for poll not working

solemn latch
#

message.channel.message.fetch?

low phoenix
#

yes

solemn latch
#

i think your missing a letter ๐Ÿค”

#

wait

#

your fetching a message

#

of the id

#

of the message you currently have

low phoenix
#

yes

solemn latch
#

why fetch what you already have

low phoenix
solemn latch
#

could just use a collector

#

thats what they are for

low phoenix
#

But for a another command is it working.

#

But why here not

solemn latch
#

messages

#

not message

low phoenix
#

ohhhhhhh

#

xd

solemn latch
#

anyway, doing it this way sends extra queries. gets you closer to the query limit of discord

#

using a collector would save you some queries

opal plank
next escarp
#

how do i make a link in a msg!

#

example :
Click Here

#

that would redirect to a linl

#

how?

sudden geyser
#

If you want to make the text clickable, you need to send it in an embed (or use a webhook) with the syntax [text here](url here)

#

For example, [Google](https://google.com/)

next escarp
#

with the [] and ()?

sudden geyser
#

yes

next escarp
#

in a .setURL as welll?

sudden geyser
#

.setURL is for the embed title. That's not the same thing.

next escarp
#

okay

#

so i can add it to a field

sudden geyser
#

Do you want to make the field title clickable, or field value clickable (aka the text under the field title)

next escarp
#

i want the embed description, i changed my mind

sudden geyser
#

Then you can use the syntax I showed above.

next escarp
#

thank u

low phoenix
sudden geyser
#

Whenever any user (including bots) sends a message, if the message content does not equal simple!invite, it reports that.

#

So if it does any of the cases, it's going to emit a new message created saying that same error, do it again and again.

#

That's called recursion.

opal plank
#

that wont work at all

#

thats a great way to create a spam bot actually lmao

#

also to get ratelimited and banned

#

also .setColor requires i string if i recall

#

i may be wrong tho

#

nope, i was right

sudden geyser
#

The way they've done it is fine.

opal plank
#

which part of that will work?

sudden geyser
#

the .setColor(0x<...>) or .setColor("<...>") are both fine.

opal plank
#

interesting

#

you on v11?

#

cuz syntax for embed is Discord.MessageEmbed()

#

oh, right, its the guy who was trying to port his code

low phoenix
#

or how can i send a error messages when not work the command?

rare prawn
#

like i did an :hover css styling
I tried to delete the command and it's still here

#

like Working

opal plank
#

@low phoenix why would the command not work?

#

its a simple send message event

#

check for permission

#

thats the only way it'd error

low phoenix
#

@opal plank when the bot not have permission to send in this channel crash the bot.

opal plank
#

then check for permission before sending

#

dont use the api as an error handler

low phoenix
#

then check for permission before sending
@opal plank and how can i do that?

opal plank
low phoenix
sudden geyser
#

If client is an instance of Client, it's because it's not a method. If you want to check if the client has permission in a guild, use guild.me.hasPermission instead.

low phoenix
opal plank
#

prob not the best approach

#

while it works, it wont work all the time

#

that'll get you the permission it has on the guild

#

you'd wanna check for final channel permissions before it sends, in case of overwrites @low phoenix

low phoenix
#

also before "client.on('message', message => {"

opal plank
#

wrong

#

ON message

#

message doesnt exist before that event

low phoenix
#

I don't get it ๐Ÿ˜ฉ

opal plank
#

message doesnt exists before its emitted

#

@low phoenix

#

it has to be used after the event is emitted

small prairie
#

const job = new CronJob("0 * * * *", function() {})

#

this should do something at 00 of every hour right?

umbral estuary
#

My js bot is saying the guild has no channels in cache, how do i fix that?

magic jackal
earnest phoenix
empty owl
#

@earnest phoenix wdym ideas

earnest phoenix
#

nvm lol forgot to pass in ctx

#

@earnest phoenix wdym ideas
@empty owl why it isnt working

#

but i forgot to pass in ctx in the async

empty owl
#

Did you define ctx

umbral estuary
#

isn't ctx supposed to be in the lightgreyhoodie();

empty owl
#

@earnest phoenix I suggest a message handler not he less

earnest phoenix
#

isn't ctx supposed to be in the lightgreyhoodie();
@umbral estuary did it

#

i have a another prob now lol

slender thistle
#

Bot

#

Not bot

earnest phoenix
#

ohh

#

lol

#

ty

opal plank
#

@earnest phoenix dont hardcode your token on the bot, thats a -1000iq play

earnest phoenix
#

yep now it's online

#

why?

opal plank
#

cuz bad

#

leaking tokens

earnest phoenix
#

making it a variavle is too long

opal plank
#

seen enough of tokens being leaked around cuz people hardcode their token

warm cloud
#

oh yeah

earnest phoenix
#

like what should i do?

warm cloud
#

dpy discord is just token leak hell

#

put it in an env var

opal plank
#

add it on an external var

#

json, env, anything you want that is readable

earnest phoenix
#

can someone show me and example of putting it in a json file? im sorry im just new to this

slender thistle
#

Google "json files with python"

earnest phoenix
#

oki

#

ty again

small prairie
#

anyone has experience with cron job?

warm cloud
#

did you google the cron specification yet

#

im p sure that does it once a year

umbral estuary
#

how can i fix no channels being in my discordjs bot cache

empty owl
#

restart your bot

#

try regening token

#

idk

small prairie
#

@warm cloud Uh?

warm cloud
#

Uh?

small prairie
#

i got it from here

warm cloud
#

Uh?

solemn latch
#

uh

pale vessel
#

i mean yeah

digital ibex
#

hi, does anyone know how I can remove the blue line when I click on it?

#

with css or html or something idk

pale vessel
#

that's :focus, try that

ebon kelp
#

:foces

digital ibex
#

kk, lemme try

pale vessel
#

if border doesn't work, try outline

ebon kelp
digital ibex
#

o ok

pale vessel
#

what did you put

ebon kelp
#

Hek

#

This guy is new to CSS?

pale vessel
#

hopefully it's not foces

digital ibex
#

outline works :D

#

yes netail, i dont like frontend web dev at all

#

i done css input:focus { outline: none;

#

and that works

ebon kelp
#

That's basic stuff tho

digital ibex
#

i've only worked on frontend once before this, that time i gave up tho

quartz kindle
#

frontend is cancer

solemn latch
#

๐Ÿค” apparently i bought my ryzen vps before they enabled cpu passthrough.
@quartz kindle

#

i bought it before it went public

quartz kindle
#

you should be able to request it, i had to do the same on galaxygate

#

i opened a ticket and they enabled it for me

solemn latch
#

ill get a benchmark when it gets added

quartz kindle
#

AES performance should be minimum 500mb/s

solemn latch
#

i dont really understand any of it.
im hoping its a magic performance increase for canvas

quartz kindle
#

how are your disk speeds btw?

solemn latch
#

they are proportional to how much storage you have

quartz kindle
#

i dont think it will impact canvas, AES is for cyptography, used in SSL and whatnot

solemn latch
#

shoot

quartz kindle
#

proportional how much

#

is it a shithole like google compute engine?

solemn latch
#

they said they would add figures later on

#

this is the standard

#

2gb

quartz kindle
#

ah not bad at all

solemn latch
#

someone on the 4gb plan was getting like 30% more speed

digital ibex
#

hm, I have this: ```html
<table class="table">
<thead>
<tr>

  </tr>

</thead>
<tbody>
<div class="boxer">
<tr>
<th>

        </th>
     </tr>
  </div>

</tbody>
</table>``` and for some reason, the table isn't going in the middle of the page ๐Ÿค” any ideas?

quartz kindle
#

on galaxygate you get ~400mb/s, on contabo you get 100, on google compute engine you get 30 lmao

digital ibex
#

my css:

#
table {
      text-align: center;
   }
   .boxer {
      display: inline-block;
   }```
pale vessel
#

bruh

quartz kindle
#

so 200+ is already better than many vps's out there

digital ibex
#

?

quartz kindle
#

you want the table itself to be centered on a page?

#

give it display:block and margin:0 auto

digital ibex
#

yeah

#

kk, lemme try

#

give that to table or the div?

quartz kindle
#

the table

digital ibex
#

kk

#

css: css table { text-align: center; display: block; margin: 0 auto; } .boxer { display: inline-block; }

misty sigil
#

what

quartz kindle
#

is that the div?

#

the table is the white area

misty sigil
#

you are writing a prefix using a web dash

#

amazing

digital ibex
#

.boxer = div; table = white thing

#

idk jeremy about it being amazing, its pretty simple if u've got half an idea about what ur doing catshrug

zenith gazelle
#

So this is hard for me to explain through text but I have an sqlite database with currency, I have a baltop command to show the top 5 global users in that database. I want to be able to do that serverwise (Discord.py) but I do not want to scan the entirety of the server.

quartz kindle
#

you dont have a guild id column in the database? or any sort of per-guild data?

zenith gazelle
#

no, because the currency is global so I would have to have multiple if they are in multiple servers

quartz kindle
#

then there is not much you can do

opal plank
#

having duplicates would be an issue

#

but you can filter those out and merge too

quartz kindle
#

either you scan the database and try fetching each user to see if they exist in a guild, or fetch all members in a guild and check if they exist in the database

opal plank
#

User A is in guild 1
User A is in guild 2
you'd have 2 A entries with different guilds, merge them into an array so you have users being in multiple shared severs,

#

SQL usually has methods for finding and dealing with duplicates

#

im assuming thats the reason why you arent using your database with guildid on it

quartz kindle
#

no need for duplicates, you can have a relational table

zenith gazelle
#

yeah, I think it would take a while to scan the entire server for id's for servers like this and also I think it might break the api limits because it is scanning so much

opal plank
#

relation tables work too

ebon kelp
#

NoSQL > SQL

digital ibex
#

hm tim any ideas?

opal plank
#

PostgresSQL >

quartz kindle
#

@digital ibex do you want the table to be full width? because tables have 100% width by default

digital ibex
#

oh

#

i dont

ebon kelp
#

PostgresSQL >
@opal plank That's still SQL

quartz kindle
#

then you need to manually set width

opal plank
#

@ebon kelp im well aware

digital ibex
#

ah, that fixed it :D thanks

strange trout
#

Postgres is the way to go

opal plank
#

im saying that postgres is the best option

#

i said PostgresSQL > [empty]

ebon kelp
#

I prefer MongoDB

strange trout
#

You can use JSONB to mimic NoSQL

digital ibex
#

mongo db is nosql

ebon kelp
#

mongo db is nosql
@digital ibex Yes

#

What about it?

strange trout
#

Which is what do for some stuff I store

quartz kindle
#

sqlite > *

#

:^)

opal plank
digital ibex
#

NoSQL > SQL
@ebon kelp

#

but u said u prefer mongodb which in my head makes no sense

quartz kindle
#

?

#

mongo is nosql

#

he said he prefers nosql

digital ibex
#

yeah, thats why im confused

quartz kindle
#

he prefers mongo

#

because its nosql

#

and he prefers nosql

ebon kelp
#

MongoDB = NoSQL, so what's confusing?

digital ibex
#

what u said, nosql > sql but then u say u prefer mongodb, and in my head. nosql > sql means 'sql is better than no sql' is how i interpreted it as

quartz kindle
#

wat

ebon kelp
#

Hek

quartz kindle
#

> stand for bigger than

digital ibex
#

nvm lol, im just confusing myself

quartz kindle
#

nosql bigger than sql

opal plank
#

wtf is this chat

digital ibex
#

ya, im getting more confused

ebon kelp
#

NoSQL > SQL
= I prefer NoSQL over SQL
= I prefer MongoDB (For example) over MySQL (For Example)

pale vessel
#

cool

ebon kelp
#

It's not that hard to understand

digital ibex
#

idk man, i tend to confuse myself a lot

ebon kelp
#

NoSQL is Json in most cases

quartz kindle
#

you inverted bigger than and smaller than in your head

opal plank
#

That moral support voice chat looks spicy

#

everyone muted

ebon kelp
opal plank
digital ibex
#

tim wym?

quartz kindle
#

the simbols < and >

slender thistle
#

x > y
x is better/bigger than y

quartz kindle
#

^

slender thistle
#

y < x
y is lesser/smaller than x

hasty lotus
#

Hi, i'm making a role reaction system, and i save all the role reactions like this :

    "MESSAGEID":{
        "channelId":"messageChannelId",
        "emojiRoleMap":{
            "emojiName":["roleID"]
        }
    }```And i made a commande to create the role reaction, that saves temporarely the data as the name of "config". At the end of the command i add the reaction role to the role react storage file like this :
```js
reactionRoles[config.message] = {
  channelId: config.channel,
  emojiRoleMap:{
           
  }
}```But as seen in the role react save example, the variable is supposed to have the name of the emoji. So how can i create a line in the "emojiRoleMap" property that has the name of the emoji (that i accesible on config.emoji) ?
slender thistle
#

You interpreted "nosql > sql" as "sql is better than nosql"

digital ibex
#

yeah

quartz kindle
#

^

digital ibex
#

ooohh

quartz kindle
#

Lol

ebon kelp
hasty lotus
#

anyone knows ?

spare mirage
#

reeeeeeeeeee

#

my ban command still not working

hasty lotus
#

xD

spare mirage
#
const Discord = require('discord.js')

  module.exports = {
    name: 'ban',
    description: "this is a ban command!",
    async execute(Discord, bot, message, args){

        
        let member = message.mentions.members.first();
        if(!member)
          return message.reply("Please mention a valid member of this server");
        if(!member.bannable) 
          return message.reply("I cannot ban this user! Do they have a higher role? Do I have ban permissions?");
    
        let reason = args.slice(1).join(' ');
        if(!reason) reason = "No reason provided";
        
        await member.ban(reason)
          .catch(error => message.reply(`Sorry ${message.author} I couldn't ban because of : ${error}`));
        message.reply(`${member.user.tag} has been banned by ${message.author.tag} because: ${reason}`);
      }
    

   


}
opal plank
#

best thing is SQL syntax

#

<> not equal to

#

wtf is that

hasty lotus
#

Hi, i'm making a role reaction system, and i save all the role reactions like this :

    "MESSAGEID":{
        "channelId":"messageChannelId",
        "emojiRoleMap":{
            "emojiName":["roleID"]
        }
    }```And i made a commande to create the role reaction, that saves temporarely the data as the name of "config". At the end of the command i add the reaction role to the role react storage file like this :
```js
reactionRoles[config.message] = {
  channelId: config.channel,
  emojiRoleMap:{
           
  }
}```But as seen in the role react save example, the variable is supposed to have the name of the emoji. So how can i create a line in the "emojiRoleMap" property that has the name of the emoji (that i accesible on config.emoji) ?

please...

ebon kelp
digital ibex
#

hm, css table { text-align: center; display: block; margin: 0 auto; width: 50%; height: 130px; border-radius: 10px; background-color: black; } the background colour of the table doesn't change, any ideas?

spare mirage
#

thats me trying for 6 hours to make a good looking ban command

opal plank
#

stoooop

#

too much code

digital ibex
#

the rest of the css works

ebon kelp
#

@digital ibex this isn't a server for css

digital ibex
#

@spare mirage no, make ur own.

pale vessel
#

chill

hasty lotus
#

@digital ibex use HEX color code

pale vessel
#

it's for development

digital ibex
#

its related to bot development

opal plank
#

@spare mirage whats the issue?

spare mirage
#

"no make ur own" lol ive been trying for 6 hours

ebon kelp
#

There's a site that's called Stacks Overflow, which is really helpful @digital ibex

slender thistle
#

HTML and CSS are supported here too

pale vessel
#

@digital ibex use HEX color code
@hasty lotus y

hasty lotus
#

guys

#

please

#

Hi, i'm making a role reaction system, and i save all the role reactions like this :

    "MESSAGEID":{
        "channelId":"messageChannelId",
        "emojiRoleMap":{
            "emojiName":["roleID"]
        }
    }```And i made a commande to create the role reaction, that saves temporarely the data as the name of "config". At the end of the command i add the reaction role to the role react storage file like this :
```js
reactionRoles[config.message] = {
  channelId: config.channel,
  emojiRoleMap:{
           
  }
}```But as seen in the role react save example, the variable is supposed to have the name of the emoji. So how can i create a line in the "emojiRoleMap" property that has the name of the emoji (that i accesible on config.emoji) ?
pale vessel
#

holy shit this bump

hasty lotus
#

i send 2 times...

digital ibex
#

ok, im gonna go over ๐Ÿ‘‰ for now

opal plank
#

@hasty lotus dont spam

slender thistle
#

You don't really need to repost your question multiple times

hasty lotus
#

can anyone answer me ? ๐Ÿ˜ฆ

opal plank
#

not if you keep spamming

slender thistle
#

If someone knows an answer, they will help you

hasty lotus
opal plank
#

i'll purposefully ignore people spamming, just chill and we'll eventually get to yours

digital ibex
#

so uh cough

digital ibex
#

u dont need to always use the hex colour, u can just provide the colour name and it'll use that

#

btw

hasty lotus
#

well try with hex

pale vessel
#

no

#

pointless

digital ibex
#

its not gonna change anything

opal plank
#

@spare mirage whats the error that you're getting?

spare mirage
#

syntax errors

opal plank
#

send error

spare mirage
opal plank
#

use debugger

#

instead of terminal @spare mirage

ebon kelp
#

u dont need to always use the hex colour, u can just provide the colour name and it'll use that
@digital ibex HEX, RGB, RGBA, Names

pale vessel
#

๐Ÿ‘€ edwin

hasty lotus
#

@spare mirage use message.mentions.users.first()

digital ibex
#

?

hasty lotus
#

insthead of message.mentions.members

pale vessel
spare mirage
#

ok

pale vessel
#

coding 100

ebon kelp
#

RBG -> RGB xd

opal plank
spare mirage
#

how does debugger work?

digital ibex
#

im confused

opal plank
#

f5 inside vsc should run debugger

#

though you'd prob need to attach it first

zenith gazelle
#

server = ["1", "2", "3"]
sql = ["1", "2", "4"]
both = []
for x in server:
if x in sql:
both.append(x)
print(both)

This is what I came up with for the server rich and I think it is what I will stick with lol

opal plank
#

this is an unevaluable tool for devs

digital ibex
#

imo thats useless

solemn latch
#

Wait, thats a secret

opal plank
#

debugger useless?

#

WHAT

digital ibex
#

i've never used it because i've never had to use it

opal plank
#

then you are doing it wrong

digital ibex
#

for me

spare mirage
#

would this work?```js
let member = message.mentions.users.first();
if(!member)
return message.reply("Please mention a valid member of this server");
if(!member.bannable)
return message.reply("I cannot ban this user! Do they have a higher role? Do I have ban permissions?");

    let reason = args.slice(1).join(' ');
    if(!reason) reason = "No reason provided";
    
    await member.ban(reason)
      .catch(error => message.reply(`Sorry ${message.author} I couldn't ban because of : ${error}`));
    message.reply(`${member.user.tag} has been banned by ${message.author.tag} because: ${reason}`);
solemn latch
#

Someone's starting a war

digital ibex
#

well, i've just never had a reason to use it

slender thistle
#

server = ["1", "2", "3"]
sql = ["1", "2", "4"]
both = []
for x in server:
if x in sql:
both.append(x)
print(both)

This is what I came up with for the server rich and I think it is what I will stick with lol
@zenith gazelle what's that supposed to do in your case?

digital ibex
#

is all im saying

solemn latch
#

Dev wars

opal plank
#

console.logging everything im guessing, then try and error?

#

when you can use step debugging?

zenith gazelle
#

it checks the sql userids and the servers userids and if they match sets it to a both so that it will mark all users that are in the server and have money with my bot

#

and then it will sort by richest

#

I guess

spare mirage
#

TypeError: Cannot read property 'users' of undefined

#

:/

zenith gazelle
spare mirage
#

nope

#

js

zenith gazelle
#

then I can't help

#

lol

solemn latch
#

Is there a mention @spare mirage

#

Did the error happen because there was no mention

spare mirage
#

I mentioned myself xD

slender thistle
#

@zenith gazelle how is your data actually stored?

hasty lotus
#

any ideas ?

zenith gazelle
#

in an sqlite database

solemn latch
#

For some reason, message.mentions is undefined

spare mirage
#

but why xD

solemn latch
#

Start console logging things till you find out ๐Ÿค”

spare mirage
#

I think there is something wrong with my args const
const args = message.content.slice(PREFIX.length).split(/ +/);

hasty lotus
#

add g

pale vessel
#

no

hasty lotus
#

.split(/ +/g)

pale vessel
#

you don't need g for something like split

hasty lotus
#

and still anyone for my question ? ๐Ÿ˜ข

slender thistle
#

in an sqlite database
What was your question, again?

pale vessel
#

I think there is something wrong with my args const
const args = message.content.slice(PREFIX.length).split(/ +/);
@spare mirage this is ok

zenith gazelle
#

I was just trying to make a way to get the top 5 people based on balance in each server exclusively and not global

solemn latch
#

Pretty sure you can just sort when you query the database

spare mirage
#

doesnt it make
!ban @pale vessel REASON
!ban -@pale vessel - REASON
!ban - @ flazepe REASON

slender thistle
#

Oh, I think I'm starting to understand

solemn latch
#

Just console log and see what it makes @spare mirage

spare mirage
#

how? xD Im so tired

solemn latch
#

you know how to console log

#

๐Ÿค”

#

I've seen you do it before

slender thistle
#

So, let's say, you have users 1 to 5 in server A, and users 25 to 30 in server B

If baltop is used in server A, leaderboard of users 1-5 is shown, but not users 25-30?

solemn latch
#

Why not query only balances for that guild?

spare mirage
#

I get the same error all the time...

slender thistle
#

Data is stored globally

solemn latch
#

O

slender thistle
#

from what I've comprehended

#

aka currency is global

solemn latch
#

I forget some people don't have balances guild by guild

hasty lotus
#

well in this case juste make a forEach and if the user is a guild member add id, else skip

zenith gazelle
#

yes @slender thistle sorry for late response

slender thistle
#

Do you store currency in cache?

zenith gazelle
#

wdym?

#

I store it in an sqlite db

slender thistle
#

either you scan the database and try fetching each user to see if they exist in a guild, or fetch all members in a guild and check if they exist in the database
Well, Tim's message applies. The way I'd do it without caching is fetch all data and iterate over data entries, create a list of users, sort it, and then take the 5 highest entries

zenith gazelle
#

up

#

yup*

#
    databaseids = []
    serverids = []
    bothids = []
    db = sqlite3.connect('main.sqlite')
    cursor = db.cursor()
    cursor.execute("SELECT userid FROM main")
    result = cursor.fetchall()
    for x in result:
        x = x.split(",")[0]
        x = x.split("(")[1]
        databaseids.append(x)
    db.commit()
    cursor.close()
    db.close()
    for x in ctx.guild.members:
        x = x.id
        serverids.append(x)
    for x in databaseids:
        if x in serverids:
            both.append(x)
    print(both)```this is what I am doing so far
slender thistle
#

Is that in your command

zenith gazelle
#

yes

slender thistle
#

Why are you creating a new connection with each command usage ๐Ÿค”

spare mirage
#

bot.commands.get('ban').execute(PREFIX, args, Discord, bot, message);
TypeError: Cannot read property 'execute' of undefined

#

why am I getting this error

zenith gazelle
#

I was told I needed to with python

#

do I not need to?

slender thistle
#

Uhhh

#

I don't think that's anywhere near efficient

strange trout
#

Because the command ban is undefined

spare mirage
#

weird

strange trout
#

Dunno can't really see anything from that

pale vessel
#

but that's not the error

strange trout
#

Have you tried logging bot.commands.get('ban')

ebon kelp
#

bot.commands.get('ban').run

strange trout
#

That's not what the error is

spare mirage
#

what?

ebon kelp
#

it's .run not .execute

#

oh

strange trout
#

bot.commands.get('ban') is undefined

ebon kelp
#

undefined

spare mirage
#

ahh

ebon kelp
#

Does the key exist?

spare mirage
#
        bot.commands.get('ban').run(PREFIX, args, Discord, bot, message);
    }```
#

U mean this?

ebon kelp
#

Yes, show how you add the commands to the collection

spare mirage
#

?

ebon kelp
#

bot.commands is a collection right?

#

bot.commands = new Collection();

#

somewhere

spare mirage
#
 
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
    const command = require(`./commands/${file}`);
 
    bot.commands.set(command.name, command);
}```
#

in index.js

ebon kelp
pale vessel
#

do you even know your command file structure

ebon kelp
#

I think that fixed it

spare mirage
#

nope

ebon kelp
#

wth

#

let file of commandFiles

#

let command

spare mirage
#

BRUHHH

#

I dont have problems with other commands

ebon kelp
#

Does every command file have the same structure?

spare mirage
#

no

ebon kelp
#

config: { name: "ping"},
run:

#

Every command file needs:

module.exports = {
  config: {
    "name": <Name>
  },
  run: <Function>
}
pale vessel
#

what a mess

spare mirage
#
const Discord = require('discord.js')

  module.exports = {
    name: 'stats',
    description: "this is a stats command!",
    execute(Discord, bot, message, args){```
ebon kelp
#

Yes that's the problem

#

consistency

spare mirage
#

ayy fixed it

spare mirage
#

IDk

#

dms

ebon kelp
#

btw add, instead of instant adding to the collection

if (file.config.name) {
  bot.commands.set(file.config.name, file);
  } else {
  console.log(`${file} is missing a name or is not string.`)
  continue;
}
#

That's a different error

#

Hope someone else can help, cuz I'm going

spare mirage
#

gn

muted cargo
#

hi

#

So I have a bot with a point system and a coinflip command - how would one go to combine these two mechanics?

whole hamlet
#

So that when you win a coin flip it gives you points?

muted cargo
#

yes or takes them away

#

@spare karma like zero two bot

spare mirage
#

you can give or take points

whole hamlet
#

You'd need a database, then if it's heads add points to the user, if it's tails take them away

muted cargo
#

would a point system be considered a database?

spare mirage
#

yes

whole hamlet
#

The points would be stored in the database, yes.

muted cargo
#

what would be the command to addor remove points

whole hamlet
#

You'd have to write one.

spare mirage
#

I dont know how ur point system works

muted cargo
#

hm

#

i must learn then

whole hamlet
#

Do you use any type of database?

tired nimbus
#

hey guys,

does anyone know how to disable fastforward in the youtube api?

#

not just hide controls

spare mirage
#

its a command right?

#

@tired nimbus

tired nimbus
#

idk

#

I know how to hide it but not completely disable fastforward

#

hold on I have an example somewhere

spare mirage
#

if its a command make the command author only

tired nimbus
spare mirage
#

as in

 if message.author.id=="urUSEDid"))```
tired nimbus
#

what

spare mirage
#

make the command for fastforward YOU only

#

did u just copy paste everything?

tired nimbus
#

what

#

im not making a bot

spare mirage
#

? then what are u making

tired nimbus
#

Im using the youtube api to show a youtube video but I want to know how to prevent fast forward

#

so users must watch the video completely

spare mirage
#

I dont think this is the right place to ask this tbh

tired nimbus
#

well on the plus side

#

im using this and using a discord application and then sending info to the bot

winter basalt
#

@spare mirage this channel isnt only for bot development

spare mirage
#

@winter basalt I know but this is mostly used for bots xD

hazy sparrow
#

okay so i trie to make a mute command. but it doesent reply anything or not showing any error. any helps?

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

const client = new Discord.Client();



client.on("message", (message) => {
    const args = message.content.slice(prefix.length).split(' ');
module.exports = {
    name: 'mute',
    description: "this is a moderation command. it mutes members.",
    execute(message){
        var person  = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[1]));
        if(!person) return  message.reply("I CANT FIND THE USER " + person)

        const  mainrole = message.guild.roles.cache.find(role => role.name === "Members");
        const role = message.guild.roles.cache.find(role => role.name === "Muted");
       

        if(!role) return message.reply("Couldn't find the mute role.")


        const time = args[2];
        if(!time){
            return message.reply("You didnt specify a time!");
        }

        person.roles.remove(Members)
        person.roles.add(Muted);


        message.channel.send(`@${person.user.tag} has now been muted for ${ms(ms(time))}`)

        setTimeout(function(){
           
            person.roles.add(mainrole.id)
            person.roles.remove(role.id);
            console.log(role.id)
            message.channel.send(`@${person.user.tag} has been unmuted.`)
        }, ms(time));
     }
 }})
solemn latch
#

i dont understand whats going on in this code bow

hazy sparrow
#

mute command

solemn latch
#

why is there a client.on in a command file

hazy sparrow
#

ok should i remove that

solemn latch
#

you have a command handler correct?

hazy sparrow
#

yes

solemn latch
#

then yes

hazy sparrow
#

ok done

solemn latch
#

you dont need any of it, client.on message, defining args outside the export
discord being required and the new client

hazy sparrow
#

umm ok

delicate shore
#

Hey

#

@restive pebble my search command isn't working can you help

spare mirage
#

u just need to give them a role muted wich the bot makes

hazy sparrow
#

this is the code now


module.exports = {
    name: 'mute',
    description: "this is a moderation command. it mutes members.",
    execute(message){
        var person  = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[1]));
        if(!person) return  message.reply("I CANT FIND THE USER " + person)

        const  mainrole = message.guild.roles.cache.find(role => role.name === "Members");
        const role = message.guild.roles.cache.find(role => role.name === "Muted");
       

        if(!role) return message.reply("Couldn't find the mute role.")


        const time = args[2];
        if(!time){
            return message.reply("You didnt specify a time!");
        }

        person.roles.remove(Members)
        person.roles.add(Muted);


        message.channel.send(`@${person.user.tag} has now been muted for ${ms(ms(time))}`)

        setTimeout(function(){
           
            person.roles.add(mainrole.id)
            person.roles.remove(role.id);
            console.log(role.id)
            message.channel.send(`@${person.user.tag} has been unmuted.`)
        }, ms(time));
     }
 }
solemn latch
#

you can define args in your command handler, and pass it like you pass message

#

execute(message,args)

hazy sparrow
#

like in the main code?

solemn latch
#

yeah

restive pebble
#

handeler

solemn latch
#

and in this code

spare mirage
#

always

#

do that

rotund willow
#

does anyone know how to add a bot to a groupchat ๐Ÿ˜”

restive pebble
#

no

hazy sparrow
#

you cant

restive pebble
#

lol

delicate shore
#

Boeing

restive pebble
#

why not working

hazy sparrow
#

unless the bot accepting your friend request

delicate shore
#

Can you come in DMS

restive pebble
#

no

delicate shore
#

Ok

spare mirage
#

@delicate shore we actually need code to solve something xD

restive pebble
#

any error?

rotund willow
#

oh lol

delicate shore
#

Ok

#

No error

#

This is what happens

spare mirage
#

just show the code ๐Ÿ˜ฉ

delicate shore
#

just show the code ๐Ÿ˜ฉ
@spare mirage
I can't I'm off pc

solemn latch
#

we cant help then

#

๐Ÿค”

spare mirage
#

we cant like solve the code from a message

delicate shore
#

Oof

#

Lol

restive pebble
#

ur message collector or whatever it is not working

delicate shore
#

ur message collector or whatever it is not working
@restive pebble
Yes I think so

restive pebble
#

it is

delicate shore
#

Wait lemme get on pc

#

And send code here

spare mirage
#
if(!message.member.hasPermission("BAN_MEMBERS") || !message.guild.owner) return errors.noPerms(message, "BAN_MEMBERS");
      if(!message.guild.me.hasPermission(["BAN_MEMBERS", "ADMINISTRATOR"])) return errors.lack(message.channel, "BAN_MEMBERS");

      let cmd = message.content.split(" ")[0].replace(PREFIX, ''); //used because command aliases
      if (args[0] === "help") return message.channel.send(usage.fullHelp(bot, cmd));

      let bUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
      if(!bUser) return errors.cantfindUser(message.channel);

      if(bUser.id === bot.user.id) return errors.botuser(message, "ban"); //if bot return with function botUser()

      let bReason = args.join(" ").slice(22);
      if(!bReason) bReason = 'No reason given';

      if(bUser.hasPermission(["BAN_MEMBERS", "ADMINISTRATOR"])) return errors.equalPerms(message, bUser, "BAN_MEMBERS");

      let banEmbed = new MessageEmbed() 
        .setDescription("~Ban~")
        .setColor("#bc0000")
        .addField("Banned user", `${bUser} with ID ${bUser.id}`)
        .addField("Banned By", `<@${message.author.id}> with ID ${message.author.id}`)
        .addField("Banned In", message.channel)
        .addField("Time", message.createdAt)
        .addField("Reason", bReason);
      try {
          bUser.ban(bReason);
          message.channel.send(banEmbed);
      } catch(e) {

        let id = second.getError(e.message);
        message.channel.send(`Unfortunately, an error occurred. Error ID: ${id}`);

if(!message.member.hasPermission("BAN_MEMBERS") || !message.guild.owner) return errors.noPerms(message, "BAN_MEMBERS");

TypeError: Cannot read property 'hasPermission' of undefined

solemn latch
#

i remember you having some issues with consistency.
Are you sure your sending params correctly?

spare mirage
#

yes

restive pebble
#

message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));

#

what is this lol

solemn latch
#

ie
execute(discord, bot, message, args)
in index
and
execute(message, bot, discord,args)

restive pebble
#

message.mentions.members.first() || message.guild.members.cache.get(args[0])

#

only this

#

ok

solemn latch
#

it was one of the issues i pointed out last time you asked this

#

undefined errors*

gloomy palm
#

Hey

#

Where do i find promo code

solemn latch
#

promo for?

winter basalt
#

annnddd how is this related to development

gloomy palm
#

The bot

winter basalt
#

bot.. promo code?

gloomy palm
solemn latch
#

๐Ÿค”

gloomy palm
#

Like this one

winter basalt
#

uh what

solemn latch
#

not a whatever that is

#

๐Ÿค”

gloomy palm
#

Oh crap

#

I ask in wrong server

#

Sory

spare mirage
gloomy palm
#

The icon is so like the same

restive pebble
#

message.mentions.members.first()||message.guild.members.cache.get(args[0])

spare mirage
#

whats wrong with that

restive pebble
#

it says undifined

spare mirage
#

how do I fix like bruh this command has taken me 9 hours

restive pebble
#

use that

spare mirage
#

instead of?

restive pebble
#

let bUser =message.mentions.members.first()||message.guild.members.cache.get(args[0])

spare mirage
#

ok

#

if(!message.member.hasPermission("BAN_MEMBERS") || !message.guild.owner) return errors.noPerms(message, "BAN_MEMBERS");
^

TypeError: Cannot read property 'hasPermission' of undefined

sudden geyser
#

using message.mentions can be unreliable

#

it means message.member is undefined. was the message sent in a guild?

spare mirage
#

no

restive pebble
#

lol

spare mirage
solemn latch
#

lets see that command handler ๐Ÿค”

sudden geyser
#

oh I also just realized execute(Discord, bot, message, args)

solemn latch
#

yeah

#

i brought up the issue a few times now

spare mirage
#
 
let commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
    let command = require(`./commands/${file}`);
 
    bot.commands.set(command.name, command);
}```
solemn latch
#

a few of his commands are in other orders too

#

thats the command loader

#

not the command handler

spare mirage
#

if(message.content.startsWith(PREFIX + "ping")) {
        bot.commands.get('ping').execute(Discord, bot, message, args);
    }else if(message.content.startsWith(PREFIX + "image")) {
        bot.commands.get('image').execute(Discord, bot, message, args);
    }else if(message.content.startsWith(PREFIX + "stats")) {
        bot.commands.get('stats').execute(Discord, bot, message, args);
    }else if(message.content.startsWith(PREFIX + "purge")) {
        bot.commands.get('purge').execute(Discord, bot, message, args);
    }else if(message.content.startsWith(PREFIX + "ban")) {
        bot.commands.get('ban').execute(Discord, bot, message, args);```
sudden geyser
#

oh god

solemn latch
#

๐Ÿค”

#

ive seen people help you try and fix that twice now

pale vessel
#

you must have copy pasted other bot commands

spare mirage
#

?

#

no I didnt

pale vessel
#

why would execute() work when you set the execute function as run()

spare mirage
#

it normally works

#

its just the ban command

marble geode
#

someone can gimme idea for economy command ?

hazy sparrow
#

uhhh

#

we can only guide you with code

#

not give ideas

marble geode
#

@hazy sparrow just gimme idea like make roulette command or something

solemn latch
#

okay

#

roulette

spare mirage
#

@marble geode betting

hazy sparrow
#

you could make a blackjack command

marble geode
#

ok thanks for idea i will make that command after my bot approved :D

delicate shore
#
case'search':
          if (!msg.member.voice.channel) {
            return msg.channel.send('You need to be in a voice channel to search for music')
          } else {
            msg.channel.send(`Please choose a song (1-10)\n\n${VIDEOS.map(v => ++index + v.title).join('\n\n')}`)
          }
          try {
            var response = await msg.channel.awaitMessages(m => m.content > 0 && m.content < 11, {
              max: 1,
              time: 30000,
              errors: ['time']
            })
            } catch {
              return msg.channel.send('Invalid search number or video')
            }
            const videoIndex = parseInt(response.first().content)
            var newPlay = await searchYT(videoIndex - 1)
            var pl = newPlay[0]
            var ay = pl.url
            msg.channel.send(newPlay)
          break;```
spare mirage
#

im so done with my ban command

delicate shore
#

@restive pebble my code of searrch command

#

and @spare mirage

tired nimbus
#

whats the discord web panel thing called again?

spare mirage
#

discord.dev

delicate shore
#

discord develeoper

spare mirage
#

just search that

tired nimbus
#

no the real web panel

#

the one where you can make your own oauth connection thing

hazy sparrow
delicate shore
#

discord developer portal

spare mirage
tired nimbus
#

bruh

#

Like dyno

delicate shore
#

pls hekp with search command

tired nimbus
#

or carl

hazy sparrow
#

-_-

solemn latch
#

whats the issue @delicate shore

marble geode
#

dashboard ?

tired nimbus
#

yes thank you!

marble geode
#

if you want make dashboard you need API

#

and web hosting :D

delicate shore
marble geode
#

uh so laggy

delicate shore
#

It's not playing

#

I'm not very good at command handler

#

So can you see if there is a mistake with that

#

I'm not able to spot

spare mirage
#

@delicate shore we need code!

delicate shore
#

I sent the code @spare mirage

#

Scroll up dude

solemn latch
#

you need to do .then after awaitMessages

delicate shore
#

so it should be awaitMessages.then?

solemn latch
#

๐Ÿค” actually you can use await, i think you just have some things out of place

delicate shore
#

Oh

#

what is meaning of pm

#

PM ME FOR HELP <<<

#

your status

solemn latch
#

its for servers i work in

#

๐Ÿค”

delicate shore
#

okk

solemn latch
#

i think all the stuff after the catch, and before the break need to be in the try statement

#

after awaitmessages

delicate shore
#

oh

#

try and catch?

solemn latch
#

ye

delicate shore
#

lemme see

solemn latch
#

response isnt available for the rest of the lines

#

due to scope

delicate shore
#

ok

spare mirage
#

can someone help me?

solemn latch
#

rn, your codes a mess imo

delicate shore
#

@solemn latch ```js
case'search':
if (!msg.member.voice.channel) {
return msg.channel.send('You need to be in a voice channel to search for music')
} else {
msg.channel.send(Please choose a song (1-10)\n\n${VIDEOS.map(v => ++index + v.title).join('\n\n')})
}
try {
var response = await msg.channel.awaitMessages(m => m.content > 0 && m.content < 11, {
max: 1,
time: 30000,
errors: ['time']
})
} catch {

try{
return msg.channel.send('Invalid search number or video')
}
const videoIndex = parseInt(response.first().content)
var newPlay = await searchYT(videoIndex - 1)
var pl = newPlay[0]
var ay = pl.url
msg.channel.send(newPlay) }

catch{
console.error(e);
}
break;```

solemn latch
#

its hard to read, so its hard for people to help

#

not another try catch

delicate shore
#

okoko

#

only try?

solemn latch
#

just move

const videoIndex = parseInt(response.first().content)
            var newPlay = await searchYT(videoIndex - 1)
            var pl = newPlay[0]
            var ay = pl.url
            msg.channel.send(newPlay) }

#

into the first try

delicate shore
#

ok

solemn latch
#

after response

delicate shore
#

thnx

#
case'search':
          if (!msg.member.voice.channel) {
            return msg.channel.send('You need to be in a voice channel to search for music')
          } else {
            msg.channel.send(`Please choose a song (1-10)\n\n${VIDEOS.map(v => ++index + v.title).join('\n\n')}`)
          }
          try {
            var response = await msg.channel.awaitMessages(m => m.content > 0 && m.content < 11, {
              max: 1,
              time: 30000,
              errors: ['time']
            })
            } catch {

              return msg.channel.send('Invalid search number or video')
            }


try{
            const videoIndex = parseInt(response.first().content)
            var newPlay = await searchYT(videoIndex - 1)
            var pl = newPlay[0]
            var ay = pl.url
            msg.channel.send(newPlay) 
}
          break;```
#

leme test this

solemn latch
#

๐Ÿค”

#

im not sure how that fixes scope issues

delicate shore
#

@solemn latch it says missing catc

solemn latch
#

ye

delicate shore
#

catch or final cause

solemn latch
#

it would

delicate shore
#

there is

solemn latch
#

you dont need more try catches

#

just put it in the first one that was already made

spare mirage
#

can someone help me?

strange trout
solemn latch
#

ay thats pretty cool

delicate shore
#

just put it in the first one that was already made
@solemn latch Wait so i need to extend the first catch till the ed?

#

end*

delicate shore
#

oh

solemn latch
#

to the inside of the try

#

the original one

delicate shore
#

It is inside try

solemn latch
#

making a new try

#

is not moving it

#

its making a new try

spare mirage
#

@strange trout ur lucky ur stuff works D:;

delicate shore
#

my brain

#

i am not getting anyhting

#
case'search':
          if (!msg.member.voice.channel) {
            return msg.channel.send('You need to be in a voice channel to search for music')
          } else {
            msg.channel.send(`Please choose a song (1-10)\n\n${VIDEOS.map(v => ++index + v.title).join('\n\n')}`)
          }
          try {
            var response = await msg.channel.awaitMessages(m => m.content > 0 && m.content < 11, {
              max: 1,
              time: 30000,
              errors: ['time']
            })
            } catch {

              return msg.channel.send('Invalid search number or video')
            }


try{
            const videoIndex = parseInt(response.first().content)
            var newPlay = await searchYT(videoIndex - 1)
            var pl = newPlay[0]
            var ay = pl.url
            msg.channel.send(newPlay) 
}
          break;```
#

this is code

#

so you want me to

#

end the first try

#

after newPlay'

#

?

solemn latch
#

get rid of the second try you added

#

take the things that was inside that try

#

and copy it, then delete it

#

and paste it inside the original try

delicate shore
#

Ok

#

So

#

Final code must be this

#

Wait

#

@solemn latch then it will give same resrurn response

solemn latch
#

the issue is scope

delicate shore
#

If he is not in the voice channel

#

Or if no results found

solemn latch
#

if that error accurs, try will stop

#

and catch will run

delicate shore
#

Ok

spare mirage
#

@solemn latch will this work better?

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

module.exports = {
  name: "ban",
  category: "moderation",
  description: "Ban anyone with one shot whithout knowing anyone xD",
  usage: "ban <@user> <reason>",
  run: async (client, message, args) => {
    
    if(!message.member.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, You do not have perms to ban someone`)
    }
    
    if(!message.guild.me.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, I am do not have perms to ban someone`)
    }
    
    const target = message.mentions.members.first();
    
    if(!target) {
      return message.channel.send(`**${message.author.username}**, Please mention the person who you want to ban.`)
    }
    
    if(target.id === message.author.id) {
      return message.channel.send(`**${message.author.username}**, You can not ban yourself!`)
    }
    
   
    
   if(!args[1]) {
     return message.channel.send(`**${message.author.username}**, Please Give Reason To ban Member`)
   }
    
    let embed = new discord.MessageEmbed()
    .setTitle("Action : Ban")
    .setDescription(`Banned ${target} (${target.id})`)
    .setColor("#ff2050")
    .setThumbnail(target.avatarURL)
    .setFooter(`Banned by ${message.author.tag}`);
    
    message.channel.send(embed)
    target.ban(args[1])
    
    
    
  }
}
delicate shore
#

@solemn latch ```js
case'search':
if (!msg.member.voice.channel) {
return msg.channel.send('You need to be in a voice channel to search for music')
} else {
msg.channel.send(Please choose a song (1-10)\n\n${VIDEOS.map(v => ++index + v.title).join('\n\n')})
}
try {
var response = await msg.channel.awaitMessages(m => m.content > 0 && m.content < 11, {
max: 1,
time: 30000,
errors: ['time']

        })

const videoIndex = parseInt(response.first().content)
var newPlay = await searchYT(videoIndex - 1)
var pl = newPlay[0]
var ay = pl.url
msg.channel.send(newPlay)

}

catch {

          return msg.channel.send('Invalid search number or video')
        }
      break;```
solemn latch
#

try it @spare mirage

spare mirage
#

node:7428) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'hasPermission' of undefined im getting an hasPermission error all the time

delicate shore
#

s

#

no wait

#

nvm

solemn latch
#

should work. your message collector responds to number

delicate shore
#

ok

#

lemme try

solemn latch
#

so to choose its just 3

#

or whatever

spare mirage
#

@solemn latch why is my code not working

solemn latch
#

try logging message for me Thonk

#

in the command

spare mirage
#

wdym

solemn latch
#

console.log(message)

spare mirage
#

where do I put it

solemn latch
#

in the execute of your ban command

#

run*

delicate shore
solemn latch
#

we are getting closer tho

delicate shore
#

Yeh

#

woo why don't you put your bot ot top.gg

#

you are very good at ciding

#

coding

solemn latch
#

change to
catch(err) {
console.log(err)
}

#

my bots in the process of being approved

delicate shore
#

oh

#

same

#

lol

solemn latch
#

but its really just a proof of concept

spare mirage
solemn latch
#

thats not an error

#

thats your entire client

delicate shore
#

lol

solemn latch
#

it appears, your sending client in the position of message

spare mirage
#

?

solemn latch
#

where you wrote message, put bot
try logging another one

#

like log client

marble geode
#

if (!message.member.hasPermission("BAN_MEMBERS))

spare mirage
#
    console.log(bot)```
#

@marble geode ?

#

if(!message.member.hasPermission("BAN_MEMBERS"))
I already have that

delicate shore
#

woo i changed the code

marble geode
#

why you put this execute(client, message, args, bot)

spare mirage
#

for @solemn latch

solemn latch
#

replace, not add

#

๐Ÿค”

marble geode
#

client = bot

solemn latch
#

well

#

his message is actually his client

spare mirage
#
F:\Users\Edwin\Desktop\Banana\commands\ban.js:11
    if(!message.member.hasPermission("BAN_MEMBERS")) {```
solemn latch
#

i told him to set it to bot, just until we figure out the order

spare mirage
#

the order shouldnt matter

marble geode
#

oo

solemn latch
#

it does

#

in functions

#

it doesnt matter in exports

spare mirage
#

๐Ÿฅด

#

an export is an function

#

lmaoo

solemn latch
#

yeah

#

but in the act of exporting it doesnt matter

spare mirage
#
  name: "ban",
  category: "moderation",
  description: "Ban anyone with one shot whithout knowing anyone xD",
  usage: "ban <@user> <reason>",
  execute(client, message, args, bot) {``` but im expoting right?
delicate shore
#

hey @solemn latch this has made my bot slow af

solemn latch
#

in executing of a function it does

delicate shore
#

it responds after 1 whole minute

#

is it due to glitch

solemn latch
#

possibly ๐Ÿค”

delicate shore
#

so now what shiuld i do ?/

solemn latch
#

or could be because of awaiting

delicate shore
#

oh

spare mirage
#

IM ON CAPS?

#

BREH

delicate shore
#

but noone commands are orming

#

working

spare mirage
#

i cant go out of caps lmao

marble geode
#

lmao

solemn latch
#

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

spare mirage
#

that was weird

solemn latch
#

maybe discord decided to throw a fit

delicate shore
#

oh wait nvm

#

only search command is not working

#

as we have not done any return repsond

#

we have just logged it

#

lol

#
    at i (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/yt-search/dist/yt-search.min.js:1:6156)
    at r (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/yt-search/dist/yt-search.min.js:1:1591)
    at new Promise (<anonymous>)
    at i (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/yt-search/dist/yt-search.min.js:1:1565)
    at t.exports (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/yt-search/dist/yt-search.min.js:1:12159)
at Client.<anonymous> (/app/index.js:481:24)
    at Client.emit (events.js:196:13)
    at MessageCreateAction.handle (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
(node:1055) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:1055) [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.```
solemn latch
#

ye

delicate shore
#

this is the error

marble geode
#

@delicate shore you remake music bot from Zhycorp ?

delicate shore
#

no

spare mirage
#
F:\Users\Edwin\Desktop\Banana\commands\ban.js:11
    if(!message.member.hasPermission("BAN_MEMBERS")) {``` woo the console logs this
delicate shore
#

they use YT api

#

i use YT_SEARCH

marble geode
#

ooo

delicate shore
#

yes

marble geode
#

why not use YT_API ?

delicate shore
#

because ny bot is in 78 servers

spare mirage
#

you need links for ytapi

delicate shore
#

and got hit iwth rate limit

#

with*

#

i used to use it

#

@marble geode

marble geode
#

ooo

strange trout
#

Music bots are really complicated

delicate shore
#
    at i (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/yt-search/dist/yt-search.min.js:1:6156)
    at r (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/yt-search/dist/yt-search.min.js:1:1591)
    at new Promise (<anonymous>)
    at i (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/yt-search/dist/yt-search.min.js:1:1565)
    at t.exports (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/yt-search/dist/yt-search.min.js:1:12159)
at Client.<anonymous> (/app/index.js:481:24)
    at Client.emit (events.js:196:13)
    at MessageCreateAction.handle (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
(node:1055) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:1055) [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.``` @solemn latch
#

error

#

modules.export? i don't have a command handler

#

why tf is it saying that

solemn latch
#

everything uses modules in js

spare mirage
#

what does this even mean

[ '@spare mirage' ]
F:\Users\Edwin\Desktop\Banana\commands\ban.js:11
    if(!message.member.hasPermission("BAN_MEMBERS")) {
                       ^

TypeError: Cannot read property 'hasPermission' of undefined```
strange trout
#

member

#

is

#

undefined

spare mirage
#

and

solemn latch
#

when you logged message, it was your client before

spare mirage
#

how

#

do

solemn latch
#

did you fix that

spare mirage
#

I

#

fix

delicate shore
#

@solemn latch this is real error

    at i (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/yt-search/dist/yt-search.min.js:1:1721)
    at r (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/yt-search/dist/yt-search.min.js:1:1591)
    at new Promise (<anonymous>)
    at i (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/yt-search/dist/yt-search.min.js:1:1565)
    at t.exports (/rbd/pnpm-volume/38b33121-f779-43cc-a95d-c99a7cf7a9d4/node_modules/yt-search/dist/yt-search.min.js:1:12159)
at Client.<anonymous> (/app/index.js:653:33)
    at processTicksAndRejections (internal/process/task_queues.js:88:5)```
solemn latch
#

console log your message again then

strange trout
#

If you log message.member it'll log undefined

delicate shore
#

maybe args

#

error?

spare mirage
#

message.author?

delicate shore
#

^^^

spare mirage
#

nah I think I will ban myself

delicate shore
#

member

#

is used for perms

strange trout
#

No, the issue comes from message not having the member property

delicate shore
#

@spare mirage no lol

#

owner can be banned anyways

strange trout
#

Hence why it logs undefined

delicate shore
#

message.member.hasPermission();

#

i use this

#

idk about you

solemn latch
#

๐Ÿค”

delicate shore
#

ยฏ_(ใƒ„)_/ยฏ

solemn latch
#

this was what happened when he logged message

#

๐Ÿค”

delicate shore
#

woo

#

pls help me

#

also

#

hehe

strange trout
#

Show how you're executing the command

#

@spare mirage

solemn latch
#

got the docs for the library your using @delicate shore i dont have it on hand

spare mirage
#

what part xD

strange trout
#

Where you're running the command

solemn latch
#

the handler

spare mirage
#

u mean }else if(message.content.startsWith(PREFIX + "ban")) { bot.commands.get('ban').execute(Discord, bot, message, args);

delicate shore
#

disocrd.js

spare mirage
#

this?

delicate shore
#

discord.js i am using this

solemn latch
#

๐Ÿค”

delicate shore
#

you want docs ? @solemn latch

strange trout
#

Issue is very obvious

solemn latch
delicate shore
#

my?\