#development

1 messages · Page 1024 of 1

winter basalt
#

no

#

apply anytime when you feel like your bot is ready

gusty oracle
#

I've applied already

#

2w 3d earlier

winter basalt
#

yeah it takes 2-4 weeks rn

#

be patient

gusty oracle
#

Ok so after it gets declined will it again take 2w?

#

Cuz I'm sure they decline most of them....

winter basalt
#

if you reapply yes

#

and they dont decline for no reason

#

soooo

gusty oracle
#

Ik ik

#

Obviously one can't keep track of all the requirements so like most of the bots won't meet them

opal plank
#

reposting cuz 2h+
say i have this object

let foo = {name: 'test', location:'somewhere'}```
Now i have a postgres jsonb table
its contains an array of objects inside like foo above.
To query filter it i can do ``filter->>'name'`` to find the proper row that its contained, however:
```js
//in the table
[{name:'bob', location:'bar'}, {a:1, b:2}, {n:1, m:4}]```
lets say i want to  replace  ``{a:1, b:2}`` obj in that table with the ``foo`` mentioned above(order doesnt matter)
the only non destructive way i see to get that would be using operator ``#-`` with the index of that object.
however im not seeing a way in SQL to get index of that object to define it to be deleted without destroying the array and checking individually
or returning the obj to js and then resending it after its been parsed on the code(instead of using SQL query)
any tips?
spare mirage
#
module.exports = {
    name: 'mute',
    description: "this is a mute command!",
    execute (bot, message, args){}``` 
I know this is a basic question but
how do I execute async here?
golden condor
#

async execute

spare mirage
#

oh lol

#

Thanks!

copper cradle
#

lmao

spare mirage
#

:3

copper cradle
#

I like your pfp

spare mirage
#

thanks

#
let muterole = guild.roles.cache.find(role => role.name === 'muted');```
 TypeError: Cannot read property 'roles' of undefined
copper cradle
#

guild isn't defined

#

where did you define guild

spare mirage
#

uhh

median star
#

hi

spare mirage
#
const Discord = require("discord.js");
const ms = require("ms");

module.exports = {
    name: 'mute',
    description: "this is a mute command!",
    async execute (bot, message, args, guild){

  //!tempmute @user 1s/m/h/d

  let tomute = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
  if(!tomute) return message.reply("Couldn't find user.");
  if(tomute.hasPermission("MANAGE_MESSAGES")) return message.reply("Can't mute them!");
  let muterole = guild.roles.cache.find(role => role.name === 'muted');```
copper cradle
#

message.guild

median star
#

so how do i get it to add the permission when it creates the role

  await guild.create_role(name="Mod", colour=discord.Colour(0x2ffde), permissions=KICK_MEMBERS)
spare mirage
#

muterole = await message.guild.createRole({
name: "muted",
color: "#000000",
permissions:[]

#

@median star

median star
#

yes?

spare mirage
#

you can do permissions like this

median star
#

this is discord py what im doing

spare mirage
#

oof

copper cradle
#

@spare mirage they're using python with discord.py as their library

spare mirage
#

ouch

#

didnt know

copper cradle
#

it's not the same

spare mirage
#

I k

median star
#

-_-

#

so no one can hepl me

copper cradle
#

just wait

spare mirage
#

go to py official discord

#

ask there

copper cradle
#

there are more than 2 people on this server afaik

#

someone that's willing to help will help you

#

or you could just read the docs

#

which is way easier

winter basalt
#

zsnails the wise man

median star
#

;-;

slender thistle
#

Well

#

What does the permissions kwarg require

pale vessel
#

we have a pythoner here

copper cradle
#

ah yes, our pythonista is here

#

dude

#

flazepe

#

c'mon

pale vessel
#

what

copper cradle
#

bruh

slender thistle
#

Have you tried searching the API reference for create_role

copper cradle
#

@pale vessel I was literally gonna say that

#

I still did tho

#

I kinda find it funny

pale vessel
#

bruh

#

we're way off topic but okay

white drum
#

can someone help me with a voicekick cmd?

winter basalt
white drum
#

?

slender thistle
#

AKA "just ask your question"

spare mirage
#
let muterole = message.guild.roles.cache.find(role => role.name === 'muted');
  //start of create role
  if(!muterole){
    try{
      muterole = await guild.roles.create({
        name: "muted",
        color: "#000000",
        permissions:[]
      })
      message.guild.channels.forEach(async (channel, id) => {
        await channel.overwritePermissions(muterole, {
          SEND_MESSAGES: false,
          ADD_REACTIONS: false
        });
      });
    }catch(e){
      console.log(e.stack);
    }
  }
  //end of create role
  let mutetime = args[1];
  if(!mutetime) return message.reply("You didn't specify a time!");

  await(tomute.addRole(muterole.id));
  message.reply(`<@${tomute.id}> has been muted for ${ms(ms(mutetime))}`);

  setTimeout(function(){
    tomute.removeRole(muterole.id);
    message.channel.send(`<@${tomute.id}> has been unmuted!`);
  }, ms(mutetime));
}}``` cannot read property of id `muterole.id`
white drum
pale vessel
#

it doesn't matter

white drum
#

oh

#

that was a problem for me

copper cradle
#

that's not how it works but ok

#

naming has nothing to do as long as you don't try to have 2 vars with the exact name in the same scope

pale vessel
#

it's because it's outside the try catch

#

WAIT NO

sudden geyser
#

no time to wait, the future is now

spare mirage
#

ok?

#

message.guild

#

yes fixed it

#

another problem

#

xD

#

imma fix this myself

#
message.guild.channels(async (channel, id) => {
        await channel.overwritePermissions(muterole, {
          SEND_MESSAGES: false,
          ADD_REACTIONS: false
        });
      });``` why is message.guild.channels not a function?
copper cradle
#

why would it?

golden condor
#

because it isn't, a function

copper cradle
#

forEach

#

you want a forEach

#

or a normal for loop

golden condor
#

.cache.forEach

brisk anvil
#

Sa

spare mirage
#

