#development

1 messages ยท Page 1016 of 1

spare mirage
#

wait what?

solemn latch
#

like i said 10 times

#

๐Ÿค”

#

wrong order

delicate shore
#
    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)```
spare mirage
#

WHATS THE GOOD ORDER :/

strange trout
#

execute(client, message, args, bot) -> message = bot

delicate shore
#

args issue?

solemn latch
#

they need to be in the same order

delicate shore
#

search is a case

solemn latch
#

since its a function

delicate shore
#

so it's 0 args right?

#

and the args 1 is name

#

of somg

strange trout
#

Show code

delicate shore
#

me?

strange trout
#

Yes

spare mirage
#

@solemn latch can u just tell me the good order :I

solemn latch
#

the one in your command handler

strange trout
#

spoon

solemn latch
#

needs to be the same as the one in the command file

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']

            })
            

 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(err) {
console.log(err)
}
          
          break;
spare mirage
#

ohh

solemn latch
#

it doesnt matter, as long as they are the same

#

but you said it doesnt matter

#

๐Ÿค”

spare mirage
#

://///

delicate shore
#

see it

spare mirage
#

I fkn own the server

delicate shore
#

buruh

solemn latch
#

videos[videoIndex - 1] maybe?
you seem to search for the index itself

delicate shore
#

you don't have a role

#

whihchas banperms

#

which has ban perms

spare mirage
#

lmaooooooo

delicate shore
#

then only it will work

spare mirage
#

ermm will it work with admin

#

?

delicate shore
#

no

#

bots are dumb as shit

solemn latch
#

your not checking overwrites, so i dont think so either

spare mirage
#

and what if I do
if(message.member.hasPermission("BAN_MEMBERS" || "ADMINISTRATOR")) {

delicate shore
#

then t shiuld

#

work

spare mirage
delicate shore
#

your bot is cool

strange trout
#

What is searchYT

spare mirage
delicate shore
#

What is searchYT
@strange trout another npm package

strange trout
#

Link

delicate shore
#

ok

strange trout
#

@spare mirage show code

delicate shore
spare mirage
#

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>",
  execute(Discord, bot, message, args) {
    console.log(bot)
    if(message.member.hasPermission("BAN_MEMBERS" || "ADMINISTARTOR")) {
      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])
    
    
    
  }
}```
#

I problly should have used hastebin

solemn latch
#

^

strange trout
#

You're checking if the member does have perms

#

And sending that message

spare mirage
#

ermm

strange trout
#
if(message.member.hasPermission("BAN_MEMBERS" || "ADMINISTARTOR")) {
  return message.channel.send(`**${message.author.username}**, You do not have perms to ban someone`)
}
spare mirage
#

Uhh ye I see

#

I wish hasnotPermission was a thing

#

xD

delicate shore
#

@solemn latch TypeError: Cannot read property '0' of undefined
at Client.<anonymous> (/app/index.js:654:29)
at processTicksAndRejections (internal/process/task_queues.js:88:5)

#

it's not working

#

even after rplcaing it

strange trout
#

That doesn't really provide any context

delicate shore
#

you saying me?

spare mirage
#

how do I fix @strange trout

solemn latch
#

!

delicate shore
#
var pl = newPlay[0]```
spare mirage
#

oh ye

delicate shore
#

this is where error is there

spare mirage
#

!member

delicate shore
#

so should i change

#

it

#

to 1

#

or add split('')

strange trout
#

Have you tried logging newPlay

delicate shore
#

no?

strange trout
#

Do it

delicate shore
#

ok

vale garden
#

hi

#
const api = require('novelcovid')
const Discord = require('discord.js')

module.exports = {
  name: 'usa19',
  description: "corona usa info",
  async execute(message, args){

    api.settings({
    baseUrl: 'https://disease.sh'
})

let state = args[1];

if (!args[1]){
  message.channel.send("You have to enter the US state whose stats you want to check")
}

const data = await api.states({state:args[1]})

const COVID = new Discord.MessageEmbed()
.setTitle("COVID-19 Stats by US State")
.setAuthor(`Requested by ${message.author.username}`, `${message.author.displayAvatarURL()}`)
.setThumbnail('https://cdn.pixabay.com/photo/2020/04/29/08/24/coronavirus-5107804_1280.png')
.setColor("#ffa343")
.addFields(
  {name: '**`State:`**', value: data.state},
  {name: '**`Total Cases:`**', value: data.cases},
  {name: '**`Today\'s Cases:`**', value: data.todayCases},
  {name: '**`No. of Active Cases:`**', value: data.cases},
  {name: '**`No. of Deaths:`**', value: data.deaths},
  {name: '**`Today\'s Deaths:`**', value: data.todayDeaths},
  {name: '**`No. of Cases per 1 Million People:`**', value: data.casesPerOneMillion},
  {name: '**`No. of Deaths per 1 Million People:`**', value: data.deathsPerOneMillion},
  {name: '**`No. of Tests Taken:`**', value: data.tests},
)
.setFooter("Info provided by: https://disease.sh")
.setTimestamp()

message.channel.send(COVID)

  }
}
#
UnhandledPromiseRejectionWarning: TypeError: Cannot read property '
execute' of undefined
#

im getting this err

delicate shore
#

hmm

vale garden
#

why

restive pebble
#

this error is not caused in this code

vale garden
#

then what

spare mirage
strange trout
#

Because the property that you are trying to execute the function from is undefined

restive pebble
#

try checking cmd handeler

vale garden
#
  case 'usa19':
    bot.commands.get('usacovid').execute(message, args);
    break;
