#development

1 messages · Page 1391 of 1

earnest phoenix
#

i was kidding lol that's 8 bit hex

#

the last two bits represent alpha

#

ok discord

#

i was kidding lol that's 8 bit hex

real niche
#

I mean

#

What would happen?

#

I don't know if there would be any real effects to it

earnest phoenix
#

oh my fucking god why is the mobile app so bad

real niche
#

idk

unborn ridge
#

Light mode pains lol

earnest phoenix
#

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

slender thistle
#

lmao cry we're in this pain together

boreal iron
#

well, you're not alone

lyric mountain
#

Wouldn't it be 3 byte for rgb?

#

Like, there are 256 values from 00 to ff

earnest phoenix
#

yes

#

6 bit hex <-> rgb
8 bit hex <-> rgba

lucid prawn
#
  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

real niche
#

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

earnest phoenix
#

because that's not how mentions look like

real niche
#

Which would probably be barely anything kek

earnest phoenix
#

oh

#

well

#

alpha channel in colors is actually really useful

lucid prawn
#

how do i fix it

real niche
#

Replace it with @lucid prawn and @lucid prawn

#

Both need to be checked because of nicks

serene crater
#

eeeeeeeeeeereeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

#

eee

#

ya

real niche
#

what

serene crater
#

wrong server

lucid prawn
#

ok

lyric mountain
#

Just do regex instead of dual boolean checks

lucid prawn
#
        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

earnest phoenix
#

slower performance wise iirc

real niche
#

Well

lyric mountain
#

Well, yeah

real niche
#

You want a prefix, right?

lucid prawn
#

no
@real niche

earnest phoenix
#

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

lyric mountain
#

Also commas

lucid prawn
#

im making it for me and then for other people

lyric mountain
#

That's the issue

earnest phoenix
#

doesn't make it less annoying and it's abusable

lyric mountain
#

^

real niche
#

Love when bots remove messages because you ping too many people in it

lyric mountain
#

It'd be safer and more helpful to get a dedicate support staff for those matters

real niche
#

Now you have a ghost ping of a bunch of people

earnest phoenix
#

i love how discord chooses to do nothing about ghost pings

real niche
#

powercord

earnest phoenix
#

...when the notification data is already there

lucid prawn
#

can u just help me 😢

lyric mountain
#

We are

earnest phoenix
#

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

lucid prawn
#

nvm I'll delete the code

lyric mountain
#

Prepare for trouble

slender thistle
#

Yee haw use DND

lyric mountain
#

Dungeons 'N Discords

open mauve
#

Hi can help me i have error "unexepted of input" ?

sudden geyser
#

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.

open mauve
#

Okay

#

SyntaxError: Unexpected token 'else'

sudden geyser
#

You have an else keyword somewhere it shouldn't be.

#

Look into the stacktrace to see where it points to.

steel agate
#

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

prisma bramble
#

const guild = message.guild

#

Wait

#

Oh yea

#

const channel = message.guild.channels.cache.find(c => channel.name === 'welcome')

#

It shouldn't be "member.guild"

steel agate
#

thanks

#

now it just says message not defined

prisma bramble
#

Wot ;-;

solemn latch
#

Yeah, looks like a guild member event

#

Not a message event

prisma bramble
#

Oh yea

solemn latch
#

The issue was your first line is placed outside the event

steel agate
#

ahhhhhhh

#

boom it works

#

im just I dot 🙂

solemn latch
#

I've made that mistake to many times.

steel agate
#

😆

#

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

});

solemn latch
#

I totally forget if the guild_member intent is needed for guildMemberAdd.

#

It may be, I cant look now.

royal crescent
#

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

solemn latch
#

is that not checking if the person has that permission?

steel agate
#

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

solemn latch
#

you can just use
User#send()

steel agate
#

thanks

lucid prawn
#
                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

solemn latch
#

what command are you using? specifically what are you typing.

lucid prawn
#

when people say call

#

i want it to send the embed

solemn latch
#

just "call'?

lucid prawn
#

yes

solemn latch
#

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

lucid prawn
#

ok

lyric mountain
#

Idk if that's what you're trying to do, but bad words filter would work better if using an array of words

steel agate
#

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

});

solemn latch
#

oop, message.channel wont work

#

since there is no message variable

lucid prawn
#

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

steel agate
#

oh ye

lyric mountain
#

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

lucid prawn
#

ok

#

how do i make a filters

#

@lyric mountain

#

what do i change @solemn latch

lyric mountain
#

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

lucid prawn
#

btw i think i never made array

lyric mountain
#

let anArray = [1, 2, 3, 4, 5]

#

If java: int[] anArray = {1, 2, 3, 4, 5};

lucid prawn
#

i do js btw

#

ok done

#

@lyric mountain

lyric mountain
#

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

lucid prawn
#

ok

tribal siren
#

message.guild.members.cache.get(m => m.id === `${message.content.split(" ").slice(1).join(" ")}`)

