#development

1 messages · Page 1299 of 1

junior turtle
#

oh okay

#

thank you! :)

fluid basin
#

oh wait nvm there wasn't an ID

junior turtle
#

what?

#

wdym

fluid basin
#

sorry my brain isn't working

#

using reaction.emoji should work

#

I guess it was due to the message.reaction part

junior turtle
#

yea that's what I was confused about

fluid basin
#

which caused the message to not get fetched

#

and the if condition will not be ===

#

my bad

#

anyways your problem should be fixed, do test it

junior turtle
#

yea I checked the "Updating from v11 to v12" page on discord.js.org and that's how they have it

fluid basin
#

👍

junior turtle
#

anyways your problem should be fixed, do test it
yea it is fixed, thank you :)

fluid basin
#

welcome

meager burrow
green kestrel
#

today i did:

ps aux | grep "./bot" | grep -v grep | awk -F ' ' '{ print $3 }' | paste -sd+ | bc -l```
#

it sums up the cpu total of multiple processes called 'bot' and returns a single value 😄

tight plinth
#

nice

green kestrel
#

2020-10-06 10:48:10.886 [I] [th#15599] : Websocket[s] connecting
2020-10-06 10:48:10.886 [I] [th#15599] : Starting bot with 8 shards (cluster ID 1, max clusters: 2)
2020-10-06 10:48:10.986 [D] [th#15603] : Shards to connect : 4
2020-10-06 10:48:10.986 [D] [th#15603] : Shard#1: connecting

starting to get a bit complex now lol

#

im splitting my bot into clusters, where each cluster is a process responsible for an equal subset of all the shards

#

right now just two clusters of 4 shards each

#

any thoughts on what might go wrong? 😛

silver lintel
#

What's the difference between const { thing } = stuff... and const thing = stuff...

pale vessel
#
const object = { foo: "bar" };

const baz = object; // { foo: "bar" }
baz.foo; // "bar"
// or
const {foo} = object; // "bar"```
stiff walrus
#

umm how can i do !avatar ?

#

if (message.content.toLowerCase() === prefix + 'avatar') {
message.channel.send(message.author.avatarURL)
}

#

and how can i do it embed?

silver lintel
#

make an embed and do .setImage(message.author.avatarURL())

stiff walrus
#

function newFunction() {
if (message.content.toLowerCase() === prefix + 'avatar') {
const embed = new Discord.MessageEmbed()
.setColor('BLUE')
.setDescription('Avatar');
message.channel.send(embed)
.setImage(message.author.avatarURL());
};
}

#

@silver lintel

#

is this right?

silver lintel
#

Erm no, add the setimage before the send

stiff walrus
#

oh okay

#