#

normal handler

spare mirage
#

it works @solemn latch yay!

vale garden
#

is it supposed to be different for an async function

#

or something

restive pebble
#

yes undefined

strange trout
#

Where are you loading the commands

delicate shore
#

@strange trout undefined

#

it logs it like this

vale garden
#

in index.js

#

wat

restive pebble
#

in starting?

delicate shore
#

boeing

#

finanly you are here

vale garden
#

ok who is asking me

#

im confused

delicate shore
#

i am not

vale garden
#

ok

restive pebble
#

did u load the command in starting

#

?

vale garden
#

me?

restive pebble
#

yes

vale garden
#

yea i did

#

its there

#
  case 'usa19':
    bot.commands.get('usacovid').execute(message, args);
    break;
#

here

strange trout
#

No

vale garden
#

then wat

delicate shore
#

alexisundefined it says newPlay is this

restive pebble
#

then the file is not correct

strange trout
#

Is commands a collection

vale garden
#

why

#

yea

#

it is

strange trout
#

Where are you setting the commands

vale garden
#

in index.js

delicate shore
#

๐Ÿ˜ญ

strange trout
#

Show

restive pebble
#

make function like init

vale garden
#

whatsthat

delicate shore
#

Alexis?

restive pebble
#

and trigger the function before the bot logins

vale garden
#
switch (args[0]) {


    case 'test':
    bot.commands.get('test').execute(message, args);
    break;

    case 'ping':
    bot.commands.get('ping').execute(message, args);
    break;
}
#

this is how it looks

#

if i only have those commands

restive pebble
#

ooof

#

where are u loading then

delicate shore
#

alexis ๐Ÿ˜ฆ

spare mirage
vale garden
#

where are u loading then
@restive pebble wdym

restive pebble
#

field

strange trout
#

You're trying to get an item from a collection that you never set

vale garden
#

no the collection is set

restive pebble
#

yes

delicate shore
#

ALEXIS ๐Ÿ˜ฆ

restive pebble
#

u need to set it

spare mirage
#

@restive pebble ur talking to me right?

strange trout
#

Hey

restive pebble
#

yes

#

addField

vale garden
#

oh

spare mirage
#

if(!args[1]) {
return message.channel.send(**${message.author.username}**, Please Give Reason To ban Member)
}

delicate shore
#

Alexis ?

vale garden
#

ok who is talking to me im confused

delicate shore
#

have you blocked me ?

spare mirage
#

Do I addfield args[1]

delicate shore
#

so you cannot see my message ?

strange trout
#

You're searching YouTube for a number @delicate shore

delicate shore
#

no?

#

is it so ?

restive pebble
#

@vale garden you have to set the collection for each command

delicate shore
#

then how ot solve it

vale garden
#
const fs = require('fs');
bot.commands = new Discord.Collection();

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);
}
#

see

delicate shore
#

to

vale garden
#

wat each comamnd

delicate shore
#

@vale garden code Lyon?

vale garden
#

all my other commands work perfectly

strange trout
#

await searchYT(videoIndex - 1)

delicate shore
#

i haveset this only ^

vale garden
#

@vale garden code Lyon?
@delicate shore got it from my friend idk

delicate shore
#

ok

strange trout
#

videoIndex is a number

#

You're subtracting 1

delicate shore
#

oh

strange trout
#

and then that's what you're searching

delicate shore
#

so

#

now

restive pebble
#

@vale garden all other commands work fine?

vale garden
#

yea

#

i think none of the async commands are working

restive pebble
#

so nothing works?

strange trout
#

Well because if execute returns a promise you have to resolve it

delicate shore
#

alexis so wohat should i do?

strange trout
#

Dunno

delicate shore
#

oh

strange trout
#

I don't understand your code

delicate shore
#

@restive pebble Do you know

strange trout
#

Can you send a haste of all of it

delicate shore
#

ok

vale garden
#

so nothing works?
@restive pebble no the await-async ones arent

#

everything else is

delicate shore
restive pebble
#

promise

strange trout
#

What is VIDEOS

delicate shore
#

What is VIDEOS
@strange trout a cons

strange trout
#

Show

spare mirage
#
let embed = new discord.MessageEmbed()
    .setTitle("Action : Ban")
    .setDescription(`:white_check_mark: Banned ${target} (${target.id})`)
    .addField("Reason : " + args[1], 'He deserved it tbh', true)
    .setColor("#ff2050")
    .setThumbnail(target.avatarURL)
    .setFooter(`Banned by ${message.author.tag}`);
    
    message.channel.send(embed)
    target.ban(args[1])

why does this only send 1 word here

delicate shore
#

let VIDEOS = VIDEO10.videos.slice(0, 9)

#

^^^^^ Alexis

strange trout
#

What is VIDEO10

delicate shore
#

@spare mirage split

restive pebble
#

args.splice(1).join(" ") @spare mirage

#

lol

spare mirage
#

wait what?

#

do I split

strange trout
#

I don't get what you're doing PG

spare mirage
#

or do I splice

#

xD

restive pebble
#

no

#

.join

#

lol

#

just paste it

spare mirage
#

where

#

in the embed lol

#

?]

delicate shore
#

I don't get what you're doing PG
@strange trout ๐Ÿ˜ฆ

#

@restive pebble can u help me ๐Ÿ˜ฆ ๐Ÿ˜ฆ

#

๐Ÿ˜ญ

strange trout
#

Where does the list of songs come from

#

That's what I don't get

delicate shore
#

Youtube search bar