#

this is wrong.

#

how to do correct?

solemn latch
#

Looks like your passing a function when you just need to pass the ID of the member your getting.

tribal siren
#

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

solemn latch
#

I would do pretty much exactly what your doing, just pass the variable rather than making it a function.

hollow sedge
#

Alternative step N° 3: give up because leetspeak exists
@lyric mountain I wonder if there's a way to normalize a string

lyric mountain
#

There is

#

But there's always a way to bypass

tribal siren
#

I would do pretty much exactly what your doing, just pass the variable rather than making it a function.
something like this?

hollow sedge
#

ik I'm just wondering

lyric mountain
#

You can't win against users

hollow sedge
#

yes i realize that

#

im just asking

#

for my own knowledge

solemn latch
#

I would also consider not using the join and slice, but just use the second thing in the array.

tribal siren
#

better to use the args?

lyric mountain
#

Regex is the best bet for leetspeak matching

#

You just need a ton of patience

#

And an infinite list of possible word permutations

solemn latch
#

If you have args already, use it. No point in doing that process multiple times.

hollow sedge
#

yeah that's the problem

#

you would need to know all of them

#

well list all of them

solemn latch
#

And regex is relatively slow especially when talking about moderately sized bots with hundreds or thousands of messages per minute it needs to check

hollow sedge
#

what do they use to check

lyric mountain
#

Yeah, but more readable than a thousand if chains

solemn latch
#

I belive custom search tools are used for larger bots.

hollow sedge
#

yeah that would make sense

solemn latch
#

Not actually sure what off the shelf solutions exist for those who can't do that

#

Im sure there's a handful out there.

hollow sedge
#

probably...i doubt this feature is much sought after anyway

royal crescent
#

can someone link me how to build a webscraper for js freakouteyes cant find a single good resource

lyric mountain
#

It's annoying if anything

#

Most people would disable because why not

#

Censor bot is hated for a reason

hollow sedge
#

you mean node right?

royal crescent
#

yeah

#

idk too much about node and js and stuff

#

new to js CBSadCat

lyric mountain
#

I'd suggest learning basics then

#

Webscraping can get quite complex

royal crescent
#

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

lyric mountain
#

Well, depends

royal crescent
#

the discord.js database and docs have been super helpful tho freakouteyes

hollow sedge
#

web scraping is pretty easy in python, not sure about other langs

lyric mountain
#

In java it is too with the right libs

royal crescent
#

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 kekw

hollow sedge
#

uh

royal crescent
#

js is easier for me to understand

hollow sedge
#

python is supposed to be one of the easier languages

lyric mountain
#

That's a rare phrase from a c++ dev

royal crescent
#

That's a rare phrase from a c++ dev
@lyric mountain i wouldnt call myself a dev kekw

lyric mountain
#

Why not?

royal crescent
#

more like c++ college dropout

solemn latch
#

Especially someone named blender

royal crescent
#

I NAMED MYSELF THAT BEFORE I KNEW IT WAS A THING IN PYTHON LOL

solemn latch
#

Lol

royal crescent
#

i didnt even know there was a 3d modeling software called blender kekw

hollow sedge
#

blender is python?

solemn latch
#

Its the reason I'm learning blender.

hollow sedge
#

you mean the 3d modelling software?

royal crescent
#

i hear that a lot

lyric mountain
#

There's also a kitchen gadget named after the software

royal crescent
#

people learning py just for blender

solemn latch
#

Yeah blender programming uses python for its api.

#

Yeah

hollow sedge
#

OH

solemn latch
#

It sucksss

hollow sedge
#

that's kinda weird

solemn latch
#

Why can't it be c# or c++ like normal things

royal crescent
#

anyways

lyric mountain
#

More like java or c++

solemn latch
#

Java sure id take that too

royal crescent
#

someone link me how to webscrape with js freakouteyes

lyric mountain
#

C# is just java++

#

But Microsoft couldn't buy it

hollow sedge
#

microsoft knows its terrible so they didnt buy it

lyric mountain
#

Nah, they really tried to make a java++

#

But couldn't due to legal issues iirc

#

Java is quite good btw

hollow sedge
#

legal issues? so what about OpenJDK

lyric mountain
#

Still legal issues

#

C# was meant to be a windows java

hollow sedge
#

oh god openJDK has 60k commits

lyric mountain
#

Openjdk is the vm btw

#

Java itself has nothing to do with either oracle or openjdk

hollow sedge
#

so why are there legal issues?

lyric mountain
#

Because Microsoft hates open source

#

They can't privatize everything

hollow sedge
#

ironic
microsoft owns github

solemn latch
#

Java++ op

#

Lol

lyric mountain
#

Lul

solemn latch
#

Minecraft 2 written in java++

hollow sedge
#

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

lyric mountain
#

Let's make a Playstation++

hollow sedge
#

xbox and playstation have the same meaning in this context lol

