#development
1 messages ยท Page 1016 of 1
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)```
WHATS THE GOOD ORDER :/
execute(client, message, args, bot) -> message = bot
args issue?
they need to be in the same order
search is a case
since its a function
Show code
me?
Yes
@solemn latch can u just tell me the good order :I
the one in your command handler
spoon
needs to be the same as the one in the command file
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;
ohh
it doesnt matter, as long as they are the same
but you said it doesnt matter
๐ค
://///
see it
buruh
videos[videoIndex - 1] maybe?
you seem to search for the index itself
lmaooooooo
then only it will work
your not checking overwrites, so i dont think so either
and what if I do
if(message.member.hasPermission("BAN_MEMBERS" || "ADMINISTRATOR")) {
your bot is cool
What is searchYT
What is searchYT
@strange trout another npm package
Link
ok
@spare mirage show code
@strange trout https://www.npmjs.com/package/yt-search
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
^
ermm
if(message.member.hasPermission("BAN_MEMBERS" || "ADMINISTARTOR")) {
return message.channel.send(`**${message.author.username}**, You do not have perms to ban someone`)
}
@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
That doesn't really provide any context
you saying me?
how do I fix @strange trout
!
var pl = newPlay[0]```
oh ye
this is where error is there
!member
Have you tried logging newPlay
no?
Do it
ok
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
hmm
why
this error is not caused in this code
then what
:)\
Because the property that you are trying to execute the function from is undefined
try checking cmd handeler
case 'usa19':
bot.commands.get('usacovid').execute(message, args);
break;
normal handler
it works @solemn latch yay!
yes undefined
Where are you loading the commands
in starting?
i am not
ok
me?
yes
yea i did
its there
case 'usa19':
bot.commands.get('usacovid').execute(message, args);
break;
here
No
then wat
alexisundefined it says newPlay is this
then the file is not correct
Is commands a collection
Where are you setting the commands
in index.js
๐ญ
Show
make function like init
whatsthat
Alexis?
and trigger the function before the bot logins
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
alexis ๐ฆ
how do I add the reason for the ban to the embed?
where are u loading then
@restive pebble wdym
field
You're trying to get an item from a collection that you never set
no the collection is set
yes
ALEXIS ๐ฆ
u need to set it
@restive pebble ur talking to me right?
Hey
oh
if(!args[1]) {
return message.channel.send(**${message.author.username}**, Please Give Reason To ban Member)
}
Alexis ?
ok who is talking to me im confused
have you blocked me ?
Do I addfield args[1]
so you cannot see my message ?
You're searching YouTube for a number @delicate shore
@vale garden you have to set the collection for each command
then how ot solve it
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
to
wat each comamnd
@vale garden code Lyon?
all my other commands work perfectly
await searchYT(videoIndex - 1)
i haveset this only ^
@vale garden code Lyon?
@delicate shore got it from my friend idk
ok
oh
and then that's what you're searching
@vale garden all other commands work fine?
so nothing works?
Well because if execute returns a promise you have to resolve it
alexis so wohat should i do?
Dunno
oh
I don't understand your code
@restive pebble Do you know
Can you send a haste of all of it
ok
@restive pebble @strange trout https://hatebin.com/echcbpulbj
promise
What is VIDEOS
What is
VIDEOS
@strange trout a cons
Show
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
What is VIDEO10
@spare mirage split
I don't get what you're doing PG
I don't get what you're doing PG
@strange trout ๐ฆ
@restive pebble can u help me ๐ฆ ๐ฆ
๐ญ
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;```
instead of args[1] @spare mirage
i am leaving it here in case someone help sme ๐ญ
Can you show me what VIDEOS is
Can you show me what VIDEOS is
@strange trout i di d
yes it works! thanks @restive pebble
I'm trying to understand what you're doing
yt-search returns videos
You're asking the user to choose from a list of songs and then searching youtube for a number
to unban u need ban permissions right?
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
var newPlay = await searchYT[videoIndex - 1]
adminstrator ok
Is searchYT and array?
u using yt search?
Yes

The one which u said @restive pebble
easy things making complex lol
Lol
So
let VIDEOS = VIDEO10.videos.slice(0, 9)
@delicate shore
This is how I defined
Where does VIDEO10 come from
Ok?
Why isn't it defined within your search command? Are you using it globally?
me taking a look on ur code
My brain hurts
how do I make unban command?
capitalized variables are usually constants
me taking a look on ur code
@restive pebble
Ok thnx
at this point I need to see your entire code to see what you're doing
I have a question about updating server count with DBL.
If anyone here has done it with Javascript, could you please help me out.
what have you done so far? What are you confused about?
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?
You need to run the method and set an interval
Where could I run the method?
Alright, so like make an interval of 15 minutes inside the ready event. Got it.
pretty sure just initlizing it properly will update it automatically
An official module for interacting with the top.gg API - DiscordBotList/dblapi.js
yea thats what I thought as well
That's what I thought too.
Does it?
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?
client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);
});
yeah thats optional
that's how u run a code again and again
why set interval
setTimeout()
guildCreate
earrrape
@restive pebble ?
it will only update when bot join guild
That's an example from the API page
ok
yeah
@restive pebble you saw my code?
i use guildCreate
You could end up spamming the API
on initlization
@delicate shore how u defined searchYT
did you just go through the code of the wrapper?
That you can listen to
postStats just emit events?
const searchYT = require('yt-search'); @restive pebble
lol
how do u make a unban command
from what I can tell, that is the code that calls it
thats not how yt search works lol
@restive pebble ok...
yes so that code calls the post stats function without doing it manually
no need to set an interval
Ah true
await VIDEOS[videoIndex - 1]
await VIDEOS[videoIndex - 1]
@restive pebble iuse this only
yes
thats not how yt search works lol
@restive pebble really rest commands are working
of music
and to get url
Wait no
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
ya
it doesnt need to be
https://giphy.com/gifs/oprah-ULvRYymfJLYgU @restive pebble
what
do ubmean
u mean
lol
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
@restive pebble can u enter my project pls pls pls
@spare mirage try it and see
you have acess to it
lol ok
to learn about arrays ---> https://www.w3schools.com/js/js_arrays.asp
to learn about objects ---> https://www.w3schools.com/js/js_objects.asp
@delicate shore
anyone know how to highlight lines in github when you send a link
๐ค
theres a way i think
btw
๐ฆ
only || "ADMINISTRATOR" wont work @spare mirage
nah it doesnt even work
o pog
what is your error @spare mirage
https://github.com/DiscordBotList/dblapi.js/blob/master/src/index.js#L52-L61
figured out how to highlight lines
k
shift click
ty for sending that link btw
probably need to learn how to use the search API too ---> https://www.npmjs.com/package/yt-search
oh
it means its not executed
i didn't need to shift click bruh
@spare mirage
pls anyone just tell what is error
are you on discord.js 11?

only || "ADMINISTRATOR" wont work @spare mirage
@spare mirage
@delicate shore I'd need to see a lot of your code to know what you're doing
Okay
really?
i have already gave him anwer
Is it a lot?
but he dosent know objects and arrays
@finite bough how do I fix?
my whole bot
Oh god I'ma go format it
oh
but they both are same
glitch has a vsc plugin
i have VSC also in my pc
does glitch have an auto format ability?
yes
if(!message....("BAN_MEMBER")) || if(!message...("ADMINISTRATOR"))
Is there a way to test the vote webhook?
yes
Yeah
ermm
https://top.gg/api/docs#mybots choose your bot and then choose test webhook
Can't really help with much @delicate shore
oh
I'd need to rewrite everything
u need to fetch
well thats not a good idea
member
yeah
so.
ยฏ_(ใ)_/ยฏ
message.guild.members.fetch() is the function I think
members
so I make a
let NAME = message.guild.members.fetch()
i doubted myself and went to my server to check the fetch thing lol @crimson vapor
lmao
Please don't joke about that

no do not do that
:/
its gonna return a promise
I think you can use a .then() function on it but I do not know
are u talking to me @crimson vapor
yea
u use async
ok
ill use .then
you have something against async?
yes
lol
It never works
just add async lol
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;```
well do you use command handling?
that thing is not enough
yes
that thing is not enough
@restive pebble what
and i told u searchYT is not an array
lmao I coded a music command as a joke and its about that many lines
VIDEOS[index]
lemme see if I can find it
?
VIDEOS[index -1]
const videoSearches = await yts(args.join(' '));
const URL = videoSearches.videos[0].url;``` my music search function
message.guild.members.fetch().then(members.unban(args[1])); @crimson vapor will this work?
ok
It won't
doesnt matter, you should test it
Told ya
.then(mem=>
how c ome the arrow function?
I use m=> because its faster to type
ok
@restive pebble still no
I should go work on my bot
send new code
newPlay is the embed I think
message.channel.send(embed)
message.guild.members.fetch().then(mem=>{
members.unban(args[1]);
});
```this?
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 ^^^
hastebin!
probably not
as you defined member as mem and then did not use it
mem.unban
so I use mem.unban?
are you sure you didn't copy paste
yes
yes
are you sure you didn't copy paste
@pale vessel who lol
looke like a tutorial
const videoIndex = parseInt(response.first().content);
const newPlay = VIDEOS[videoIndex - 1];
msg.channel.send(newPlay);
```@delicate shore
can you try that
it sends the embed but lilpeep124 is not unbanned
Where did you even define NEwOlay
wat
Where did you even define
NEwOlay
@strange trout i mean newPlay
did you get an error?
mem.unban(args[1]);
});``` but why is he not un=banned
TypeError: mem.unban is not a function
one sec pulling up the docs
ok
you can't ban members lmao
flapzepe can u help me?
i did
flezepe ":??????
that's not you
flapzepe*
OH
what happened
wait I thought you were trying to ban a member im sorry
o
Is there a way to send a test vote right now?
yes
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
How would I do that MILLION?
what's the problem
how do u unban xD
I am there
choose bots
Okay I'm there
@crimson vapor do u know how unban works
and when i log newPlay
kinda
well yeah newPlay is just an embed no
you're not sending it to anything
no newPlay is an array I thought
mad as heck
object
did you not create a voice connection?
What do I put in the provided fields @crimson vapor
@pale vessel do u know how I make the unban?
did you not create a voice connection?
@crimson vapor i have /
newPlay is a failed attempt at searching for a song
newPlay is a failed attempt at searching for a song
@strange trout oh then soslution?
var newPlay = await searchYT[videoIndex - 1];
searchYT is not an array
did you setup the correct settings for the webhook at the site?
its a function
I feel so sorry for you Boeing
why lol
discord.User.unban(args[1]); will this work?
The code I told you to try should have at least led you in the right direction
yea :(
@delicate shore i am entering ur project
right ?
i will fix
no worries
lol
Omega spoon
it is message.guild.unban("USERID", member, message)
u can use cheerio tho
do u need member, message)
no you only need one
I guess userid is best
i dont like mod commands
understandable as they suck
no one does
ok Justii
can i see
ok anyway, back to helping you
so first, I fetched the guild bans
message.guild.unban(${args[1]}) will this work?
#development message this is hot
but cannot copy
no, unless you plan to only use user IDs that are banned
thanks boeing
My bot is hot
I suggest not doing that as it will error if they are not banned
what is the best way?
i didnt even fixed lol
does that video thing works?
My level command is 400 lines of code on it's own 
:3
cheerio is best api
cheerio is not an api
now try
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) })
shhhh
but that's v11 code
damn it
now try
@restive pebble me
I stopped coding as they released 12
yes
what has changed lmao
ok
ok lemee seses
it returns a collection of baninfo instead of users
wait what
find(o => o.user.id)
uuhhhh
@restive pebble no ๐ฆ
Honestly I'm pretty experienced with coding and the last thing I want to make is a music bot
ok
nice
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
not executed
bruh
They're hard to maintain and resource intensive if you want to make it public
fix that
yeah that admin
this better?
@delicate shore does the command list all the videos?
I edited the message
test it
message.guild.unban(args[1])
^
TypeError: message.guild.unban is not a function
isn't it members.unban
oof
@delicate shore does the command list all the videos?
@restive pebble yes
Sorry for late reply
My net went oof
Of
I get the embed but still banned
But it takes a lot of time Boeing
@delicate shore ur code was fine
oh
its inside try
Ok lemme see
now try
Ok
now try
@restive pebble
Nope
And I changed the const video Inez
Index once
I get the embed but still banned
@crimson vapor
She said me
can you send your code?
Ok
ya
yep
What's the point of pl
thats an object
And ay
url
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)
}
}```
oh
oj
i gave newplay an array lol
const { title, url } =VIDEOS[videoIndex -1]
message.channel.send(title)
Ok
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
@restive pebble nope not wening
yea ur code it ok
Working
@spare mirage when you used the command what did you say?
Oh
did you include a used id?
yes
ok
it worked?
not to u
and you checked the bans list and lilpeep is sill banned?
it worked?
@restive pebble
No
Errors?
send error lol
Errors?
@strange trout no errors
hmm
final quote :his await message is not working
Oh btw @restive pebble message doesn't work in my code
To make it work you have to write msg
ok
Idk why but if you write message it says message is not defined
ah leave ill google
what are you trying to do boeing?
my web socket disconnects in 2 mins
On his await messages
Ok
:/
his filter
collector?
var response = await msg.channel.awaitMessages(m => m.content > 0 && m.content < 11, { max: 1, time: 30000, errors: ['time'] })
yes the filter on it
I would just restrict to author
here ima send my ban command on hastebin
its gay
i pick the first result
why argue lol
busy livestreaming, cant help rn
yes mod commands are bad af
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
Boeing you should change a lot about your code
const index = (await msg.channel.awaitMessages(m => m.author.id === message.author.id, { max: 1, time: 30000, errors: ['time'] })).first()
//rest of code
what code
sorry
@spare mirage i already saw you are using guild permissions, bad
boeing did it work?
check final permissions, not guild
fb.fuckoff
no
oh works
dont let me do this again
wrong channel?
lol
just tell me how I unban
u sure?
but works
just code properly
wait lemme see
Just do it right 4head
'it works' is not valid if you want to properly develop a bot
wait how do you check final perms?
channel overwrites exists and a lot of people sue them
check final permissions, not guild
aka, check channel permisions
@opal plank how
read the d.js guide on Final permission
-_-
read the doc
Channel perms dont matter for unban does it
ยฏ_(ใ)_/ยฏ
๐ค
permissions can be changed channel wise
People really like getting spoon fed here
but i dont think thats one
yeah it happens a lot here
ban should be role only
In general
i dont remember
@strange trout talking about me
only 10?
take a break, read the docs, try again

bruh
lol
Just tell me whats wrong here
Docs are great
u were streaming lol
@restive pebble whath to do?
message.guild.members.unban(args[1])
wdym
๐
DIDNT HELp

Justii do you know how to read the docs?
guild.members.unban('84484653687267328')
.then(user => console.log(`Unbanned ${user.username} from ${guild.name}`))
.catch(console.error);```
no I forgot to read
@restive pebble CODING SUCKS
didnt i tell you to use debugger to debug your code?
oh boeing
Don't do it then
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
@opal plank debugger is weird
yeah leave coding then like me
Bruh
i literally told you how to properly debug your code
you refuse to use it
and except spoonfeed?
what
glitch also has debugger
stuborn af dude, ffs
^
ReferenceError: guild is not defined```
did you just copy paste

sigh
Logging stuff is also something that could help
Justii
?
fetch bans, then find a ban with the correct id, then unban that id
yes

and also no
so you can make the command async or use .then
message.guild.fetchBans()
Aka you have to resolve the promise
message.guild.fetchBans().then - arrow function??
mhmm
arrow
bans.forEach(banInfo => {
message.guild.members.unban(banInfo.user);
});```
like this?
?