Ok

golden condor
brisk anvil
#

-notr @spare mirage

sudden geyser
#

zSnails got yourself a little clone

brisk anvil
#

@golden condor tamam ab

white drum
#

you are not a coder are you

#

this is copied from a bot

#

that is discord v11

copper cradle
#

@sudden geyser lol

opal plank
#

you DONT want a forEach

copper cradle
#

ofc they don't want that

opal plank
#

never use forEach

copper cradle
#

tho I cba to explain how a for loop works

golden condor
#

It's the easiest option in this case so shutup

opal plank
#

while
for ... in

#

dont use forEach

#

use other loops, dont use that one though

sudden geyser
#

forEach is just another way of doing it. It's fine.

copper cradle
#

tho I cba to explain how a for loop works

opal plank
#

use for()

golden condor
#

forEach is just another way of doing it. It's fine.
@sudden geyser exactly, it's the same as a for loop but just presented differently

white drum
#

instead of making a overwrite for each channel just change the perms in the role

#

ez

sudden geyser
#

There are a few differences, but in the end they act similarly (and vary on performannce).

opal plank
#

for() while() provide loop breakers AND are faster

#

DONT use forEach

golden condor
#

Dude

copper cradle
#

making points 101

golden condor
#

In this case

opal plank
#

there isnt a reason to use forEach

golden condor
#

It really doesn't matter

copper cradle
#

there isn't a reason not to use forEach

opal plank
#

performance

#

teach them the proper way to code

golden condor
#

Just stop getting heated over something that doesn't matter at all.

sudden geyser
#

please stop

opal plank
#

im not, you are the one defending something that shouldnt be taught

#

use for() or while()

fresh hatch
#

Any discord.js developer wanna make a bot with me?

opal plank
#

i gave you reasons not to use forEach()

golden condor
#

Dude, we are just explaining one way of doing it.

copper cradle
#

there's a big gap between what someone says, and what someone will do

opal plank
#

though neither told them to use either of those 2

sudden geyser
#

Qaazy sadly I'll pass

opal plank
#

if you just explain, use a loop as example

golden condor
#

There is nothing wrong with .forEach except minor performance issues

copper cradle
#

They were trying to use a forEach

golden condor
#

though neither told them to use either of those 2
@opal plank we didn't explain because the person was trying to use a forEach loop

copper cradle
#

you can get that from the code they were trying to run

opal plank
#

then just calmly explain to them that forEach is a bad loop function, and they should for for(var in cache) =>

#

instead

copper cradle
#

v a r

opal plank
#

dont use vars either

copper cradle
#

I agree with that

golden condor
#

You are complaining at us for using forEach while using var, thats ironic

opal plank
#

var in this context just mean (seomthing)

spare mirage
copper cradle
#

api abuse

#

holy fuck I'm outta here

sudden geyser
#

for in isn't much better as it can have issues with prototyping. ¯_(ツ)_/¯

copper cradle
#

oh wait

sudden geyser
#

Justii the role permissions? Did you pass { data: { ... } }?

copper cradle
#

that's not api abuse

golden condor
#

while (true) { function(); }

spare mirage
#
  if(!muterole){
    try{
      muterole = await message.guild.roles.create({
        name: "muted",
        color: "#000000",
        permissions:[]
      })
      message.guild.channels.cache.forEach(async (channel, id) => {
        await channel.overwritePermissions(muterole, {
          SEND_MESSAGES: false,
          ADD_REACTIONS: false
        });
      });
    }catch(e){
      console.log(e.stack);
    }
  }```
ember lodge
#

someone knows how can i add background color to a div class?

I added it to the CSS file but nothing :(

golden condor
#

@ember lodge you can do it in the div like style="some CSS here"

ember lodge
#

I mean, i want to add background color to a part of my website

copper cradle
#

@ember lodge .class {/rules here/} that should work lol

golden condor
#

body {
background-color: hex code
}

ember lodge
#

i have the style tags and i added background-color

#

but nothing

golden condor
#

Added it to what element

ember lodge
#

like this

copper cradle
#

did you include the stylesheet

ember lodge
#

i am doing it on <style> tags inside html file

spare mirage
#

can someone help me

golden condor
#
.class { 
rule: rule example;
}```
ember lodge
#

That's what i did

golden condor
#

did you save?

copper cradle
#

i n d e n t t h a t p l e a s e

pale vessel
#

yes?

ember lodge
#

it haves autosave

cinder patio
#

Does the element have that class?

copper cradle
#

haves

golden condor
#

Try put color: black

pale vessel
#

no?

ember lodge
#

yep i think

golden condor
#

Check

ember lodge
#

nothing

pale vessel
#

color is for text, they want the background to change

ember lodge
#

This is what i have:

<style>
  .spec1 {
  display: block;
  background-color: black;
  padding: 16px;
  color: black;
</style>

<div class="spec1">
a
a
a
a
a
</div>
cinder patio
#

You have a syntax error in there

pale vessel
#

close the rule

cinder patio
#

you're missing a closing bracket }

ember lodge
#

I forgot to add it to the code in Discord

#

but it's on the code

pale vessel
#

do you want something like a wave on the bottom?

#

or literally just a black rectangle

ember lodge
#

Wave would be good

pale vessel
spare mirage
#

muterole = await memssage.guild.roles.create({ data: { name: 'muted', permissions: ['SEND_MESSAGES', 'ADD_REACTIONS'] } }); how do I make these permissions false

pale vessel
#

deny

#

i think

ember lodge
#

Thanks love

sudden geyser
#

by default, anything not in the array will not be enabled

cinder patio
#

you mean disabled?

sudden geyser
#

yes

spare mirage
#

@sudden geyser I think it will be default /

#

normal

sudden geyser
#

you could try it and see if it does

pale vessel
#

deny is for permissionoverwrites

ember lodge
pale vessel
#

reduce the margin

ember lodge
#

how? Omg

pale vessel
#

is the site live?

ember lodge
#

yep

pale vessel
#

send url

ember lodge
pale vessel
#

add margin-top: -6px; to .spec1 spoonfeed

#

it basically reduces the margin

ember lodge
#

thxs

#

i am new on this XD

marble juniper
#

thats some ugly spacing

#

also why is there this white line

#

lol

spare mirage
#
muterole = await message.guild.roles.create({ data: { name: 'muted', permissions: ['SEND_MESSAGES', false] } });```
How can I make 'SEND_MESSAGES' false
ember lodge
#

I fixed it lmfao

pale vessel
cinder patio
#

Don't include it

pale vessel
#

fix your avatar class

humble gyro
#

p e r h a p s

marble juniper
#

@spare mirage the permissions you don't include wont be enabled lol

#

so if you only have read messages they can't send messages

#

bruh

ember lodge
#

@pale vessel what i have to do Omg

pale vessel
#

learn css mate

marble juniper
#

^

ember lodge
#

lol, i am new on this tho, thanks love

marble juniper
#

go use stackoverflow

#

and have them complain that you didn't search for it

pale vessel
#

you most likely didn't close your avatar class

marble juniper
#

lol

pale vessel
#

take a look again

ember lodge
#

It's closed

pale vessel
#

that's not possible

ember lodge
pale vessel
#

you have to do .avatar img

#

separately

spare mirage
#

@marble juniper I need them to be disabled lol

#

but they are enabled

cinder patio
#

Just. don't. include. it.

ember lodge
#

done

spare mirage
#

@cinder patio SEND_MESSAGES is on by default

#

so it will be on

pale vessel
#

you're right that did nothing

pure lion
#

What is this and why is flazepe a weeb

marble juniper
#

flazepe is a weeb because he knows whats good

winter basalt
#

always has been

pure lion
#

Okay I'll switch to my weeb fanart pfp

#

Brb

earnest phoenix
ember lodge
#

Is that BetterDiscord? Lol

pure lion
#

:o

earnest phoenix
#

No, lol

#

Phone amoled lmao

pure lion
#

Wait discord has that?

winter basalt
#

on phone

earnest phoenix
#

Yes HR_WaitWhat

winter basalt
#

click dark theme several times iirc

pure lion
#

Oooo

#

I love it

winter basalt
#

hurts my eyes

earnest phoenix
#

So do you know?

pure lion
#

Well

#

I'd assume that a bot would use that up in any situation

cinder patio
#

How many servers is your bot in?

pure lion
#

^

earnest phoenix
#

Let me show you

pure lion
#

Just evaluate .guilds.cache.size

earnest phoenix
#

I know lmao

pure lion
#

Well it's called being used

#

It's not time that fills up memory, it's memories

cinder patio
#

That's A LOT for 258 servers

earnest phoenix
#

^

pure lion
#

Stronge

earnest phoenix
#

Firstly I get 18mb

#

After 24h it goes to 100

#

And I can not solve the problem

spare mirage
#
 muterole = await message.guild.roles.create({ data: { name: 'muted', permissions: ['SEND_MESSAGES', 'ADD_REACTIONS'] } });
      const permissions = new Permissions([
        'SEND_MESSAGES',
        'ADD_REACTIONS'
    ]);
    permissions.remove('SEND_MESSAGES', 'ADD_REACTIONS'); ```
#

why is this still not working

earnest phoenix
#

You are not removing perms from role.

pale vessel
spare mirage
#

I deleted that part

pale vessel
#

you don't even need to provide permissions for roles.create

spare mirage
#

?

#

SEND_MESSAGES is on by default

#

so it will be on

pale vessel
#

you'll be overwriting them

spare mirage
#

uh

#

oko

#
    message.guild.channels.forEach(async (channel, id) => {
        await channel.overwritePermissions(muterole, {
          SEND_MESSAGES: false,
          ADD_REACTIONS: false
        });
      });``` like this
#

yes! works thanks

cursive laurel
#

I need some assistance. No matter what I do, I can't seem to get my bot to delete messages sent from a specified channel

#

I've tried many variations and such (I also double checked the bot perms and it seems to be good)

delicate shore
#

How to make

#

The bot delete message

#

Itself

#

Of his

#

Like he sent I deleted 29 messgaes from this channel
Then it delets this^

#

msg.delete

cinder patio
#

The send method returns a promise containing the message object. Resolve it then call .delete() on it

delicate shore
#

Umm

#

So

#

msg.channel.send("Fetching details...")
.delete()

#

I wanna add timeout

cinder patio
#

No, msg.channel.send("Fetching details...") will return a promise

#

resolve that promise and then call .delete() on the returned value

delicate shore
#

What

cinder patio
delicate shore
#

Ok

#

But

#

What you mean my promise

#

Etc ?

cinder patio
delicate shore
#

Ok

copper cradle
#

learn the basics of promises, and async code

delicate shore
#

.then(msg => {
msg.delete({10000})

pure lion
#

Use async please it's so much tidier

#

And easier

delicate shore
#

here this is in what

#

like 10000 millisecond?

copper cradle
#

yeah, but I cba to explain async/await mmLol

delicate shore
#

Use async please it's so much tidier
@pure lion ?/ tideier?

#

cba??

copper cradle
#

what's your native lang?

delicate shore
#

hindi

tulip oak
#

@cursive laurel Should msg be message? lol

copper cradle
#

cba??
@delicate shore can't be assed

delicate shore
#

no

#

ok

#

@cursive laurel Should msg be message? lol
@tulip oak not always

#

i have set it to msg

#

in starting

#

so

pure lion
#

[foxxo]

pure lion
#

Oh

copper cradle
#

also that if else if

#

uuh

pure lion
#

@cursive laurel I'd reccomend learning about arrows, but for now let's just say that the word before the arrow is a placeholder, it can be whatever you want but it will always be linked to that specific listener

copper cradle
#

it's a function

#

just some syntactic sugar

#

message => {} is the same as function(message) {}

cursive laurel
#

@pure lion I'm still learning the ropes of more complex coding. I only know the basic stuff of making bots

delicate shore
#

Ok

pure lion
#

I'm in your shoes rn

copper cradle
#

if you don't know how functions work then that's the first thing you'll need to learn

cursive laurel
#

Majority of what I did is basically looking through stuff online

delicate shore
#

brvh

cursive laurel
#

and using that as a template to base it off of and work with my own edits

delicate shore
#

@cursive laurel how many servers is your bot in

cursive laurel
#

My basic bot is in about 220 servers. This 1 im currently coding is private

delicate shore
#

wot

pure lion
#

Ssssh

delicate shore
#

bruh

#

wow

#

noice

cursive laurel
#

People love randomized video responses :P

delicate shore
#

good

#

why don't you have verieid bot developer role?

pure lion
#

I have that too >:c

delicate shore
#

i mean in this server

#

you don't have a role

pure lion
#

ssssh

earnest phoenix
delicate shore
#

my parents won't let me

cursive laurel
#

Well I wouldn't consider myself a "true" 1 until I actually know more complex coding than the tip of the iceberg basics

delicate shore
#

i also got it

#

@pure lion how to do random

#

in music

#

?

earnest phoenix
#

...

pure lion
#

Why would you want that

earnest phoenix
#

shuffle command

delicate shore
#

like if someone does

#

s!play random

#

s!random

#

then it plays random song

earnest phoenix
#

well

pure lion
#

s!play gets a popular song

earnest phoenix
#

you would use an array

#

regex a top 100 song website

#

ez

delicate shore
#

hey

#

shitdev

#

one thing

earnest phoenix
#

kekw

delicate shore
#

is there any way that if someone do s!rickroll it stars playing rick roll in the VC the person is

#

like

#

@pure lion

pure lion
#

Wait

delicate shore
#

ok

pure lion
#

A bot just dmed me

delicate shore
#

same

#

he said i cannot send msg

pure lion
#

s!ping

delicate shore
#

in that channel

#

s!help

#

ok

#

10 dm

earnest phoenix
#

sad!

delicate shore
#

just do s!help

#

and see

earnest phoenix
#

s!help

delicate shore
#

i got 10 dms

earnest phoenix
#

HOLY

#

xd

delicate shore
pure lion
earnest phoenix
#

!help

#

got nothin

#

lol

delicate shore
#

yes

earnest phoenix
#

a!help

#

2

#

b!help

#

5

#

c!help

#

7

#

d!help

#

9

#

e!help

marble geode
#

s!help

earnest phoenix
#

s!help

marble geode
#

wtf

pure lion
#

Oh no

earnest phoenix
#

z!help

#

my dms are legit

#

bruh

marble geode
#

r!h

delicate shore
#

Ok

#

So

#

Staff

#

if we run cmds here

#

like if i say msg.content blaah blah blah and if it includes s!help

#

the bot dms

#

me

spare mirage
#

@delicate shore That is all in the docs

#

-_-

delicate shore
#

@delicate shore That is all in the docs
@spare mirage ?

#

i am saying

spare mirage
#

like if i say msg.content blaah blah blah and if it includes s!help
@delicate shore

delicate shore
#

that in this server

#

if you do s!help

#

in this char

#

chat

spare mirage
#

s!help

delicate shore
#

then RIP

spare mirage
#

lol

delicate shore
#

ok

spare mirage
#

10 pings

delicate shore
#

ys

boreal latch
#

s!help

delicate shore
#

bruh

spare mirage
#

d!help

#

d!help

delicate shore
#

ok

#

What is the result you want? @delicate shore
@earnest phoenix I am complaining

#

Blacklist this channel then.
@earnest phoenix if you do s!help or d!help your DMS get filled so why can bots see this msg ?

spare mirage
#

then stop complaining

delicate shore
#

why

spare mirage
#

you do s!help

delicate shore
#

why are bots allowed to see this channel

spare mirage
#

and u know u get dms

#

liike dont do it

#

s!help do this

delicate shore
#

Ok

spare mirage
#

because korea

why are bots allowed to see this channel
@delicate shore

earnest phoenix
#
 let image = "https://media1.tenor.com/images/d8a030a99a3475c938607856c0ac7968/tenor.gif?itemid=16262406"
Canvas.loadImage(image)
``` what is wrong here?
#

you tell me

restive pebble
#

await canvas

#

or it will throw error

#

command runs ahead instead of waiting for loading image @earnest phoenix

earnest phoenix
#

k

#

uhh how

#

can i wait

restive pebble
#

await loadImage

earnest phoenix
#

ok

modern wagon
#

I'm having trouble in a next command
I'm using python
I want to stop the bot from executing next command once it's executed

restive pebble
#

break

#

¯\_(ツ)_/¯

modern wagon
#

Can I dm u the code?

golden condor
#

Just keep it here

restive pebble
#

sorry

modern wagon
restive pebble
#

idk python

earnest phoenix
#

use switch case over else ifs

#

and just

#

dont reassign the value?

modern wagon
#

That's js

pale vessel
#

no?

modern wagon
#

Switch case is js?

pale vessel
#

no

#

not only

earnest phoenix
#

py doesn't have switch

restive pebble
#

its everywhere lol except some

#

use that return state ment ig

surreal notch
#
        { name: 'Servers:', value: 'client.guilds.cache.size', inline: true },
        { name: 'Users:', value: 'client.user.cache.size', inline: true },
    )
    ```
#

It is not giving me desired output

boreal latch
#

what does the output looks like

#

and what do you want it to look like?

earnest phoenix
#

well you're passing it as a string

restive pebble
#

wut version is that

earnest phoenix
#

what you probably meant to do was use the getters on the variables

#

but you encapsulated it in a string

autumn summit
#

How do you get a command to be dm only

#

like for guild only its @commands.guild_only()

#

how do u do dms

restive pebble
autumn summit
#

oh ok

#

thx

#

no ik what to do from here

restive pebble
#

yeah its ok

plucky harness
#

502 Bad Gateway whats causing this?

restive pebble
#

it is bassically because of invalid response

#

many sites do this to avoid bots

plucky harness
#

test button

restive pebble
#

503 means server not responding

plucky harness
#

on ubuntu

restive pebble
coarse hearth
#

how do i make so a command can only be used in a certain channel .

earnest phoenix
#

compare the channel id

spare mirage
#

^

earnest phoenix
#
const { MessageEmbed } = require("discord.js");
  const pdb = require("../../db");
            let prefix = pdb.get(`Prefix_${message.guild.id}`) ? pdb.get(`Prefix_${message.guild.id}`) : "lt!"
  const e = new MessageEmbed()
  .setColor("#ff9900")
  .setThumbnail(bot.user.displayAvatarURL({ dynamic: true }))
  .setDescription(":warning: **The default prefix for** **__Legendary Bot__** **is lt!**\n**If you want a more detailed description about a command you can use lt!help [commandName]\n\nAnd if you want to change the prefix use lt!cc prefix [prefix]** \n\n\n:tools: `-` **Moderation Commands**\n\n`addrole` | `ban` | `clear` | `kick` | `mute` | `removerole` | `unban` | `unmute` | `warn` | `warns`\n\n\n:battery: `-` **Fun Commands**\n\n`8ball` | `animememe` | `birb` | `cat` | `catfact` | `coinflip` | `dance` | `dog` | `dogfact` | `fight` | `fox` | `foxfact` | `howgay` | `howlong` | `howsexy` | `hownoob` | `koala` | `meme` | `panda` | `pika` | `roll` | `rpanda`\n\n\n:money_with_wings: `-` **Economy commands**\n\n`beg` | `buy` | `buylist` | `credits` | `daily` | `deposit` | `pay` | `profile` | `roulette` | `sell` | `slots` | `weekly` | `work`\n\n\n:heart: `-` **Love Commands**\n`angry` | `cry` | `hf` | `hug` | `kiss` | `slap` | `wink` | `pat`\n\n\n:compass: `-` **Info Commands**\n\n`settings` | `avatar` | `userinfo` | `botinfo` | `serverinfo` | `avatar` | `covid` | `ping` | `support` | `invite` | `stats`\n\n\n:miscwe: `-` **Misc Commands**\n\n`poll` | `report` | `votekick`\n\n\n:gear: `-` **Config Commands**\n`settings` | `cc`\n\n\n:musical_note: `-` **Music Commands**\n\n`play` | `skip` | `skipto` | `playlist` | `queue` | `volume` | `loop` | `pause` | `resume` | `nowplaying` | `search` | `shuffle` | `stop` | `remove`\n\n\n:peach: `-` **NSFW Commands**\n\n**For NSFW Commands please write lt!nsfw in a NSFW channel!**")
  .setFooter("Help command | Made by Sabin");

  message.channel.send(e);

error:

fields.flat is not a function

#

help ?

pale vessel
#

upgrade node

earnest phoenix
#

fields.flat is not a function
@earnest phoenix are you sure this is the good file ?

#

the function doesn't exist in the node version they're using

#

flat is introduced in node v12

spare mirage
#

@earnest phoenix how?

earnest phoenix
#

@earnest phoenix yes, i m sure

#

@earnest phoenix how?
@spare mirage because bots can't send message here

spare mirage
#

that wont break it?

earnest phoenix
#

it worked before i changed the gost

#

upgrade nodejs to (minimum) v12

spare mirage
#

discordjs*

earnest phoenix
warped jay
#

It has been three weeks

#

Since I applied for bot list

restive pebble
#

hmmm

warped jay
#

Atleast please say the pos

#

Or atleast if my bot is denied

lusty quest
#

patience is key

#

its not exactly 2-3 weeks it can take a little bit longer. If you are Denied Luca (bot from here) will send you a DM and you get a Notification here on the server

spare mirage
#

@warped jay whats ur uptime?

#

maybe the mods couldnt test it

warped jay
#

8D 3H 40M

#

Ok?

spare mirage
#

uhh

#

%

#

10%

#

20%

#

30%

#

etc

summer acorn
#

that one search result

spare mirage
#

lul

carmine echo
#

why is typescript doing that help how do i make typescript stop doing that

#

I can't see how it can be undefined as it checks if there's at least 1 module in the array right before that

earnest phoenix
#

use optional chaining

carmine echo
#

Oh yea that's a good idea

#

i'm new to ts so im not used to it yet

earnest phoenix
#

variable.whatever() turns into variable?.whatever()

carmine echo
#

yea i already did it thanks

earnest phoenix
#

it's fine dw

carmine echo
#

moden es features are great though

tight plinth
pale vessel
#

class starts with ., IDs being # and tags with no prefix

tight plinth
#

i fucking forgot how css works

cinder patio
#

you can also right click it and copy the selector

digital ibex
#

hm, im having a small issue, im passing an object through the backend to frontened, and when i try to use the object in the frontend, it says its not defined. any ideas?

#

my backend code: js res.render('chat', { user: user.findOne({ id: req.params.user }) }); my frontend code: js socket.on('message', (message) => { createMessage(`${user}: ${message}`); });

quartz kindle
#

not enough information

#

im assuming res.render() is an ejs renderer?

digital ibex
#

i believe res.render is for all frontend stuff, idk

#

and yeah, im using ejs

quartz kindle
#

and what are you rendering?

digital ibex
#

wdym?

quartz kindle
#

the render function is usually used to render/build ejs files

vernal vapor
#

Hey yesterday I was told that to make the buttons transparent (on site) I would have to deal with opacity. However I have no idea what div class the buttons on site belongs to.

#

In that case what should I do

golden condor
#

wait

#

what

#

you have just bamboozled my brain

noble dagger
#

how can i make my discord bot dm a specific user in glitch.

where i would type (prefix)dm @user (contents of DM)

quartz kindle
#

@vernal vapor right click on these buttons, and inspect

golden condor
#

how can i make my discord bot dm a specific user in glitch.

where i would type (prefix)dm @user (contents of DM)
@noble dagger check for mentions

digital ibex
#

yeah, it everything works, like the code in the chat.ejs file, but for some reason, it says user is not defined.

quartz kindle
#

so you are rendering the chat.ejs file?

noble dagger
#

ok, tnx @golden condor

quartz kindle
#

show that file

vernal vapor
#

Ahh true thanks :) didn't think about that

digital ibex
#

yeah tim, and 1 sec

earnest phoenix
#

J'aurais besoin d'un code nodejs quand qu'elle qu'un rejoin le serveur !

golden condor
#

Me PM

earnest phoenix
#

Qui peux s'enregistrer dans une base de données MySQL

#

Okay

digital ibex
quartz kindle
#

dont you have to use ejs's <% %> tags

digital ibex
#

you can use the script tag too

quartz kindle
#

no i mean

#

you're doing render(file,{data})

#

to use that data in the rendered file, you need to use <% data %>

golden condor
#

no he is right

#

you need to use <%

#

inside script

digital ibex
#

and then its gonna be defined? or

#

oh

quartz kindle
#

because basically

golden condor
#

lik<%= user %>

quartz kindle
#

ejs is a template builder/generator

golden condor
#

it's html without that

quartz kindle
#

so the render function reads your ejs files, and replaces all ejs tags with the data you provide

#

then sends to the browser

digital ibex
#

this is in the script tag?

quartz kindle
#

the <% tags are like placeholders for the render function

#

for example

#

if your file is <html> <% bla %> that means you have an html file, and you want to replace the bla placeholder with some data that you will give

#

and this data is given through the render function: .render(file,{bla})

#

the render does find and replace on the file

#

before sending to the browser

digital ibex
#

so i can't use that data in the script tag? im confused

quartz kindle
#

you have some user data

#

and you're sending it to the file through the render function

#

but in the ejs file, you need to define where you want to put this data

#

you can put it anywhere, but since its json data, it will only work inside script tags of course

digital ibex
#

in the script tag, i put it there and I get a syntax error

quartz kindle
#

you need to put it there with ejs tags

#

else its not pulling data from anywhere

digital ibex
#

am im doing it wrong?

quartz kindle
#

something like that

#

probably better to not duplicate it

#
var user = <%- user %>
#

because the ejs user is a variable that contains everything you passed in the .render() function

#

and this data needs to be placed in the html file, as text

#

so basically, the <% user will be replaced by full json data

#

and the fully rendered file will look like this

#
var user = {
  bla: 10,
  bla2: 20,
  etc: 50
}
digital ibex
#

yeah

#

but I still get an error in the script tag with the const user = <%- user %>

quartz kindle
#

you might need to stringify it, idk if ejs stringifies objects into json by default

digital ibex
#

it doesn't.

quartz kindle
#

what error is it? server side or browser side?

digital ibex
#

syntax error

#

because of the <

quartz kindle
#

you can always check page source to see exactly what the fully rendered html looks like

#

btw doesnt user.findOne() need to be awaited?

digital ibex
#

OH

quartz kindle
#

when working with rendering and templating engines, always check both sources, the server side source, and the browser side source, so you can see exactly whats going on

#

for example, compare your chat.ejs file to the source code in the browser (right click, view page source)

#

and you will see what ejs is actually doing to the file, and you can find any problems or mistakes

digital ibex
#

it works btw

#

but I get a syntax error idk how to fix. when I do the const user = <%- user %>

#

it turns it into an object

#

thats in the sources thing

quartz kindle
#

this is the page source after rendering?

digital ibex
#

yeah

quartz kindle
#

you need to stringify it

#

JSON.stringify(data)

digital ibex
#

kk

#

ah ha, thanks tim :D

#

ok uh, js socket.on('sendMessage', (message) => { socket.emit('message', message); }); it doesn't send the message? any ideas why

#

im pretty sure it was working fine before.

lusty quest
#

@quartz kindle thank you for d.js-light. i use it now in 3 Bots and got my largest one down to 86MB ram (from 160MB)

pure lion
#

inferior Dev noises<

digital ibex
#

ok uhmmmmmmmmmm

#

i fixed that, but now I create an account and it just loads, I found out where its coming from and its here: js const nu = await user.create({ id: Date.now().toString(), username, password: argon2.hash(password) }); does anyone know why this is happening?

surreal notch
#

how to use hyperlink in field discord.js v12

quartz kindle
#

@lusty quest awesome lmao

surreal notch
#

@quartz kindle

digital ibex
#

hyperlinks have nothing to do with the library, or even the language. its markdown

pale vessel
#

[title](url)?

digital ibex
hazy girder
#

is rainboe bot name allowed

earnest phoenix
hazy girder
#

with css

earnest phoenix
#

shit not this link w8

quartz kindle
#

yes its allowed

#

you can do anything in top.gg css

hazy girder
#

k

#

ty

quartz kindle
#

as long as you dont hide/disable the top.gg buttons or ads

sinful belfry
#

@hazy girder your css can't be too flashy either btw

#

rainbow text is generally kinda flashy, though if it only changes colour very slowly then you should be good

earnest phoenix
#

• Use CSS/JS or anything to hide DBL placed ads/banners

pure lion
#

Ping if you wanna join the esolang gang

sick cloud
#

is that an ad

earnest phoenix
#

rip

pure lion
#

No

earnest phoenix
#

what does this esolang gang do?

pure lion
#

It's not an ad because you're not buying anything and nobody will get anything good out of it

#

what does this esolang gang do?
Make joke coding languages

earnest phoenix
#

hmmmmmmmmmmmmm

#

idk how to make languages lol

pure lion
#

Neither do i :D

earnest phoenix
#

if i did wouldve joined

pure lion
#

Dude

#

You could literally tell me to add something and ill add it

#

It could be anything

earnest phoenix
#

meh idk lol

pure lion
#

A compiler that works backwards

#

h#

earnest phoenix
#

im here cos i need help with my bot lol

pure lion
#

hode hs

#

Oh cool what library?

earnest phoenix
#

u work js

pure lion
#

Ah

#

Yeah I am js

#

Lets make jason

earnest phoenix
#

lol

#

ok ill join esolang

pure lion
#

:D

#

Epic

#

Now I just gotta find a workspace for that

#

Let's ask tim

#

@quartz kindle what workspace can I use to make an esolang?

elfin flower
#

i swear

pure lion
#

You swear

quartz kindle
#

you can use anything

#

a programming language is essentially a program that converts text into code

#

so you can technically code a programming language in any pogramming language

pure lion
#

What would I name the file, how would I make the syntax interpret it and have the cool drop-downs?

quartz kindle
#

wdym cool drop-downs, like inside a code editor?

pure lion
#

Yeah

quartz kindle
#

you'd need to make a script/plugin/extension for said code editor to support it

pure lion
#

Ah okay

#

But how'd I integrate the syntax to a file so it can read it and shit?

elfin flower
#

how do i make the bot know whoever sent a message?
message.user?

pure lion
#

Well

quartz kindle
#

if your target program is a binary executable, like an .exe or something, you'd need to translate your code into machine code, take a look at what other compilers do

elfin flower
#

wait

#

author

pure lion
#

If you want a guild member object you do message.member

elfin flower
#

author

#

right?

#

its author

#

ty for the help

pure lion
#

if your target program is a binary executable, like an .exe or something, you'd need to translate your code into machine code, take a look at what other compilers do
Say I wanted it to be like js and python had a threesome with the letter h

hazy girder
elfin flower
#

now i made it if someone says "ayay" excluding ME the bot will say "ok"

pure lion
#

Break monitor

elfin flower
#

fun

slender thistle
#

@hazy girder .shapes-background iirc

pale vessel
#

shapes-background shapes-1 yeah

#

there's more shapes? 👀

pure lion
#

:o

slender thistle
#

I just display: none the .shapes-background and it works

#

shrug

quartz kindle
#

js and py are interpreted languages, so you'd need to write a program that interprets them

pure lion
#

Yeah that's what I'm getting at

pale vessel
#

@slender thistle i had to put shapes-1 too since the background-image came from that

pure lion
#

How to write interpreter in hode hs

quartz kindle
#

hode hs

pure lion
#

Yes

quartz kindle
pure lion
#

Ok what if I wanted to make a lang from scratch

quartz kindle
#

something like C?

#

everything is built on top of something else

#

back then there were tapes with holes in them to represent zeros and ones

#

then someone made up a language to represent binary operations more easily

#

for example assembly

#

then someone made up a language to represent functions and operations more easily, for example C

#

so everything is built on top of something else

#

it all depends what is your target

#

if you want to write a language for computer controllers and hardware operations, you'd probably need a very low level language, like assembly

#

if you want to write a scripting language for node.js, you can write it in js

pure lion
#

aaaaaaa okay

quartz kindle
#

languages are built in a similar way to frameworks

#

they take low level code and represent it in an easier way to work with

earnest phoenix
#

wait bruh

tight plinth
#

imagine reacting to own msg

earnest phoenix
#

and trolling it

elfin flower
#

discord.User

slender thistle
elfin flower
#

ya

#

y

quartz kindle
#

the v8 engine (javascript interpreter) that powers google chrome and node.js is written in C++

elfin flower
#

C plus plus

#

see plus plus

earnest phoenix
#

Hey so I'm making a discord bot using java and I got stuck on the help command. I have a main driver file and then a folder with a bunch of commands that all have an object that contains information like the description, usage, etc. How can I access these objects without having some sort of list in the driver that I have to manually update? I just want to be able to get the information for each command so it can be displayed in the help command.

pure lion
#

@quartz kindle time to learn 🌊 ➕ ➕

spare mirage
#

@earnest phoenix Do U mean a help command that automatically updates?

earnest phoenix
#

yeah basically

spare mirage
#

hmm

elfin flower
#

because my friend keeps

pure lion
#

@spare mirage Do U know java?

#

If oNLy I kNeW tOo

quartz kindle
#

java should have some way of reading a directory and listing its files, and then importing those files to obtain its objects

spare mirage
#

bruh what

pure lion
#

If you were me I'd put them in a JSON

#

But I'm also retarded

earnest phoenix
#

Yeah I was thinking of doing that, but i'm not sure how to create objects based on a string name of the class

pure lion
#

Uhhhh

#

Assign IDs?

earnest phoenix
#

I meant to what Tim was saying

pure lion
#

a

#

loudly is a retard<

earnest phoenix
#

its all good

#

even using your way (which could work) I would still have the same problem, the only difference is that I would be writing to a file when I can just get the list of files in the directory seperately

pure lion
#

Tru

cobalt spruce
pure lion
#

V12? @cobalt spruce

quartz kindle
#

im not a java dev, so i cant help, but look into importing and exporting objects between files

cobalt spruce
#

what i replace fetch User with?

#

yup

pure lion
#

users.fetch

earnest phoenix
#

I might have found something, thanks for the help @quartz kindle

cobalt spruce
#

am using my old bot script and do some fixies

pure lion
#

I'm gonna learn java so Tim doesn't have to :D

#

Then I'll make a bot in C

quartz kindle
#

good luck, you'll need it

spare mirage
#

how do good leveling systems work?

pure lion
#

Tankya

quartz kindle
#

writing a bot in C is beyond hell

pure lion
#

@spare mirage add xp on every message, set the amount of xp per level and boom

slender thistle
#

C++ yet?

earnest phoenix
#

lol yeah turns out that thing I found is just a different format of the same problem, Ill keep looking

cobalt spruce
spare mirage
#

Seems easy @pure lion

pure lion
#

Did you read it? @cobalt spruce

spare mirage
#

lol

cobalt spruce
#

yea

pure lion
#

Tell me what it says

slender thistle
#

fetching unban as a user yet?

pure lion
#

That has less pixels than I have braincells

quartz kindle
#

all images in the world have less pixels that the dumbest person on earth's brain cells lmao

pure lion
#

Looks like I brutally murdered the chat again

#

I am aware tim

solemn latch
#

Snowflakes are IDs

Looks like your putting unban where an ID should be

cobalt spruce
#


*


ogged in as Ahx#4022!
(node:10888) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
user_id: Value "unban" is not snowflake.
    at RequestHandler.execute (C:\Users\Abdo_Mido\Desktop\islam2\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:10888) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:10888) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
````
#

here is the erro

solemn latch
#

I just told you what it means

#

🤔

slender thistle
#

user_id: Value "unban" is not snowflake.

#

Is args[0] "unban"?

cobalt spruce
#

full code

#

am new at v12

#

bro

#

am using my old bot script

quartz kindle
#

that try catch doesnt work if you dont await it

solemn latch
#

Thats not a v12 issue I dont think

cobalt spruce
#

@quartz kindle uhhh

quartz kindle
#

also, reason should not be inside an object

pure lion
#

Args[0] is generally the command uWu

quartz kindle
#

also, what is your node.js version?

solemn latch
#

That depends @pure lion

#

A lot of devs get rid of the command from the args

cobalt spruce
#

v12.18.2

pure lion
#

several people are typing

quartz kindle
#

ShitDev is most likely right, hes getting that unban is not a snowflake, which likely means args[0] contains unban due to being the unban command

pure lion
#

@solemn latch why slice 1 when you can do it later

sudden geyser
#

It's not a v12 issue; it's an issue with how you're parsing your user arguments.

r?unban @Lite bad -> unban @Lite bad (.substring) -> ["unban", "@Lite", "bad"] (.split)

solemn latch
#

Because do it globally and then you don't have to duplicate code

pure lion
#

M e h

solemn latch
#

You know the command name from that point anyway

pure lion
#

But switch case do be useful tho

restive pebble
#

nice

cobalt spruce
#

i dont understand anything here

#

lol

pure lion
#

We will teach you

quartz kindle
#

@cobalt spruce args[0] -> args[1]

pure lion
#

With the power of do-

#

xxing

cobalt spruce
quartz kindle
#

guild.members.unban

pure lion
#

<member>

#

Lets ban the guild reports

restive pebble
#

hmmm

pure lion
#

Perfectly legal 😄 👍

elfin flower
#

is there a way a bot can check every message if theres a specific word in it?

pure lion
#

Yes

#

That's what it does by default

elfin flower
#

yes

#

what

pure lion
#

That's how commands/prefixes work

#

Lol

restive pebble
#

i was thinking of a way to ban everyone from a guild using a command without for loop

pure lion
#

Pray tell?

restive pebble
#

lol

elfin flower
#

my bot doesnt have a prefix

restive pebble
#

ok

pure lion
#

You're getting mooted

#

Nocap

restive pebble
#

slice command then

elfin flower
#

ok

digital ibex
#

@elfin flower what language?

elfin flower
#

discord py

solemn latch
#

English

pure lion
#

Windows

elfin flower
cobalt spruce
#

guys what's rong with my create channel script when i try to ban or mute it send this

slender thistle
#

is there a way a bot can check every message if theres a specific word in it?
on_message:
if "some text" in message.content

digital ibex
#
if 'whatever' in message.content:
elfin flower
#

ty

#

both

#

👍

digital ibex
#

np

pure lion
elfin flower
#

why is my bot spamming

restive pebble
#

lmao

digital ibex
#

send ur code

pure lion
#

LOL I WONDER

restive pebble
#

return if message author is bot lol

elfin flower
#

i didnt tell it to spam

solemn latch
#

Is your bot checking for a word, that your bot then says

digital ibex
#

dude, theres no need to be rude if he's asking a question

solemn latch
#

🤔

digital ibex
#

LOL I WONDER

#

lmao

elfin flower
#

I didnt put a while True: why is it doing this

pure lion
#

It's checking every message right? So it's gonna do something on every message if you don't limit it

digital ibex
#

send ur code, blout

solemn latch
#

Including its own messages

pure lion
#

if (!message.content.startsWith('balls')) { return } else { cool shit }

elfin flower
#

if "hello, bot" in message.content:
if message.author.id != 612900626799788042:
await message.channel.send("hi")

pure lion
#

Um

restive pebble
#

id in quotes

digital ibex
#

send the code above it

#

no, boeing

pure lion
#

We need moar

restive pebble
#

hmmm

elfin flower
#

id in quotes didnt work

digital ibex
#

because its not a string

#

send the code above it

solemn latch
#

Ids are sent as a string

#

Actually

restive pebble
#

yes lol

pure lion
#

^^

elfin flower
#

wait

digital ibex
#

in python? no

elfin flower
#

i fixed it

solemn latch
pure lion
#

I was gonna say but I'm reartar

elfin flower
#

i accidentally fixed it

#

a

pure lion
#

EYYYY

elfin flower
#

im big brain now

pure lion
#

Break it again so you can learn how you fixed it, that's what I do all the time

slender thistle
#

id in quotes
@restive pebble not in d.py 1.0.0+

digital ibex
#

👍

slender thistle
#

how do you not see the colons tbh

elfin flower
#

wait

pure lion
#

a

elfin flower
#

tested it and it still spams

pure lion
#

Oh no

elfin flower
#

and there is a while True: in the code above it

slender thistle
#

why

#

Why is it there

elfin flower
#

it checks everytime if the name gets changed

#

and when it gets changed it prints

pure lion
#

Why loop tho

elfin flower
#

eh the code isnt important

slender thistle
#

why the while True: though

solemn latch
#

The code is everything

slender thistle
#

What name do you mean

solemn latch
#

Its how you tell a bot to do stuff

elfin flower
#

so it checks everytime

pure lion
#

The name of?

elfin flower
#

the guild

#

the server

#

if it gets changed then it prints

#

i deleted the code

#

maybe that can help

slender thistle
#

sounds like on_guild_update

pure lion
#

Also not sure of py but do emitters and listeners work in a relatively similar way to js?

#

Shit happens, it triggers more shit?

cobalt spruce
#

@pure lion

pure lion
#

Yes?

slender thistle
#

Essentially, that's how event emitters work

cobalt spruce
#

the create channel script working

#

but when i try to

#

ban

#

or mute

#

it sends that too