lyric mountain
#

Got confused

serene crater
#

#560180018467045376 message

sudden geyser
#

We(?) can't see what message that URL points to

serene crater
#

thats what it is

sudden geyser
#

oh ok

earnest phoenix
#

@serene crater bruh

serene crater
#

what

#

i got muted on every server but this one

earnest phoenix
#

dont send walls of text or you will be muted on this server too KEKW

agile lance
#

@earnest phoenix He was showing @sudden geyser what it said -.-

sudden adder
#

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.

hollow sedge
#

That's not communism but it sure is a dictatorship. Also this is #development

stark abyss
#

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?

lethal grail
#
    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

timber wedge
#

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

undone tundra
#

what language

#

and what are you using

#

(lavalink, yt-dl/ffmpeg/yt-dlc)

undone tundra
#

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

earnest phoenix
#

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

earnest phoenix
#

Hi

#

@pseudo dust And?

#

Got it?

pseudo dust
#

yeah thanks

earnest phoenix
#

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

analog imp
#

back with another question with my discord.js bot lol

earnest phoenix
#

Ask me ;)

#

Im using discord.js aswell

analog imp
#
if (this.activities) clone.activities = this.activities.map(activity => activity._clone());
TypeError: activity._clone is not a function
#

lemme pull up the code btw

earnest phoenix
#

What are you trying to make?

analog imp
#

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](https://cdn.discordapp.com/emojis/778154999863443497.webp?size=128 "Offline") Offline';
earnest phoenix
#

Your trying to display the bots status?

analog imp
#

no, a user's status, i can get a screenshot of the gui end

earnest phoenix
#

I see the problem, members dont have a presence, a user does

river hinge
#

okay

#

yea she is right

earnest phoenix
#

Im a he

river hinge
#

i can show how my bot does it

#

my bad

earnest phoenix
#

🤣

river hinge
#

sorry

earnest phoenix
#

Np

river hinge
#

but yea he is right

#

also make sure bot it enable to be able to read presence

analog imp
#

ahhh hold up, that's defined as a variable, "member"

#

and yes it is :)

earnest phoenix
#

yes

analog imp
earnest phoenix
#

Nice!!

analog imp
#
        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;
earnest phoenix
#

u need a user

#

thats a member

#

u defined

river hinge
#

woah dude you member variable looks way longer than mines

earnest phoenix
#

ye

#

🤣

#

same

river hinge
#

const mention = message.mentions.members.first();

#

this is how i get the user

analog imp
#

lmaooo

river hinge
#

.addField("Status",mention.presence.status, true)

#

and this is the status

earnest phoenix
#

Thats still a member

analog imp
#

it can read mentions, ID

river hinge
#

yea ik but his one looks like rocket science to me

earnest phoenix
#

Yes

river hinge
#

cute dog btw nutella

earnest phoenix
#

yess

#

I love it

analog imp
#

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?

earnest phoenix
#

Maybe in a bin

#

so this channel doesnt gets flooded with your code

analog imp
#

gotcha, i will be back with that

earnest phoenix
#

k

river hinge
#

so big brain nutella

earnest phoenix
#

yes

hazy sparrow
analog imp
#

@earnest phoenix to reproduce, use {prefix}userinfo then change from Idle/online/dnd/offline to a different status, then try to use it again

earnest phoenix
#

K

analog imp
#

will come up with TypeError: activity._clone is not a function

earnest phoenix
#

Let me have a quick look

#
let member = message.author```
#

use this for member

#

temp

#

to just check if that's the problem

analog imp
#

gotcha, will do that

earnest phoenix
#

k

#

hit me up once you've done that

analog imp
#

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())
earnest phoenix
#

OP

#

O

#

I see the problem

#

the user is already a user

#

so you have to remove the part .user. of member.user stuff

hazy sparrow
#

message.author is a user iirc

earnest phoenix
#

yes

#

thats what i am trying to say

analog imp
#

btw it still crashes even after changing it

#

even as message.author

hazy sparrow
#

change member.user.tag to member.tag

analog imp
#

still crashing with TypeError: activity._clone is not a function

neon heart
#

if you need member.user.tag use const member = message.member

earnest phoenix
#

a member doesn't have a presnce

#

*presence

#

so yes....

analog imp
#

ahhh, so they should be saved as a variable?

past needle
#

some people get confused on the difference between a User object and a Member object tho'

earnest phoenix
#

No, you should define member as a user

#

yes they do

hazy sparrow
#

so umm imma post my problem again

past needle
#

use ```js
try {
client.commands...
} catch(err) {
console.error(err)
}

hazy sparrow
#

hmm okay, ill try that

past needle
#

"catch" is used for promises like sending a message or deleting a channel

#

^^

#

so for normal functions just use "try catch"

hazy sparrow
#

kk, thanks!

past needle
#

nope

pseudo hare
#

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

past needle
#

yea true too ^