#
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(err) {
console.log(newPlay)
}
          
          break;```
restive pebble
#

instead of args[1] @spare mirage

delicate shore
#

i am leaving it here in case someone help sme ๐Ÿ˜ญ

strange trout
#

Can you show me what VIDEOS is

delicate shore
#

Can you show me what VIDEOS is
@strange trout i di d

strange trout
#

Yeah it's just another variable VIDEO10

#

What is VIDEO10

spare mirage
#

yes it works! thanks @restive pebble

strange trout
#

I'm trying to understand what you're doing

restive pebble
#

yt-search returns videos

strange trout
#

You're asking the user to choose from a list of songs and then searching youtube for a number

spare mirage
#

to unban u need ban permissions right?

delicate shore
#

You're asking the user to choose from a list of songs and then searching youtube for a number
@strange trout
Yes

#

Not for a number

#

I wanna search for song

#

That is the issue

strange trout
#

var newPlay = await searchYT[videoIndex - 1]

restive pebble
#

adminstrator ok

strange trout
#

Is searchYT and array?

restive pebble
#

u using yt search?

delicate shore
#

Yes

restive pebble
delicate shore
#

The one which u said @restive pebble

restive pebble
#

easy things making complex lol

delicate shore
#

Lol

#

So

#

let VIDEOS = VIDEO10.videos.slice(0, 9)
@delicate shore

#

This is how I defined

strange trout
#

Where does VIDEO10 come from

delicate shore
#

Ok?

strange trout
#

Why isn't it defined within your search command? Are you using it globally?

restive pebble
#

me taking a look on ur code

strange trout
#

My brain hurts

restive pebble
#

what ytsearch defined

#

i mean searchYT

spare mirage
#

how do I make unban command?

strange trout
#

capitalized variables are usually constants

restive pebble
#

<member>.unban

#

u need to check if he was even banned lol

delicate shore
#

me taking a look on ur code
@restive pebble
Ok thnx

strange trout
#

at this point I need to see your entire code to see what you're doing

earnest phoenix
#

I have a question about updating server count with DBL.

#

If anyone here has done it with Javascript, could you please help me out.

crimson vapor
#

what have you done so far? What are you confused about?

earnest phoenix
#

I just wanted to know, is this enough to update my server every 15 minutes.

#
  const dbl = new DBL(process.env.DBL_TOKEN, {
    webhookPort: PORT,
    webhookAuth: "",
    webhookServer: httpServer,
    statsInterval: 900000
  }, client);
#

Or do I have to run the postStats method?

strange trout
#

You need to run the method and set an interval

earnest phoenix
#

Where could I run the method?

strange trout
#

Or schedule a cron-job

#

On your ready event

earnest phoenix
#

Alright, so like make an interval of 15 minutes inside the ready event. Got it.

solemn latch
#

pretty sure just initlizing it properly will update it automatically

crimson vapor
#

yea thats what I thought as well

earnest phoenix
#

That's what I thought too.

strange trout
#

Does it?

solemn latch
#

poststats can be used optionally

#

if you want

#

๐Ÿค”

earnest phoenix
#

So then what I have is enough right?

#

Imma slide in here is their a way to have the bot send a message at a certain time without needing the command to be triggered?

strange trout
#
client.on('ready', () => {
    setInterval(() => {
        dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
    }, 1800000);
});
solemn latch
#

yeah thats optional

finite bough
#

that's how u run a code again and again

restive pebble
#

why set interval

finite bough
#

setTimeout()

restive pebble
#

guildCreate

delicate shore
#

earrrape
@restive pebble ?

restive pebble
#

it will only update when bot join guild

strange trout
#

That's an example from the API page

restive pebble
#

ok

solemn latch
#

yeah

delicate shore
#

@restive pebble you saw my code?

restive pebble
#

i use guildCreate

solemn latch
#

but the library already does it

strange trout
#

You could end up spamming the API

solemn latch
#

on initlization

restive pebble
#

@delicate shore how u defined searchYT

delicate shore
#

you have acess

#

to my code

strange trout
#

@solemn latch no

#

Those just emit events

crimson vapor
#

did you just go through the code of the wrapper?

strange trout
#

That you can listen to

solemn latch
#

postStats just emit events?

delicate shore
#

const searchYT = require('yt-search'); @restive pebble

solemn latch
#

lol

spare mirage
#

how do u make a unban command

crimson vapor
#

from what I can tell, that is the code that calls it

restive pebble
#

ok

#

member.unban

delicate shore
#

guys

#

help 'me

#

lol

restive pebble
#

thats not how yt search works lol

spare mirage
#

@restive pebble ok...

crimson vapor
#

yes so that code calls the post stats function without doing it manually

#

no need to set an interval

solemn latch
#

^

#

it calls postStats()

strange trout
#

Ah true

restive pebble
#

await VIDEOS[videoIndex - 1]

delicate shore
#

await VIDEOS[videoIndex - 1]
@restive pebble iuse this only

restive pebble
#

yes

delicate shore
#

thats not how yt search works lol
@restive pebble really rest commands are working

#

of music

restive pebble
#

and to get url

strange trout
#

Wait no

restive pebble
#

newPlay.url

#

newPlay[0] is undefined lol

#

new play is an object now

strange trout
#
   this.postStats()
          .then(() => this.emit('posted'))
          .catch(e => this.emit('error', e));
        setInterval(() => {
          this.postStats()
            .then(() => this.emit('posted'))
            .catch(e => this.emit('error', e));
        }, this.options.statsInterval);
#

No params are passed

restive pebble
#

ya

solemn latch
#

it doesnt need to be

delicate shore
#

what

#

do ubmean

#

u mean

#

lol

spare mirage
#

    if(!message.member.hasPermission("BAN_MEMBERS" || "ADMINISTARTOR")) {
      return message.channel.send(`**${message.author.username}**, You do not have perms to unban someone`)
    }
    
    if(!message.guild.me.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, I do not have perms to unban someone`)
    }
    
   
    
    
    let embed = new discord.MessageEmbed()
    .setTitle("Action : unban")
    .setDescription(`:white_check_mark: unbanned ${userID}`)
    .setColor("#ff2050")
    .setThumbnail(target.avatarURL)
    .setFooter(`unbanned by ${message.author.tag}`);
    
    message.channel.send(embed)
    member.unban(args[1])``` does this work @restive pebble
strange trout
#

Ah

#

I see

delicate shore
#

@restive pebble can u enter my project pls pls pls

finite bough
#

@spare mirage try it and see

delicate shore
#

you have acess to it

spare mirage
#

lol ok

restive pebble
solemn latch
#

anyone know how to highlight lines in github when you send a link

#

๐Ÿค”

#

theres a way i think

finite bough
#

btw

delicate shore
#

๐Ÿ˜ฆ

finite bough
#

only || "ADMINISTRATOR" wont work @spare mirage

spare mirage
#

nah it doesnt even work

solemn latch
#

o pog

crimson vapor
#

what is your error @spare mirage

solemn latch
restive pebble
#

k

solemn latch
#

shift click

crimson vapor
#

ty for sending that link btw

delicate shore
#

woo

#

Woo do you know abouti t?

restive pebble
#

yeah works

#

lol

spare mirage
#

none

#

@crimson vapor I dont get an output

solemn latch
#

ive not been paying attention

#

sorry

strange trout
delicate shore
#

oh

restive pebble
#

it means its not executed

pale vessel
#

i didn't need to shift click bruh

restive pebble
#

@spare mirage

delicate shore
#

pls anyone just tell what is error

spare mirage
#

oh lmaoo

#

yes

#

xD

crimson vapor
#

are you on discord.js 11?

delicate shore
#

no

#

v12

restive pebble
crimson vapor
#

sorry, I was asking Justii

#

should have clarified my bad

restive pebble
#

ooof

#

he didnt executed

#

lol

finite bough
#

only || "ADMINISTRATOR" wont work @spare mirage
@spare mirage

delicate shore
#

๐Ÿ˜ฆ

#

end my life

#

๐Ÿ˜ญ

strange trout
#

@delicate shore I'd need to see a lot of your code to know what you're doing

delicate shore
#

i can sen you

#

my whole

#

code

#

in hatebin

strange trout
#

Okay

delicate shore
#

really?

restive pebble
#

i have already gave him anwer

strange trout
#

Is it a lot?

restive pebble
#

but he dosent know objects and arrays

delicate shore
#

here

spare mirage
#

@finite bough how do I fix?

delicate shore
#

my whole bot

strange trout
#

Oh god I'ma go format it

crimson vapor
#

oh its one file

#

do you use vsc? @delicate shore

delicate shore
#

no

#

i use glitch

crimson vapor
#

oh

delicate shore
#

but they both are same

restive pebble
#

glitch has a vsc plugin

delicate shore
#

i have VSC also in my pc

crimson vapor
#

does glitch have an auto format ability?

delicate shore
#

yes

finite bough
#

if(!message....("BAN_MEMBER")) || if(!message...("ADMINISTRATOR"))

earnest phoenix
#

Is there a way to test the vote webhook?

crimson vapor
#

yes

strange trout
#

Yeah

spare mirage
crimson vapor
strange trout
#

Can't really help with much @delicate shore

delicate shore
#

oh

spare mirage
#

member.unban(args[1])

#

why does this not work?

strange trout
#

I'd need to rewrite everything

restive pebble
#

u need to fetch

crimson vapor
#

well thats not a good idea

restive pebble
#

member

crimson vapor
#

yeah

restive pebble
#

with returns a promise

#

which*

spare mirage
#

so.

restive pebble
#

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

crimson vapor
#

message.guild.members.fetch() is the function I think

restive pebble
#

members

crimson vapor
#

oh

#

been so long since ive done anything

delicate shore
#

๐Ÿ˜ฆ

#

๐Ÿ˜ญ

#

bye

#

i am gonna end my life real quick

spare mirage
#

so I make a
let NAME = message.guild.members.fetch()

restive pebble
#

i doubted myself and went to my server to check the fetch thing lol @crimson vapor

crimson vapor
#

lmao

strange trout
#

Please don't joke about that

restive pebble
crimson vapor
#

no do not do that

spare mirage
#

:/

delicate shore
#

i am not joking

#

i already deleted my bot rn from top.gg

crimson vapor
#

its gonna return a promise

#

I think you can use a .then() function on it but I do not know

spare mirage
#

are u talking to me @crimson vapor

crimson vapor
#

yea

restive pebble
#

u use async

spare mirage
#

no

#

no async

#

no

restive pebble
#

ok

spare mirage
#

ill use .then

crimson vapor
#

you have something against async?

spare mirage
#

yes

restive pebble
#

lol

spare mirage
#

It never works

restive pebble
#

just add async lol

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']

            })
            

 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(err) {
console.log(newPlay)
}
          
          break;```
