#development
1 messages ยท Page 1018 of 1
it is in config
@spare mirage https://hatebin.com/thvfofpudr
@restive pebble i dont have root
i use env
questoin how do u execute/run it?
bruh
bruh
simply set prefix
@restive pebble pro
@restive pebble i mean in ths code he is not asking for prefix anywhere how is he doing if(command === "plau")?
oop
I am dead
how do people make currency systems?
db
What
datebases? hmm how does that work
const { PlayerManager, Player } = require("../dist/index.js");
what does this mean
@delicate shore he has defined prefix inside config.js
what is dist
require lol
@delicate shore he has defined prefix inside config.js
@restive pebble but i have in env
so
replace lol
require lol
@restive pebble what is it requiring
Replace name
bruh

@restive pebble
imagine not knowing require
^


imagine not knowing require
@restive pebble i know but
yes lol
hmmm
If u dont know about require then why do u have the bot working?
const Discord = require("/discord.js")
config.prefix
If u dont know about require then why do u have the bot working?
const Discord = require("/discord.js")
@spare mirage bruh i know it
brubhrurbhrhrhrhrhr
r
i mena
bruh moment
const { PlayerManager, Player } = require("../dist/index.js");```
lmaoo
brain.exe stopped
what to do of this
a
const { PlayerManager, Player } = require("../dist/index.js");
this file is in root of the directory
const { PlayerManager, Player } = require("../dist/index.js");
@restive pebble i don't have any file named
so make lol
what the heck is /dist/
why expect spoon food
i have a file called index.js
but i never declared Player or Player Manager there
@spare mirage most people compile typescript projects in folder named dist
ok...
@pure lion dm
@earnest phoenix use var not let
Ew lavalink
Never used it
But why use it over ytdl
But why use it over ytdl
@pure lion rate limit
Ball
-checkdms
Please watch the following video. Replace any instances of twitter with discord. https://www.youtube.com/watch?v=umxmHpUPS5A
imagine not knowing the difference between ytdl and yt-search services
@restive pebble Don't bully me
and i know
@pure lion the spam isn't necessary
I'm cofucuous
ok
did i get ghost pinged? lmao
ytdl is basically a downloader of youtube videos in pure node js
By me Tim :E
:c
arbitary format
ok
I'm changing back to dice
so u can play with discord.js's .play
.play(ytdl(url))
Then you use something that will affect rate cough and get the URL from yt
what are some fun fun games on discordjs
logic
Also @delicate shore basically what I'm saying is we're gonna get rate limited unless we use a screen scraper
Screen scraper = ๐ช ๐ฑ
@delicate shore pls watch the video that starman posted
@sinful belfry
@delicate shore pls watch the video that starman posted
@quartz kindle where
smh
Lolmao also hi Tim also is there a way to use ytdl for audio only because apparently it downloads the vid by default
^^^^^^
lol
literally scroll up a bit
yes
๐ฆ

@pure lion filter lol
๐ญ
.play(ytdl(url,{format:'audioonly'}))
format: 'opus'
how do I give out welcome roles?
No
bruh
that thing is removed
And some pliers
can someone help with rank card lol
Yeah lol canvas lol
that thing is removed
@restive pebble @pure lion
my problem is with progress bar
opus is not needed
lol
and if u put it wont play anything
Fill (percentage)
Lol
._.
Akowwkwko
fillRect(x,y,width.height)
...
shit
ohh
dev
Rame
Yeah
https://i.alhassan.best/u/mJZXDNr6iK.png
Why does this happen?
I'm resolving it already
@earnest phoenix you gotta map them
map the flags?
Yeah
I'm talking about the Pending Promise though
lmfao
shit :/
await Promise.resolve()
i aswered
@pure lion what to do
SCROLL UP LMA9
u cannot resolve promises with eval lol
Oh?
you dont need promise resolve? just await fetchFlags directly
also you dont need to assign it to a var
:o
just output it directly as an expression
Or map th-
flags is not populated by default i believe

so i don't rely on cache
hmmm
Sometimes the flags are buried too deep in the floor cache
<uwuser>.flwags.mop(f => f).join(
how does a man create levels/xp systems
Wait how do I index shit
maths lol
xD

why did that not work the time I tried it
maths lol
what do u mean
How do I filter an array of strings alphabetically? Iโm using JavaScript.
say I add await Promise.resolve(evalcode) would it work
alr thx
say I eval message.channel.send('test') shouldnt show promise pending right?
Yep, amazing!
yees
Uh
Avatarurl is a fu-
send error lol
@restive pebble np error
displayAvatarURL()
And do displayAvatarURL()
no*
Nnnnn
EPIC
{size:2048} lol
...
how can i use fillRect with percentage
@thin bolt (X, Y, {value here} % 100, height)
let me tryy
change the 100 to ur width lol
that wont work, you have to transform the percentage to pixels
๐๏ธ
np
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);
}else if(message.content.startsWith(PREFIX + "unban")) {
bot.commands.get('unban').execute(Discord, bot, message, args);
}else if(message.content.startsWith(PREFIX + "kick")) {
bot.commands.get('kick').execute(Discord, bot, message, args);
}else if(message.content.startsWith(PREFIX + "say")) {
bot.commands.get('say').execute(Discord, bot, message, args);
}else if(message.content.startsWith(PREFIX + "size")) {
bot.commands.get('size').execute(Discord, bot, message, args);
}
``` I want to make a command called "banana" but that will break because it has "**BAN**ana" it runs the ban command :3 how do I fix
https://hatebin.com/khhcuarulr <<<<<<MY CODE
MY error
ur not dming bot?
wot?
are u dming bot?
no
it's not dm mess bot
can u make bots reply on dms?
yes you can
:o
if(channel.dm)funckoff
@delicate shore processArticle returns an embed
so you're doing embed.channel.send()
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);
}else if(message.content.startsWith(PREFIX + "unban")) {
bot.commands.get('unban').execute(Discord, bot, message, args);
}else if(message.content.startsWith(PREFIX + "kick")) {
bot.commands.get('kick').execute(Discord, bot, message, args);
}else if(message.content.startsWith(PREFIX + "say")) {
bot.commands.get('say').execute(Discord, bot, message, args);
}else if(message.content.startsWith(PREFIX + "size")) {
bot.commands.get('size').execute(Discord, bot, message, args);
}
``` I want to make a command called "banana" but that will break because it has "**BAN**ana" it runs the ban command :3 how do I fix
@spare mirage

split commandname
dot

and execute

so you're doing embed.channel.send()
@quartz kindle what
const command = args.shift(); do I just add something like this
thats not what he said
@delicate shore
he said split the args
const commandname = message.content.slice(prefix.length).split(' ')[0]
oh
`
const args = message.content.slice(prefix.length).split(/ +/);
wait wich one do I use xD
const commandname = message.content.slice(prefix.length).split(' ')[0]
command name
use try and catch
you can also replace your entire if else wall with this lol ```js
if(...startsWith(PREFIX) && bot.commands.has(cmd)) { bot.commands.get(cmd).execute(...) }
that is a big brain idea
i use try {
cmd.run(message,args,Discord)
}catch {return}
if run is an async function, you need to await it
then await cmd.run()
wouldnt
const args = message.content.slice(prefix.length).split(/ +/)
const command = args.shift();
if (command === 'ping') {
bot.commands.get('commandname').execute(BLABLABLA);
I would use stng like this
the idea is that instead of manually typing every single command, you use the command itself to see if it exists and execute it
@restive pebble yes but if cmd.run() is an async function, that try catch will not work
async is awesome lol
lol
you cant do shit without it
easy
:3
unless you wanna go back to the era of callback hell
ik im being annoying
callbacks shit
(async()=>{let flags = await message.author.fetchFlags()
flags.toArray()})()
this i a valid way to use async right
eww async
which dosent give promise
the await Promise.resolve() ?
wouldnt
const args = message.content.slice(prefix.length).split(/ +/) const command = args.shift(); if (command === 'ping') { bot.commands.get('commandname').execute(BLABLABLA);
will this work
why overcomplicate it tho
make a event
@earnest phoenix why not just await message.author.fetchFlags()
no lol
who ya talking to
const cmd = client.commands.get(args.shift().toLowerCase())
if(!cmd)fuckoff
cmd.execute(arguments)
@earnest phoenix
Ye but then I need to run .toArray() on it
@earnest phoenix
Ohh you added () to the first thing
Incase user isnt in cache
uhh how did u make ur eval accept await :/
lol
ah
if not, it falls back to the api
okk
if(!cmd)fuckoff
cmd.execute(arguments)``` why (!cmd)
it means if someone
uses a invalid command
it wont throw some fking error
lol
my eval function is different
mind showing it or is it private
lol
and how do I use normal commands
u can try this tho
await Promise.resolve(eval(async()=>{code})()))
big brains
erm..
await Promise.resolve(eval((async()=>{code})()))
i do like this lol
and how do I use normal commands
@spare mirage
yeah thats my 4th form
@restive pebble
wut normal commands