analog imp
#
    if (this.activities) clone.activities = this.activities.map(activity => activity._clone());
                                                                                     ^
TypeError: activity._clone is not a function

still coming up

past needle
#

you want to clone every single activity ?

#

@analog imp

analog imp
#

no, it's coming up after the presence of a guild member changes

hazy sparrow
#

@pseudo hare the one which @past needle suggested works, though thanks for the help!

analog imp
#

from say Idle to Do not disturb

past needle
#

but what do you want to do :o

analog imp
#

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"

pseudo hare
#

does .execute return a Promise, cause if it does, the error wont be caught with a try {} catch {} block unless you use async / await

past needle
#

you can just use

shy steeple
#

how do i attach images in my top.gg desc?

past needle
#

html

hazy sparrow
#

you can do that?

shy steeple
#

yyes

past needle
#

you can pratically create a website

hazy sparrow
#

yo that'd be helpful if i knew it before

#

you can pratically create a website
@past needle discord in top.gg

analog imp
#

hmmmm

past needle
#

@shy steeple use <img src="image link">

analog imp
#

i will keep attempting a fix for this

shy steeple
#

ty

past needle
#

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"
@analog imp why not just use <USER>.presence.status $-$ ?

shy steeple
#

it doesnt work

#

it shows as just like an image icon not the image

hazy sparrow
#

can i get a animated profile for my bot?

past needle
#

no

#

:l

analog imp
#

@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

hazy sparrow
#

:(

shy steeple
#

anyone?

brazen knoll
#

I want to make a bot which show collection

#

Tell me code please

past needle
#

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

late cedar
#

@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?

brazen knoll
#

Oh you used t4 bot which show badges like that

hazy sparrow
#

Tell me code please
@brazen knoll umm we're not spoonfeeders.

past needle
#

@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

analog imp
#

whether it's a user or member object, it still errors in activity._clone is not a function

brazen knoll
#

Oh i have hypersquad ballance badge when will i get bot developr badge

past needle
#

impossible to get the bot devlopper badge right now

#

too late

analog imp
#

Early verified bot developer badge is too late

past needle
#

no longuer the badge can be given and they told us a while ago i think with the official discord bot

brazen knoll
#

I not understand

hazy sparrow
#

@brazen knoll You can't get the bot developer badge anymore.

brazen knoll
#

Somebody told that i will get when my bot reach 1000 server

past needle
#

lol

hazy sparrow
#

lmao

past needle
#

who told you

#

that guy hates you and your family

hazy sparrow
past needle
#

omg

#

my bot is 90% of approval

#

hope hcole will approve 👁️👄👁️

brazen knoll
#

How i will check

past needle
#

check what ^^'

brazen knoll
#

My bot is approved hiw much

past needle
#

go to the website

#

login

#

click on you name at the top right

#

go to the bottom and click "view bot"

brazen knoll
#

@past needle ty but give link i am new

past needle
#

of course only if you already registred a bot

#

login in the website

#

and tell me when you finished

brazen knoll
#

Yes i login

#

Then

past needle
#

so what's your bot id ?

#

it usually looks like 764870886621708290

brazen knoll
#

Saying you have no bot

past needle
#

oh

#

did you registeer a bot

thin jacinth
#

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

spark oracle
past needle
#

your bot can't do something

#

talk, delete messages

#

idk

#

it's a DiscordAPIError so its not from dbl

spark oracle
#

i know

fickle sapphire
#

it says that your bot is missing permissions...

past needle
#

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

brazen knoll
#

How much time it take to verify my bot i add it today

neon heart
#

2-4week

earnest phoenix
#

or dont use promise then pattern and instead use await/async like a sane human

brazen knoll
#

Oh what

past needle
#

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

gusty quest
#

so i have this error ReferenceError: Intents is not defined but i defined it here const intents = new Intents();

pale vessel
#

The error said Intents, not intents

neon heart
#

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

pale vessel
#

Intents should be <Discord.js>.Intents

#

You can simply define it using const { Intents } = require("discord.js") or require("discord.js").Intents

past needle
#

xc

#

or

gusty quest
#

no

#

its not working

pale vessel
#

Then you did something wrong

past needle
#

const Discord = require('discord.js') Discord.Intents

#

mqrkelich maybe screen your code to be sure you placed them at the right place

neon heart
#
const intents = new Intents()```
gleaming owl
#

Hi

#

I'm a bot developer

#

I made my music bot

earnest phoenix
#

...okay?

neon heart
#

then?

twilit rapids
#

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

pale vessel
twilit rapids
#

I mean yeah I can use exec

pale vessel
#

So client.set("key", "value", "EX", 5000);

twilit rapids
past needle
#

I made my music bot
cool

pale vessel
#

You can still provide callback at the end

slim swan
#

Hallo everyone
Can someone give me "user" code like Probot prime? redhh

past needle
#

wha

#

a userinfo command ?

slim swan
#

Yah @past needle

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

spark oracle
past needle
#

there is a command that doesn't have the "run" function @spark oracle

#

or maybe nothing at all

slim swan
#

OK @past needle

spark oracle
#

Can i dm you @past needle

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

shy steeple
#

How do i change my background page on top.gg using css?

slim swan
#

OK @past needle

past needle
#

cx

slim swan
#

What if i want add invite member and inviter?
@past needle

past needle
#

that's a little bit complicated

#

try this : ```js
console.log(message.guild.fetchInvites())

#

then you'll have all the informations

pale vessel
#

How do i change my background page on top.gg using css?
@shy steeple Add the HTML style tag somewhere in your bot's long description.html <style> body { background-image: prop; } </style>

slim swan
#

Can you show me example for this case ?
@past needle

hazy sparrow
#

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.

past needle
#

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)
hazy sparrow
#

