#development
1 messages · Page 1391 of 1
the last two bits represent alpha
ok discord
i was kidding lol that's 8 bit hex
oh my fucking god why is the mobile app so bad
idk
Light mode pains lol
nothing would happen, the decimal value of 8 bit hex is way bigger than 6 bit hex so discord would just refuse to use it
lmao cry we're in this pain together
well, you're not alone
if(message.content.startsWith(prefix + "@LoveAnime#5066" )){
if(!message.mentions.users.first()) return;
var embed = new Discord.MessageEmbed()
.setDescription("pls dont ping the owner of the bot beacuse ping are very annoying and she is a very busy person she code and work to make the bot as googd as she can by pinging her she will have to stop coding and check it and next time you ping her you will be muted")
.setColor("#99ff99")
.setTimestamp()
.setImage('https://media1.tenor.com/images/aaaf46867f0668d40901b2d0eafaca7c/tenor.gif?itemid=18039238')
message.channel.send(embed);
}
it not work when i get ping
nothing would happen, the decimal value of 8 bit hex is way bigger than 6 bit hex so discord would just refuse to use it
@earnest phoenix No I meant like what people would use it for
because that's not how mentions look like
Which would probably be barely anything 
how do i fix it
Replace it with @lucid prawn and @lucid prawn
Both need to be checked because of nicks
what
wrong server
ok
Just do regex instead of dual boolean checks
if(message.content.startsWith("@lucid prawn" )){
if(!message.mentions.users.first()) return;
var embed = new Discord.MessageEmbed()
.setDescription("pls dont ping the owner of the bot beacuse ping are very annoying and she is a very busy person she code and work to make the bot as googd as she can by pinging her she will have to stop coding and check it and next time you ping her you will be muted")
.setColor("#99ff99")
.setTimestamp()
.setImage('https://media1.tenor.com/images/aaaf46867f0668d40901b2d0eafaca7c/tenor.gif?itemid=18039238')
message.channel.send(embed);
}
like this
@real niche
slower performance wise iirc
Well
Well, yeah
You want a prefix, right?
no
@real niche
that's an annoying feature to have in your bot regardless, if you dont want notifs just set yourself on DND and disable push notifications lol
Also commas
im making it for me and then for other people
That's the issue
doesn't make it less annoying and it's abusable
^
Love when bots remove messages because you ping too many people in it
It'd be safer and more helpful to get a dedicate support staff for those matters
Now you have a ghost ping of a bunch of people
i love how discord chooses to do nothing about ghost pings
powercord
...when the notification data is already there
can u just help me 😢
We are
question yourself if you want the feature there in the first place
users can send more messages per 5 seconds than bots
that's already an issue if someone goes ahead and spams
now imagine multiple people spamming pings
nvm I'll delete the code
Prepare for trouble
Yee haw use DND
Dungeons 'N Discords
Hi can help me i have error "unexepted of input" ?
It's a syntax error, which means something was unexpected, or you're missing something. You could show us your code as just the error isn't very helpful.
You have an else keyword somewhere it shouldn't be.
Look into the stacktrace to see where it points to.
const guild = member.guild;
client.on('guildMemberAdd', member => {
const channel = member.guild.channels.cache.find(channel => channel.name === "welcome");
if (!channel) return;
const exampleEmbed = new Discord.MessageEmbed()
.setColor('#0a6af5')
.setTitle(`Welcome to Server ${guild.server}`)
.setAuthor('member.user', 'member.avatar')
.setDescription('Server description')
.addFields({ name: 'New member', value: 'member.user' }, { name: 'Account Created', value: 'account.created' }, { name: 'New Total Members', value: `${total.guild.members}` }, )
.setFooter('ICE BOT' | './images/ice-bot');
channel.send(exampleEmbed);
});
This says member is not defined can anyone help me figure out why it says that please
const guild = message.guild
Wait
Oh yea
const channel = message.guild.channels.cache.find(c => channel.name === 'welcome')
It shouldn't be "member.guild"
Wot ;-;
Oh yea
The issue was your first line is placed outside the event
I've made that mistake to many times.
😆
thanks
Right well now its just not sending in the welcome channel and I dontt know why
client.on('guildMemberAdd', member => {
const guild = member.guild
const channel = member.guild.channels.cache.find(channel => channel.name === "welcome");
if (!channel) return;
const Embed = new Discord.MessageEmbed()
.setColor('#0a6af5')
.setTitle(`Welcome to Server ${guild.server}`)
.setAuthor('member.user', 'member.avatar')
.setDescription('Server description')
.addFields({ name: 'New member', value: 'member.user' }, { name: 'Account Created', value: 'account.created' }, { name: 'New Total Members', value: `${total.guild.members}` }, )
.setFooter('ICE BOT' | './images/ice-bot');
message.channel.send(Embed);
});
I totally forget if the guild_member intent is needed for guildMemberAdd.
It may be, I cant look now.
so i know that there's
if(message.member.permissions.has("ADMINISTRATOR")){
but is there a way to do this for a specific person
not a role
is that not checking if the person has that permission?
whats the embed to get dmed by bot please you know like message.channel.send for channels but whats tthe one to get a dm
thanks
if(message.content.startsWith("call")){
var embed = new Discord.MessageEmbed()
.setDescription(message.author.username + ' bad word ')
.setColor("#99ff99")
.setTimestamp()
.setImage('https://media.tenor.com/images/21474b3088522f76843e7829aadbf8e6/tenor.gif')
message.channel.send(embed);
}
it not send the embed
what command are you using? specifically what are you typing.
just "call'?
yes
okay, because right now it only checks if it starts with call
for example call dsaewadsada will run it
!call adadsad wont run
hey call dsadsad wont run
ok
Idk if that's what you're trying to do, but bad words filter would work better if using an array of words
This still doesnt work and I have no idea why :)
client.on('guildMemberAdd', member => {
const guild = member.guild;
const channel = member.guild.channels.cache.find(channel => channel.name === "welcome");
if (!channel) return;
const Embed = new Discord.MessageEmbed()
.setColor('#0a6af5')
.setTitle(`Welcome to Server ${guild.server}`)
.setAuthor('member.user', 'member.avatar')
.setDescription('Server description')
.addFields({ name: 'New member', value: 'member.user' }, { name: 'Account Created', value: 'account.created' }, { name: 'New Total Members', value: `${total.guild.members}` }, )
.setFooter('ICE BOT' | './images/ice-bot');
message.channel.send(Embed);
});
Idk if that's what you're trying to do, but bad words filter would work better if using an array of words
@lyric mountain wym
oh ye
For example, instead of 30 ifs, you could iterate an array containing all the blocked words
However, please note that 100% failproof language filters are impossible
Even 40% would be asking too much
Make an array of all words you want to block
For each sent message, compare each word with the ones inside the array
Repeat
Alternative step N° 3: give up because leetspeak exists
btw i think i never made array
I can't really guide you thought it. Research a bit about while/for loops
Then do a simple string comparation
But as i said earlier, that's useless and easily bypassed
ok
message.guild.members.cache.get(m => m.id === `${message.content.split(" ").slice(1).join(" ")}`)
this is wrong.
how to do correct?
Looks like your passing a function when you just need to pass the ID of the member your getting.
yeah
you know, people don't like to get mentioned every time someone wants to read info about them
so i try to do that by ID
and i got stuck here
I would do pretty much exactly what your doing, just pass the variable rather than making it a function.
Alternative step N° 3: give up because leetspeak exists
@lyric mountain I wonder if there's a way to normalize a string
I would do pretty much exactly what your doing, just pass the variable rather than making it a function.
something like this?
ik I'm just wondering
You can't win against users
I would also consider not using the join and slice, but just use the second thing in the array.
better to use the args?
Regex is the best bet for leetspeak matching
You just need a ton of patience
And an infinite list of possible word permutations
If you have args already, use it. No point in doing that process multiple times.
And regex is relatively slow especially when talking about moderately sized bots with hundreds or thousands of messages per minute it needs to check
what do they use to check
Yeah, but more readable than a thousand if chains
I belive custom search tools are used for larger bots.
yeah that would make sense
Not actually sure what off the shelf solutions exist for those who can't do that
Im sure there's a handful out there.
probably...i doubt this feature is much sought after anyway
can someone link me how to build a webscraper for js
cant find a single good resource
It's annoying if anything
Most people would disable because why not
Censor bot is hated for a reason
you mean node right?
i have some programming knowledge just not a huge ton
i know a bit of c++ but i heard it was shit for discord bots
Well, depends
the discord.js database and docs have been super helpful tho 
web scraping is pretty easy in python, not sure about other langs
In java it is too with the right libs
web scraping is pretty easy in python, not sure about other langs
@hollow sedge i tried python earlier but it got too hard to code everything
uh
js is easier for me to understand
python is supposed to be one of the easier languages
That's a rare phrase from a c++ dev
That's a rare phrase from a c++ dev
@lyric mountain i wouldnt call myself a dev
Why not?
more like c++ college dropout
Especially someone named blender
I NAMED MYSELF THAT BEFORE I KNEW IT WAS A THING IN PYTHON LOL
Lol
i didnt even know there was a 3d modeling software called blender 
blender is python?
Its the reason I'm learning blender.
you mean the 3d modelling software?
i hear that a lot
There's also a kitchen gadget named after the software
people learning py just for blender
OH
It sucksss
that's kinda weird
Why can't it be c# or c++ like normal things
anyways
More like java or c++
Java sure id take that too
someone link me how to webscrape with js 
microsoft knows its terrible so they didnt buy it
Nah, they really tried to make a java++
But couldn't due to legal issues iirc
Java is quite good btw
legal issues? so what about OpenJDK
oh god openJDK has 60k commits
Openjdk is the vm btw
Java itself has nothing to do with either oracle or openjdk
so why are there legal issues?
ironic
microsoft owns github
also https://en.wikipedia.org/wiki/Visual_J%2B%2B here is the java++ you were talking about
Lul
Minecraft 2 written in java++
Sun Microsystems had originally licensed Java to Microsoft but later initiated litigation against Microsoft for trademark violation. Sun's trademark license for usage of the Java brand insists that all implementations be "compatible".
yeah we're stopping cause we got a trademark violation
Let's make a Playstation++
xbox and playstation have the same meaning in this context lol
Got confused
#560180018467045376 message
We(?) can't see what message that URL points to
thats what it is
oh ok
@serene crater bruh
dont send walls of text or you will be muted on this server too 
@earnest phoenix He was showing @sudden geyser what it said -.-
Anyways off topic go to #general or #general-int
Website administrators reserve the right to issue punishments without providing reasons
Moderators can issue punishments at their own discretion regardless of if the rules don’t specify an offence at the time.
That's called dictatorship or communism.
That's not communism but it sure is a dictatorship. Also this is #development
i have a cmd that required quite a bit of talk back and forth -- would having a timout to delay editing message a good way not to api spam?
name: "slowmode",
description: "Lets you set slowmode on the channel.",
execute: (message, args, client) => {
const amount = parseInt(args[0])
if(isNaN(amount)) return message.channel.send("It doesn't seem to be valid number")
if (!message.member.hasPermission('MANAGE_CHANNELS')) {
return message.channel.send("You don't have enough Permissions")
if(args[0] === amount + "s") {
message.channel.setRateLimitPerUser(amount)
if(amount > 1) {
message.channel.send("Sucess! slowmode is now " + amount + " seconds")
return
}
else {message.channel.send("slowmode is now " + amount + " second")
return }
} if(args[0] === amount + "min") {
message.channel.setRateLimitPerUser(amount * 60)
if(amount > 1) {
message.channel.send("slowmode is now " + amount + " minutes")
return
} else {
message.channel.send("slowmode is now " + amount + " minute")
return }
} if(args[0] === amount + "h") {
message.channel.setRateLimitPerUser(amount * 60 * 60)
if(amount > 1) {
message.channel.send("slowmode is now " + amount + " hours")
return
} else {
message.channel.send("slowmode is now " + amount + " hour")
return}
} else {
message.channel.send("You can only set seconds(s), minutes(min) and hours(h)")
}
}
}
can anyone see a problem in this code? bot is failing to boot
I'm having an issue with playing music from my bot, say i have a 4 minute song playing, after about 2 min of playback, the bot goes silent, but stays in the voice channel for the remainder of the length of the song.
Not looking for technical help necessarily, just seeing if anyone has an idea of where i can investigate the cause of this, been at it for a couple of days now
also i need help with this code
@bot.command(name='unantiad', help='')
async def unantiad(ctx):
if ctx.message.author.guild_permissions.manage_messages:
try:
await ctx.send("Anti-Advertising is disabled.")
elif:
await ctx.send("No. Shut up. Get lost. Ruin someone else's day.")
except "discord.gg" in ctx.content.lower():
await ctx.delete(antiad)
``` (im tryna make an anti-advertising COMMAND so people could enable/disable it as they please)
i've only taken a summer of python and tried to find the documentation for this specific thing but couldn't find it
just use the has_permissions decorator, and i'd use regex to detect the link. And as for the question, store the config on db or something
yeah thanks
k
perfect ;)
Hloo
Hello, whars your question?
@earnest phoenix
Bot command not working
Oh, is it your bot?
If its someone elses bot, you're in the wrong server
back with another question with my discord.js bot lol
if (this.activities) clone.activities = this.activities.map(activity => activity._clone());
TypeError: activity._clone is not a function
lemme pull up the code btw
What are you trying to make?
userinfo command, so it works, but if i switch my status from DND to Idle, it crashes the bot with the TypeError shown above
if (member.presence.status === 'dnd') member.presence.status = '⛔ Do Not Disturb';
if (member.presence.status === 'online') member.presence.status = '🟢 Online';
if (member.presence.status === 'idle') member.presence.status = '🟡 Idle';
if (member.presence.status === 'offline') member.presence.status = ' Offline';
Your trying to display the bots status?
no, a user's status, i can get a screenshot of the gui end
I see the problem, members dont have a presence, a user does
Im a he
🤣
sorry
Np
yes
Nice!!
let userArray = message.content.split(" ");
let userArgs = userArray.slice(1);
let member = message.mentions.members.first() || message.guild.members.cache.get(userArgs[0]) || message.guild.members.cache.find(x => x.user.username.toLowerCase() === userArgs.slice(0).join(" ") || x.user.username === userArgs[0]) || message.member;
woah dude you member variable looks way longer than mines
lmaooo
Thats still a member
it can read mentions, ID
yea ik but his one looks like rocket science to me
Yes
cute dog btw nutella
i would post the full code here but it's pretty long lol, everything is defined. so are you suggesting to make the if conditions differently?
gotcha, i will be back with that
k
yes
alright got the bin in pastebin: https://pastebin.com/i228Qa48
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@earnest phoenix to reproduce, use {prefix}userinfo then change from Idle/online/dnd/offline to a different status, then try to use it again
K
will come up with TypeError: activity._clone is not a function
Let me have a quick look
let member = message.author```
use this for member
temp
to just check if that's the problem
gotcha, will do that
alright, results in a type error "tag" of "undefined", on the basis how the embed sets up with .user property
.setAuthor(member.user.tag, member.user.displayAvatarURL())
OP
O
I see the problem
the user is already a user
so you have to remove the part .user. of member.user stuff
message.author is a user iirc
change member.user.tag to member.tag
still crashing with TypeError: activity._clone is not a function
if you need member.user.tag use const member = message.member
ahhh, so they should be saved as a variable?
some people get confused on the difference between a User object and a Member object tho'
use ```js
try {
client.commands...
} catch(err) {
console.error(err)
}
hmm okay, ill try that
"catch" is used for promises like sending a message or deleting a channel
^^
so for normal functions just use "try catch"
kk, thanks!
nope
its not a reference error, its a syntax error...
you're using promise.catch wrong, it should be
client.commands.get(command).execute(message).catch(err => {
@hazy sparrow
yea true too ^
if (this.activities) clone.activities = this.activities.map(activity => activity._clone());
^
TypeError: activity._clone is not a function
still coming up
no, it's coming up after the presence of a guild member changes
@pseudo hare the one which @past needle suggested works, though thanks for the help!
from say Idle to Do not disturb
but what do you want to do :o
if i use the command userinfo while Idle
then if i change it to DND, and use userinfo, it crashes the bot with that error "activity._clone is not a function"
does .execute return a Promise, cause if it does, the error wont be caught with a try {} catch {} block unless you use async / await
you can just use
html
you can do that?
yyes
you can pratically create a website
yo that'd be helpful if i knew it before
you can pratically create a website
@past needle discord in top.gg
hmmmm
i will keep attempting a fix for this
ty
if i use the command
userinfowhile Idle
then if i change it to DND, and useuserinfo, it crashes the bot with that error "activity._clone is not a function"
@analog imp why not just use<USER>.presence.status$-$ ?
can i get a animated profile for my bot?
@analog imp why not just use
<USER>.presence.status$-$ ?
@past needle because variable "member" is including args if given. so an ID, mention, or first result, or if left blank their own, but i don't think the issue is that
:(
anyone?
you can use <img src='image link' width="image width with numbers"> etc there are a lot of parameters
I want to make a bot which show collection
?? i don't understand srry
@brazen knoll do you want to have a collection in array and then show them as list that can be moved with reacting on emojis left and right?
Oh you used t4 bot which show badges like that
Tell me code please
@brazen knoll umm we're not spoonfeeders.
@analog imp honestly i use ```js
let target = message.mentions.users.first()
|| message.guild.members.cache.find(m => m.user.username === args.join(' '))
|| message.guild.members.cache.find(m => m.nickname === args.join(' ')))
// etc..
if(!args[0]) target = message.member
if(!target) return message.channel.send('no')
this way whathever condition works it'll give me a member object
and then i can use it for the embed qvq
whether it's a user or member object, it still errors in activity._clone is not a function
Oh i have hypersquad ballance badge when will i get bot developr badge
Early verified bot developer badge is too late
no longuer the badge can be given and they told us a while ago i think with the official discord bot
I not understand
@brazen knoll You can't get the bot developer badge anymore.
Somebody told that i will get when my bot reach 1000 server
lol
lmao