crimson vapor
#

well do you use command handling?

restive pebble
#

that thing is not enough

spare mirage
#

yes

delicate shore
#

that thing is not enough
@restive pebble what

restive pebble
#

and i told u searchYT is not an array

crimson vapor
#

lmao I coded a music command as a joke and its about that many lines

restive pebble
#

VIDEOS[index]

crimson vapor
#

lemme see if I can find it

delicate shore
#

?

restive pebble
#

searchYT is not an array

#

it a function

delicate shore
#

oh

#

then

#

it should be VIDEO[index] acc to u?

restive pebble
#

VIDEOS[index -1]

delicate shore
#

vidoes?

#

i have not decleared it

crimson vapor
#
        const videoSearches = await yts(args.join(' '));
        const URL = videoSearches.videos[0].url;``` my music search function
spare mirage
#

message.guild.members.fetch().then(members.unban(args[1])); @crimson vapor will this work?

crimson vapor
#

no

#

wait

#

test it

spare mirage
#

ok

strange trout
#

It won't

crimson vapor
#

doesnt matter, you should test it

spare mirage
#

no it doesnt

#

members is not defined

strange trout
#

Told ya

restive pebble
#

.then(mem=>

spare mirage
#

how c ome the arrow function?

crimson vapor
#

I use m=> because its faster to type

restive pebble
#

ok

delicate shore
#

@restive pebble still no

strange trout
#

I should go work on my bot

delicate shore
#

in logs it says that newPlay is undefined

#

that is it

restive pebble
#

send new code

crimson vapor
#

newPlay is the embed I think

spare mirage
#
message.channel.send(embed)
    message.guild.members.fetch().then(mem=>{
      members.unban(args[1]);
    });
    ```this?
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']

            })
            

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




}