ahh, i get it now, thanks a lot!

past needle
#

no prob

hazy sparrow
#

but can i replace 1000 * 60 with 60000?

#

nvm, im dumb for asking this question, ofcourse i can

past needle
#

lmfao

#

yea i just rather use 1000 * 60

#

because

#

1 second = 1000 milliseconds

#

so the code is more readeable

earnest phoenix
#

how do you make a EVAL command

humble rock
#

how do you make a EVAL command
@earnest phoenix *an EVAL command

earnest phoenix
#

oh ok

#

i wanna make a eval command

humble rock
#

Search on YT

#

or stackoverflow

#

Search on YT
@earnest phoenix there's a lot of videos

hazy sparrow
#
const taggedMember = message.mentions.users.first();```  this was working until now
brazen knoll
#

Any one who use poketwo

pale vessel
#

@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?

hazy sparrow
#

sure lemme put it in a bin

#

wait wtf

#

some of the code has wandered around

#

ohh i found the mistake

#

actually no i didnt find out, im dumb

pale vessel
#

Can you make it print error.stack for your error handler?

#

That looks like it's printing error.message

hazy sparrow
#

its message.channel.send(err)

pale vessel
#

make it err.stack

hazy sparrow
#

ok lemme try that

pale vessel
#

Can you show line 42 of that file from your editor?

hazy sparrow
#

kill.js?

pale vessel
#

Yes

#

Not sure if pastebin is correct

hazy sparrow
#

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. `,

somber ridge
#

@hazy sparrow that should be ```
taggedmember.user.tag

pale vessel
#

Nah

#

taggedMember is a user

somber ridge
#

Oh nvm

hazy sparrow
#

lol

somber ridge
#

I thought it was a member object

hazy sparrow
#

lemme see if the comma fixes it

pale vessel
#

That's why I told him to know the difference

tardy hornet
#

i forgot how to see how many members are in all the servers that my bot is in

#

is it

#

${bot.guilds.memberCount}

#

?

somber ridge
#

No

#

No

hazy sparrow
#

actually it was message.mentions.members.first()

#

i was lazy to change the variable name

tardy hornet
#

i wanna see the total

pale vessel
#

Then it should be taggedMember.user.username

past needle
#

${taggedMember ? taggedMember.username : 'No one '

hazy sparrow
#

or could reverting users to members work?

past needle
#

oh wait it's a member object

#

like hoggers bro said

somber ridge
#
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

pale vessel
#

@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)

vale garden
#

hi

#

Any one who use poketwo
@brazen knoll me

#

lol

#

i have a html related question

unborn ridge
#

need help

#

pls

vale garden
#

ca anyone help me

pale vessel
#

Just ask

unborn ridge
#

pls

#

ok

vale garden
#

lol

unborn ridge
#

have u seen dank memer help menu

frozen topaz
#

how can I get my bot in here?

unborn ridge
#

just tell me difference between add feilds and add fied

#

field

pale vessel
vale garden
#

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

somber ridge
#

@pale vessel couldn't you just do something like ```
const totalUsers = client.users.cache.size

pale vessel
#

That works, if you cache all members

#

Otherwise it would only be cached users

somber ridge
#

Yep

unborn ridge
#

caan i get example of fields pls

#

i am unable to do that

somber ridge
#

Embeds ?

unborn ridge
#

i can just addfield

#

yes embeds

tardy hornet
#

.addField("hey")

unborn ridge
#

fields

tardy hornet
#

o

pale vessel
#

addFields([{ name: "Name", value: "Value", inline: true }, { name: "Name 2", value: "Value 2", inline: true }]);

somber ridge
#

That's fairly simple

message.channel.send(new MessageEmbed() 
.addFields(
{name: 'some name' , value : 'some value ' }, 

// Same procedure for next set 
)) 
unborn ridge
#

thank u @pale vessel

#

is there thanks command

#

?

