#development

1 messages Β· Page 1021 of 1

regal raven
#

What is cow?
Ans: It gives milk

spare mirage
#

πŸ˜‚

#

oh really

#

didint know

calm saddle
#

What is cow?
It gives milk
@regal raven yup calling the cops

spare mirage
#

lmao

lusty quest
spare mirage
#

lmaoo

#

thats impossible

regal raven
#

πŸ˜‚

calm saddle
#

if you read the table above it kinda makes sense in a way it doesn't make sense

spare mirage
#

if you read the table above it kinda makes sense in a way it doesn't make sense
@calm saddle still impossible to make a bot with it

lusty quest
#

there are actually people that write stuff in COW

#

its possible but you work on a way lower level than the regular languages

#

not on Binary level but still down there

calm saddle
#

daym those ppl have a lot of brain cells

spare mirage
#

ikr

calm saddle
#

i barely have 10

spare mirage
lusty quest
#

its nothing serious just for having the Balling rights for writing stuff in COW

calm saddle
#

troo

spare mirage
#

maybe even more

calm saddle
#

xDD

#

and here i was thinking py sucked

#

no offense to the py users :p

spare mirage
#

ye same

trim saddle
#

any language is capable of the same thing any other language is

spare mirage
#

Cow has something special

#

Milk πŸ₯›

calm saddle
#

9 1 1

delicate shore
#

client.guild.get is not a function

wheat valve
#

cache.get

earnest phoenix
#

How do i use a for loop on everyone who has a specific role in my server? I wanna run db.set(smth) on every user id

delicate shore
#

<client>.guilds.cache.get();
@earnest phoenix we need<>?

#

ok

#

pls help me guys everything is in the link

restive pebble
#

roles.cache.find

restive furnace
#

^

delicate shore
#

ok thnx

spare mirage
#

unbans?

delicate shore
#

mute*

#

unban is still not working

spare mirage
#

@delicate shore for unban let userID = args[0] message.guild.fetchBans().then(bans=> { if(bans.size == 0) return let bUser = bans.find(b => b.user.id == userID) if(!bUser) return message.guild.members.unban(bUser.user)

delicate shore
#

omly this much?

spare mirage
#

yes

delicate shore
#

but

#

what about return replies

#

what is bUser?

spare mirage
#

let bUser

delicate shore
#

and what is bans.size?

spare mirage
#

The amount of bans on a server

delicate shore
#

let bUser
@spare mirage let bUser what

#

btw thnx

spare mirage
#

let bUser = bans.find(b => b.user.id == userID)

calm saddle
#

that syntax does not work for me :-;

regal raven
#

Is there any way other than sending a text file for messages with more than 2000 characters?

restive pebble
#

yes

#

slice

regal raven
#

You mean send multiple messages?

restive pebble
#

yes

regal raven
#

Nice Idea

#

Thanks

restive furnace
#

what library you working on, since some libs have it already implememted

#

like on discord js you can add following flag into the message: split: true

earnest phoenix
#

dm who send messages to everyone dm

delicate shore
#

@spare mirage i am facing an error

#

here

#

but if i remove that

#

then the nxt if command doens't works

restive furnace
#

have heard of else ifs?

restive pebble
#

does discord.js has that?

#

freestyle

restive furnace
#

yeah

restive pebble
#

oh

#

thx

earnest phoenix
#

dm who send messages to everyone dm

#

dm who send messages to everyone dm

#

dm who send messages to everyone dm

#

dm who send messages to everyone dm

restive furnace
#

what you mean, also spamming it doesnt make us to answer faster

restive pebble
#

get all users

spare mirage
#

pgamerx

restive pebble
#

and use for loop

delicate shore
#

spam @green kestrel

#

pgamerx
@spare mirage ys

spare mirage
#

do u have an args command?

restive pebble
#

dont help who is restless

delicate shore
#

what

#

args

#

yes

restive pebble
#

like spamming

delicate shore
#

i have defined args

#

but what u mean by args command?

spare mirage
#

uhh

#

nvm

#

do u have args

restive pebble
#

split message and splice

spare mirage
#
 const args = message.content.slice(PREFIX.length).split(/ +/);```
#

discord is weird

restive pebble
#

why split like that

#

u can split like anything

spare mirage
#

yes

#

thats what I use

restive pebble
#

.split(":")

delicate shore
#

I HAVE THAT

plucky harness
#

how to auto update guilds in bots status

restive pebble
#

anything lol

delicate shore
#

BUT

#

JUSTI

#

sorry for caps

#

lol

restive pebble
#

client.guilds.cache.size

delicate shore
#

by mistake

#

there is an error happening

plucky harness
#

?

delicate shore
#

it keeps on saying unexpected token

restive pebble
#

discord.js?

plucky harness
#

py

#

u asking me?

delicate shore
#

js

restive pebble
#

it keeps on saying unexpected token
@delicate shore u are missing a bracket

plucky harness
#

confusion

restive pebble
#

or something

delicate shore
#

no

restive pebble
#

yes

spare mirage
#

give whole code

delicate shore
#

it says extra bracket

restive pebble
#

so just fix lol

delicate shore
#

  if(command === "unban"){
   
    let bUser = bans.find(b => b.user.id == userID)
    let userID = args[0]
      message.guild.fetchBans().then(bans=> {
      if(bans.size == 0) return 
      let bUser = bans.find(b => b.user.id == userID)
      if(!bUser) return
      message.guild.members.unban(bUser.user)
    
  } }

    ```
spare mirage
#

yes

#

u need 2nd one

delicate shore
#

this is code i use

#

but then it says unexpected token }

spare mirage
#

1 tip: command handler

restive pebble
#

@plucky harness i suggest u to take help from discord.py official server

delicate shore
#

idk how to

restive pebble
#

since no python guy is here right now

delicate shore
spare mirage
#

give whole code from the 'message', message => stuff

#

bot.on('message', message =>{

restive pebble
#

})

delicate shore
#

what

#

then i have to chage

restive pebble
#

in the line that red dot

delicate shore
#

whole

#

cod

restive pebble
#

u are missing )

spare mirage
#

and ;

restive pebble
#

where the red dot

#

; is not required lol