catch(err) {
console.log(newPlay)
}
          
          break;
#

boeing ^^^

spare mirage
#

hastebin!

delicate shore
spare mirage
#
      members.unban(args[1]);
    });```
#

will this work?

crimson vapor
#

probably not

restive pebble
#

why using await

#

lol

crimson vapor
#

as you defined member as mem and then did not use it

restive pebble
#

mem.unban

spare mirage
#

so I use mem.unban?

pale vessel
#

are you sure you didn't copy paste

restive pebble
#

yes

crimson vapor
#

yes

restive pebble
#

are you sure you didn't copy paste
@pale vessel who lol

crimson vapor
#

looke like a tutorial

strange trout
#
const videoIndex = parseInt(response.first().content);

const newPlay = VIDEOS[videoIndex - 1];
msg.channel.send(newPlay);
```@delicate shore
#

can you try that

delicate shore
#

@strange trout it sys NEwOlay us not defined

#

is

spare mirage
solemn latch
#

why would you wanna unban lilpeep124

#

dudes a meanie

strange trout
#

Where did you even define NEwOlay

spare mirage
#

:(

strange trout
#

wat

delicate shore
#

Where did you even define NEwOlay
@strange trout i mean newPlay

crimson vapor
#

did you get an error?

delicate shore
#

yes

#

yes

#

it says newPlay is not defined

spare mirage
#
      mem.unban(args[1]);
    });``` but why is he not un=banned
#

TypeError: mem.unban is not a function

crimson vapor
#

one sec pulling up the docs

delicate shore
#

ok

pale vessel
#

you can't ban members lmao

delicate shore
#

flapzepe can u help me?

pale vessel
#

i did

spare mirage
#

flezepe ":??????

pale vessel
#

that's not you

delicate shore
#

flapzepe*

pale vessel
#

OH

delicate shore
#

that is not my ques

#

yeah

pale vessel
#

what happened

delicate shore
#

i am having erro with music

#

search command

crimson vapor
#

wait I thought you were trying to ban a member im sorry

pale vessel
#

o

earnest phoenix
#

Is there a way to send a test vote right now?

crimson vapor
#

yes

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']

            })
            

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




}

catch(err) {
console.log(newPlay)
}
          
          break;```
#

this is my code

earnest phoenix
#

How would I do that MILLION?

pale vessel
#

what's the problem

spare mirage
#

how do u unban xD

crimson vapor
#

@earnest phoenix go to the api in top.gg

earnest phoenix
#

I am there

crimson vapor
#

choose bots

pale vessel
earnest phoenix
#

Okay I'm there

crimson vapor
#

choose yours

#

and test webhook

delicate shore
#

what's the problem
@pale vessel it is not palying

#

song

spare mirage
#

@crimson vapor do u know how unban works

delicate shore
#

and when i log newPlay

crimson vapor
#

kinda

pale vessel
#

well yeah newPlay is just an embed no

delicate shore
#

it saus undefiend

#

oh

pale vessel
#

you're not sending it to anything

delicate shore
#

ok

#

i am mad

#

then

crimson vapor
#

no newPlay is an array I thought

delicate shore
#

mad as heck

restive pebble
#

object

pale vessel
#

but you're not sending it to anything for it to play

#

that's why it didn't play

crimson vapor
#

did you not create a voice connection?

earnest phoenix
#

What do I put in the provided fields @crimson vapor

spare mirage
#

@pale vessel do u know how I make the unban?

delicate shore
#

did you not create a voice connection?
@crimson vapor i have /

strange trout
#

newPlay is a failed attempt at searching for a song

delicate shore
#

newPlay is a failed attempt at searching for a song
@strange trout oh then soslution?

strange trout
#
var newPlay = await searchYT[videoIndex - 1];
restive pebble
#

searchYT is not an array

crimson vapor
#

did you setup the correct settings for the webhook at the site?

restive pebble
#

its a function

crimson vapor
#