pale vessel
unborn ridge
#
in a server there was thanks command and thanks leaderboard lol```
pale vessel
#

That's weird

#

I don't see point of doing that

#

Only makes people help for points

hazy sparrow
#
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?

pale vessel
unborn ridge
#

server owner paid 20$ to top of leaderboard
LOL

hazy sparrow
#

oh fuck

pale vessel
#

It's message.mentions

unborn ridge
#

yes

hazy sparrow
#

ii didnt copy and pasted it so i wrote it mistakly lemme correct it

unborn ridge
#

const taggedMember = message.mentions.users.first()

pale vessel
#

You should rename it to taggedUser

#

Since it's not a member

hazy sparrow
#

hmm check the code again

#

i reverted it back to member

pale vessel
#

message.mentions.members.first() and taggedMember.user.username

#

OR message.mentions.users.first() and taggedUser.username

hazy sparrow
#

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

pale vessel
#

Check how you defined your args and look in your reload command

hazy sparrow
#
const args = message.content.slice(prefix.length).trim().split(/ +/);
pale vessel
#

Can you show your reload command?

#

Only the part where you define what to reload

hazy sparrow
#

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);
pale vessel
#

Can you add console.log(commandName, command.name); before delete?

hazy sparrow
#

sure lemme do that

#

how many times are you gonna edit that XD

pale vessel
#

lulw

hazy sparrow
#

it says user-info userinfo

#

for server-info it says server-info serverinfo

pale vessel
#

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

hazy sparrow
#

but what is causing it to remove the -?

pale vessel
#

The file is user-info.js right?

hazy sparrow
#

user-info.js

pale vessel
#

Yes

#

and can you see name inside the command under module.exports?

hazy sparrow
#

ohhhhh

pale vessel
#

It tried to use that

hazy sparrow
#

if i make it name: user-info?

pale vessel
#

You can, but then users have to type user-info instead

#

You can just change command.name to commandName

hazy sparrow
#

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

pale vessel
#

If you change the name, it changes the command name itself

#

So the trigger will be user-info

hazy sparrow
#

yep, that's what i want

pale vessel
#

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

hazy sparrow
#

yeah the command is user-info from start lol

mint obsidian
#

hi

#

chanch nikn name pleas

gentle lynx
#

how can i loop through server members

#

for (var member in message.guild.members) ?

pale vessel
#

close

gentle lynx
#

;-;

pale vessel
#

message.guild.members.cache.values()

gentle lynx
#

oh alright

#

member is a GuildMember?

pale vessel
#

Yes

gentle lynx
#

ty

lyric mountain
#

also, var?

gentle lynx
#

i did that and its not looping

lyric mountain
#

is it even reaching there?

gentle lynx
#

yes.

#

i put a loop under it and it works just fine

lyric mountain
#

the cache has a single member then

#

probably the bot itself

gentle lynx
#

hm

lyric mountain
#

don't use var btw

gentle lynx
#

ok

#

is there a way to fix the cache issue?

pale vessel
#

If you have the guild members intent, you can enable fetchAllMembers in ClientOptions

#

Otherwise no

gentle lynx
#

yes

#

thanks

pale vessel
#

All good my man

hazy sparrow
#

whats the latest version of google-play-scraper?

pale vessel
#

@gentle lynx Can you try for of instead of for in?

gentle lynx
#

sure

#

sec

#

i enabled fetchAllMembers, my bot is taking some time to start

#

is it because of that?

pale vessel
#

Yeah, it shouldn't work since you used for in

gentle lynx
#

oh ok

pale vessel
#

is it because of that?
@gentle lynx and yes

gentle lynx
#

it worked thanks

pale vessel
#

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

gentle lynx
#

aight

outer perch
#

should I keep my bot hosted on Heroku

#

or host it on Glitch?

earnest phoenix
#

buy a vps

#

inst it that the bot are coming on this server?

outer perch
#

please choose one of those

#

Heroku vs Glitch, which is better

earnest phoenix
#

Heroku

#

According to me

regal saddle
#

@coral trellis here too catJAM

earnest phoenix
#

Heroku vs Glitch, which is better
@outer perch heroku

#

i use keroku

#

heroku*

north birch
#

Heroku vs Glitch, which is better
@outer perch Glitch updated his TOS and, hosting bot on Glitch in against the TOS

#

So Heroku

willow mirage
#

why this is not working

#

ah hsit

#

why this is not working?

#

it doesn't console log

cerulean pebble
#

.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

cinder patio
#

I think you need to enable guild member intents

lethal trout
sudden geyser
#

^ (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.

lethal trout
#

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

unborn ridge
#

.addFields([{ name: "**🧷Avatar Link**", value: `**[Link]${avatar}**`, inline: true }

#

not showing button

#

posting link directly

#

avatar is defined

sudden geyser
#

args[1] was probably not supplied. Heck, you don't even check if it was.

unborn ridge
#

pls

sudden geyser
#

You're doing that with args[0]

lethal trout
#

args[1] was probably not supplied. Heck, you don't even check if it was.
@sudden geyser so wat should i change?

sudden geyser
#

@unborn ridge [link](url)

#

for a link

unborn ridge
#

for avatar link

#

of user

sudden geyser
#

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.

unborn ridge
#

done

#

tq

lethal trout
#

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

cerulean pebble
#

@cinder patio so this is not my problem

lethal trout
#

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"

sudden geyser
#

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:

  1. Check if args[0] is a number (see parseInt).
  2. Parse it to a number (which you'll do above with parseInt) and save it to a variable.
  3. Use that number as the argument to <TextChannel>.bulkDelete(num)
  4. In the message sent after, put that number in the string in replacement of args[1] (I cleared ${num} messages)
outer perch
#

imagine if the bot deletes less than what you asked

restive furnace
#

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?

outer perch
#
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 ☝️

umbral zealot
#

You shouldn't really be looping through to delete a lot of messages. It's easily considered API abuse.

restive furnace
#

hmm okay

#

thanks for the help though

outer perch
#

remember, never try to delete more than 100 msgs. at a time

earnest phoenix
#

I have a question: HOW TO CREATE A WEBHOOK URL

drifting wedge
#

How would I like run a function after a certain period even if I reset the bot etc? Python

outer perch
#

@restive furnace ah, my code doesn't answer your formula

unborn ridge
#

(node:1712) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'highest' of undefined

outer perch
#

but it's the best way I found to delete normally

restive furnace
#

yeah it's ok, i'll just probably make a another command for clearing whole channeö

outer perch
#

@unborn ridge show the variable being declared, and where it's changed

unborn ridge
#

${user.roles.highest}

#

pls tell how to declare role

#

roles

outer perch
#

user.roles.cache.highest

#

you now need .cache for .roles and .guilds

#

@unborn ridge fixed?

unborn ridge
#

(node:6708) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cache' of undefined

outer perch
#

oh wait

#

show user

unborn ridge
#
      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

outer perch
#

yeah

unborn ridge
#

@outer perch seen?

outer perch
#

I'm forgetting about something

unborn ridge
outer perch
#

let me check the documentation and my code

#

don't worry it'll be fixed

full mortar
#
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?

outer perch
#

@unborn ridge ok, you got the user, but u need to get him as a member of the guild, not the user by itself

unborn ridge
outer perch
#

so put it like this

#

member.user.roles.cache.highest

#

@unborn ridge

unborn ridge
#

i am getting confused

outer perch
#

or read this if you prefer

#

let member = message.guild.member(user)

unborn ridge
#

them

#

member.user.roles.cache.highest
@outer perch

outer perch
#

yes

#

define user, then define member like I said

#

then that

unborn ridge
#

message.guild.members.get is not a function

#

@outer perch

outer perch
#

bro, not that xD

#

let me give you the snippet

unborn ridge
#

ok

outer perch
#
let user = message.mentions.users.first() || message.author,
  member;
if (user) member = message.guild.member(user);
#

member.user.roles.cache.highest

earnest phoenix
#

hi

outer perch
#

hi

unborn ridge
#
    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````

outer perch
#

let user = message.mentions.users.first() see this @unborn ridge ?

#

forgot to add || message.author

sudden geyser
#

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.

outer perch
#

let user = message.mentions.users.first() || message.author should look like this

#

or else, if you don't tag anybody, it'll be undefined

restive furnace
#

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.
outer perch
#

ESLint

sudden geyser
#

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.

outer perch
#

you have

cosmic roost
#

👀

outer perch
#

just change the file preferences

sudden geyser
#

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.

restive furnace
#

my eslint config has like 5 default configs and i'm lazy to add/delete so pretty much i choose my style

outer perch
#

I can send you my file

#

this was recommended by Discord.JS

restive furnace
#

ok

topaz lynx
#

Where to code my bot

unborn ridge
#

notepad

sudden geyser
#

a code editor/ide

#

visual studio code if you want an example

topaz lynx
#

I am on Android mobile

#

😑

sudden geyser
#

bad

umbral zealot
#

Get a PC.

topaz lynx
#

🤨

sudden geyser
#

coding on a pc gives you more features

topaz lynx
#

Get a PC.
@umbral zealot
I am a kid

#

😑

sudden geyser
#

Your parent/guardian doesn't have one you can use?

umbral zealot
#

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.

topaz lynx
#

I use bot designer
Is that a good app?

#

😅

umbral zealot
#

No, it's not "good".

topaz lynx
#

No, it's not "good".
@umbral zealot
You used it?

umbral zealot
#

No because I'm an actual developer.

topaz lynx
#

▼・ᴥ・▼

#

No because I'm an actual developer.
@umbral zealot
Of apps

#

?

umbral zealot
#

Of apps, websites, and bots.

topaz lynx
#

Oh

umbral zealot
#

Can you please stop using the Quote feature btw, that's annoying as hell.

topaz lynx
#

Of apps, websites, and bots.
@umbral zealot
Suggest me something

umbral zealot
#

Yeah of course buddy

#

Step 1) get a PC

topaz lynx
#

I can't
:(

umbral zealot
#

Step 2) learn a programming language

#

Ok then Step 0) wait until you're old enough for a PC.

topaz lynx
#

Should I use GitHub?

umbral zealot
#

Github can't help you.

sudden geyser
#

Your parent/guardian doesn't have a laptop/desktop you can use?

topaz lynx
#

Your parent/guardian doesn't have a laptop/desktop you can use?
@sudden geyser
My parents only gimme for online classes

#

😟

sudden geyser
#

Ask for permission to use it for more, because coding on a PC gives you far more advantages over coding on mobile

topaz lynx
#

If they agrees

#

I need what software?

sudden geyser
#

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)

topaz lynx
#

........

#

They denied

#

......

umbral zealot
#

Then wait until you're old enough.

sudden geyser
#

one day

topaz lynx
#

😕

sudden geyser
#

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.

blissful coral
#

@topaz lynx how old are you is it because of the software or your parents

#

For age

topaz lynx
#

@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

blissful coral
#

Ah

topaz lynx
#

If I hit 18 they said they will give me pc

#

That is too much late tho

hard anchor
#

Hi guys, can you help me? I need my bot to say a random value with a command

umbral zealot
#

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.

topaz lynx
#

Bruh

umbral zealot
#

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?

hard anchor
#

I want my bot to send random memes

umbral zealot
#

mmmkay, random memes from where?

cosmic roost
#

Could use the reddit api for that

hard anchor
#

mmmkay, random memes from where?
@umbral zealot from a host of images

umbral zealot
#

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?

hard anchor
#

I just need code for my discord.py bot to give me a random value

agile lance
#
message.guild.members.cache.find("705731402972528690").send("hi")

Error - TypeError: fn is not a function

cosmic roost
#
message.guild.members.cache.get("705731402972528690").send("hi")

That would work

agile lance
#

Ty

cosmic roost
#

:)

hollow sedge
#

@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

past needle
#

codacademy is a free online programming school

cosmic roost
#

w3schools is also good for programming but be sure to read library documentation and other things that would help along the way.

thin turret
#

W3 is kinda outdated when it comes to JS

#

You have to define args first

molten yarrow
#

is this all you have in your message event?

unborn ridge
#

any way i can add my bot in this server today itself

thin turret
rustic nova
#

any way i can add my bot in this server today itself
@unborn ridge your bot doesn't get added here

sudden geyser
#

Codecademy is meh

unborn ridge
#

why

thin turret
#

Args guide ^

unborn ridge
#

others bot is here

sudden geyser
#

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
#

@unborn ridge your bot doesn't get added here
@rustic nova what about other bots added here

thin turret
#

Discord placed a limit on the number of bots that can be added to a server

rustic nova
#

they will explain it further

little meteor
#

i can use async def on_dbl_vote(self, data) to do something when someone vote right ?

unborn ridge
#

everything like this happens when my turn comes

#

when i thought of making bot verified developer badge update

thin turret
#

🐢

unborn ridge
little meteor
unborn ridge
rustic nova
#

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

unborn ridge
#

no

#

i just told

#

why u so wierd

#

i just told

#

i didnt even know how to et that badge at that time

quartz kindle
#

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

boreal forum
#

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

quartz kindle
#

show code?

#

and show full error

boreal forum
#
(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

quartz kindle
#

that means flags are null

boreal forum
#

But why?

quartz kindle
#

because the flags are not cached

#

did you fetch the user?

#

you may need to fetch the flags separately

boreal forum
molten yarrow
#

you need to fetch if you dont mention a user

quartz kindle
#
let user = await client.users.fetch(id here);
let flags = await user.fetchFlags();
boreal forum
#

id?
but it is for all users

quartz kindle
#

well you said "info id"

boreal forum
#

Nono

#

Example

#

info @boreal forum not get error, but whit info 285854417004134401 yes

quartz kindle
#

yes

#

so put the id there

north birch
#

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!')
            }
        };```
blissful coral
#

Error?

boreal forum
#

so put the id there
@quartz kindle
But would I have to put the id of all users basically?

quartz kindle
#

@boreal forum put the id that the user wrote in the command

north birch
#

Error?
@blissful coral It return the message 'You dont own this weap...'

blissful coral
#

Then your if statement is fake

#

False*

north birch
#

And ik

boreal forum
#

Let me try

north birch
#

I dont know how to make a statement to check if var contain that string

sudden geyser
#

if (string.includes(...)) {...}

north birch
#

Oh yeah ty @sudden geyser

little meteor
#

is using webhook the only way to do something when a user vote?

sudden geyser
#

If you want to know on-time when a user has voted.

quartz kindle
#

@little meteor the only way to do it in real time

#

all other ways are severely delayed

little meteor
#

i see

#

thnx

boreal forum
#

@quartz kindle Works! but only one id