stop...
wtf
make different files
I have those
Yo @quartz kindle mind sending me that on hastebin or smth
fs.readdir
how do I execute them
jesus christ
bruh
lmaoo
xD
@earnest phoenix https://github.com/timotejroiko/discord.js-light/blob/v2/discord.js
line 151
do you want to make a command handler or not?
@spare mirage
I HAVE THAT SHIT
because you dont need to explicitly type every single command in a giant if-else
you can literally use the command string and check if it exists
Must be kidding me.. I used the code from your repo Tim https://i.alhassan.best/u/IwptdoWRBM.png
so I dony need bot.on('message', message+>{
})
bruh moment
just renamed the function to evaluate and I use like this evaluate(code);
yall out here screaming NOOOOOOOO
@spare mirage you cant remove bot.on("message") lol
can I ask why you have empty catch statements
I have this: ```html
<audio src="https://www.youtube.com/watch?v=uLHKrlVUT14" autoplay></audio>
@earnest phoenix i have 4 different evals, each handles a different situation if the previous errors out
help category like this
I have this: ```html
<audio src="https://www.youtube.com/watch?v=uLHKrlVUT14" autoplay></audio>
@digital ibex lmao
u cannot play like that
So if they all error out it returns with which error?
the last one
u need arbitary audio source
how can I play it then?
ytdl
ok
message.mentions.channels.first() does this not work anymore?
shut up
@earnest phoenix the reason i did it that way is so i can preview promises, like this
and also use complex code like returning and assigning vars without breaking the eval
dude u cannot play yt audios like that
That's amazing!
and im asking how...
Does anyone knows what I have to use instead of message.mentions.channels.first()?
Shut up
how am I this dumb
it does work chicken
@earnest phoenix #memes-and-media please
stop
let channel = message.mentions.channels.first();
message.channel.send(channel)
Cannot send an empty message
channel should return the channel object
was a channel actually mentioned?
Yes
you're trying to send the entire channel object
what part of that channel do you want to send?
then send the channel mention
Alright
like channel.toString()
Oh
or channel.mention if it exists
@restive pebble ****why dont I understand this?
tim
Alright ty verry much
does anyone know how i can play music then?
yeah
@restive pebble ****why dont I understand this?
? can I get some more code to see where exactly u added it
pls dont
yo tim have a look at this https://discordapp.com/channels/264445053596991498/265156286406983680/728583663629107280
hmmm
the link i sent is using your eval
yeah, im making a button to toggle
i cannot show personal codes for reason
lever?
how do i access the getprefix function in cog
@quartz kindle Seems like ur eval hates comments
whats wrong with it?
@restive pebble where did u put that code
dude.. im not using js, im using html
https://discordapp.com/channels/264445053596991498/265156286406983680/728584286919458866
Anyone know why it errors on comments :/
@digital ibex How about you check google
yup, apparently doesnt work with comments
Hmm...
i've checked google, and im asking why its not playing after i used the example i gave
What can be done about that
i'll see if i can do anything about that
kk
i usually test like this lol
Oh ok
@spare mirage index.js
tim, any ideas why its not playing?
@spare mirage client.on('message')
ok thanks
:/
rest all works lol
this.client wow!!1!11!!11!1
?
if (!message.content.startsWith(PREFIX)) return;
ok thanks
np ๐
do i have to put this before every case?
no
above the switch
so does anyone know how I can play music? I do ```html
<audio src="https://www.youtube.com/watch?v=uLHKrlVUT14" autoplay></audio>
with html
@earnest phoenix you can add an additional eval test at the end of the 4 evals, one without any function wrapped around it, that will fix both comments and displaying the last value without needing to return
<script>
:/
this is what im following, it doesn't say anything about using js
promise lol
lol
and i dont want to use js
its promise lol u have to resolve
Here's how the code turned out https://hasteb.in/uwopevuz.js
The object is still too long (2285 characters)
??
That is unfortunate
theres no need to be rude
Ask again
marcos, whats your question?
That's not being rude lmao
still no one has answered my question
@earnest phoenix do you get any error in console?
you can use JSON.stringify(whatever)) to get whatever is inside the object
then whats ur problem?
how can i kick a user in voice channel
bot.commands = new Discord.Collection();
bot.aliases = new Discord.Collection();
const modules = ['fun', 'moderation', 'others'];
const fs = require('fs');
modules.forEach(c => {
fs.readdir(`./commands/${c}/`, (err, files) => {
if (err) throw err;
console.log(`[Commandlogs] Loaded ${files.length} commands of module ${c}`);
files.forEach(f => {
const props = require(`./commands/${c}/${f}`);
bot.commands.set(props.help.name, props);
props.conf.aliases.forEach(alias => {
bot.aliases.set(alias, props.name);
});
});
});
});```
bot.commands.set(props.help.name, props);
TypeError: Cannot read property 'name' of undefined
what are you talking about.. i dont know what ur code is
@earnest phoenix what if you log result to console before sending?
this channel is cancer sometimes
xd
bruh
wut error
{ MongoError: Topology is closed, please connect
@earnest phoenix maybe you need to connect to mongodb?
nothing appears in the console
@earnest phoenix that's weird
whats the error lol
hey i need someone's help pls
no its not, maybe because it has no value?
bot.commands = new Discord.Collection();
bot.aliases = new Discord.Collection();
const modules = ['fun', 'moderation', 'others'];
const fs = require('fs');
modules.forEach(c => {
fs.readdir(`./commands/${c}/`, (err, files) => {
if (err) throw err;
console.log(`[Commandlogs] Loaded ${files.length} commands of module ${c}`);
files.forEach(f => {
const props = require(`./commands/${c}/${f}`);
bot.commands.set(props.help.name, props);
props.conf.aliases.forEach(alias => {
bot.aliases.set(alias, props.name);
});
});
});
});```
bot.commands.set(props.help.name, props);
TypeError: Cannot read property 'name' of undefined
reeeeeeeeeeeeeeeeeeeeeee my friend told me this would work :3
this channellllll
i am not aksing for spoonfeed
If you can explain it in DMs, you should be able to explain it here as well
cancer
before trying the embed i had a normal message and it sent
Result: [object Promise]or something like that
@earnest phoenix I see. So its a promise. You need to await it then you can get the result
If you can explain it in DMs, you should be able to explain it here as well
@hasty sparrow ok listen my new code was not working so i went to my old command and copied that but it is not working
cancer
@digital ibex if this channel really is "cancer" then dont talk here lmao
@spare mirage props doesn't have a property help
what does that mean
like im going to listen to you 
Describe what isn't working, show the error and hastebin the code
u talking to me?
No
That's why I ping the person I am replying to. LOL
Describe what isn't working, show the error and hastebin the code
@hasty sparrow nothing my whole code
Learn the JS basics before creating a bot
https://i.alhassan.best/u/YHIJafvk1s.png Does this look fine?
?
I mean that's the best I could do considering the field limit
Learn the JS basics before creating a bot
@hasty sparrow bruh i made a whole bot and left that becasue of one command but now i copied pasted from my old poject and it's not working https://hatebin.com/pwdnhnkoba
What is the error message?
What is the error message?
@hasty sparrow no error msg
none of the music commadn is working
@spare mirage Log props and check what properties it has
@weary anchor but, before, using
azul eval message.author.flags.toArray()made it sendResult: HOUSE_BRAVERYnow that doesnt work either
@earnest phoenix you can check ifresultis a Promise or not. then await only if it is a promise.
how
console.log?
console.log?
@hasty sparrow i did but nothig
oh ye lmao
Not you, I meant Justii
hmm
weird
someone can help my with the vote api (discord.py)
I'm using Firebase for db. So guildCreate is used to put data of a new guild. How would I put data of a guild that was there before
I tried guildUpdate but didn't work I don't even think it is guildUpdate
[Commandlogs] Loaded 3 commands of module fun
{
name: 'size',
description: 'this is a fun command!',
execute: [Function: execute]
}
F:\Users\Edwin\Desktop\Banana\index.js:28
props.conf.aliases.forEach(alias => {
^
TypeError: Cannot read property 'aliases' of undefined``` it loaded the commands in my fun folder
@delicate shore Debug your bot, simple as that
@spare mirage Check the other commands, they are clearly missing properties that are present in the fun commands
help meee
@spare mirage , you really need to learn javascript, you've been here asking the simplest of issues you'd know if you even spent an hour trying to learn.
idk why
@earnest phoenix Tried googling?
@earnest phoenix I have an eval command, you can yoink it if you want LOL
went to stackoverflow
@digital ibex im learning it while doing this stuff ยฏ_(ใ)_/ยฏ
but they are not helpfull
it explicitly says on the d.js docs to learn then make a bot

smh no help
you're gonna have to suffer a lot during development if you think like that @spare mirage
i think its ok either way but u should prolly google it before asking in here
this place can get kinda toxic
@weary anchor that obviously was a joke
xD
https://i.alhassan.best/u/m8vWMiKT04.png How can I remove the paths?
edits for the win
inspect?
https://i.alhassan.best/u/m8vWMiKT04.png How can I remove the paths?
@earnest phoenix do you only want the error name and message?
@spare mirage Check the other commands, they are clearly missing properties that are present in the fun commands
@hasty sparrow I dont think they do... they all work the same
Clearly they don't or you wouldn't have the error
You either forgot the property, forgot to export it, have a typo or are looking in the wrong directories
align them to the center?
my html: html <div class="tabs is-boxed"> <ul class="tab"> <li> <a> <span class="icon is-small"><i class="fas fa-film" aria-hidden="true"></i></span> <span>Online Chat</span> </a> </li> <li> <a> <span class="icon is-small"><i class="far fa-file-alt" aria-hidden="true"></i></span> <span>URL Shortener</span> </a> </li> </ul> </div>
my css: css .tabs { background-color: rgba(235, 233, 233, 0.253); text-align: center; } .tab { display: inline-block; } and yes @weary anchor
I mean, align them lol
Bulma?
@digital ibex hm I'm not so good with frontend design. but I'd probably use flexbox to align them
@hasty sparrow what if I declare props outside of the forEach
What about it?
nvm
I'm trying to make progress bar:
User Earned:180
It's working with this correctly, because i set width 250, but Needed XP is always changing. When i change width to that then Progress bar is going out of canvas!!
canvas is hard
yep
const Discord = require('discord.js')
module.exports = {
name: 'stats',
description: "this is a stats command!",
execute(Discord, bot, message, args){
}
}
is there anything wrong with this @hasty sparrow
wym @weary anchor
shouldn't the progress bar stay the same size though? and just scale the earned xp based on the required xp?
^
like why would the progress bar get wider over time
@spare mirage just ๐ learn ๐ javascript ๐ please ๐ then ๐ make ๐ a ๐ bot
Cause you set it to <xp count>pixels, duh /s
lol
@spare mirage Regarding your error, yes, otherwise no
@spare mirage why are you taking in a variable called Discord in the execute function?
Cause he hasn't learned JS yet
if you stop taking in a variable called Discord then it should work fine
either that or don't create a const at the top
justii
if you have no experience with javascript, making a bot along the way is cool and all
but might i suggest maybe starting with just if/else statements rather than command handlers and such
Ree people told me this would work better than an endless if else :3
it does work better, but it takes more knowledge to understand
It does, but it also requires above base-level (Node)JS knowledge
:/
whereas if/else statements can be understood very easily
kinda annoying how I am just wasting my time
if else?? switch is for cool kids only ๐
Learning is wasting time?
get used to it
You're wasting more time trying to force things to work rn
as a developer, you don't even know the amount of projects you create and then scrap
i've wasted countless hours on projects i've just recycled
@hasty sparrow nah making this command handler im about to delete because it doesnt work
Your call, d.js guide has examples on how to create your own handler ยฏ_(ใ)_/ยฏ
either switch to if/else or correct your command handler
on a not "super duper" advanced one yes
error messages are very useful by the way
They have tutorials on a command handler u use if else for
they generally tell you exactly what the issue is
but also different files
Exactly
you shouldn't use if/else for stuff like that
learn js
run bot
read error
fix error
https://sololearn.com - only for coolkids too btw
Everyone starts somewhere and asking questions is smart. Do not attack people for not knowing how to code. Point them to great learning sources and help them with problems.```
Do not attack people for not knowing how to code.
@earnest phoenix what is the error
:3
who is attacking/ spoonfeeding u?
u xD
you probably just don't have a proper message variable
learn js
"learn js" is not an attack
report them immediately!
learn js is not attack
its an actual statement
you literally need to learn js
you're not a beginner if you don't even start
so "don't attack beginners" doesn't apply to you
^^^
lmao thats great
guys how can I replace every record of 'SOMETHING' with 'EDITED'
str.replace()
-_-
send code
@earnest phoenix You need node v12
guys how can I replace every record of 'SOMETHING' with 'EDITED'
@earnest phoenixstr.replace(/SOMETHING/g, "EDITED")try this
idk, i didn't complete all of it
he said he is referring to objects
https://sololearn.com
@spare mirage I needed a week to finish JS here
I'm talking about objects
i spent like 2 months on it
SoloLearn: Learn to Code for Free
is it free??!??
yes
yes lol
did u do npm i nodejs
lol
Mhh no
CurSed
imagine installing nodejs with npm

i was asking to ask, it was a legitimate issue someone had before
does anyone know how I can centre the things on the right of the page?
How i can discord the mongoose
my html: html <div class="tabs is-boxed"> <ul class="tab"> <li> <a> <span class="icon is-small"><i class="fas fa-film" aria-hidden="true"></i></span> <span>Online Chat</span> </a> </li> <li> <a> <span class="icon is-small"><i class="far fa-file-alt" aria-hidden="true"></i></span> <span>URL Shortener</span> </a> </li> </ul> </div>
u wot
lol
@digital ibex Are you using a CSS library?
a framework
Which one?
this is my css: css .tabs { background-color: rgba(235, 233, 233, 0.253); text-align: center; } .tab { display: inline-block; } a framework for flexbox btw, so css > flexbox > bulma
im using bulma
Tried googling? There are a bunch of answers that provide the CSS
yeah, it says: parent - text-align: center; child -display: inline-block;
but it still doesn't centre so im kinda confused
https://github.com/jgthms/bulma/issues/1604#issuecomment-422407761 for an older version
1 sec
Uninstall the old one first
oh, im not using the navbar component, im using this https://bulma.io/documentation/components/tabs/
the cdn
oH, i didn't see that thanks :D
Did you follow the installation instructions?
I'm gonna make my bot able to execute python even though it's coded in nodejs
Wait you can do that?
You can
:o
maybe I should allow multiple languages
ill ping u when i make the py eval
what is 1+1
Hello, I have already made the join logs, How do I have my bot send me an invite to the server it joined?
0
module.exports = {
async execute(Bot, guild) {
Bot.config.logChannels.map(ch => {
let userSend = bot.users.cache.get("694367588464984095")
channel = Bot.channels.cache.get(ch)
channel.send(`Joined Guild - ${guild.name} With ${guild.memberCount} Members!`)
userSend.send(`Joined Guild - ${guild.name} With ${guild.memberCount} Members!`)
})
}
}```
What I have^
eat my fat buuttt
pls
Nope.
const Discord = require('discord.js')
const db = require('quick.db')
module.exports = {
name: 'add',
description: "adds money into someone's balance if you have perms",
execute(message, args) {
let ownerID = '@vale garden'
if (!(message.author.id === ownerID)) {
return message.channel.send(`Only ${ownerID} (Bot Owner) can use this command lol.`)
}
if (!args[1]) return message.reply('Please specify an amount to add.')
if (isNaN(args[1])) return message.reply('That was not a valid number!')
let user = message.mentions.users.first() || message.author
message.channel.send('Successfully added ' + args[1] + ' to ' + user)
db.add(`money_${message.guild.id}_${message.author.id}`, args[1])
}
}
this is my code but it isnt working even for me
lol
Whats not working
error?
what is that
What is says
@vale garden your user id is 394320584089010179 so when you run the command msg.author.id would be 394320584089010179, since you have included the <@> in your ownerid let (required for mentioning) that will never match an id that consists of just numbers. 394320584089010179 is not equal too <@394320584089010179.> . is to prevent mention
What is says
@ebon kelp that's not the best way to do that
if (message.author.id !== ownerID) easily could do that
How to make an IF statement that only runs a case if the person has admin rights?
Please @ me if u want to help
Depends on the library
@mild flower ^
Also, if you google it, its like the first result
People ask too much before using ๐ The Internet ๐
๐ง: ๐ people here don't like doing stuff for themselves and instead act like children depending on mommy ๐งโจ
asking > tutorials > learning javascript 
stop making up your own methods and properties and read the docs
if(command === "unabn"){
let reason = args.slice(1).join(' ');
let user = args[0];
if (!reason) return msg.reply('You must supply a reason for the unban.');
if (!user) return msg.reply('You must supply a User Resolvable, such as a user id.').catch(console.error);
if(msg.member.hasPermission("BAN_MEMBERS")) return msg.reply("**Bruh You don't have perms to Ban Members so technically you can't unban them either**")
.guild.members.unban(user);
const unban = new Discord.MessageEmbed()
.setColor("#7289DA")
.setAuthor(user.author.tag, user.author.displayAvatarURL())
.setDescription(`Member Succesfull Unbanned!`)
.addField(`Member Unabnned : ${user}`)
.addField(`By : ${msg.author}`)
.addField(`Reason : ${reason}`)
.setFooter(`s!help`);
msg.channel.send(unban)
console.log();
};
pls help it's not working
unabn
we cant help you without a error