function newFunction() {
if (message.content.toLowerCase() === prefix + 'avatar') {
const embed = new Discord.MessageEmbed()
.setColor('BLUE')
.setDescription('Avatar');
.setImage(message.author.avatarURL());
message.channel.send(embed)
};

#

now?

#

i am new about this

#

sry

#

@silver lintel

silver lintel
#

Make sure you dont have a semicolon on the end of the setadescription

stiff walrus
#

and

#

i want my bot prefix !

#

how do i it?

silver lintel
#

if (message.content.toLowerCase() === prefix + 'avatar')?

#

prefix should be the prefix

stiff walrus
#

okay

#

thank youu

silver lintel
#

So at the top you would do const prefix = '!';

stiff walrus
#

what can i do

#

node pkmn.js

#

@silver lintel

silver lintel
#

Code from lines 20-26 should be in the client.on("message".....

#

After the first if statement

#

Okok, also you're mixing up Discord and discord.

tardy hornet
#

my bot prefix is !

#

but he respond to anything else (?,@,% etc)

#

how do i fix that?

silver lintel
#

How do you start ur cmds?

#

Like if statement

tardy hornet
#

in cases

#

for example

#
case 'yellow':
message.channel.send('something')
    break;```
silver lintel
#

Ahh ok

#

Hmmm

clever dust
#

just add js if(!message.content.startsWith(prefix)){return} above the let args = ....

tardy hornet
#

ty

silver lintel
#

Do: if (!message.content.startsWith(prefix) || message.author.bot) return;

#

Above the args

tardy hornet
#

ty so much

#

one more question

silver lintel
#

go on

tardy hornet
#

i want that

#

to look like that:

clever dust
#

that's inline (on embed field)

silver lintel
#

Set the colors to false, funny to true, object to false, moving true and reactions false

tardy hornet
#

idk how lol

silver lintel
#

Send the code you are using for that embed

tardy hornet
#
case 'emojis':
  const helpEmbed3 = new Discord.MessageEmbed()
  .setColor('33EC0A')
  .addField('**colors**', 'normal among us colors emojis', true)
  .addField('**funny**', 'funny among us emojis', true)
  .addField('**objects**', 'objects in among us emojis', true)
  .addField('**moving**', 'moving among us emojis', true)
  .addField('**reactions**', 'reactions among us emojis', true)
  message.channel.send(helpEmbed3)
break;
silver lintel
#
case 'emojis':
  const helpEmbed3 = new Discord.MessageEmbed()
  .setColor('33EC0A')
  .addField('**colors**', 'normal among us colors emojis', false)
  .addField('**funny**', 'funny among us emojis', true)
  .addField('**objects**', 'objects in among us emojis', false)
  .addField('**moving**', 'moving among us emojis', true)
  .addField('**reactions**', 'reactions among us emojis', false)
  message.channel.send(helpEmbed3)
break;
tardy hornet
#

now its like that

#

which is good too btw

rocky hearth
#

Is it possible to access a message from other server?

open rune
#

yes

#

I mean, by connecting your bot to other server

rocky hearth
#

nah nah, not like that

open rune
#

for accessing message without bot, you can only use announcement channel, that's all I know

rocky hearth
#

I mean by url or something. I want to fetch a message from another server.

open rune
#

fetch message by declaring guild's id, probably yes

rocky hearth
#

any hints?

fathom bobcat
#

Discord list plzzzz

slender thistle
#

-faq 1 @fathom bobcat

gilded plankBOT
earnest phoenix
#

find out why

#

debug it, it's your code

ashen yarrow
#

:/

fickle sapphire
#

What does it log @ console.log(spotify)?

ashen yarrow
#

nothing oldEyes @fickle sapphire

thin turret
#

Then it probs didnt find the element

#

What comes up for (array1)

solemn leaf
#

Lilpeep

earnest phoenix
#

what should be the name of my discord c# api wrapper thing

solemn leaf
#

Why dont you json stringify spotify

earnest phoenix
#

cuz its undefined, probably

stiff walrus
#

Code from lines 20-26 should be in the client.on("message".....
@silver lintel
if (message.content.toLowerCase() === prefix + 'avatar') {
const embed =new Discord.MessageEmbed()
.setColor('Blue')
.setDescription('Kendi Avatarın burada!')
.setImage(message.author.avatarURL());
message.channel.send(embed)
}

#

where do i add?

#

after the if?

#

client.on("message") const embed =new Discord.MessageEmbed()

#

this?

earnest phoenix
#

wtf

open rune
#
client.on("message", message => {
  const embed =new Discord.MessageEmbed()
  .setColor('Blue')
  .setDescription('Kendi Avatarın burada!')
  .setImage(message.author.avatarURL());
  message.channel.send(embed)
})
earnest phoenix
#

this is the worst help vampire I've seen in a while lol

blissful coral
#

What’s the problem?

stiff walrus
#

still same @open rune

blissful coral
#

It says it

#

Show more code

#

Where do you define message

open rune
#

Where do you define message

#

you have to add event

#

client.on("message", message => {

stiff walrus
#

why i cant start my bot

open rune
#

you closed the event without put your code in it

blissful coral
#

You closed your message event

earnest phoenix
#

Having more than one of the same event is bad practice

stiff walrus
#

how do i open

#

i am new about developing bots

open rune
#
client.on("message", message => {
  if( .... ) {
     const embed =new Discord.MessageEmbed()
     .setColor('Blue')
     .setDescription('Kendi Avatarın burada!')
     .setImage(message.author.avatarURL());
     message.channel.send(embed)
  }
})
stiff walrus
#

so i need help

blissful coral
#

The if statement is outside of the message event

#

And have one event

#

Don’t spoon feed him

open rune
#

I will soon explain the code

#

so, it won't be spoon feed

#

@stiff walrus well, you have to put your code into the event listener which is "client.on()"

#

and add some code inside it

faint prism
#

Learn Javascript.
You're closing out the your event handler, and referencing a message object which doesn't exist outside of the event's scope

blissful coral
#

^

stiff walrus
#

now this

earnest phoenix
#

....

#

BRO

#

Learn javascript

stiff walrus
#

okay...

earnest phoenix
faint prism
#

now this
@stiff walrus That means you have a syntax error somewhere. Syntax is a programming language's "grammer". It has to be written without a syntax mistake to work

stiff walrus
#

okay i started bot

#

thanks...

open rune
#

now, do you understand your code?

#

how it works?

stiff walrus
#

yes

faint prism
#

@stiff walrus Maybe this will help you find the mistakes

solemn leaf
#

@faint prism come on async stuff

frozen python
#

How to create your own welcome bot or giveaway bot

tight plinth
summer blade
#

selam

lunar storm
#

as

fluid juniper
#

sohbet değil

lunar storm
#

önerceğin bit site

fluid juniper
#

sorular için

lunar storm
#

var mı

#

vds

summer blade
#

var

fluid juniper
#

var

#

keyubu

summer blade
#

KAYIZER bilişim

lunar storm
#

min ne kadar

summer blade
#

3gb ramli vdsler 20 tl

#

windows server 2012

fluid juniper
#

keyubuda 2gb 20 tl sağlam firma

lunar storm
#

discord botlarından para kazanılmıyor değil mi

faint prism
#

What

lunar storm
#

geliştirici tagı filan alınca

earnest phoenix
#

english only (in this channel)

summer blade
#

parayla bot yapabilirsin geliştirici rozeti alırsan

faint prism
summer blade
#

isteyen gişilere

lunar storm
#

auger

#

Can you please tell me a free bot site like glitch

#

general 2 de konuşalım

#

burdanda kovdular

summer blade
#

we do not chat, we support

#

Auger

ionic dawn
#

@faint prism what a good person painting that code x_awwLove

faint prism
#

parayla bot yapabilirsin geliştirici rozeti alırsan
@summer blade They don't give out badges anymore btw

eternal osprey
#

hey peeps

summer blade
#

It has nothing to do with the badge anyway

#

Technical support

eternal osprey
#

how would i actually show the contents of a json file into an embed?

#

i do have a json file with 1 channel id in it.

earnest phoenix
#

just... read the contents and put it as the description lol

#

if you read the contents it's already a string

eternal osprey
#

what would the name of the string be to access it?

earnest phoenix
#

that's not valid json

eternal osprey
#

it is.

earnest phoenix
#

no it isn't lol

faint prism
#

no

#

there is literally no tokens there

eternal osprey
#

well it works lmao.

earnest phoenix
#

it doesn't

eternal osprey
#

by using !channelset

#

it changes the numbers

#

of the channel it is in.

earnest phoenix
#

How in the god's name is that a valid json

faint prism
#
{
  "id": 5495495495352
}

is valid

earnest phoenix
#

because you're overwriting the file contents omegaLUL

eternal osprey
#

it literally works:

faint prism
#

but not what you did

earnest phoenix
#

you're overwriting the file contents

#

your code doesn't care about what was in the file

#

the extension does not matter

#

you do not parse the json so it works

#

you don't read it properly

eternal osprey
#

and i am defining the channel1.

#

by ereading the data1.json

faint prism
#

Storing text in a json file
Just make it a .txt

earnest phoenix
#

because, again, you're not parsing the json

#

because it isn't

#

proper

#

json

#

formatting

eternal osprey
#

but

#

it

#

works

faint prism
#

Just rename it to a .txt and read it like any other file

slender thistle
#

plz don't spam

earnest phoenix
#

you're just reading the file contents and it works because you're just feeding the channel id without parsing the json

#

also avoid file collation databases in the first place

eternal osprey
#

look at the begin of the json file

#

it only has [].

#

after i use !setchannel

#

it changes and the code works properly

faint prism
#

I see no array in the image

eternal osprey
#

anyways, how would i put the contents of the json file into an embed.

earnest phoenix
#

i told you

eternal osprey
#

yeah because it got erased

earnest phoenix
#

just read the file

eternal osprey
faint prism
earnest phoenix
#

get a proper database

eternal osprey
#

i do

#

have mongodb atlas.

earnest phoenix
#

then use it lol

eternal osprey
#

but i am just using json as it is easier

#

and it only has to store 1 channel.

#

nothing that can go wrong.

#

but what is the string name?

#

that's the question.

earnest phoenix
#

it isn't

#

just read the file contents

eternal osprey
#

nvm wait

#

can't i juse fs.readFileSync("./data1.json")

earnest phoenix
#

"i can use plastic instead of metal for this chair because it's just easier lol nothing can go wrong"

eternal osprey
#

@earnest phoenix you are damn right! There are millions of chairs being made of plastics.

#

in my experience, i have never seen a metal chair.

#

too ROUGH for the job it needs to do.

earnest phoenix
#

uh

eternal osprey
#

same goes for mongodb

earnest phoenix
#

school chairs

#

office chairs

#

i should stop helping help vampires altogether i'm losing my sanity

eternal osprey
#

they are manily made out of wood with a metal framing

#

what???? Are you good bro?

slender thistle
#

MongoDB is a proper database whereas JSON files are bleh

eternal osprey
#

it is just my opinion, nothing to blame me on. Thanks for your help tho!

#

i know shivaco.

#

it only stores 1 channel.

#

there is nothing much to go wrong.

#

i am not saving all my users in the server or whatever. Just a few codes.

slender thistle
#

Unless you're constantly rewriting to it

eternal osprey
#

once every week

slender thistle
#

Eh good enough then

eternal osprey
#

exactly.

#

i am saving my mongo for some proper projects

slender thistle
#

I mean, I'd still suggest using Mongo but that's my preference

#

I use JSON file as my database for my C# project lmfao

eternal osprey
#

yeah i know. MongoDB is one of the easiest and best databases to use.

earnest phoenix
#

use sqlite + efcore you'll never want to go back shiv

eternal osprey
#

I just thought that there couldn't be something wrong with using a json file for only 1 line of code.

slender thistle
#

hahaha cry

#

I'd learn proper databases if I had enough time really

open rune
#

mysql still better

earnest phoenix
#

ef core is super easy

#

that's arguable lol

#

mysql is so limiting and it's made by oracle

#

they're also not really comparable per se

#

one is a local db one is a server db

slender thistle
#

Entity Framework?

earnest phoenix
#

yup

eternal osprey
#

btw, can i actually upgrade the plan of an existing cluster?

earnest phoenix
#

entity framework core*

eternal osprey
#

as i already have info on that database.

slender thistle
#

Got any easy-to-understand resources handy?

earnest phoenix
#

sec

slender thistle
#

Microsoft docs do be helpful

earnest phoenix
#

there are samples on there that can get you ready in like 5 minutes

faint prism
#

I still need to look into EF core. I just end up making my own classes from scratch

earnest phoenix
#

i love ef core because how smart it internally is

#

deciding what to cache and what not to etc

#

there's also a really great async querying api

faint prism
#

Oh wow, it looks like cake to get working

#

Is that right?

earnest phoenix
#

yeah

#

super easy

#

there's also an advantage when you're working with asp.net core since ef core is ready for web use

faint prism
#

mhmm, I was aware of that bit

#

Just never utilized it

tulip ledge
#

So I have 4 arrays, each with about 4 values, I'm tryna get all possible combinations how would I do that?

faint prism
#

Multiplication

#

Or exponents rather

tulip ledge
#
let combos = []
for (let i = 0; i < tnineArray.length; i++) {
    for (let j = 0; j < necroArray.length; j++) {

        let combo = [];
        combo.push(tnineArray[i])
        combo.push(necroArray[j])
        combos.push(combo)
    }
}

I did this

#

But it only works for 2

earnest phoenix
#

isnt it just O(n^k)

tulip ledge
#

wtf is that

earnest phoenix
#

big O notation

faint prism
#

Notation

tulip ledge
#

I've heard about it

#

But dont know how to implement it

earnest phoenix
#

you were on the right track with the nested for loops

faint prism
#

I don't think that's necessary

#

well maybe since it's 4 arrays

#

hm

#

(Haven't had my coffee yet)

earnest phoenix
#

it probably is

#

since it's being pushed to a 2d matrix

#

no?

tulip ledge
#

I guess so

#

Since they are objects wich I turned into an array

#

Then I need to find every possible combination

#

And then filter it so if it is: apple + apple + pear this one doesn't get included since it has 2 of the same things

faint prism
#

Isn't it (4^4) = 256

tulip ledge
#

No no

#

I need to generate the combination

#

not how many there are

#

I need every single possible combination

sick fable
faint prism
#

ah

sick fable
#

Copy theink of this emoji

#

I need it 🥺

#

The link***

faint prism
#

then yeah, nested for loops

earnest phoenix
#

what 2d javascript physics engine would you guys recommend for a game in HTML

tardy hornet
#

heym

earnest phoenix
#

the indentation is a bit fucked

#

you might have to adapt it to your use case

#

what 2d javascript physics engine would you guys recommend for a game in HTML
matter.js or phaser or smth else?

tardy hornet
#

i have a command that suppose to react with couple of reactions, and that's what happened:

#

only 1 is getting added

#

thats the code:

earnest phoenix
#

that's not how react works

#

you need to react each emoji one by one

tardy hornet
#

its not a default discord emoji

#

i already fixed

#

ty anyway

mild flower
#

hey how do i deteect if a variable is a tagged role

earnest phoenix
#

what

#

you mean a string?

mild flower
#

no

earnest phoenix
mild flower
#

wait

#

basically

#

i want to detect wether the variable is a mentioned role

earnest phoenix
#

so... a string

#

a string can't be a mentioned role, it can contain a mentioned role

#

@mild flower MessageMentions.roles

mild flower
#

if(lmao === messagementions.roles) return poop
this work?

earnest phoenix
#

wtf no

delicate merlin
#

wtf am i looking at

mild flower
#

¯_(ツ)_/¯

earnest phoenix
mild flower
#

does this work then

#

i mean

#

basically

#

making a role command where the role can be either the role name or the tagged role

open rune
#

what is it

#

well, I am trying to understand, hold on

mild flower
#

nvm i worked things out

limber flume
#

Is there a way to make a JavaScript eval in python ? oml

earnest phoenix
#

this method always works

limber flume
#

?

#

I want a JavaScript eval in a python bot not a python eval I already made python eval in python bot oml

prisma oriole
#

ik in js you could spawn a child process of python and do something like that idk if theres a pip package in python that allows you to make a child process in js

limber flume
earnest phoenix
#

all of the libs seem to be EOL'd

#

or abandoned

#

i presume one way would be to spawn a node process and feed your eval contents through stdin

#

then let node eval it

#

and output it through stdout

limber flume
earnest phoenix
#

then from python read the stdout content

limber flume
#

Ok thanks oml

earnest phoenix
#

it runs on google's V8 engine

#

it's probably what you're looking for

sudden tulip
#

hi i have a question

#
client.on('guildMemberNicknameUpdate', (member) => {
    console.log(`${member.user.tag} updated nickname to ${member.user.tag}!`);
});
#

i have this logging section in my discord js script

#

how do i get the nickname instead of the user tag

#

I might be dumb

#

but i couldnt find in docs

pale vessel
#

did that event even trigger

sudden tulip
#

ye

earnest phoenix
#

no it didnt

#

stop bullshitting lol

sudden tulip
#
// Load modules
const logs = require('discord-logs');
const Discord = require("discord.js"),
backup = require("discord-backup"),
client = new Discord.Client(),
settings = {
    prefix: "b!",
    token: "t"
};
logs(client);

//logging
client.on('guildMemberNicknameUpdate', (member) => {
    console.log(`${member.user.tag} updated nickname to ${member.user.tag}!`);
});

client.on("ready", () => {
    console.log("I'm ready !");
});
#

it did

#

i can show a ss

green kestrel
sudden tulip
#

@earnest phoenix no bs

#

@pale vessel so what do i do

earnest phoenix
#

you're using discord-logs lol

#

that package is just bloat

pale vessel
#

check if the old member's nickname and the new member's nickname are different and log them if so

drifting wedge
#

what are .ejs files?

earnest phoenix
#

embedded js

#

it's a templating language

compact oriole
#

top.gg uses it now but they are moving away

sharp swift
#

How can I find the API token of my bot?

faint prism
midnight quarry
#

hi can you help me when i have create the bot on discord developers the how i do

#

please help me idont know how i bring the bot online

tired panther
#

@midnight quarry xD. The bot must be hosted anywhere.

#

Or it will be offline.

midnight quarry
#

how where i host

tired panther
#

Discord just gives you the bot ACCOUNT .

#

On ur pc

#

On a vps xDDDD

mild flower
#

hey how do i check if a variable is the name of a role or the id of a role of that guild?

tired panther
#

here a link for the beginners 🙂

#

hey how do i check if a variable is the name of a role or the id of a role of that guild?
@mild flower do u want to male a info command?

mild flower
#

no

#

i want to make a ;role add command

#

where i want to get input

#

and check if that is a role name or an id

#

and then add that role to the user

midnight quarry
#

but i have now createt bot in developer portal then when i go on visualstudio code or other apps

mild flower
#

@midnight quarry bruh just watch a youtube video

midnight quarry
#

is very hard to see on yt

mild flower
#

anyways

#

what was the thing again

#

oh yeah scroll up

tired panther
#

You mention first

#

something like that

faint prism
#

how where i host
@midnight quarry on a dedicated server. So either buy a VPS, or host it yourself and never turn off the PC

mild flower
#

what

tired panther
#

@midnight quarry on a dedicated server. So either buy a VPS, or host it yourself and never turn off the PC
@faint prism I told xD. Yes Pc will get fried

mild flower
#

You mention first
GWczeWhat

faint prism
#

It won't "get fried"

tired panther
#

something with first mention

#

just google

#

@mild flower

earnest phoenix
#

how to add json to a js file
where json would have all bot's replies

faint prism
#

Require it

tired panther
#

Json gets fast corrupt

#

Why do not use db?

faint prism
#

He said replies, and as long as he's not updating the values, it's a fine use for JSON

tired panther
#

yes Indeed.

earnest phoenix
#

yeah, there would only be a text

faint prism
#

ie static data is fine to store in JSON

#

yeah, there would only be a text
@earnest phoenix google how to serialize JSON in JavaScript.
Don't worry, it's pretty easy.

earnest phoenix
#

alright then

tired panther
#

👍

mild flower
#

let rrole = args[1]
if(rrole = message.member.roles.cache.some(r => r.name == rrole))
im trying to detect if the string is a name of a role in a guild and this doesnt seem to be working

earnest phoenix
#

some?

tired panther
#

becuase the args has <@&>

#

@mild flower

#

you have to split it

#

make an if condition

#

If it has the things it splits

earnest phoenix
#

i think u should use .find instead of .some

mild flower
#

yeah

earnest phoenix
#

oh maybe do like this:
if (message.member.roles.cache.has(r => r.name === "rolename") {

mild flower
#

the args had nothing to do with it

#

@earnest phoenix doesnt that detect if the user already has that role?

#

oh wait nvm

earnest phoenix
#

yeh but u want to get the role? or check

dark kestrel
#

@earnest phoenix no bro

#

read the docs

mild flower
#

i want to get the role

earnest phoenix
#

i read the docs pretty well

mild flower
#

not check if the useer has the role

#

basically

#

makeing a role comamnd

dark kestrel
#

there are no .has()

mild flower
#

where we can add roles using the role name

dark kestrel
#

nice read

earnest phoenix
#

there is .has

#

and .get

#

.has for string and .get for id

dark kestrel
#

wait let me try

mild flower
#

yeah

#

there is .has

earnest phoenix
#

so you want a command

#

to add role to user

dark kestrel
mild flower
#

yeah i do

#

add using the role name

earnest phoenix
#
let roleName = message.guild.roles.cache.find(r => r.name === "roleName")
message.member.roles.add(roleName)
errant perch
#

whenever I try to write to file it says cannot access "variable" before initialization

earnest phoenix
#

what's your code

prisma oriole
#

your probably trying to do something like

console.log(myVar)

let myVar = 5;
// Not exactly this code, but along the lines of
mild flower
#

YES

#

@earnest phoenix thank you!

earnest phoenix
#

np

errant perch
#
bot.on("message", message => {
  if (message.channel instanceof Discord.DMChannel) return;
   if (message.author.bot) return;

const PREFIX = "m-"

  let level = JSON.parse(fs.readFileSync("./level.json", "utf8"));

  if (!level[message.author.id])
    level[message.author.id] = {
      age: 0,
    };
  let userData = level[message.author.id];

  fs.writeFile("./level.json", JSON.stringify(level), err => {
    if (err) console.error(err);
  });


  let args = message.content.substring(PREFIX.length).split(" ");
 
  switch (args[0].toLowerCase()) {
case "test":
            userData.age++;
            fs.writeFile("./level.json", JSON.stringify(level), err => {
              if (err) console.error(err);
            });
    break;
})```
dark kestrel
#

i just googled

#

@errant perch dude how u are even vertified, when ur bot doesn't have events handlers

earnest phoenix
#

yikes, don't use json as a database

errant perch
#

huh

dark kestrel
#

and using Json database

compact oriole
#

yikes, don't use json as a database
THIS

dark kestrel
#

: /

earnest phoenix
#

whats wrong with json

errant perch
#

lemme corrupt my data in peace

dark kestrel
#

Bad

prisma oriole
#

Lmao

earnest phoenix
#

as long as u r not storing terabytes per ms u'll be fine

errant perch
#

im to lazy to create a handler

#

there is no benefit for me

#

im going to soon

dark kestrel
#

not this

prisma oriole
#

but what about actually helping him instead of bashing him about json

#

but what about actually helping him instead of bashing him about json

#

but what about actually helping him instead of bashing him about json

compact oriole
#

json db is such a shit choice

earnest phoenix
#

correcting horrible code is helping

errant perch
#

its just a few numbers

compact oriole
#

for that it's ok

mild flower
#

if(rrole == message.mentions.roles.first())
this not working

errant perch
#

as long as there is no errors it wont corrupt

compact oriole
#

but if you save even a bit of more data it is horrible

dark kestrel
#
In case you didn’t got it by now: I strongly discourage you from adding JSON fields in a relational database. The only situation in which you should consider it is when you don’t have to query the JSON data with SQL (which is a pity). The JSON type will guarantee that the data inserted is correct (from a syntactic point of view) but you should not aim for more. Finally, it’s worth noting that the arguments I present in this post are applicable to other types: XML fields, Array fields (to some extend), etc. So be careful when you use fancy types, and make sure you use them for the right reason.
compact oriole
#

as long as there is no errors it wont corrupt
not true

earnest phoenix
#

you're using it for levels uhuh

dark kestrel
#

from https://www.thomascerqueus.fr/json-fields-relational-databases-postgresql/

errant perch
#

its just a name

#

chill

prisma oriole
#

bro @errant perch what did you need help with

#

lmao

#

they just go on about json

errant perch
#

one sec

#
bot.on("message", message => {
  if (message.channel instanceof Discord.DMChannel) return;
   if (message.author.bot) return;

const PREFIX = "m-"

  let level = JSON.parse(fs.readFileSync("./level.json", "utf8"));

  if (!level[message.author.id])
    level[message.author.id] = {
      age: 0,
    };
  let userData = level[message.author.id];

  fs.writeFile("./level.json", JSON.stringify(level), err => {
    if (err) console.error(err);
  });


  let args = message.content.substring(PREFIX.length).split(" ");
 
  switch (args[0].toLowerCase()) {
case "test":
            userData.age++;
            fs.writeFile("./level.json", JSON.stringify(level), err => {
              if (err) console.error(err);
            });
    break;
})``` whenever i run the test command it says cannot access "level" before initialization
dark kestrel
#

some mods who is watching this channel

#

can u pin this

mild flower
#

lol

prisma oriole
#

dude

earnest phoenix
#

bruh

#

that code is asking for corruption lol

#

it doesn't have a mutex or locks

mild flower
#

Sb93 has made a pin to this channel. Click here to view all pins

#

lol

errant perch
#

rule 8

#

😳

prisma oriole
#

@errant perch why use fs.readFileSync, you could try importing it directly

dark kestrel
#

aghhh

#

im done

faint prism
#

Ok

errant perch
#

how would i do that lol

slender thistle
#

can u pin this
We'd rather help than judge people for their choices

prisma oriole
#

const level = require('path/to/level.json')

#

thank you shivaco

errant perch
#

[{"name":"John","age":"17"},{"name":"Jack","age":"36"},{"name":"Rick","age":"76"}]

//in js
const list = require( 'list.json' );
console.log(list);

slender thistle
#

The jsondbbad pin is there only as a guidance

prisma oriole
#

think you gonna do ./list.json

errant perch
#

i'll try this out

prisma oriole
#

not just list.json

errant perch
#

ok

earnest phoenix
#

require has caching behaviour

faint prism
#

@errant perch that looks like mutable data. And would therefore be more applicable in a database

prisma oriole
#

bro

compact oriole
#

auger with da facts

earnest phoenix
#

do it before it's too late, you're going to regret not doing it later lol

prisma oriole
#

my brain

compact oriole
#

also once you have a db setup, you can use it for other things

#

it's easier now than later

errant perch
#

im currently learning german and why json will get you trashed

prisma oriole
#

its funny how you guys have spent the last 10 minutes just bashing him about json instead that helping

faint prism
#

It might seem easy to just serialize a collection. But doing that continuously will result in file access issues and eventually mess up the tokenization process corrupting your JSON database

errant perch
#

lol

dark kestrel
#

i think the youtubers that making discord tutorials are bad

#

they make ppl use json

errant perch
#

i didnt watch a youtuber for this

slender thistle
#

As long as you aren't rewriting contents to the file on a constant basis, it's alright

faint prism
#

Yeah

earnest phoenix
#

which they are lol

#

on every message

errant perch
#

nope

#

im not

prisma oriole
#

i think the people that criticize people who take time out of their day to teach beginners developing are bad

faint prism
#

Static data, like config, or predetermined replies are fine and JSON files

compact oriole
#

@prisma oriole uses json db erww

#

run away or he will infect us

slender thistle
#

Caching for life

prisma oriole
#

i use mongodb, and am currently migrating to psql??

dark kestrel
#

static data (token, prefix) better use .env

earnest phoenix
#

can't cache my heroku instAncE gIves mE 5 mb Of Ram :(((((((((((((((( helpP LS

prisma oriole
#

i just want to help the poor dude rather than waste his time talking about json

slender thistle
#

I sometimes feel like muting anyone who can't stand JSON databases here

faint prism
#

You can, but I honestly don't think it matters

compact oriole
#

I should setup a redis server

earnest phoenix
#

redis yuck

compact oriole
#

for caching lul

prisma oriole
#

redis is fire watchu mean 😔

compact oriole
#

it is super fast caching but as a db :P

earnest phoenix
#

overengineering your code

compact oriole
#

postgresql for life

earnest phoenix
#

redis can be boiled down to a simple dictionary/list in your code, if you want to share data there's always IPC and named pipes

#

so like

#

to me it's just overengineering and bloating

dark kestrel
#

imma move to heroku :))

compact oriole
#

It is not useful if you have on process/app

#

BUT

prisma oriole
#

bashing users about json then using heroky

#

heroky

#

heroku

compact oriole
#

if you have kubernetes, it is required

prisma oriole
#

seems a bit hypocritical

errant perch
#

hmmm yes

#

free ide

compact oriole
#

like you can't cache stuff in a dictionary when user multiple clusters/nodes

faint prism
#
#Things not to mention in dbl
- json
- @mods
compact oriole
#

jsondb*

prisma oriole
#

lol

slender thistle
#

I wonder why people can't mention jsondb

errant perch
#

scroll up

compact oriole
#

I luv json but jsondb >:(

slender thistle
#

and if getting shat on for using one is really the user's issue

prisma oriole
#

they dont know how to help the person so they just resort to bashing users about json to think they're doing something productive shrug

compact oriole
#

and if getting shat on for using one is really the user's issue
they had the chance to not use it so now we make them >:)

earnest phoenix
#

it's preventing an issue that's granted to happen; corruption and access violations

#

and then they're going to complain how it doesn't work and how it got messed up

#

lol

compact oriole
#

it's better to make their bot not tilt

slender thistle
#

Let users suffer the consequences of their choices

compact oriole
#

than to fix a small bug

prisma oriole
#

its understandable if you just said "I'd reccomend db over json", and then proceeded to assist him. But yall didnt even do that

slender thistle
#

Almost every time I see users being judged for jsondb ends up in literal violation of rule 1

errant perch
#

i use .json for other commands and it works just fine

#

¯_(ツ)_/¯

earnest phoenix
#

try it with more than 10 people using your bot per hour

#

i use json to store my token, api keys and shit, etc

prisma oriole
#

they're concern is that it won't work as well at a more higher use case

earnest phoenix
#

once you put stress on a json database it's going to fall flat and die

faint prism
#

I serialized directly to bytes mmLol

errant perch
#

i doubt im going to get that far

#

but sick 😎

compact oriole
#

i use json to store my token, api keys and shit, etc
different thing

#

that's just a config :P

#

I use .env but same idea

errant perch
#

same

compact oriole
#

it is data not being constantly saved

earnest phoenix
#

I serialized directly to bytes mmLol
i write binary on a piece of paper then OCR it and send pulses to the cpu BigBrain

faint prism
#

OCR it
Reeeeeeeeee
Enjoy the corrupted data

stuck scaffold
errant perch
#

let level = JSON.parse(fs.readFileSync("./level.json", "utf8"));

faint prism
#

Just require it

errant perch
#

o

prisma oriole
#

thats what i said

errant perch
#

oh

prisma oriole
#

lol

earnest phoenix
#

require has caching behaviour

errant perch
#

shutup

#

i dont wanna hear it

prisma oriole
#

lMao

compact oriole
#

lmao

#

then fuck off and don't ask for help

earnest phoenix
#

your data literally won't be up to date lol

prisma oriole
#

dude require uses json wtf

compact oriole
#

if you don't like help don't ask

prisma oriole
#

require is bad

#

console.log uses json

#

wtf

#

so bad

earnest phoenix
#

shut the fuck up oh my god

errant perch
#

delete code and install fortnite

earnest phoenix
#

require caches the thing you require, even though you write new data to the file the required file won't be up to date because, well, it's cached

prisma oriole
#

development channel go brrrrrrrrr

faint prism
stuck scaffold
errant perch
#

i dunno looks like json to me

#

¯_(ツ)_/¯

earnest phoenix
#

you have a recursive call somewhere that looped so much it errored out

#

try googling the error and attaching mongodb to it

stuck scaffold
#

hmmm

earnest phoenix
stuck scaffold
#
  useNewUrlParser: true,
  useUnifiedTopology: true,
  useFindAndModify: false,
})```
sly marten
#

@near veldt

#

here

near veldt
#

ok

leaden flame
#

:__:

fervent goblet
#

is there a video where i can learn image generation with canvas?

#

anything you guys recommend that is

earnest phoenix
#

will checking perms on every message affect ratelimit?

#

pls @ ping me 🙂

sinful belfry
#

@earnest phoenix it won't if the perms are cached by ur bot

earnest phoenix
#

I'm trying to make an emoji info, but when the user sends the emoji ready it gives as invalid, so I made an expression to remove the "<" and ">" you can tell me if it's right?

sinful belfry
#

in most cases, they are cached

earnest phoenix
#
message.guild.emojis.cache.get(args[0].slice("<", ">")) || message.guild.emojis.cache.find(emoji => emoji.name === args.join("_")) || message.guild.emojis.cache.find(emoji => emoji.id === args.join("_")) || message.guild.emojis.cache.find(emoji => emoji.url === args.join("_")) || message.guild.emojis.cache.find(emoji => emoji.identifier === args.join("_"))```
sudden geyser
#

emojis can look like <:name:id> and <a:name:id> for animated emojis. Your best bet is to use a regular expression to parse the emoji for the name & ID.

earnest phoenix
#

I wanted him to take months <> to be able to recognize the name or id

gentle lynx
clever beacon
#

quick aiohttp (Python) question, when handling a request I have some code like this for example:

return web.json_response({"error": "invalid_auth_header"}

this returns a 200 OK response, which I don't want since it's an error. so, I tried this:

return web.json_response({"error": "invalid_auth_header"}).set_status(400) # Bad Request

but now, cURL tells me that the server returns an empty response. why?

quick lily
#

Does anyone have the code to give charge for the badge?

clever beacon
#

what?

quick lily
#

The code for autorole by badge

slender thistle
#

@clever beacon Tried using web.Response yet?

clever beacon
#
  1. we have no idea what language you're using
  2. we're just here to help, not make everything for you
#

@clever beacon Tried using web.Response yet?
@slender thistle i'll try that and just add a content-type header

slender thistle
#

👍

clever beacon
#

i just don't understand why this wouldn't work since it's just a pre-configured web.Response

slender thistle
#

ig that's the exact reason

placid iron
#

why do you want json with curl anyway?

#

try return web.json_response({data}, status = 400)

clever beacon
#

well, I'm just using cURL for testing

#

yeah that worked

#

thanks!

crystal mountain
#
const puppeteer = require('puppeteer');
fs = require('fs');

exports.run = async(client, msg, args) => {
    var names = args.splice(0).join(' ');
    var configs = JSON.parse(fs.readFileSync("./warinfo.json"));
    configs["status"] = "idle";
    const json = JSON.stringify(configs);
    fs.writeFile("./warinfo.json", json, (err) => {
        if (err) {
            console.log(err);
        }
    });
}

it doesnt do anything why?

sudden geyser
#

Do anything by what means. Does it write anything? Have you tried debugging to see if the callback was successful?

crystal mountain
#

not really

#

it should write idke

#

idle”

tardy hornet
#

any idea how to put own emojis there, (i have my emoji and i don't know how to put him there like in the picture )

solemn latch
sudden geyser
#

start each line with an emoji?

earnest phoenix
#

@earnest phoenix it won't if the perms are cached by ur bot
@sinful belfry probably, I check the perms for the client in the message.channel

sinful belfry
#

d.js?

earnest phoenix
#

yes

sinful belfry
#

yeah pretty certain theyre all cached

#

youll be fine

earnest phoenix
#

any idea why my ws.ping increases with 15k when i use my stats command

#

it just fetches values from the shards

sinful belfry
#

wtf 15k?

earnest phoenix
#

yes

sinful belfry
#

is it adding them up or something

earnest phoenix
#

it only happens when i use my stats command

sinful belfry
#

its possible ur just adding the ws ping up 👀

#

otherwise im not entirely sure why that would be happening, sorry

earnest phoenix
#

wdym?

errant perch
#

hey

#

im back

sinful belfry
#

are you just adding the client.ws.ping of each shard?

#

also does this happen all the time?

#

might just be a blip/discord being slow briefly

earnest phoenix
#

my stats command uses fetchClientValues and broadcastEval to count the members etc.

#

but when i use that

#

and i eval the ping of the bot on the shard im using

#

it's +15k

#

after a minute or so

#

it goes down

sinful belfry
#

ig it might just be a blip then?

#

not too sure tho zoomeyes

earnest phoenix
#

blip?

drifting wedge
#

is html and ejs the same?

sinful belfry
#

basically just a spike in the ping

drifting wedge
#

like file type?

#

i have a .ejs file thats in html

earnest phoenix
#

ok thanks

#

gl with your homework

sinful belfry
#

@drifting wedge ejs is a html rendering engine

#

hehe ty

drifting wedge
#

so can i like rename ejs files to .html?

sinful belfry
#

no, you cannot

drifting wedge
#

and also, how can use python as backend?

#

like instead of js?

sinful belfry
#

it basically puts html together to form a html document as its output

#

not too sure, sorry

#

there are probably great guides online, or people who can help u out here but i dont do python :(

earnest phoenix
solemn latch
#

define client?

earnest phoenix
#

Well yes

#

I have the package and stuff

#

but it says error

#

idk im still new to this

solemn latch
#

isnt it supposed to be

client = discord.Client()

``` or something 🤔
earnest phoenix
#

I dont know

#

Lemme try it

#

or not

#

hmm

frail ocean
#

Use documentation and look it up. We can't give you all the code.

earnest phoenix
#

Okay.

frail ocean
#

You should know the basics of coding before you do major projects.

earnest phoenix
#

this is just a project

#

nothing much

solemn latch
#

bots are often major projects

#

mines 6 months in or so, just took a month and a half break, still got much more work to do 🤷‍♂️

earnest phoenix
#

How do I fix this: `Application run failed

java.lang.UnsupportedClassVersionError: lavalink/server/info/AppInfo has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0`

vital flax
#

Does anyone have examples for Detailed description ?

solemn latch
#

any bots page, the long description @vital flax

frail ocean
#

Don't copy and paste it though.

solemn latch
#

^ ez rejection

frail ocean
#

Anything about your bot basically, explain it. It's what people look at when they think of what they wish to invite.

drifting wedge
#

@earnest phoenix

#

dont make it on ready

honest inlet
#

Hi just got here, how do I invite the bot I made? I am also looking to post it :)

drifting wedge
#

or else every time u start bot it sends MY PREFIX IS .....

#

not when it joins a guild

vital flax
#

@frail ocean i mean the theme

solemn latch
#

@honest inlet invite it here? dont think they add new bots here
to submit a bot for the website
https://top.gg/newbot

vital flax
solemn latch
#

CSS

honest inlet
#

I meant to my server lol

earnest phoenix
#

or else every time u start bot it sends MY PREFIX IS .....
@drifting wedge oof

solemn latch
#

oh, you need to generate an invite link

vital flax
#

Ah

honest inlet
#

Idk how

solemn latch
#

i need to make lunch, will be back in about 30 min.

slender thistle
#

and also, how can use python as backend?
@drifting wedge Use a webserver framework

drifting wedge
#

alr alr

#

i have someone working with me who knows what theyre doing

#

its for the dashboard

slender thistle
#

I wish I had someone who knows their shit work with me...

drifting wedge
#

lol

#

i have a group of 4

#

and a designer

errant perch
#

is it bad to have like 40 .js files

#

for a command handler?

solemn latch
#

Just the command handler? Or including the commands

errant perch
#

including the command

solemn latch
#

Thats normal

errant perch
#

ok good

drifting wedge
#

lol the bot im working on is like becoming something big lol

errant perch
#

what is it

drifting wedge
#

well i mean its not a secret

#

but like i dont wanna self promote

earnest phoenix
#

I'm bored
ping meh if you need help with JavaScript

errant perch
#

then dm me im curious

earnest phoenix
#

It's not advertising if the guy deliberately asks for info about the bot

#

@green kestrel trivia bot dashboard optimized for mobile when?

#

you should make a seperate whole version for novile users

#

everything is same except the HTML layout

#

there's a heckload of ways you can check what device the user is using (please HTTPS only)

compact oriole
#

why separate version

#

I always make my site optimized for pc and mobile, with the same stylesheet and backend/framework

earnest phoenix
#

why separate version
@compact oriole how the fuck would you change the HTML layout on the same page using js
that'll slow down the website a snol amount
and by seperate version i meant basically a full copy of the dashboard except the HTML layout is optimised for mobile

primal oar
#

anybody else change their bots name recently on discord discord dev portal and it just take abnormally long?
pfp changes fine but i changed my bots name over 10 hours ago and it still hasn't changed

slender thistle
#

You sure you didn't change the application's avatar instead?

green kestrel
#

@compact oriole @earnest phoenix its already mobile friendly except for some tables, it uses bootstrap 4

#

if you find something you cant work with on mobile ping me, i'll fix it

#

@primal oar you verified? you cant change the name of a verified bot

primal oar
#

nah im not verified

tardy hornet
#

i have a command that i want it to ask them if they want to do it or not and if they type "yes" it will do the command.
someone know?

primal oar
#

the thing is the name changes on the application page itself and the role it creates when the bot joins a server changed but the bots actual name doesnt change

solemn latch
#

@tardy hornet message collectors

tardy hornet
#

idk how to make it

primal oar
#

yeah so i figured it out, didnt know the bot had a whole username page

solemn latch
#

Docs for your library will tell you

compact oriole
#

@compact oriole how the fuck would you change the HTML layout on the same page using js
that'll slow down the website a snol amount
and by seperate version i meant basically a full copy of the dashboard except the HTML layout is optimised for mobile
you have then never made a site mobile in mind with a modern framework

#

I can make it mobile friendly with 99.9% css

#

it doesn't need js to make it mobile friendly

#

I only uses js to polyfill request libs

#

well of course the site is primarily made with js/ts, but it has nothing to do with compatibility

solemn latch
#

Pretty sure with just media in css you can do mostly anything you need to make a desktop site mobile compatible

restive furnace
#

and most frameworks do it for you

solemn latch
#

Oo thats nice 🤔

misty sigil
#

The jsondbbad pin is there only as a guidance
@slender thistle its pinned?

#

last time i checked it was the free hosting thingy

slender thistle
#

idk, I get fairly exhausted throughout the day with my studies

misty sigil
#

well then pin it

fervent goblet
#
    const nodes = [
        {
          id: "main",
          host: "localhost",
          port: 2333,
          password: "youshallnotpass",
        },
      ];
      
    const manager = new Manager(nodes, {
        shards: 1,
        send(id, data) {
          const guild = client.guilds.cache.get(id);
          if (guild) guild.shard.send(data);
          return;
        }
      });
      manager.use(new QueuePlugin());

module.exports = manager;

how do i call client from a separate file so i can use it here?

earnest phoenix
#

you can create a class and take in the client from the constructor

#

at least that's what i'd do

fervent goblet
#

tbh i have never used classes before

cinder patio
#

You can also export a function which takes the client as a parameter and returns the manager instance

faint prism
#

youshallnotpass
I almost think that is a legit pass

solemn latch
#

I have some pretty goofy passwords for my internal stuff

#

its not goofy enough to be real

ripe quest
#

!addmembers

faint prism
#

My guest wifi password is: fourwordsalluppercase
So when I go to say it, its: "four words all uppercase, one word all lowercase"

ripe quest
#

!addmembers

faint prism
#

!addmembers
@ripe quest no

ripe quest
#

it doesnt do anything

earnest phoenix
#

@compact oriole @earnest phoenix its already mobile friendly except for some tables, it uses bootstrap 4
@green kestrel basically the whole website except individual server dashboards aren't optimized

ripe quest
#

I dont even have a bot here

solemn latch
#

still shouldnt attempt commands in dev channels

ripe quest
#

ok

earnest phoenix
#

goto #commands if your bot is already invited to this server

#

(we don't invite any more bots btw)

ripe quest
#

Sorry

karmic compass
#

is there a way to split a string by each character

#

so ```js
"Cool!"

```js
["C", "o", "o", "l"]
earnest phoenix
#

@karmic compass just pass an empty string in the split function

#

String.split("");

karmic compass
#

so ""

#

ah

earnest phoenix
#

that's it

#

it'll split at every character because there is nothing between each character and we're passing nothing (by nothing i mean empty string)

tardy hornet
cinder patio
#

There's also Array.from("Cool");

tardy hornet
#

why its not deleting it after 10s

#

?

cinder patio
#

Because .then accepts a function

#

and message.delete returns a promise

karmic compass
#
message.channel.send("B").then(m => {
setTimeout(() => {
  m.delete()
}, 10000)
})
tardy hornet
#

ty

cinder patio
#

message.delete(10000) is also a thing but alright

#

Buut I think you need to provide an object with a timeout property {timeout: 10000} for example

earnest phoenix
#

@cinder patio you can also just pass message.delete into .then without the parenthesis and it'll work but you can't do the timeout

cinder patio
#

Why are you telling me this? I know, and also you can pass the function itself with the timeout parameter with the bind function

earnest phoenix
#

Why are you telling me this? I know, and also you can pass the function itself with the timeout parameter with the bind function
@cinder patio this channel is all aboud madness

limber flume
solemn latch
limber flume
#

broken

#

github broken

#

why this do this i use right things

mint shuttle
#

does the webhook link have /github at the end?

limber flume
#

OH

mint shuttle
limber flume
#

lol im dumb

tardy hornet
#

now working

#

still saying that i dont have the premissions

still merlin
#

Do you have administrator perms?

tardy hornet
#

yes

still merlin
#

Are you the server owner, or someone with a role?

cinder patio
#

Look at your if statement again... if the message member HAS the ADMINISTRATOR permission, you send the "you don't have permissions" error

tardy hornet
#

oh

#

how do i fix that @cinder patio

still merlin
#

Your if statement is wrong,

if(

you need
if(!

cinder patio
#

Check if the member doesn't have the admin permission, aka if hasPermission returns false

#

there are several ways to check

still merlin
#

Your method is checking if you have the administrator permission, And you do, But you've set it to return false even if you do, Try it like

if (!message.member.hasPermission
stark abyss
#

yeah ! means not

#

so if they don't have the permission-

#

im late asf 😔

tardy hornet
#

didnt work

#

want me to send here to code?

clever beacon
#

yes

slim heart
#

for storing peoples school classes should i do
a) different entry's for all the classes in one big db, with ids attached to them so i'd have to do

classes.find({
  user: 'jpbberry' 
})```
or
b) one user entry with an array of class data like
```js
.findOne({ id: 'jpbberry' }).classes```
idk which is better practice
tardy hornet
#

thats the part that is not working:

case 'setup':
                  message.delete()

                  if (!message.guild.me.hasPermission("ADMINISTRATOR")){
                    return message.channel.send("I don't have permission to that.");
                  }
                    if(!message.member.hasPermission('ADMINISTRATOR')){
                      message.reply('you dont have the premissions to use this command!');
                      return;
                  } 
torpid tiger
#

My bot gives such an error even though the command is not used, what do you recommend me to do?

solemn latch
#

means the bot doesnt have permission to do what you have it doing

torpid tiger
#

Something what?

honest inlet
#

I'm filling out the form to submit a bot and it says I need to write my commands. Where do I put that?

solemn latch
#

write your commands?

honest inlet
#

Yeah where

solemn latch
#

🤷‍♂️ lemme open the page, they musta changed it

honest inlet
#

Kk

torpid tiger
#

@solemn latch ı didn’t use a command but it is saying this error

solemn latch
#

is your bot public?

torpid tiger
#

Yeah

solemn latch
#

then someone else did

torpid tiger
#

Bu ı can see when the command used

tardy hornet
#

thats the part that is not working:

case 'setup':
                  message.delete()

                  if (!message.guild.me.hasPermission("ADMINISTRATOR")){
                    return message.channel.send("I don't have permission to that.");
                  }
                    if(!message.member.hasPermission('ADMINISTRATOR')){
                      message.reply('you dont have the premissions to use this command!');
                      return;
                  } 
solemn latch
#

no, thats why you need to check perms before every api request

eager raft
#

:/

solemn latch
#

i dont see what your seeing on the submit page @honest inlet

honest inlet
#

Lemme send a pic

solemn latch
#

generally youd write commands in the long description

honest inlet
#

Yeah it's very simple, only one command. I wrote it there

solemn latch
#

and is there an error anywhere when you submit?

honest inlet
#

Yes, it says the long desc is too short and that I need to write my commands

pure lion
#

ah, this channel once again

honest inlet
#

IT WORKED!

tardy hornet
#

someone can answer me?

pure lion
#

so i have some css on my site thats not allowing me to select fields on a text box

tardy hornet
#

someone?

pure lion
#

but when a certain element is deleted i can then select everything i need

tardy hornet
#

someone can please answer me?

solemn latch
#

whats not working 🤔

tardy hornet
#

asking me?

solemn latch
#

ye

tardy hornet
#

ty