delicate shore
#

not working

restive pebble
#

unless spliting

delicate shore
#

still

spare mirage
#

Pgamerx cmon

#

an command isnt that hard

restive pebble
#

the red dot

#

where shows

#

remove all brackets

delicate shore
#

command ? you mea command handler

restive pebble
#

above that line ) add

spare mirage
#

both

#

xD

delicate shore
#

ok

#

so

#

I AM sending my command here

#
if(command === "unban"){
   
    let bUser = bans.find(b => b.user.id == userID)
    let userID = args[0]
      message.guild.fetchBans().then(bans=> {
      if(bans.size == 0) return 
      let bUser = bans.find(b => b.user.id == userID)
      if(!bUser) return
      message.guild.members.unban(bUser.user)
    
      }
                                     )

                                     }
    
spare mirage
#
if(!message.member.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, You do not have perms to unban someone`)
    }
    
    if(!message.guild.me.hasPermission("BAN_MEMBERS")) {
      return message.channel.send(`**${message.author.username}**, I do not have perms to unban someone`)
    }
    
    let userID = args[0]
      message.guild.fetchBans().then(bans=> {
      if(bans.size == 0) return 
      let bUser = bans.find(b => b.user.id == userID)
      if(!bUser) return
      message.guild.members.unban(bUser.user)
})```
delicate shore
#

onvm

#

it

#

says ban

#

is not defined

#

@spare mirage

restive pebble
#

is correct

#

ur code

spare mirage
#

whos code

delicate shore
#

bans

spare mirage
#

breh

#

glitch fkn sucks

delicate shore
#

why

restive pebble
#

bruh

delicate shore
#

what's the error now

restive pebble
#

u cannot use bans before defining it

delicate shore
#

oh

#

and how do i define

#

ban?

restive pebble
#

and dont expect someone will rewrite code for u

delicate shore
#

i never did

#

@restive pebble

spare mirage
#

:3

restive pebble
#

I AM sending my command here
@PGamerX#7350

delicate shore
#

but

#

ah

#

i figured it outh

#

how to define bans

#

?

restive pebble
#

message.guild.fetchBans

delicate shore
#

ojo

restive pebble
#

get bans from here

#

and justii sent the code

spare mirage
#

let userID = args[0]
message.guild.fetchBans().then(bans=> {
if(bans.size == 0) return
let bUser = bans.find(b => b.user.id == userID)
if(!bUser) return
message.guild.members.unban(bUser.user).then(message.channel.send(embed))

restive pebble
#

remove the buser line

#

pgamerx

delicate shore
#

whic

restive pebble
#

where it says ban is not defiΓ±ed

delicate shore
#

ok

restive pebble
#

let userID = args[0]
message.guild.fetchBans().then(bans=> {
if(bans.size == 0) return
let bUser = bans.find(b => b.user.id == userID)
if(!bUser) return
message.guild.members.unban(bUser.user).then(message.channel.send(embed))
@spare mirage

#

use this

#

dont directly copy lol

delicate shore
#

wym

spare mirage
#

πŸ€¦β€β™‚οΈ

#

Dont copy it

#

copy paste

delicate shore
#

not working

#

no error

#

no logs

#

bye

slender thistle
#

Could you not spam like that

delicate shore
#

sorry

spare mirage
#

u have to use the userID

#

to unban

#

@delicate shore

delicate shore
#

yes

#

ik

spare mirage
#

code

#

?

delicate shore
#
if(command === "unban"){
    if(!msg.member.hasPermission("BAN_MEMBERS")) {
      return msg.channel.send(`**${msg.author.username}**, You do not have perms to unban someone`)
    }
    
    if(!msg.guild.me.hasPermission("BAN_MEMBERS")) {
      return msg.channel.send(`**${msg.author.username}**, I do not have perms to unban someone`)
    }
    
    let userID = args[0]
      msg.guild.fetchBans().then(bans=> {
      if(bans.size == 0) return 
      let bUser = bans.find(b => b.user.id == userID)
      if(!bUser) return
      msg.guild.members.unban(bUser.user)
})
    
  ;}```
spare mirage
#

;} wtf is this

delicate shore
#

ok

#

so

#

idk

spare mirage
#

log args and show me what it says

delicate shore
#

lol

#

ok

#

and it's not that imp

#

this is imp that why this command is not wokring

spare mirage
#

JUST LOG ARGS

delicate shore
#
if(command === "mute"){
    let reason = args.slice(1).join(' ');
  let user = msg.mentions.users.first();
   let muteRole = client.guilds.cache.get(msg.guild.id).roles.cache.find('name', 'muted');
    
    if(!msg.member.hasPermission("MANAGE_ROLES"))
      return msg.reply("You need manage roles perms to do this brvh");
    
 

  if (!muteRole) return msg.reply('I cannot find a mute role. Make sure its named as Muted').catch(console.error);
  
  if (msg.mentions.users.size < 1) return msg.reply('You must mention someone to mute them.').catch(console.error);
  const embed = new Discord.MessageEmbed()
    .setColor(0x00AE86)
    .setTimestamp()
    .addField('Action:', 'Un/Mute')
    .addField('User:', `${user.username}#${user.discriminator} (${user.id})`)
    .addField('Modrator:', `${msg.author.username}#${msg.author.discriminator}`)
    .addField('Reason', reason);

  if (!msg.guild.member(client.user).hasPermission('MANAGE_ROLES_OR_PERMISSIONS')) return msg.reply('I do not have the correct permissions.').catch(console.error);

  if (msg.guild.member(user).roles.has(muteRole.id)) {
    return msg.reply("User already has muted role , Brvh")
  } else {
    msg.guild.member(user).addRole(muteRole).then(() => {
      msg.channel.send(embed).catch(console.error);
    });
  }```
#

i am logging arga

#

but this is my mute command

#

and logs say cannot read property roles

#

of undefined

spare mirage
#

idk about mute

delicate shore
#

ok

spare mirage
#

πŸ€¦β€β™‚οΈ Just log args

delicate shore
#

i am

spare mirage
#

and execute the command

delicate shore
#

oj

#

@spare mirage [ 's!unban', '@toxic bramble' ]

#

rhis is what it logs

#

i randomly pinged anyone for test

spare mirage
#

u need to ban someone

#

and unban them

#

try*

delicate shore
#

ok

#

i have 7 bans

#

lemme unba

#

[ 's!unban', '646247715214458890' ]

#

this is what it logs

#

and it's not unbanning

spare mirage
#

whats the heck is ur args var

delicate shore
#

??
???

spare mirage
#

reeeeeeeee

#

change args[1]

#

to that

#

^

delicate shore
#

et argsx = msg.content.slice(PREFIX.length).split(" ");

#

ok

spare mirage
#

whats ur prefix const or let or var

delicate shore
#

s!

#

my prefix

indigo folio
#

shouldn't matter as long as it is defined in the correct area

spare mirage
#

yes

#

but is ur

#

const prefix = blabla

#

or const PREFIX

delicate shore
#

env

#

PREFIX

#

is my const

spare mirage
#

let userID = args[1]

#

do this

#

instead of let userID = args[0]

delicate shore
#

poko

spare mirage
#

and make an command handler

#

lol

delicate shore
#

@spare mirage worked

#

thnx

spare mirage
#

:3

delicate shore
#

u are very good

#

my sheep likes u

indigo folio
#

justii correct me if i was wrong but were u the one crying about how hard command handlers were less than 24 hours ago

spare mirage
#

yes I was

#

now it work

#

s

delicate shore
#

oh

spare mirage
#

and its great

#

so make one

delicate shore
#

i treid them 100 times

#

but i couldn't

#

so i gave up

#

😦

indigo folio
#

its aight man everyone starts somewhere

delicate shore
#

yeah

spare mirage
#

never give up ~Justii

delicate shore
#

ok

crystal socket
#

I wrote this sometime ago and i think it looks pretty nice. i think every bot should have one

delicate shore
#

@spare mirage my bot won't reply if we enter invalid user

spare mirage
#

to what

delicate shore
#

unban

#

command

earnest phoenix
#

use try catch ?

spare mirage
#

^

restive pebble
#

@delicate shore match user and if no user found return

delicate shore
#

o

restive pebble
#

how are u finding user tho

delicate shore
#

args[1]

earnest phoenix
#

if (!client.users.has(args[1])) return; ///...

delicate shore
#

ok

#

how to change perms

#

like of command is run

#

s!lock

#

it changes perms for everyone to not send message

#

in that channel

restive pebble
#

lock channel?

#

overwrite perms

delicate shore
#

yes

#

yes

restive pebble
#

and since many users has a space in their name that thing fails

#

if (!client.users.has(args[1])) return; ///...

#

args.join

delicate shore
#

ni

#

no

#

i need id o ly @restive pebble

#

only

#

for unbanning

restive pebble
#

hmmm

#

..find()

delicate shore
#

what is command for override perms

restive pebble
#

Β―\_(ツ)_/Β―

fresh hatch
#
if(isValidCommnad(message, "addrole")) {
        let args = message.content.toLowerCase().substring(9)
        let { cache } = message.guild.roles;
        console.log(cache)
        let role = cache.find(role => role.name.toLowerCase() === args)
        if (role) {
            if(message.member.roles.cache.has(role.id)) {
                message.reply("You already have this role!")
                return;
            } 
            if(role.permissions.has("ADMINISTRATOR") || role.permissions.has("KICK_MEMBERS")) {
                
            } else {
                message.reply("Role not found!");
            }
             
    }
});
#

Can somebody help me what's the error here? At the last ) it says Declaration or statement expected

restive pebble
#

ok wait

#

ur missing brackets

spare mirage
#

^^^ ^^

earnest phoenix
#

how do i get a channel by id and send a message there in js v12? i only know how to do it in v11 crying

spare mirage
#

docs

restive pebble
#

guild.cache.get()

delicate shore
#

how to change perms for a channel

restive pebble
#

handle like map

delicate shore
#

for everyone

restive pebble
#

docs lol

#

and idk

delicate shore
#

ok

fresh hatch
#

where do i miss?

#

can i you tell me the line?

indigo folio
#

i don't think ur missing brackets

#

or any that i could see

#

but what is the ); at the end for?

restive pebble
#

oh lol i read that twice

spare mirage
#

check the error :

indigo folio
#

the last line is });

#

it should just be }

#

its not closing a function or anything

earnest phoenix
#

@delicate shore channel.overwritePermissions

delicate shore
#

ok

fresh hatch
delicate shore
#

channel.overwritePermissions then?

restive pebble
#

lol

delicate shore
#

how to select which role and which perm

earnest phoenix
#

wait

#

channel.overwritePermissions([
{
id: guild.id,
deny: ['VIEW_CHANNEL'],
},

#

]);

#

smth like that idk

indigo folio
#

idk what all you have going on in that whole script since u only sent that one portion @fresh hatch

delicate shore
#

waht

restive pebble
#

}}

indigo folio
#

so add another } i guess

restive pebble
#

yea

#

vsc says so

fresh hatch
#
    //Add role command
    if(isValidCommnad(message, "addrole")) {
        let args = message.content.toLowerCase().substring(9)
        let { cache } = message.guild.roles;
        console.log(cache)
        let role = cache.find(role => role.name.toLowerCase() === args)
        if (role) {
            if(message.member.roles.cache.has(role.id)) {
                message.reply("You already have this role!")
                return;
            } 
            if(role.permissions.has("ADMINISTRATOR") || role.permissions.has("KICK_MEMBERS")) {

            } else {
                message.reply("Role not found!");
            }
             
    }
}
earnest phoenix
#

how to hosting discord bot

indigo folio
#

thats still just the one portion

restive pebble
#

add another }

earnest phoenix
#

i poor

fresh hatch
#

@indigo folio i tried another } and didn't work

#

still gets error

earnest phoenix
#

:''

#
    {
        id: ,
        deny: ['VIEW_CHANNEL'],
    },
]);
fresh hatch
#

}}) worked

restive pebble
#

lol

indigo folio
#

yeah i didn't see the client.on part

#

like i said 2 times

restive pebble
#

it means it is inside a event listener

#

lmao

#

send full codes lol

spare mirage
#

@earnest phoenix youtube exists

earnest phoenix
#

how to hosting discord bot
@earnest phoenix pls help me :'v i poor people

restive pebble
#

node

earnest phoenix
#

hmmmm

indigo folio
#

@earnest phoenix if u dont wanna pay for hosting you can just run the bot on your own personal machine or use like heroku or glitch or whatever the cool kids use

spare mirage
#

node and js

#

npm i discord.js

earnest phoenix
#

i use node

restive pebble
#

choose ur library

earnest phoenix
#

i have wooden pc :'v

restive pebble
earnest phoenix
#

hmmmm

indigo folio
#

use heroku or glitch then

earnest phoenix
#

okey thx

spare mirage
#

U dont even need a "good"pc

#

to host a bot

#

I fkn host mine from an intel core i3 4th gen laptop

restive pebble
#

discord.js caches everything which makes it slower for large bots so u need a good pc at that time

spare mirage
#

still works for me x

#

D

indigo folio
#

small bot

spare mirage
#

and its not that slow

restive pebble
#

yes

spare mirage
#

its small

#

for now

#

Imma buy vps soon

indigo folio
#

so you'll feel the pain eventually

earnest phoenix
#

I fkn host mine from an intel core i3 4th gen laptop
@spare mirage :'' okey

indigo folio
#

i leech off my friend and pay $0/month for VPS

#

its pretty sick

#

windows server 2016

spare mirage
#

:/

delicate shore
#

channel.overwritePermissions([
{
id: guild.id,
deny: ['VIEW_CHANNEL'],
},
@earnest phoenix guild id ? but i wanna change for a speicfic role

#

specific role

earnest phoenix
#

oop

#

thought you mean channel perms

delicate shore
#

yeah

#

channel perms

#

@everyone : Send messages = denied

#

i want this

earnest phoenix
#

but only for a specific channel?

delicate shore
#

yes

#

specififc channel

amber gorge
#

Hi

delicate shore
#

in which command is run

#

hello

amber gorge
#

what are you talking about?

delicate shore
#

?

earnest phoenix
delicate shore
#

like u say s!lockdown
so bot will override perms in channel

earnest phoenix
#

shouldn't be that hard

delicate shore
#

and don't allow everyonr rot ype

#

but i am not getting i t

#

@earnest phoenix so .

earnest phoenix
#

i'll try something out

delicate shore
#

ok thnx

wheat hornet
delicate shore
#

boeing can u belp?

restive pebble
#

send the screenshot of ./models/usertimes.js lol

delicate shore
#

help*

restive pebble
#

what thing

delicate shore
#

the lockdown

wheat hornet
delicate shore
restive pebble
#

that thing is not a function

wheat hornet
#

than what is?

restive pebble
#

@delicate shore i already told u i cant help in such things

#

go to discord.js server

#

i never did that

delicate shore
#

ok

restive pebble
#

@wheat hornet can u send screenshot of ./models/useritems.js

wheat hornet
#

ok

pure saddle
restive pebble
#

lol

#

nice

pure saddle
#

-botinfo 714818987539562519

gilded plankBOT
#
Bot info
ID

714818987539562519

Username

Lyear

Discriminator

9124

Short Description

TΓΌrk yapΔ±mΔ± discord botu LYEAR, moderasyon ve eglence komutlarΔ± ile sizinle.

Library

discord.js

Prefix

'L+' or 'l+'

Total Upvotes

1

Monthly Upvotes

0

Server Count

No server count

Owner(s)

@pure saddle

restive pebble
#

hmmm

wheat hornet
restive pebble
#

module.exports.belongTo = ()=>{}

cinder patio
#

I'm pretty sure you have to do Sequelize.import("path to the model"); so you can work with the actual Model object

#

And not a function which represents it

wheat hornet
#

sequelize.import is depriciated now

restive pebble
#

u didnt defined the function name

#

module.exports.belongTo = ()=>{}
@Boeing#6104

delicate shore
keen willow
#

@winter basalt are you having fun?

cinder patio
#

it is? Well I haven't worked with Sequelize in quite a wihile

wheat hornet
#

@restive pebble thx it help

restive pebble
#

yea lol u didnt defined the name

cinder patio
#

That doesn't fix anything, you are just calling a function that doesn't do anything now

wheat hornet
restive pebble
#

does anyone knows some good equalizer for windows 10?

wheat hornet
#

@cinder patio

#

see

restive pebble
#

hmmm

delicate shore
#

ok

#

so

#

i ran s!help

earnest phoenix
#

@delicate shore i dont think i'll sucess

delicate shore
#

and

restive pebble
#

first thing ur bot is not here ig

delicate shore
#

These all are bots DMS

earnest phoenix
#

lol

delicate shore
#

how many bots have prefix s!?

#

like

restive pebble
#

enjoy lol

delicate shore
#

brvh

restive pebble
#

its good that common prefix bots cant see channels

#

or imagine

earnest phoenix
#

C! Is for two bots here

#

Mine and another one

spare mirage
#

C!

#

c!

#

c!help

earnest phoenix
spare mirage
#

I got 5 pings

#

lmaooo

restive pebble
#

bruh

delicate shore
#

i dare u to open your dms and do s!help in #commands

restive pebble
#

7 bots then

wheat hornet
#

i am getting this error now: sequelize.define is not a function

#

@restive pebble

earnest phoenix
#

.

#

is mongodb good for python

spare mirage
#

@wheat hornet boeing muted

wheat hornet
#

why?

spare mirage
wheat hornet
#

fuck

#

so whos gona help me?

spare mirage
#

internet

wheat hornet
#

not helping at all

#

i came when i gave up on net

calm saddle
#

;-; need help

still merlin
#

Be patient

spare mirage
#

and read the docs

calm saddle
#

im tryna get my bot to fetch info about a banned user

digital ibex
#

what language?

calm saddle
#

d.js

spare mirage
#

message.guild.fetchBans()

calm saddle
#

ik but one specific member

spare mirage
#

I think u have to grab the userID

digital ibex
#

im having a bit of a security issue with something.. when I do mywebsite.com/users/userID it logs u right in without having to put ur password and stuff in. any ideas how I can fix this? I'm looking at express-session, and thats kind of confusing me.

calm saddle
#
 const List = await message.guild.fetchBans();
 const User = List.find(user => user.id === 'ID');
#

this not working

digital ibex
#

no

#

because thats not even how u do it.

calm saddle
#

yess i realized

#

;-;

spare mirage
#

; - ;

calm saddle
#

fetchBan()?

spare mirage
#

s

digital ibex
#

no

#

it literally says

spare mirage
#

message.guild.fetchBans()

digital ibex
#

still not helping justii, its a promise which returns a collection

calm saddle
#

oh yea

#

kk

#

i got it

#

all i needed was a glass of water and another good look at the docs

#

thnx

spare mirage
#

all i needed was a glass of water and another good look at the docs
@calm saddle thats all u need for an awnser to some questions

#

lol

calm saddle
#

H2O

#

xDD

robust arrow
#

in djs12, is there a way to compare 2 random math calculations to know which one is greater or if they are equal

quartz kindle
#

yes, just a gazillion ways probably

#

you want to get the biggest number out of 2 numbers?

#

or what do you want to do with them?

robust arrow
#

to know which one is greater

#

or basically a "rollbet" game

quartz kindle
#

for example Math.max(10,20) will return 20

robust arrow
#

ok

#

I'm just tired rn

still merlin
#

Is there a way in discord.js I can check if a message contains a word from a .txt file and deleted it if its the same

#

I'd just asume it would be message.content(${file.txt}) message.delete

odd radish
#

how can I make the profile picture on top.gg round?

spare mirage
#

@robust arrow make to vars
if (var1 > var2) {}

#

else if (var1 < var2) {}

robust arrow
#

ok

wide sage
#

i need help with something very basic

graceful dock
#

use const in your case

wide sage
#
      let splitCommand = fullCommand.split(" ");
      let primaryCommand = splitCommand[0];
      let arguments = splitCommand.slice(1);``` here arguments hold the single string value after the command.. like when i type !yt Leo Messi, it holds the value of only Leo and ignores Messi, what do i do make it hold both the values?
graceful dock
#

why using var if youre not going to modify it

pale vessel
#

i have no vars at all in my code, just let and const

graceful dock
#

using var for everything is stoopid

spare mirage
#

@graceful dock const and let are vars too

graceful dock
#

const are not variable

spare mirage
#

sort of

graceful dock
#

Constant is a constant

#

And a var

#

Is

#

Variable

wheat hornet
quartz kindle
#

@wide sage arguments contains the entire array minus the first item, if messi is being deleted, then the problem is elsewhere, that code looks correct

spare mirage
#

πŸ‘ Const πŸ‘ isπŸ‘ aπŸ‘ varπŸ‘ uπŸ‘ cantπŸ‘ changeπŸ‘

graceful dock
#

? Bruh

#

what the point of having const and let on js then ? πŸ€¦β€β™‚οΈ

quartz kindle
#

let and const didnt exist a few years ago

#

so its normal to call everything variables

wheat hornet
#

anyone gona help me

graceful dock
#

yes but a few years ago is not the present

spare mirage
#

and it would still work

using var for everything is stoopid
@graceful dock

graceful dock
#

why using var if you can use const lol?

#

If youre not modying it

spare mirage
#

why use const if u can use a var lol?

pale vessel
#

WTF

quartz kindle
#

they are still called variables regardless, because the word variable is what all programming languages use, independent of functionality

graceful dock
#

ok im loosing brain cells

quartz kindle
#

even js websites and information pages call them variables

#

for example Variables defined with const behave like let variables, except they cannot be reassigned:
and The let statement declares a block-scoped local variable

graceful dock
#

const are more safe than var in some contexts

#

And that why const exist

spare mirage
#

explain

#

Give me a situation

graceful dock
spare mirage
#

its an error

pale vessel
graceful dock
#

its because i hacked google

pale vessel
#

this is the same concept that i use

#

i never use vars

spare mirage
#

show me your whole code

#

and ill find a varf

#

lmoa

pale vessel
#

wait

graceful dock
#

big brain

cinder patio
#

Using const & let is way more readable as well

quartz kindle
#

@wheat hornet show how you use that function

spare mirage
#

I bet u have some problems if u cant read
V A R

graceful dock
#

Yes but for the js kids, var are 》》》

pale vessel
#

never mind, too much files

quartz kindle
#

i use let everywhere because its shorter than const

spare mirage
#

not the same

cinder patio
#

By readable I mean you know that a variable can't change.

pale vessel
#

var is just old

spare mirage
#

ur old

#

iight im out

graceful dock
#

scuse us js kid

lusty quest
#

var is only there to keep compability with older scripts

graceful dock
#

js modern generation

spare mirage
#

they could just delete var if it was useless

graceful dock
#

Var is useful in some contexts just like const and let

quartz kindle
#

var still has its uses, for example, makes conditional assignment easier inside functions

spare mirage
#

:3

cinder patio
#

No, that would break thousands of old unmaintained scripts

spare mirage
#

ok byee

#

lol

quartz kindle
#

it would break internet explorer :^)

spare mirage
#

im out

#

it would break internet explorer :^)
no one would care

graceful dock
#

bye roblox kid

spare mirage
#

lmao

#

I love roblox

#

Fun to make exploits

#

bye

graceful dock
#

please uninstall roblox

#

Roblox is T R A S H ☠️

earnest phoenix
#

bro

#

agree

worthy magnet
#

Hey i have a problem... Can someone help me?
(JavaScript)
Code: ```js
let data = ops.active.get(message.guild.id) || {};

ERROR:
```json
TypeError: Cannot read property 'active' of undefined      
at Object.module.exports.run (/root/BOTs /Lorion/commands/play.js:31:18)     
at runMicrotasks (<anonymous>)                                    at processTicksAndRejections (internal/process/task_queues.js:97:5) 
tight plinth
#

define ops

weary anchor
#

I don't have a single var for @earnest phoenix lol

worthy magnet
#

I already have that. That is not the problem

weary anchor
#

I think this channel is English only

worthy magnet
#

Sry Google Translate xD

weary anchor
#

according to the error, that is the problem

#

show us how you define ops

worthy magnet
#
module.exports.run = async (bot, message, args, ops) =>{

That's the way it should be, right?

weary anchor
#

depends on your command handler. does your command handler pass ops after args?

worthy magnet
#

Actually already.

#

I swapped args and ops. Now the mistake is coming

TypeError: Cannot read property '0' of undefined                                                                                                         
at Object.module.exports.run (/root/BOTs /Lorion/commands/play.js:20:11)                                                                             
at module.exports (/root/BOTs /Lorion/events/message.js:28:9)                                                                                        
at Client.emit (events.js:310:20)                                                                                                                    
at MessageCreateHandler.handle (/root/BOTs /Lorion/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)              
at WebSocketPacketManager.handle (/root/BOTs /Lorion/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)          
at WebSocketConnection.onPacket (/root/BOTs /Lorion/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)                      
at WebSocketConnection.onMessage (/root/BOTs /Lorion/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)                     
at WebSocket.onMessage (/root/BOTs /Lorion/node_modules/ws/lib/event-target.js:120:16)                                                               
at WebSocket.emit (events.js:310:20)                                                                                                                 
at Receiver.receiverOnMessage (/root/BOTs /Lorion/node_modules/ws/lib/websocket.js:789:20) 
#

The message event?

tight plinth
#

do you even know what you are doing?

worthy magnet
#

Nah xD

tight plinth
#

lol

worthy magnet
#

Not always xD

tight plinth
#

if you dont know what the fuck you are doing, learn js and discord.js before doing bots

#

an music is very hard to do

robust arrow
#

ty justii it works now

worthy magnet
#

I can do JavaScript, but I haven't had school for 5 months and I'm slowly getting more Brain AFK

livid rivet
#

...

earnest phoenix
#

How do I get the Bot as a Member instance for a Guild

tight plinth
earnest phoenix
#

ty

spare mirage
#

please uninstall roblox
@graceful dock nah

#

Why would I

#

if roblox is bad

#

discord is bad

#

20% of discords population plays roblox

earnest phoenix
#

ok and

#

dont be a sheep

#

uninstall

delicate shore
#

bruh @restive pebble

#

muted

spare mirage
#
if(!message.member.hasPermission("DELETE_MESSAGES")) {
  return message.channel.send(`**${message.author.username}**, You do not have perms to do this`)
}

if(!message.guild.me.hasPermission("DELETE_MESSAGES")) {
  return message.channel.send(`**${message.author.username}**, I do not have perms to do this`)
}

low phoenix
#

How can i make a play command with youtube links?

spare mirage
#

why is this not working?

#

ytdl

#

@low phoenix

low phoenix
#

And how can i make the command?

spare mirage
#

Β―_(ツ)_/Β―

cinder patio
#

how is that not working?

earnest phoenix
#

@spare mirage v12?

cinder patio
#

any errors?

blazing ravine
cobalt spruce
spare mirage
#

yes

blazing ravine
cobalt spruce
earnest phoenix
#

avatarURL

blazing ravine
#

who can help me

spare mirage
#

@earnest phoenix

earnest phoenix
#

@spare mirage not hasPermission its should be permissions.has

spare mirage
#

Really?

earnest phoenix
#

yes

spare mirage
#

in v12?

cobalt spruce
#

@earnest phoenix i should use avatarurl?

earnest phoenix
#

yeah?

spare mirage
#

u sure

earnest phoenix
#

TRY

spare mirage
#

okok

earnest phoenix
#

@cobalt spruce yeah avatarURL

blazing ravine
cobalt spruce
#

@earnest phoenix it wont work

blazing ravine
#

who can help me pls

earnest phoenix
#

@cobalt spruce v12?

cobalt spruce
#

@earnest phoenix yes

#

@restive pebble fixed it user.displayAvatarURL({dynamic:true})

earnest phoenix
#

avatarURL()

spare mirage
#
RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.
    at Function.resolve (F:\Users\Edwin\Desktop\Banana\node_modules\discord.js\src\util\BitField.js:150:11)
    at Permissions.has (F:\Users\Edwin\Desktop\Banana\node_modules\discord.js\src\util\BitField.js:45:28)
    at Permissions.has (F:\Users\Edwin\Desktop\Banana\node_modules\discord.js\src\util\Permissions.js:45:85)
    at Object.execute (F:\Users\Edwin\Desktop\Banana\commands\purge.js:9:32)
    at Client.<anonymous> (F:\Users\Edwin\Desktop\Banana\index.js:35:35)
    at Client.emit (events.js:314:20)
    at MessageCreateAction.handle (F:\Users\Edwin\Desktop\Banana\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (F:\Users\Edwin\Desktop\Banana\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (F:\Users\Edwin\Desktop\Banana\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
    at WebSocketShard.onPacket (F:\Users\Edwin\Desktop\Banana\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22) {
  [Symbol(code)]: 'BITFIELD_INVALID'
#

whats this

earnest phoenix
#

@blazing ravine Davetleri gΓΆremiyor galiba

blazing ravine
#

evt

#

ama return olmuyor

#

when invites undefinend not return

#

koda bakabilirmisin

pale vessel
#

it's MANAGE_MESSAGES

spare mirage
#

oh wait what

pale vessel
#

members that have manage messages can delete messages

spare mirage
#

okok

pale vessel
#

there's no such thing as delete messages permission

spare mirage
#

ok didnt know lol

pale vessel
spare mirage
#

:3 thanks!

pure lion
#

How do i make a map of fetched messages contents and author's?

pale vessel
#

collection#map()

pure lion
#

Ik

#

But I'm not sure how to map them together

pale vessel
#

well, map them by content and author, that simple

#

wait

pure lion
#

πŸ‘οΈ

pale vessel
#

messages.map(message => message.content)

#

something like that but with authors too

pure lion
#

Yeah got that already

pale vessel
#

so what's the problem

pure lion
#

How me do author too?

slender thistle
#

message.author

quartz kindle
#

you want an array of {content:content,author:author} ?

pure lion
#

Yeah

pale vessel
#

messages.map(message => { return { content: message.content, author: ...message.author }; })

#

not sure

#

this is probably wrong

pure lion
#

I'll probably figure it out

quartz kindle
#

.map(msg => ({content:msg.content,author:msg.author}))

pale vessel
#

OH

#

THANK YOU

#

i didn't know you didn't need those function

pure lion
#

Thanks Tim :D

#

I should have tried curlies in the first place lol

kind sedge
#

I need help

flat pelican
#

@earnest phoenix Keep this channel english only, this isn't the first time

earnest phoenix
#

@flat pelican Ok,sorry.

pure lion
#

They're all undefined hahahahahahahahahahahahahahaghahahahaha

fleet warren
#

-help

cobalt spruce
#

why it add y?

#

@pure lion

#

help

slender thistle
#

Probably because "//say" is 5 characters long and you try to get a substring starting from 4th character

cobalt spruce
#

ok

#

lt me see

blazing ravine
#

can some1 help me

pure lion
#

Yo this is pretty funny

#

If you look at the second image and read the text on the first line

blazing ravine
#

look i try t oreturn

#

the udnefined but not work

pure lion
#

You will see words, and the order these words in is called and error

#

If you read them you might find out what's wrong

blazing ravine
#

cant find inviter

pure lion
#

:galaxybrain:

blazing ravine
#

i know but

#

cant return

#

the undefined

pure lion
#

@blazing ravine you're defining inviter in itself?

blazing ravine
#

wdym

#
 bot.on("guildMemberAdd", async member => {
    

    
    let wChan = db.fetch(`${member.guild.id}`);

    if (wChan == null) return;

    if (!wChan) return;
    
    member.guild.fetchInvites().then(guildInvites => {

    const ei = invites[member.guild.id];

    invites[member.guild.id] = guildInvites;

    const invite = guildInvites.find(i => ei.get(i.code).uses < i.uses);


    const inviter = bot.users.cache.get(invite.inviter.id);
      if(invite.uses == undefined) return member.guild.channels.cache
      .get(wChan)
      .send(
        "πŸ“₯I can't find who Invited " + `${member.user}`
      );
      
               if(inviter === undefined) return member.guild.channels.cache
      .get(wChan)
      .send(
        "πŸ“₯I can't find who Invited " + `${member.user}`
      );

    member.guild.channels.cache
      .get(wChan)
      .send("πŸ“₯" + `${member.user}` + " joined; Invited by " + `${inviter.tag}` + ". Invite code[**" + `${invite.code}` + "**] (**" + `${invite.uses}` + "** Invites).πŸ“Œ");
  });
#

check the code '/

#

idk how t ofix

#

when i return the udnefined not work

quartz kindle
#

if invites[member.guild.id] doesnt exist, ei becomes undefined
after you add guildInvites to invites[member.guild.id], ei is still undefined

pure lion
#

Const inviter = .get(invite.inviter.id)

cobalt spruce
pure lion
#

Cache

cobalt spruce
#

oh

#

i forgot am in x12

#

v12*

pure lion
#

Eyyyy

#

hey so i wanna get messages in a channel then log them into a txt/json file but its writing them as [object Object]

      var CHmsgfetch = await msg.channel.messages.fetch()
      var ticketChnMsgs = (CHmsgfetch.map(m => ({author: m.author.tag, content: m.content})).reverse())
      fs.writeFile('ticket.json', ticketChnMsgs, (err) => {
        if (err) throw err;
      })
#
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
#

it logged to the console fine btw

quartz kindle
#

JSON.stringify()

#

also, no need for the extra () around CHmsgfetch

pure lion
#

oh ty

#

@quartz kindle if I wanted to join it with \n? (It's going back to objects)

quartz kindle
#

if you're saving in a json file, use JSON.stringify() with spacing options

pure lion
#

What about if I'm writing to a txt?

quartz kindle
pure lion
#

Oooooooo

quartz kindle
#

if you wanna add extra new lines, do it after stringifying

pure lion
#

Oh

#

Ok*

#

Thx again

earnest phoenix
#

how do i periodically send messages to a user with the ID 503948134439976972 (me)

#

i tried 503948134439976972.send(""); but it gives an errorrrrrrr

pure lion
#

You gotta search for it to be a user object

earnest phoenix
#

boeing answered me

#

he's a g0d

#

but he's muted

#

lol

#

umm its giving an error

if (db.get(`userBalance_718819301737627679.balance`) >= 50000) {
bot.users.cache.get(718819301737627679).send("Hi you got 50k coins? If yes spam DM code913");
} else {
db.add("userBalance_718819301737627679.balance",50000);
bot.users.cache.get(718819301737627679).send("Hi you got 50k coins? If yes spam DM code913")
}```

i was giving coins to someone for winning a giveaway
#

bot.users.cache.get(718819301737627679).send("Hi you got 50k coins? If yes spam DM code913")
^
TypeError: Cannot read property 'get' of undefined

cinder patio
#

That will give coins only to the user with ID 718819301737627679. Also IDs are too big to be numbers so they have to be strings "718819301737627679"

#

Console log bot because it's likely not a Client instance

earnest phoenix
#

so

#

bot is a client instance

#

const bot = new Discord.Client();

cinder patio
#

Are you using discord.js version 12?

earnest phoenix
#

no

#

11

cinder patio
#

Then there's no .cache

#

It's just bot.users.get

earnest phoenix
#

oh

#

thx mate

spare mirage
#

update to v12

earnest phoenix
#

Alright, I am using basic HTML Coding on Top.gg, When I paste it in there, It is just letters, Can someone explain that please?

#

use markdown

spare mirage
#

show me

earnest phoenix
spare mirage
#

printscreen

earnest phoenix
#

Code^

#

aa you gave me a virus

spare mirage
#

lol

earnest phoenix
#

i will eat you

hasty sparrow
#

Pretty sure JS isn't allowed

spare mirage
#

book banning

earnest phoenix
#

lol

#

?

spare mirage
#

only OG minecraft players remember

earnest phoenix
#

@earnest phoenix you're literally using CSS in formatting text on top.gg

#

Yes..

#

and?

#

so you're basically putting a web page ina web page

#

that's illegal

#

wot?

hasty sparrow
#

No it's not

earnest phoenix
#

<insert meme here>

spare mirage
#

xD

earnest phoenix
#

lmao

#

im saying whatever

#

i din't get half the file

#

but pretty sure top.gg only supports normal colored, bold, italics and other stuff text

#

use markdown

hasty sparrow
#

@earnest phoenix What does the preview show?

cinder patio
#

nah top.gg supports css and html

earnest phoenix
#

aaa now my pc has 3kb less of space you maniac why did you send the file to me!

#

@hasty sparrow

hasty sparrow
#

Remove html, head, body and script tags

earnest phoenix
#

that's what you want to do right

#

so much cringe at wesbites that use captchas other than recaptcha

#

@hasty sparrow

hasty sparrow
#

Remove all the JS

earnest phoenix
#

??

#

JS?

hasty sparrow
#

JavaScript?

earnest phoenix
#

Still shows like that^

pure lion
#

uh

#

send the html shit

earnest phoenix
pure lion
#

hastebin please

earnest phoenix
#

I don't use that.

pure lion
#

well im not gonna download a file and open it just to help you

#

(:

earnest phoenix
pure lion
#

ty

earnest phoenix
#

|| I think thats it ||

pure lion
#

||o||||w||||o||

earnest phoenix
#

Shouldn't that be good?

pure lion
#

i dont know jack about html but where are the script tags around the function at the bottom?

earnest phoenix
#

@hasty sparrow Said remove them

hasty sparrow
#

Removed, as I'm pretty sure top.gg doesn't allow JS

earnest phoenix
cinder patio
#

Remove all of the javascript

pure lion
#

^

earnest phoenix
#

It's all java

hasty sparrow
#

Haha, no

cinder patio
#

It acts as text if it's not in a script tag, and top.gg doesn't allow JS

pure lion
#

java == java
javascript != java

#

@earnest phoenix put in head ^

hasty sparrow
#

** java == java

pure lion
#

o shit ye

earnest phoenix
#

???

#

????

#

Still

hasty sparrow
#

Remove everything after function openPage, including the aforementioned

earnest phoenix
#

Like it was before.

#

Didn't work.

restive pebble
#

ah mute over lol

earnest phoenix
#

lol

pure lion
#

sirpandatelevision (lol how did you get a knighthood) the site popularly known as 'top.gg' does not allow its users to utilize and take advantage of the scripting language known as 'javascript' (which has no relation to the language 'java'). reasons unclear (read the dOCS), but you must observe these rules. have a pleasant day

restive furnace
#

bruh * deleted his msg *

pure lion
#

lol

hasty sparrow
#

No need to be rude when others are trying to help you

pure lion
#

lets aeon snipe that

#

instant replay

earnest phoenix
#

ah mute over lol
@restive pebble GG

pure lion
#

top.

hasty sparrow
#

What what means?

earnest phoenix
#

you didn't provide a color

still merlin
#

the error is 'property value expected'

cinder patio
#

That's css and the ; is in red because the color is missing a value

still merlin
#

o

coarse hearth
#
const { MessageEmbed } = require('discord.js')

module.exports = {
    name: "b!ban",
    run : async (client, message, args) => {
        if (!message.member.hasPermission('BAN_MEMBERS')) return message.channel.send('you can’t ban people');
        const user = message.mentions.members.first() || message.guild.members.cache.get(args[0]);
        user.ban().then (() => {const embed = new MessageEmbed()
        .setColor('9000FF')
        .setTitle("User is Banned  :btvpurple: ")
        .setThumbnail(`${displayAvatarURL({ dynamic: true })}`)
        .setDescription(`\n\n${client.users.cache.get(member.user.id)}, has been banned`)
        .setFooter(`Brutal Bot at your service ![mad](https://cdn.discordapp.com/emojis/728656985511166064.webp?size=128 "mad")`,message.author.displayAvatarURL({ dynamic: true }))

        message.channel.send(embed);
        })

    }
   
}
earnest phoenix
#

?

coarse hearth
#

@earnest phoenix

earnest phoenix
#

what?

coarse hearth
#
: (node:4) UnhandledPromiseRejectionWarning: TypeError: user.user.displayAvatarURL(...) is not a function
earnest phoenix
#

v11?

coarse hearth
#

21

#

12

earnest phoenix
#

hmm, lemme see

#

anyone

#

help

#

@thorn owl ?

#

:))

pure lion
#

uh

#

reinstall discordjs-opus

#

or whatever its called

restive pebble
earnest phoenix
#

dude i dont use Music

#

why i need opus

#

smh

coarse hearth
#

lol

#

i use opus

earnest phoenix
#

wut

restive pebble
#

u installed prism media

#

lol

#

u installed prism media
@restive pebble

coarse hearth
#

and it brings problems

#

to heroku

delicate shore
#

error ^^^^^^^^

#

my code

#
if(command === "whois"){
     let member = msg.mentions.members.first() || msg.member,
  user = member.user;
    const joinDiscord = moment(user.createdAt).format('llll');
    const joinServer = moment(user.joinedAt).format('llll');
    let whois = new Discord.MessageEmbed()
        .setAuthor(user.username + '#' + user.discriminator, user.displayAvatarURL)
        .setDescription(`${user}`)
        .setColor(`RANDOM`)
        .setThumbnail(`${user.displayAvatarURL}`)
        .addField('Joined at:', `${moment.utc(user.joinedAt).format('dddd, MMMM Do YYYY, HH:mm:ss')}`, true)
        .addField('Status:', user.presence.status, true)
         .addField('Roles:', member.roles.map(r => `${r}`).join(' | '), true)
        .setFooter(`ID: ${user.id}`)
        .setTimestamp();

    msg.channel.send(whois);
    console.log();
    
  }```
still merlin
#

Can you- member.roles.map is not a function

#

what are you trying to do?

delicate shore
#

yes

#

who is commadn

#

it gives info

#

when he joined

#

his roles

#

etc

#

i found thsi tutorial on stackoverflow

still merlin
#

stop line spam please

plucky harness
#

-bash: ./ngrok: Permission denied on my vps

still merlin
#

read the docs

plucky harness
#

but on my pc it works

cobalt spruce
cinder patio
#

Likely because it's not in an async function

delicate shore
#
.setThumbnail(`${user.displayAvatarURL}`)```