How i will check
check what ^^'
My bot is approved hiw much
go to the website
login
click on you name at the top right
go to the bottom and click "view bot"
@past needle ty but give link i am new
of course only if you already registred a bot
login in the website
and tell me when you finished
Saying you have no bot
Are there any ways to make html tabbers without js scripts? Cuz top.gg doesn't execute js functions and tabber buttons aren't clickable
WHAT DO I DO :((((((
your bot can't do something
talk, delete messages
idk
it's a DiscordAPIError so its not from dbl
i know
it says that your bot is missing permissions...
yea but we can't know
where exactly
did the error got created
@spark oracle just in all your commands make try catch for example ```js
mmeber.ban().catch(err => console.error(err))
not only ban.js but all your commands
this way you'll see the error next time
How much time it take to verify my bot i add it today
2-4week
or dont use promise then pattern and instead use await/async like a sane human
Oh what
with covid19 problems and mass people wanting their bot verified the staff team is taking a bit longer but they're doing what they can
yea 3 to 4 weeks
depends
and trust me it's really flustrating when your bot get rejected for a small details so be sure everything is good on your bot in #rules-and-info

so i have this error ReferenceError: Intents is not defined but i defined it here const intents = new Intents();
The error said Intents, not intents
and trust me it's really flustrating when your bot get rejected for a small details so be sure everything is good on your bot in #rules-and-info
@past needle rejected broke my brain lmao
Intents should be <Discord.js>.Intents
You can simply define it using const { Intents } = require("discord.js") or require("discord.js").Intents
Then you did something wrong
const Discord = require('discord.js') Discord.Intents
mqrkelich maybe screen your code to be sure you placed them at the right place
const intents = new Intents()```
...okay?
then?
Has anyone here used the npm package called "redis"? I'm trying to find how to set a ttl when setting a value but I don't see it anywhere in their docs
I mean yeah I can use exec
So client.set("key", "value", "EX", 5000);

I made my music bot
cool
You can still provide callback at the end
Hallo everyone
Can someone give me "user" code like Probot prime? 
Yah @past needle
first you'll have to decide how to know the member ```js
let member = message.mentions.member.first /* get a mention, if there isn't it will be udefined so it will use ->*/ || message.member
Why do i have this?
there is a command that doesn't have the "run" function @spark oracle
or maybe nothing at all
OK @past needle
Can i dm you @past needle
then you can just take the propertis of the user ```js
let embed = new Discord.MessageEmbed()
.setColor('RED')
.setDescriptio(Username ${member.user.username} Nickname ${member.nicknamùe || 'No nickname'})
etc...
sure
OK @past needle
cx
What if i want add invite member and inviter?
@past needle
that's a little bit complicated
try this : ```js
console.log(message.guild.fetchInvites())
then you'll have all the informations
How do i change my background page on top.gg using css?
@shy steeple Add the HTMLstyletag somewhere in your bot's long description.html <style> body { background-image: prop; } </style>
Can you show me example for this case ?
@past needle
how do i "refresh" my bot's custom status every 1 minute or so? i KNOW that i should use setInterval but idk how. even if i do
setInterval(client.user.setActivity(`${client.users.cache.size} people!`, { type: 'WATCHING' }), 60000)
its not refreshing the number of people.
the first parameter of setInterval must be a function
like this
function(){
dosomething
}
so your code should be
setInterval(
function(){
client.users.setActivity(`${client.users.cache.size} users :D`,{type : 'WATCHING'})
},1000 * 60)
ahh, i get it now, thanks a lot!
no prob
but can i replace 1000 * 60 with 60000?
nvm, im dumb for asking this question, ofcourse i can
lmfao
yea i just rather use 1000 * 60
because
1 second = 1000 milliseconds
so the code is more readeable
how do you make a EVAL command
how do you make a EVAL command
@earnest phoenix *an EVAL command
Search on YT
or stackoverflow
Search on YT
@earnest phoenix there's a lot of videos
const taggedMember = message.mentions.users.first();``` this was working until now
Any one who use poketwo
@hazy sparrow You need to know the difference between member and user. Your constant's name is tagMember but it's actually a user (mentions.users.first()).
But that aside, can you show your code?
sure lemme put it in a bin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
wait wtf
some of the code has wandered around
ohh i found the mistake
actually no i didnt find out, im dumb
Can you make it print error.stack for your error handler?
That looks like it's printing error.message
its message.channel.send(err)
make it err.stack
Can you show line 42 of that file from your editor?
kill.js?
ok wait
oh i forgot to add a comma in line 41
`${taggedMember.username} got hit by a car and got flying off to the side of the read where they hit ${message.author.username}'s head and they both died. `,
@hazy sparrow that should be ```
taggedmember.user.tag
Oh nvm
lol
I thought it was a member object
lemme see if the comma fixes it
That's why I told him to know the difference
i forgot how to see how many members are in all the servers that my bot is in
is it
${bot.guilds.memberCount}
?
actually it was message.mentions.members.first()
i was lazy to change the variable name
i wanna see the total
Then it should be taggedMember.user.username
${taggedMember ? taggedMember.username : 'No one '
or could reverting users to members work?
const users = bot.users.cache.size
``` @tardy hornet
It's a member object , I guessed it long ago since the error came from there but I thought it was rectified
@tardy hornet Like mihz said, every guild has the memberCount property. client.guilds is a collection of guilds where you can reduce() it and get total member count of all guilds combined: <Client>.guilds.cache.reduce((acc, guild) => acc + guild.memberCount, 0)
ca anyone help me
Just ask
lol
have u seen dank memer help menu
how can I get my bot in here?
@frozen topaz #announcements message
my problem is that, im building an online ide, but then the cursor is always a few spaces ahead of the text, and that increases as the line gets longer, so if anyone knows why that is happening plz help me out
just tell me difference between add feilds and add fied
@unborn ridge fields adds many fields while field adds only one
@pale vessel couldn't you just do something like ```
const totalUsers = client.users.cache.size
Yep
Embeds ?
.addField("hey")
fields
o
addFields([{ name: "Name", value: "Value", inline: true }, { name: "Name 2", value: "Value 2", inline: true }]);
That's fairly simple
message.channel.send(new MessageEmbed()
.addFields(
{name: 'some name' , value : 'some value ' },
// Same procedure for next set
))

in a server there was thanks command and thanks leaderboard lol```
const taggedMember = message.members.mentions.first()
so wherever i rquire it to say taggedMember.username it just says undefined. for example;
message.channel.send(`${taggedMember.username} is a idiot`)
just returns "undefined is a idiot" how can i fix that?
This is not valid
server owner paid 20$ to top of leaderboard
LOL
oh fuck
It's message.mentions
yes
ii didnt copy and pasted it so i wrote it mistakly lemme correct it
const taggedMember = message.mentions.users.first()
message.mentions.members.first() and taggedMember.user.username
OR message.mentions.users.first() and taggedUser.username
oh right i forgot to add the .user
thanks!
ok so whenever i command it to reload user-info it reloads userinfo for some reason
Check how you defined your args and look in your reload command
const args = message.content.slice(prefix.length).trim().split(/ +/);
hmm sure
const commandName = args[1].toLowerCase();
const command = message.client.commands.get(commandName)
|| message.client.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));
delete require.cache[require.resolve(`./${command.name}.js`)];
try {
const newCommand = require(`./${command.name}.js`);
message.client.commands.set(newCommand.name, newCommand);
Can you add console.log(commandName, command.name); before delete?
lulw
So it used the command's name instead
You should just use commandName directly
You don't really need command
As long as you get the name right, it won't error
but what is causing it to remove the -?
The file is user-info.js right?
user-info.js
ohhhhh
It tried to use that
if i make it name: user-info?
You can, but then users have to type user-info instead
You can just change command.name to commandName
im the only one who can use that command
well its easier to make it user-info than changing a bunch of things so yeah
If you change the name, it changes the command name itself
So the trigger will be user-info
yep, that's what i want
So when you run the command, you'll need to type <prefix>user-info instead of <prefix>userinfo
If you're fine with that then I guess it's okay
yeah the command is user-info from start lol
close
;-;
message.guild.members.cache.values()
Yes
ty
also, var?
is it even reaching there?
hm
don't use var btw
If you have the guild members intent, you can enable fetchAllMembers in ClientOptions
Otherwise no
All good my man
whats the latest version of google-play-scraper?
@gentle lynx Can you try for of instead of for in?
sure
sec
i enabled fetchAllMembers, my bot is taking some time to start
is it because of that?
Yeah, it shouldn't work since you used for in
oh ok
is it because of that?
@gentle lynx and yes
it worked thanks
Ah, nice
But yes, it will take some time for your bot to be ready since it's fetching all members for each guilds it's in
aight
@coral trellis here too 
Heroku vs Glitch, which is better
@outer perch Glitch updated his TOS and, hosting bot on Glitch in against the TOS
So Heroku
why this is not working
ah hsit
why this is not working?
it doesn't console log
.addField(Member Count, guild.memberCount, true)
.addField("Humans", ${guild.members.cache.filter(member => !member.user.bot).size} , true)
.addField("Bots", ${guild.members.cache.filter(member => member.user.bot).size} , true)
i see the first line work but the second and third :)))
i think your guys can solve the problem please help me
I think you need to enable guild member intents
there is some problem in my code can someone help me
^ (to GoogleFeud) It may also be smarter to run the filter once and make two variables to total up the number of users vs. bots opposed to filtering over the collection twice.
Firedragon show your source code please.
kk
module.exports= {
name: 'clear',
description: "Clears messages",
execute(message, args){
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send("You do not have permission to do that");
if(!args[0]) return message.channel.send(`Give me a number!`)
message.channel.bulkDelete(Math.floor(args[1] + 1))
message.channel.send(`I cleared ${args[1]} messages`).then((msg) => {
setTimeout(function(){
msg.delete()
}, 3000)
})
}
}
here u go
.addFields([{ name: "**🧷Avatar Link**", value: `**[Link]${avatar}**`, inline: true }
not showing button
posting link directly
avatar is defined
args[1] was probably not supplied. Heck, you don't even check if it was.
pls
You're doing that with args[0]
args[1]was probably not supplied. Heck, you don't even check if it was.
@sudden geyser so wat should i change?
You validate args[0], parse it to a number, and bulk delete by that number because it accepts a number. You then show it in the message sent after purging has been completed. It would be smart to save it to a variable.
You validate
args[0], parse it to a number, and bulk delete by that number because it accepts a number. You then show it in the message sent after purging has been completed. It would be smart to save it to a variable.
@sudden geyser can u send me the code use mine and show me pls
but args[0] works well
the next part does not work
i think
@cinder patio so this is not my problem
because it does not delete the message, and it is supposed to tell how many messages it delete instead it says "i deleted undefined numbers"
I won't send you the code (I can't be bothered either way), but I'll describe the logic on how to implement it:
- Check if
args[0]is a number (seeparseInt). - Parse it to a number (which you'll do above with
parseInt) and save it to a variable. - Use that number as the argument to
<TextChannel>.bulkDelete(num) - In the message sent after, put that number in the string in replacement of
args[1](I cleared ${num} messages)
imagine if the bot deletes less than what you asked
I got a question about so called purge command: so basically how I can delete like over 100 messages, i have thought using for loops, but i haven't found the right "formula" for it is it literally just: msgsWantedToBeDeleted / 100?
let number = parseInt(args),
plural = '';
if (!Number.isInteger(number)) {
return;
}
else {
if (number > 100) {
number = 100;
}
message.channel.bulkDelete(number, true).then(deleted => {
if (deleted.size != 1) plural = 's';
message.channel.send(`I have deleted \`${deleted.size}\` message${plural}!`).then(msg => msg.delete({ timeout: 5000 }));
});
}
I did it like this @restive furnace @lethal trout ☝️
You shouldn't really be looping through to delete a lot of messages. It's easily considered API abuse.
remember, never try to delete more than 100 msgs. at a time
I have a question: HOW TO CREATE A WEBHOOK URL
How would I like run a function after a certain period even if I reset the bot etc? Python
@restive furnace ah, my code doesn't answer your formula
(node:1712) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'highest' of undefined
but it's the best way I found to delete normally
yeah it's ok, i'll just probably make a another command for clearing whole channeö
@unborn ridge show the variable being declared, and where it's changed
user.roles.cache.highest
you now need .cache for .roles and .guilds
@unborn ridge fixed?
(node:6708) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cache' of undefined
if(!user) return message.reply(`No User Mentioned !`)
let avatar = user.displayAvatarURL({size: 4096, dynamic: true});
let highest = user.roles.cache.highest
let userinfoembed = new Discord.MessageEmbed()
.setTitle(`🏷 USERINFO `)
.setColor('RANDOM')
.setThumbnail(user.displayAvatarURL({dynamic:true}))
.setTimestamp()
.addFields([{ name: "**🗯 Name**", value: `\`${user.username}\``, inline: true }, { name: "🔖ID", value: `\`${user.id}\``, inline: true },{ name: "**📇Discriminator**", value: `\`#${user.discriminator}\``, inline: true }])
.addFields([{ name: "**🧷Avatar Link**", value: `[CLICK ME](${avatar})`, inline: true }, { name: "💎Status", value: `\`${user.presence.status}\``, inline: true },{ name: "**🤖BOT ?**", value: `\`${user.bot}\``, inline: true }])
.addFields([{ name: "**📬Joined Discord**", value: `\`${moment(user.createdAt).format('MMM DD YYYY')}\``, inline: true },{ name: "**📙Highest Role**", value: `\`${highest}\``, inline: true }])
message.channel.send(userinfoembed);```
@outer perch
yeah
@outer perch seen?
I'm forgetting about something

msg.channel.send(Embed).then((msg) => {
msg.react('◀').then((r) => {
msg.react('▶');
const backwardsFilter = (reaction, u) => reaction.emoji.name === '◀' && !u.bot;
const fowardsFilter = (reaction, u) => reaction.emoji.name === '▶' && !u.bot;
const backwards = msg.createReactionCollector(backwardsFilter, { idle: 30000 });
const fowards = msg.createReactionCollector(fowardsFilter, { idle: 30000 });
});
});
does anyone know why it only collects reactions from the author of the message?
@unborn ridge ok, you got the user, but u need to get him as a member of the guild, not the user by itself

or read this if you prefer
let member = message.guild.member(user)
ok
let user = message.mentions.users.first() || message.author,
member;
if (user) member = message.guild.member(user);
member.user.roles.cache.highest
hi
hi
member;
if (user) member = message.guild.member(user);
let highest =member.user.roles.cache.highest
if(!user) return message.reply(`No User Mentioned !`)
let avatar = user.displayAvatarURL({size: 4096, dynamic: true});
let userinfoembed = new Discord.MessageEmbed()
.setTitle(`🏷 USERINFO `)
.setColor('RANDOM')
.setThumbnail(user.displayAvatarURL({dynamic:true}))
.setTimestamp()
.addFields([{ name: "**🗯 Name**", value: `\`${user.username}\``, inline: true }, { name: "🔖ID", value: `\`${user.id}\``, inline: true },{ name: "**📇Discriminator**", value: `\`#${user.discriminator}\``, inline: true }])
.addFields([{ name: "**🧷Avatar Link**", value: `[CLICK ME](${avatar})`, inline: true }, { name: "💎Status", value: `\`${user.presence.status}\``, inline: true },{ name: "**🤖BOT ?**", value: `\`${user.bot}\``, inline: true }])
.addFields([{ name: "**📬Joined Discord**", value: `\`${moment(user.createdAt).format('MMM DD YYYY')}\``, inline: true },{ name: "**📙Highest Role**", value: `\`${highest}\``, inline: true }])
message.channel.send(userinfoembed);```
why god
ahh
errors
```node:2004) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'user' of undefined````
let user = message.mentions.users.first() see this @unborn ridge ?
forgot to add || message.author
It's hard to read code when a lot of it is on the same line. Consider constraining yourself to 80 - 120 characters max per line.
let user = message.mentions.users.first() || message.author should look like this
or else, if you don't tag anybody, it'll be undefined
It's hard to read code when a lot of it is on the same line. Consider constraining yourself to 80 - 120 characters max per line.
- serious formatting what I recommend everyone to do.
ESLint
I like using 120 characters because I have the room
Though I don't like ESLint as much as I used to because I don't feel like I have the flexibility.
you have
👀
just change the file preferences
I know that
Then there's Dart & Flutter where its extremely opinionated on how you should structure your code. The only thing you can change is the line limit.
Edit: You can set your style via the analysis_options.yaml file in your top-level directory, but it's still quite opinionated.
my eslint config has like 5 default configs and i'm lazy to add/delete so pretty much i choose my style
ok
Where to code my bot
notepad
bad
Get a PC.
🤨
coding on a pc gives you more features
Your parent/guardian doesn't have one you can use?
then don't make bots.
Coding on mobile is horrible, don't do it
Mobile devices like your handheld phone are not appropriate devices to create code. Phones:
- Are way too small. You can't see the whole line, or it's too small, or you scroll for days. Your eyes will suffer from this.
- Don't have a proper keyboard. Yeah there's a "hacker keyboard" but it's still going to be a painful endeavour to write proper syntax.
- Have horrible editors. There's some crap IDEs out there but they barely function to a level that's useful.
- Can't run a lot of bot code, and it's hard to do that in the first place. You can't run databases, sqlite, ffmpeg, canvas, or anything requiring more than core javascript. And running Termux is a pain in the ass, and it can't access your files (or your editor can't access the termux storage) without some intense technical gymnastics. That's if you have an Android, not an Apple phone, which can't even get that far.
- Getting help is hard because nobody wants to see your damn badly cropped screenshot showing your 25 facebook notifications from your mom inviting you to play farmville, or your 9% battery charge.
- Can't easily interact with online services like github to save/manage your code or upload it to your host.
If you really think you can code on a phone, you are horribly insane. That's your prerogative, but don't drag us into your insanity, we don't want anything to do with it.
No, it's not "good".
No, it's not "good".
@umbral zealot
You used it?
No because I'm an actual developer.
Of apps, websites, and bots.
Oh
Can you please stop using the Quote feature btw, that's annoying as hell.
Of apps, websites, and bots.
@umbral zealot
Suggest me something
I can't
:(
Step 2) learn a programming language
Ok then Step 0) wait until you're old enough for a PC.
Should I use GitHub?
Github can't help you.
Your parent/guardian doesn't have a laptop/desktop you can use?
Your parent/guardian doesn't have a laptop/desktop you can use?
@sudden geyser
My parents only gimme for online classes
😟
Ask for permission to use it for more, because coding on a PC gives you far more advantages over coding on mobile
depends on what you're making. If you're make a Discord bot with JavaScript, you'll likely need Node.js and an IDE (like Visual Studio Code)
Then wait until you're old enough.
one day
😕
How you ask matters too. It's the difference between, "Hey dad, can I have something" vs. "Hey dad, can I have something because it does X and I need it for Y and the Z alternative is not good enough." Anyway I'm not your relative.
@topaz lynx how old are you is it because of the software or your parents
For age
@topaz lynx how old are you is it because of the software or your parents
@blissful coral
I am 13 so they gave me only mobile
Ah
Hi guys, can you help me? I need my bot to say a random value with a command
If I hit 18 they said they will give me pc
Shit parenting if you ask me, but there's nothing we can do for you. Mobile programming is just crap.
Bruh
Hi guys, can you help me? I need my bot to say a random value with a command
Sure, what do you need help with specifically?
I want my bot to send random memes
mmmkay, random memes from where?
Could use the reddit api for that
mmmkay, random memes from where?
@umbral zealot from a host of images
Ok and where is this host of imagesÉ
Do I have to keep pulling teeth one at a time, or would you rather actually take the time to describe the entire context of your question?
I just need code for my discord.py bot to give me a random value
message.guild.members.cache.find("705731402972528690").send("hi")
Error - TypeError: fn is not a function
message.guild.members.cache.get("705731402972528690").send("hi")
That would work
Ty
:)
@topaz lynx if you're really interesting in programming, you can still learn
see if there's a program at your school (who might be able to give you a device to learn anyway), something online, etc.
Although covid has really limited your options here
codacademy is a free online programming school
w3schools is also good for programming but be sure to read library documentation and other things that would help along the way.
is this all you have in your message event?
any way i can add my bot in this server today itself
any way i can add my bot in this server today itself
@unborn ridge your bot doesn't get added here
Codecademy is meh
why
Args guide ^
others bot is here
besides the basic of the language, a lot of their decent stuff is locked behind their pro paywall. Like, Python 2 vs. Python 3
@unborn ridge your bot doesn't get added here
@rustic nova what about other bots added here
Discord placed a limit on the number of bots that can be added to a server
read the #announcements regarding that please @unborn ridge
they will explain it further
i can use async def on_dbl_vote(self, data) to do something when someone vote right ?
everything like this happens when my turn comes
when i thought of making bot verified developer badge update
🐢