I feel so sorry for you Boeing

restive pebble
#

why lol

crimson vapor
#

every time you explain it

#

and nothig changes

spare mirage
#

discord.User.unban(args[1]); will this work?

strange trout
#

The code I told you to try should have at least led you in the right direction

crimson vapor
restive pebble
#

yea :(

delicate shore
#

beoing

#

you told me about this

restive pebble
#

@delicate shore i am entering ur project

delicate shore
#

right ?

restive pebble
#

i will fix

delicate shore
#

ok

#

thanks

restive pebble
#

no worries

delicate shore
#

fucking sak e

#

thanks

restive pebble
#

lol

strange trout
#

Omega spoon

crimson vapor
#

it is message.guild.unban("USERID", member, message)

restive pebble
#

u can use cheerio tho

crimson vapor
#

Boeing did you make an unban command?

spare mirage
#

do u need member, message)

crimson vapor
#

no you only need one

restive pebble
#

no

#

i didnt

spare mirage
#

I guess userid is best

restive pebble
#

i dont like mod commands

crimson vapor
#

understandable as they suck

spare mirage
#

no one does

crimson vapor
#

ok Justii

strange trout
#

I recently redesigned my bots rank card

#

Looks pretty cool

crimson vapor
#

my bot's rank card is so lit

#

ill send a pic

spare mirage
#

can i see

restive pebble
#

canvacord has good rank cards

#

really hot

spare mirage
#

xD

#

good

crimson vapor
#

ok anyway, back to helping you

strange trout
crimson vapor
#

so first, I fetched the guild bans

restive pebble
#

i like this

spare mirage
#

message.guild.unban(${args[1]}) will this work?

pale vessel
restive pebble
#

but cannot copy

crimson vapor
#

no, unless you plan to only use user IDs that are banned

delicate shore
#

thanks boeing

spare mirage
#

yes

#

thats what I will use

strange trout
#

My bot is hot

crimson vapor
#

I suggest not doing that as it will error if they are not banned

delicate shore
#

thank god kind epople

#

exist

#

like boeing

spare mirage
#

what is the best way?

restive pebble
#

i didnt even fixed lol

delicate shore
#

you will

#

later

#

ik

restive pebble
#

does that video thing works?

delicate shore
#

yes

#

play works

strange trout
#

My level command is 400 lines of code on it's own omg

delicate shore
#

stop works

#

queue works

spare mirage
#

:3

delicate shore
#

skip works

#

now playing works

#

only search

spare mirage
#

cheerio is best api

pale vessel
#

cheerio is not an api

restive pebble
#

now try

crimson vapor
#

a simple command: js let userID = args[1] message.guild.fetchBans(),then(bans=> { if(bans.size == 0) return let bUser = bans.find(b => b.user.id == userID) if(!bUser) return message.guild.unban(bUser) })

pale vessel
#

are they on v11?

crimson vapor
#

shhhh

pale vessel
#

but that's v11 code

crimson vapor
#

damn it

delicate shore
#

now try
@restive pebble me

crimson vapor
#

I stopped coding as they released 12

restive pebble
#

yes

crimson vapor
#

what has changed lmao

restive pebble
#

ok

delicate shore
#

ok lemee seses

pale vessel
#

it returns a collection of baninfo instead of users

spare mirage
#

wait what

pale vessel
#

find(o => o.user.id)

spare mirage
#

uuhhhh

pure saddle
crimson vapor
#

oh

#

that makes so much sense

delicate shore
#

@restive pebble no ๐Ÿ˜ฆ

strange trout
#

Honestly I'm pretty experienced with coding and the last thing I want to make is a music bot

restive pebble
#

ok

crimson vapor
#

I made one as a joke

#

entirely a constructor

#

but badly coded

delicate shore
#

nice

spare mirage
#
      return message.channel.send(`**${message.author.username}**, You do not have perms to unban someone`)
    }
    
    if(!message.guild.me.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, I do not have perms to unban someone`)
    }
    
   
    
    
    let embed = new discord.MessageEmbed()
    .setTitle("Action : unban")
    .setDescription(`:white_check_mark: unbanned `)
    .setColor("#ff2050")
    .setFooter(`unbanned by ${message.author.tag}`);

    
    
    message.channel.send(embed)
    
    message.guild.unban(args[1])```why does  this not work?? its weird
restive pebble
#

not executed

pale vessel
strange trout
#

They're hard to maintain and resource intensive if you want to make it public

pale vessel
#

fix that

restive pebble
#

yeah that admin

spare mirage
#

this better?

restive pebble
#

@delicate shore does the command list all the videos?

spare mirage
#

I edited the message

crimson vapor
#

test it

spare mirage
#

message.guild.unban(args[1])
^

TypeError: message.guild.unban is not a function

crimson vapor
#

one sec

#

oh

pale vessel
#

isn't it members.unban

crimson vapor
#

message.guild.members.unban

#

because d.js v12

spare mirage
#

oof

delicate shore
#

@delicate shore does the command list all the videos?
@restive pebble yes

#

Sorry for late reply

#

My net went oof

#

Of

spare mirage
#

I get the embed but still banned

delicate shore
#

But it takes a lot of time Boeing

restive pebble
#

@delicate shore ur code was fine

delicate shore
#

Ok

#

Then ? What was worng

restive pebble
#

i changed slice to splice

#

and this is not expected

delicate shore
#

oh

restive pebble
#

its inside try

delicate shore
#

Ok lemme see

restive pebble
#

now try

delicate shore
#

Ok

#

now try
@restive pebble
Nope

#

And I changed the const video Inez

#

Index once

spare mirage
#

I get the embed but still banned
@crimson vapor

delicate shore
#

She said me

crimson vapor
#

can you send your code?

restive pebble
#

are u getting any reply

#

to channel?

delicate shore
#

no

#

Wge I type number

#

Nothin happens

restive pebble
#

actually bot restarted

#

try again

delicate shore
#

Ok

strange trout
#

Btw

#

Is newPlay an object?

restive pebble
#

ya

crimson vapor
#

yep

delicate shore
#

No

#

Boeing no

restive pebble
strange trout
#

What's the point of pl

crimson vapor
#

thats an object

strange trout
#

And ay

restive pebble
#

url

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


module.exports = {
  name: "unban",
  category: "moderation",
  description: "Welcome Back!",
  usage: "unban <@user> <reason>",
  execute(Discord, bot, message, args) {
   
    if(!message.member.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, You do not have perms to unban someone`)
    }
    
    if(!message.guild.me.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, I do not have perms to unban someone`)
    }
    
    message.guild.members.unban(args[1])
    
    
    let embed = new discord.MessageEmbed()
    .setTitle("Action : unban")
    .setDescription(`:white_check_mark: unbanned `)
    .setColor("#ff2050")
    .setFooter(`unbanned by ${message.author.tag}`);

    
    
    message.channel.send(embed)
    
    
    
    
    
    
  }
}```
restive pebble
#

its strange then

#

cuz it gives no error

delicate shore
#

oh

restive pebble
#

oh sorry

#

i am a fuck

#

ok try now

delicate shore
#

oj

restive pebble
#

i gave newplay an array lol

delicate shore
#

No

#

:(

#

Alexis the code you said me to change

#

Should we reverse that

restive pebble
delicate shore
#

oh

#

So maybe a package is missing

#

Hey

strange trout
#
const { title, url } =VIDEOS[videoIndex -1]

message.channel.send(title)
delicate shore
#

enable-npm

#

@restive pebble run this in terminal

restive pebble
#

can u try again

#

i am logging now

delicate shore
#

Ok

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


module.exports = {
  name: "unban",
  category: "moderation",
  description: "Welcome Back!",
  usage: "unban <@user> <reason>",
  execute(Discord, bot, message, args) {
   
    if(!message.member.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, You do not have perms to unban someone`)
    }
    
    if(!message.guild.me.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, I do not have perms to unban someone`)
    }
    
    message.guild.members.unban(args[1])
    
    
    let embed = new discord.MessageEmbed()
    .setTitle("Action : unban")
    .setDescription(`:white_check_mark: unbanned `)
    .setColor("#ff2050")
    .setFooter(`unbanned by ${message.author.tag}`);

    
    
    message.channel.send(embed)
    
    
    
    
    
    
  }
}``` why is this not unbanning
delicate shore
#

@restive pebble nope not wening

restive pebble
#

yea ur code it ok

delicate shore
#

Working

restive pebble
#

i see await message is not working

#

thats the problem

crimson vapor
#

@spare mirage when you used the command what did you say?

delicate shore
#

Oh

spare mirage
#

PREFIX + unban

#

it does

crimson vapor
#

did you include a used id?

spare mirage
#

yes

restive pebble
#

ok

spare mirage
delicate shore
#

Do Boeing

#

Now

#

I mean so*

#

Not do

#

Lol

restive pebble
#

it worked?

spare mirage
#

no

#

just the embed

restive pebble
#

not to u

spare mirage
#

not the unban

#

ok

#

lol

crimson vapor
#

and you checked the bans list and lilpeep is sill banned?

delicate shore
#

it worked?
@restive pebble
No

strange trout
#

Errors?

spare mirage
#

yup

restive pebble
#

send error lol

delicate shore
#

Errors?
@strange trout no errors

crimson vapor
#

hmm

restive pebble
#

final quote :his await message is not working

delicate shore
#

Oh btw @restive pebble message doesn't work in my code

#

To make it work you have to write msg

restive pebble
#

ok

delicate shore
#

Idk why but if you write message it says message is not defined

restive pebble
#

ah leave ill google

crimson vapor
#

what are you trying to do boeing?

strange trout
#

Because

#

That filter makes no sense

restive pebble
#

my web socket disconnects in 2 mins

strange trout
#

On his await messages

delicate shore
#

Ok

restive pebble
#

i am trying to make own library

#

ill google

spare mirage
#

:/

restive pebble
#

lol

#

@strange trout wut filter

crimson vapor
#

his filter

restive pebble
#

collector?

strange trout
#
var response = await msg.channel.awaitMessages(m => m.content > 0 && m.content < 11, { max: 1, time: 30000, errors: ['time'] })
crimson vapor
#

yes the filter on it

restive pebble
#

oh

#

lol

spare mirage
#

reeeeeeeeeee

#

mod commmands are the worst

crimson vapor
#

I would just restrict to author

restive pebble
#

yes

#

i left that search one

crimson vapor
#

here ima send my ban command on hastebin

restive pebble
#

its gay

opal plank
#

@spare mirage mod commands are the easiest

#

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

restive pebble
#

i pick the first result

spare mirage
#

no

#

@opal plank

#

then help me xD

opal plank
#

yes

#

they are

crimson vapor
restive pebble
#

why argue lol

opal plank
#

busy livestreaming, cant help rn

delicate shore
#

yes mod commands are bad af

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


module.exports = {
  name: "unban",
  category: "moderation",
  description: "Welcome Back!",
  usage: "unban <@user> <reason>",
  execute(Discord, bot, message, args) {
   
    if(!message.member.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, You do not have perms to unban someone`)
    }
    
    if(!message.guild.me.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, I do not have perms to unban someone`)
    }
    
    message.guild.members.unban(args[1])
    
    
    let embed = new discord.MessageEmbed()
    .setTitle("Action : unban")
    .setDescription(`:white_check_mark: unbanned `)
    .setColor("#ff2050")
    .setFooter(`unbanned by ${message.author.tag}`);

    
    
    message.channel.send(embed)
    
    
    
    
    
    
  }
}``` they send the embed but dont get unban
crimson vapor
#

Boeing you should change a lot about your code

strange trout
#
const index = (await msg.channel.awaitMessages(m => m.author.id === message.author.id, { max: 1, time: 30000, errors: ['time'] })).first()

//rest of code
restive pebble
#

what code

crimson vapor
#

sorry

opal plank
#

@spare mirage i already saw you are using guild permissions, bad

delicate shore
#

boeing did it work?

opal plank
#

check final permissions, not guild

crimson vapor
#

wrong person my bad

#

I mean justii

restive pebble
#

fb.fuckoff

spare mirage
#

no

restive pebble
#

oh works

spare mirage
#

dont let me do this again

crimson vapor
#

wrong channel?

restive pebble
#

lol

spare mirage
#

just tell me how I unban

delicate shore
#

u sure?

restive pebble
#

but works

opal plank
#

just code properly

delicate shore
#

wait lemme see

solemn latch
#

Just do it right 4head

opal plank
#

'it works' is not valid if you want to properly develop a bot

crimson vapor
#

wait how do you check final perms?

opal plank
#

channel overwrites exists and a lot of people sue them

#

check final permissions, not guild

#

aka, check channel permisions

spare mirage
#

@opal plank how

delicate shore
#

did not work boeing

#

๐Ÿ˜ฆ

opal plank
#

read the d.js guide on Final permission

spare mirage
#

-_-

opal plank
#

read the doc

solemn latch
#

Channel perms dont matter for unban does it

opal plank
#

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

solemn latch
#

๐Ÿค”

spare mirage
#

no they dont

#

lma

opal plank
#

permissions can be changed channel wise

strange trout
#

People really like getting spoon fed here

opal plank
#

but i dont think thats one

spare mirage
#

@strange trout u talking bout me

#

?

crimson vapor
#

yeah it happens a lot here

opal plank
#

ban should be role only

strange trout
#

In general

opal plank
#

i dont remember

delicate shore
#

@strange trout talking about me

spare mirage
#

if u talk about me ive been trying for 10 hours

#

no sleep

#

:/

delicate shore
#

only 10?

opal plank
#

take a break, read the docs, try again

restive pebble
spare mirage
#

bruh

delicate shore
#

lol

spare mirage
#

Just tell me whats wrong here

strange trout
#

Docs are great

restive pebble
#

u were streaming lol

delicate shore
#

@restive pebble whath to do?

spare mirage
#

message.guild.members.unban(args[1])

restive pebble
#

change filter

delicate shore
#

filter

#

er

spare mirage
#

KEKW wdym

delicate shore
#

๐Ÿ˜†

opal plank
spare mirage
#

DIDNT HELp

delicate shore
crimson vapor
#

Justii do you know how to read the docs?

opal plank
#
guild.members.unban('84484653687267328')
  .then(user => console.log(`Unbanned ${user.username} from ${guild.name}`))
  .catch(console.error);```