when i thought of making bot verified developer badge update
@unborn ridge if you wanted to make a bot just because of that badge, you should rethink your decisions, just saying
no
i just told
why u so wierd
i just told
i didnt even know how to et that badge at that time


not having your bot here is a good thing
back then when intents were not a thing, bots would crash when they were added here because of the sheer amount of members and presences updates they would receive lmao
Does anyone know why I get an error in toArray when I want to see the information of a user through their ID?
It is an error that only appears in badges
(node:3244) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toArray' of null```
Error
let userFlags = member.user.flags.toArray();```
It only happens when I put "info id", if I use "info @fair rover" it doesn't give an error
that means flags are null
But why?
because the flags are not cached
did you fetch the user?
you may need to fetch the flags separately

you need to fetch if you dont mention a user
let user = await client.users.fetch(id here);
let flags = await user.fetchFlags();
id?
but it is for all users
well you said "info id"
Nono
Example
info @boreal forum not get error, but whit info 285854417004134401 yes
So..yesterday i was wrong lmao, @quartz kindle was right, the problem here is the equip command code, It return if there are more than 1 weapon in the 'armi' variable, what can i do here to fix?
if(args[0] === 'Weapon1') {
if(armi == 'Weapon1') {
if(isSomethingEquipped === true) {return message.channel.send('You already have something equipped')};
message.channel.send('You equipped Weapon1');
db.set(`${message.author.id}_equipweapon`, 'Weapon1');
armaequip = db.fetch(`${message.author.id}_equipweapon`)
const filtro = weaps;
const nuovearmi = filtro.filter(weaps => weaps!= armaequip);
db.set(`${message.author.id}_weapon`, nuovearmi)}
else {
return message.channel.send('You dont own this weapon, please buy it from the shop!')
}
};```
Error?
so put the id there
@quartz kindle
But would I have to put the id of all users basically?
@boreal forum put the id that the user wrote in the command
Error?
@blissful coral It return the message 'You dont own this weap...'
And ik
Let me try
I dont know how to make a statement to check if var contain that string
if (string.includes(...)) {...}
Oh yeah ty @sudden geyser
is using webhook the only way to do something when a user vote?
If you want to know on-time when a user has voted.
@little meteor the only way to do it in real time
all other ways are severely delayed
@quartz kindle Works! but only one id