spare mirage
#

no I forgot to read

delicate shore
#

@restive pebble CODING SUCKS

opal plank
#

didnt i tell you to use debugger to debug your code?

delicate shore
#

oh boeing

strange trout
#

Don't do it then

delicate shore
#

i think you are in wrong

#

project

#

lol

crimson vapor
#

I suggest reading the docs before you ask any questions here, not saying we won't help but it will be good practice and can help you learn more about d.js

spare mirage
#

@opal plank debugger is weird

restive pebble
#

yeah leave coding then like me

opal plank
#

Bruh

#

i literally told you how to properly debug your code

#

you refuse to use it

#

and except spoonfeed?

#

what

restive pebble
#

glitch also has debugger

opal plank
#

stuborn af dude, ffs

spare mirage
#

I dont expect a spoonfeed

#

and debugger is kinda weird to setup ngl

pale vessel
#

haha pressing a button is hard

#

can't relate

crimson vapor
#

thank you for saying that

#

made me laugh

spare mirage
#
    ^

ReferenceError: guild is not defined```
pale vessel
#

did you just copy paste

restive pebble
crimson vapor
#

sigh

strange trout
#

Logging stuff is also something that could help

crimson vapor
#

Justii

spare mirage
#

?

crimson vapor
#

fetch bans, then find a ban with the correct id, then unban that id

spare mirage
#

ok

#

so I only have to fetch the bens now

restive pebble
#

yes

spare mirage
crimson vapor
#

and also no

restive pebble
#

promise lol

spare mirage
#

no

#

he promised

restive pebble
#

fetch is promise

crimson vapor
#

so you can make the command async or use .then

spare mirage
#

message.guild.fetchBans()

strange trout
#

Aka you have to resolve the promise

spare mirage
#

message.guild.fetchBans().then - arrow function??

pale vessel
#

mhmm

restive pebble
#

arrow

spare mirage
#
    bans.forEach(banInfo => {
      message.guild.members.unban(banInfo.user);
    });```
#

like this?

pale vessel
spare mirage
#

?