#development

1 messages ยท Page 1782 of 1

young rune
#

....

#

i mean the date-

tender raft
#

Ask stupid questions get stupid answers

young rune
#

lol

tender raft
#

Fax

#

What date you think I'm in

young rune
#

lol

tender raft
#

6/14/2022

young rune
#

idk

young rune
#

22???

#

wth

tender raft
#

Like come on dude if you need to buy common sense your in luck my shop's open

#

1 knuckle sandwich is $100
I black eye is $200

#

Nevertheless Pop Plays call me whenever your ready

young rune
#

kk

wanton pebble
#

any one ther

sage bobcat
#

One message removed from a suspended account.

wanton pebble
#

heyy

#

do you know how to write code so your bot auto deletes the command start up
so if i go !ping it will delete the !ping and say Pong

sage bobcat
#

One message removed from a suspended account.

wanton pebble
#

could u help me with it

sage bobcat
#

One message removed from a suspended account.

wanton pebble
#
  name: 'ping',
  description: "a command used to Ping the bot.",
  execute(message, args){
    message.channel.send('Pong!');
  }
}``` This is what i have for ping command rn
wanton pebble
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

wanton pebble
#

ok thx

wanton pebble
#

message.delete().catch(O_o=>{});

young rune
#

i finally figured out how to use repl's secrets-

#

wow-

#

took me 5 minutes -_-

long crow
#

Not so secret anymore I guess

young rune
#

lol

fleet radish
#
new Client({
  partials: ['MESSAGE', 'CHANNEL', 'USER', 'REACTION'],
})```

```js
 if (messageReaction.partial) await messageReaction.fetch();
  if (messageReaction.message.partial) await messageReaction.message.fetch();```
im doing this but still the old non cached ones wont work
earnest phoenix
#

i am making 2d minecraft inside discord
am i in my right mind

young rune
#

how

#

that possible

earnest phoenix
#

umm

#

with only 50 lines of code?

#

@coral trellis scam website above

wheat mesa
#

so many of these guys

earnest phoenix
#

^this only works on custom emojis

#

for default emojis type \:emoji: in chat

round cove
#
class Command {
   public:
    Command(const std::string & name, const std::string & desc = ""): m_name(name), m_description(desc) {}

    std::string m_name;
    std::string m_description;

    virtual void command_exec(const std::vector<std::string> words) = 0;

    void run(
      const dpp::message_create_t & event,
      const std::function<void(std::vector<std::string>)> & callback
    ) {
      const std::vector<std::string> words = content(event);
      callback(words);
    }

    inline std::vector<std::string> content(const dpp::message_create_t & event) {
      std::stringstream ss(event.msg->content);
      const std::istream_iterator<std::string> begin(ss);
      const std::istream_iterator<std::string> end;
      const std::vector<std::string> words(begin, end);
      
      return words;
    }

    bool canRun() {
      return true;
    }

  private:
    static int commandsRan;
};``` @latent heron
latent heron
#

what in the unholy fuck is this

#

oh no

#

I have numerous questions and concerns

#

this is r/programminghorror at its finest

round cove
#

Concerns?

#

How

latent heron
#

why is the word content as a constant

earnest phoenix
round cove
#

If you don't know const correctness don't talk to me

#

Literally

latent heron
#

const is fucking stupid

round cove
#

you're fucking stupid

#

holy fuck

latent heron
#

if you're able to have dynamically changing values

#

DYLAN YOU ARE DUMB

#

THE WHOLE POINT OF A CONSTANT

#

IS THAT ITS CONSTANT

#

IT DOESNT CHANGE

round cove
#

EXACTLY

earnest phoenix
#

var sucks
let is better

round cove
#

????????????????

latent heron
#

BUT

#

IF THE CONTENT SOMEHOW CHANGES
COUGH EDITING

#

IT AINT CONSTANT

round cove
#

IT'

#

S PER MESSAGE

latent heron
#

BUT THE MESSAGE CAN BE CHANGED

earnest phoenix
#

YES
BUT LET AND CONST ARE BETTER THAN VAR

round cove
#

THEN IT'LL BE UPDATED????

latent heron
#

VAR IS BETTER THAN YOUR BOTUM

round cove
#

VARIABLES ARE DESTROYED WHEN THE SCOPE IS OUT

#

?????????????????????????????????

latent heron
#

ok

round cove
#

holy shit dude

earnest phoenix
latent heron
#

i've triggered dylan

round cove
#

var is literally auto

latent heron
round cove
#

lmao

latent heron
#

i've succeeded

round cove
#

gg

#

dylan triggered

#

malding

latent heron
#

malding

#

why is that a fucking term lmaoo

round cove
#

TIL sirius doesn't know c++

#

s

#

mh

latent heron
#

no i do

#

i just hate coding in it

round cove
#

bad then

latent heron
#

i personally find more excitement in PHP than C++

round cove
#

no wonder you use php

latent heron
#

LMAO

round cove
#

g

#

g

latent heron
#

the salt

#

i've broken dylan

round cove
#

don't even use php correctly

latent heron
#

what's the correct way of using it then

round cove
#

templating

latent heron
#

ehhh

round cove
#

literally the purpose of the language

#

any other use is torturing the devs

latent heron
#

i disdain template engines in php

earnest phoenix
#

since when did we have a spam channel

round cove
#

lmao

latent heron
#

oh dylan

#

wanna see some cool php code i wrote

round cove
#

go on

latent heron
#

no

round cove
latent heron
sudden geyser
#

we are once again reminded that javascript sucks

sudden geyser
prime mist
#

I thought they were talking about rust lol.

sudden geyser
#

I am once again reminded that I can't read.

#

they were talking about C++ and i somehow interpreted it as javascript by seeing 913's var statement

#

also what the fuck it's 12 am

earnest phoenix
sudden geyser
#

The reasons are indescribable.

opal plank
#

im quiet on my corner ffs

sudden geyser
#

detritus bad

opal plank
#

i smell haters who never tried the lib

earnest phoenix
#
var intervall = setInterval (function () {
            client.guilds.cache.forEach(guild => {
                 let checkif = db.fetch(`voiceactivity_${guild.id}`) 
                 if(checkif === true) {
                  let voicegain = db.fetch(`voicegain_${guild.id}`)
            const voiceChannels = guild.channels.cache.filter(c => c.type === 'voice');
            let idUser = [];
        for (const [id, voiceChannel] of voiceChannels){
            voiceChannel.members.forEach(member => {
                idUser.push(member.user.id)
            });
            let membercount = idUser.length;
            for (var i = 0; i < membercount; i++) {
                  let member = client.users.cache.get(idUser[i]);
                  let verif = db.fetch(`balance_${guild.id}_${member.id}`) 
                       if(verif === null) return
                  if(member.bot) return;
                        console.log(member.id + member.tag + ` ${voicegain}`)
                       
                        db.add(`balance_${guild.id}_${member.id}`, voicegain) 
                        let lchannel = db.fetch(`lchannel_${guild.id}`) 
                        if(lchannel === null) return;
                       let asend = guild.channels.cache.get(lchannel)
                       if(asend){
  const color = db.fetch(`embedcolor_${guild.id}_${member.id}`)
asend.send({embed:{ description: `${member} vient de gagner \`${voicegain} coins\``, color: color, author: { name:`โฐ 15 minutes de vocal` }, footer: { text: `๐Ÿ•™ ${getNow().time}` } }})
                       }
            }}
           
        }
      })
          }, 90000);```

Why its spamming x5 messages ?
This should add a sum of money to the voice person every 15 minutes
opal plank
#

also you have a loop there in ur code

earnest phoenix
#

Yes

opal plank
#

take a guess why thats going on

#

also avoid using forEach()

earnest phoenix
#

:////

opal plank
#

also this indentation is killing me

earnest phoenix
#

I only want get all user in voice channel wtf

prime mist
#

Yes but you are making our eyes bleed :)

opal plank
#

pls lint ur code

#
var intervall = setInterval(function () {
  client.guilds.cache.forEach(guild => {
    let checkif = db.fetch(`voiceactivity_${guild.id}`);
    if (checkif === true) {
      let voicegain = db.fetch(`voicegain_${guild.id}`);
      const voiceChannels = guild.channels.cache.filter(c => c.type === 'voice');
      let idUser = [];
      for (const [id, voiceChannel] of voiceChannels) {
        voiceChannel.members.forEach(member => {
          idUser.push(member.user.id);
        });
        let membercount = idUser.length;
        for (var i = 0; i < membercount; i++) {
          let member = client.users.cache.get(idUser[i]);
          let verif = db.fetch(`balance_${guild.id}_${member.id}`);
          if (verif === null) return;
          if (member.bot) return;
          console.log(member.id + member.tag + ` ${voicegain}`);

          db.add(`balance_${guild.id}_${member.id}`, voicegain);
          let lchannel = db.fetch(`lchannel_${guild.id}`);
          if (lchannel === null) return;
          let asend = guild.channels.cache.get(lchannel);
          if (asend) {
            const color = db.fetch(`embedcolor_${guild.id}_${member.id}`);
            asend.send({
              embed: {
                description: `${member} vient de gagner \`${voicegain} coins\``,
                color: color,
                author: { name: `โฐ 15 minutes de vocal` },
                footer: { text: `๐Ÿ•™ ${getNow().time}` },
              },
            });
          }
        }
      }
    }
  });
}, 90000);```
earnest phoenix
#

Yes i see that wtf

opal plank
#

you get lost on ur own mess without linting

#

first, like i said, fix your var

#

and foreach

earnest phoenix
#

Im not on my computer now but ok

opal plank
#

also idk what db u have, but you sure those arent promises?

earnest phoenix
#

But how fix my foreach sad

opal plank
#

most db's are promise based

#

use for ... of

earnest phoenix
#

I'm not good at

#

hey if anyone knows mysql

wanton pebble
#

anyone know how to do a message edit

#

for.js

earnest phoenix
#

im trying to make a warn command with case numbers, and when someone warns a user, it adds 1 to the case number, and puts it in the database

earnest phoenix
#

pretty sure that works

wanton pebble
#

ok

earnest phoenix
#

I think i found something people are using to bypass Top.gg's System.
And Verifying there own Bots.

boreal iron
spare badger
#

@earnest phoenix Can you describe it to me in DM?

earnest phoenix
#

Sure!

slender thistle
#

How much of it makes logical sense

earnest phoenix
opal plank
prime mist
#

Had a quick look into this, and using it with JavaScript isn't too bad. Still get the intellisense stuff if you are using an editor that support it.

earnest phoenix
#

any ejs gurus here?

#

<%=card("<%=guild.id%>")%>

#

how can i have a template inside a template

prime mist
woeful pike
#
<% card("`${guild.id}`") %>
tired panther
distant bramble
#

lol

terse lynx
#

How to detect member voted to server?

earnest phoenix
#

how do i get my bot to reply like this

lament rock
# earnest phoenix how do i get my bot to reply like this

depends on the library you're using. If you're using the raw rest, you need to send a payload similar to:

POST /channels/:channel_id/messages
{
  "content": "This is a reply."
  "message_reference": {
    "message_id": "854279202114371584"
  }
}
lament rock
#

message.reply

earnest phoenix
#

If i do message.reply

lament rock
#

You need to install discordjs/discord.js then

earnest phoenix
#

npm i discordjs/discord.js?

lament rock
#

yeah

earnest phoenix
#

@lament rock

lament rock
#

install git

earnest phoenix
#

Same error

lament rock
#

restart your cmd window after you install git

earnest phoenix
#

Same

lament rock
earnest phoenix
#

I installed npm i git

lament rock
#

That's not what you needed to do AlienPersianDerp

prime mist
earnest phoenix
#

Npm i git/scm?

lament rock
#

no lol

earnest phoenix
#

I am noob tell me more clear

lament rock
#

go to that link and download the windows version

prime mist
#

npm install Photoshop

earnest phoenix
#

I host my project on Glitch

lament rock
#

okay... and?

#

just now re-read that. Thought you said GitHub. Not Glitch. I'm tired. Look up how to install git on glitch

lavish bramble
#
const fs = require('fs');
const Discord = require('discord.js');
const emojis = ['โš”', 'โš™', '๐Ÿƒ', '๐ŸŽƒ', '๐ŸŽŠ', '๐ŸŽญ', '๐ŸŽฎ', '๐ŸŽผ', '๐Ÿ”Ž', '๐Ÿ–ผ', '๐Ÿค–'];
module.exports = {
	name: 'ehelp',
	execute: async (client, message, args) => {
		const embed = new Discord.MessageEmbed()
			.setTitle('Help Menu!')
			.setDescription('Which Category you want to check!')
			.setColor('RANDOM')
			.setFooter(message.author.username, message.author.displayAvatarURL());

		const m = await message.channel.send(embed);
		for (const reaction of emojis) await m.react(reaction);

		const filter = (reaction, user) =>
			emojis.includes(reaction.emoji.name) && user.id === message.author.id;

		const collector = m.createReactionCollector(filter, { time: 60000 });

		collector.on('collect', reaction => {
			reaction.users.remove(message.author);
			if (reaction.emoji.name === '๐ŸŽƒ') {
				embed.setDescription(getcmd('FUN'));
				m.edit(embed);
			}
		});

		collector.on('end', () => {
			if (!m.deleted) {
				m.reactions.removeAll();
			}
		});
	}
};
async function getcmd(dir) {
	fs.readdirSync(`../../commands/${dir}`).forEach((file) => {
	  console.log(file.name)
	})
}

Error : no such file or directory

cinder patio
#

Your path is incorrect, fs paths are relative to where you started the code

#

Use __dirname

lavish bramble
#

Where

cinder patio
#

${__dirname}/../../commands/${dir}

#

also there's a better way of doing this

lavish bramble
#

How

#

Sir

cinder patio
#

I'm assuming the command handler is the one from the discord.js guide?

lavish bramble
#

Yup

#

I think

cinder patio
#

You have a client.commands property, where all your commands are stored. You can simply get the command info from there

cinder patio
#

give something like a "category" to each command and then filter them based on that category

lavish bramble
#

Only for 1 category

cinder patio
#

client.commands.filter(c => c.category === "fun")

#

but before that you have to give each of your commands a category

lavish bramble
#

Then I map or join?

cinder patio
#

yup

fresh kindle
#

How do i get the bot developer role

#

i made a bot thats working

lavish bramble
#

I have
client.commads.set(command.name.toLowerCase, command)

cinder patio
fresh kindle
#

oh

#

okok

#

ill wait

lavish bramble
cinder patio
#

toLowerCase is a function, call it otherwise the handler won't work

sudden leaf
#

i like people

#

i like people

lavish bramble
#

Mine was working

finite wolf
#

How do you even code a bot?

stiff lynx
#

[root@NOVABOT ~]# yum install http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm
Last metadata expiration check: 0:00:15 ago on Tue 15 Jun 2021 09:56:02 AM UTC.
[MIRROR] SDL2-2.0.10-1.el7.x86_64.rpm: Status code: 404 for http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm (IP: 195.220.108.108)
[MIRROR] SDL2-2.0.10-1.el7.x86_64.rpm: Status code: 404 for http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm (IP: 195.220.108.108)
[MIRROR] SDL2-2.0.10-1.el7.x86_64.rpm: Status code: 404 for http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm (IP: 195.220.108.108)
[MIRROR] SDL2-2.0.10-1.el7.x86_64.rpm: Status code: 404 for http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm (IP: 195.220.108.108)
[FAILED] SDL2-2.0.10-1.el7.x86_64.rpm: Status code: 404 for http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm (IP: 195.220.108.108)
Status code: 404 for http://rpmfind.net/linux/epel/7/x86_64/Packages/s/SDL2-2.0.10-1.el7.x86_64.rpm (IP: 195.220.108.108)

#

anyone that can help me?

sudden leaf
#

i like people

cinder patio
#
category: "some category here"
crystal wigeon
#

anyone know react?

cinder patio
crystal wigeon
#

lel

#

okay so, im trying out suspense but every time an api call is made in useEffect the suspense fallback is called making it look like the component has unmounted. but this is not good with pagination

#

currently when i click on next page the page shows loading until the data is populated

#

before the table loads again

terse lynx
#

how do i detect server webhook, like if smn voted server it give its role by !vote

#

okk

terse lynx
shrewd hazel
#

Do you use .js or .py ?

#

Just wondering cuz i want to know which is more popular

#

Oh

sacred aurora
#

is this a new feature?

terse lynx
terse lynx
sudden geyser
pale vessel
#

Wrong mention?

sudden geyser
#

ah

#

yeah wrong mention

#

thought they were asking for an example on how to use buttons

terse lynx
#

ops

earnest phoenix
#

why does setting a property on this array throw an invalid lhs error?

stuff ? stuff : (stuff) && stuff[] = stuff
young rune
#

wait, does anyone know how to intergrate google sign in with a website, google is giving me auth issues about my website not authenticated with the app, even though its explicitly shown on the google console...

cinder patio
#

you need to have an expression in there

earnest phoenix
#

well there's an assignment in (stuff) && and it works

#

i fixed it by using if statements

cinder patio
#

assignments are not the problem

earnest phoenix
#

oh you meant the stuff inside the brackets

#

it's an array index

cinder patio
#

...yes but there's nothing inside, unless you left that out on purpose

earnest phoenix
#

left that out on purpose

#

here's the actual code if you want:

#
map[y][x] = "air";
#

where y and x are numbers between 0 and 9

lyric mountain
#

you cant use ternary for assignment afaik

#

it's a result-only op

cinder patio
#

probably ^

#

you can do map[y][x] = (stuff) && stuff

drifting wedge
#

i need a way to like send stuff from my backend to front end

#

i want to use fetch()

#

but i cant seem to get it to work

#

any ideas?

woeful pike
#

show code

opaque acorn
#
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, open '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'
npm ERR!  [OperationalError: EACCES: permission denied, open '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'] {
npm ERR!   cause: [Error: EACCES: permission denied, open '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'] {
npm ERR!     errno: -13,
npm ERR!     code: 'EACCES',
npm ERR!     syscall: 'open',
npm ERR!     path: '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'
npm ERR!   },
npm ERR!   isOperational: true,
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'open',
npm ERR!   path: '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json',
npm ERR!   parent: 'express'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/npm-cache/14.15.2/_logs/2021-06-15T12_27_01_727Z-debug.log```
woeful pike
#

an assignment is an expression so it's valid wherever other expressions are valid

drifting wedge
woeful pike
#

yes

torpid marsh
#

hello

#

Can any of you help me with a JavaScript code?.

drifting wedge
#

uhh

#

wait so basically right there's one more tihng

#

so im using flask right

#

ait

#

wait

#

ok ok

drifting wedge
#

Uncaught TypeError: fetch(...).data is undefined

prime glacier
#
run: (client, message, args) => {


    if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send(":x: You need `MANAGE_MESSAGES` perms to use this command")

    let cmdname = args[0]

    if(!cmdname) return message.channel.send(`:x: You have to give command name, \`addcmd <cmd_name> <cmd_responce>\``)
    let okembed = new discord.MessageEmbed()
    .setDescription(args.slice(1).join(" "))

    let cmdresponce = `${okembed}`

    if(!cmdresponce) return message.channel.send(`:x: You have to give command cmd responce, \`addcmd <cmd_name> <cmd_responce>\``)

    let database = db.get(`cmd_${message.guild.id}`)

    if(database && database.find(x => x.name === cmdname.toLowerCase())) return message.channel.send(":x: This command name is already added in guild custom commands.")

    let data = {
      name: cmdname.toLowerCase(),
      responce: cmdresponce
    }

    db.push(`cmd_${message.guild.id}`, data)

    return message.channel.send("Added **" + cmdname.toLowerCase() + "** as a custom command in guild.")


  }```
error ```DiscordAPIError: Cannot send an empty message```
drifting wedge
#

let prefix_data = JSON.parse(fetch("my bot's url i dont wanna share").data.response);

#

@woeful pike

woeful pike
#

oh boy

#

is this a problem with promises or are you just giving an example here

drifting wedge
#

im not a js master

#

so def not promises

woeful pike
#

that's not how js works

drifting wedge
#

im just trying to get the response in json format

woeful pike
#

or promises rather

drifting wedge
#

i mean how do i get the response?

woeful pike
#
const res = await fetch(url)
const data = await res.json()
drifting wedge
#

oh

#

lemme try

woeful pike
#

you should look up how fetch works

drifting wedge
#

i need the await?

woeful pike
#

yes

drifting wedge
#

kk

woeful pike
#

promises are crucial you just gotta learn em

drifting wedge
#

yep

#

im still learning js

#

i know the basics

#

and syntax

#

but nothing like remotely advanced

lyric mountain
#

promises are just basic async stuff

opaque acorn
#
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, open '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'
npm ERR!  [OperationalError: EACCES: permission denied, open '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'] {
npm ERR!   cause: [Error: EACCES: permission denied, open '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'] {
npm ERR!     errno: -13,
npm ERR!     code: 'EACCES',
npm ERR!     syscall: 'open',
npm ERR!     path: '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json'
npm ERR!   },
npm ERR!   isOperational: true,
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'open',
npm ERR!   path: '/app/node_modules/express/node_modules/merge-descriptors/npm-shrinkwrap.json',
npm ERR!   parent: 'express'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/npm-cache/14.15.2/_logs/2021-06-15T12_40_30_329Z-debug.log```
#

help

torpid marsh
#
const bot = new Discord.Client(); 
bot.login('Token');
/*Codio de comands*/
bot.on('message', message =>{

    let responseObject = {
    "hp mnt" : "Estou em Manutenรงรฃo Aguarde...",
    "hp yt": "https://www.youtube.com/channel/UCIXoIMkvAJbMZqVlpoaSDvQ/featured",
    "hp jรก tomou a vacina?" : "Nรขo exite vacina contra meus virus. ;-;",
    "hp pow pow" : "Morri",
    "hp pei pei" : "Pow Pow",
    "hp eu peidei?" : "Claro moh catinga!",
    "hp o Pedro peido?": "claro moh fedozรฃo!"

};


if(responseObject[message.content]){
    message.channel(responseObject[message.content]);
}

}); 
#

help

#

plz

drifting wedge
#

omfg it worked

#

@woeful pike ily

#

IVE BEEN DOING THIS FOR 5 DAYS

lyric mountain
drifting wedge
#

IM FREEEEEEE

woeful pike
#

lol I love how people randomly pop in here, paste a codeblock and type help with no explanation or context

boreal iron
lyric mountain
#

like, I know the issue just by looking at it

woeful pike
#
console.log('hello world')

help

lyric mountain
#

but that's so fckin cringe

drifting wedge
#

ty xet tho

lyric mountain
#

I refuse to read like I knew brazillian

drifting wedge
#

and kuuhaku

lyric mountain
#

mostly xet, I barely helped this time

torpid marsh
drifting wedge
#

yesterday tho

#

and the days before

#

AHH

#

ily lmfao

#

im so fuckin tired of js

#

imma go back to the easy and simple brainfuck

#

way easier than js

lyric mountain
#

cara, nรฃo fica pingando os outros

torpid marsh
#

foi mal

lyric mountain
#
if(responseObject[message.content]){
    message.channel(responseObject[message.content]);
}

seu problema ta aki

torpid marsh
#

oq eu fiz de errado

lyric mountain
#

message.channel() n existe

#

message.channel.send() existe

torpid marsh
#

nossa man vlw

#

posso te adiconar como amigo?

lyric mountain
#

nah, melhor n

torpid marsh
#

ta bom

#

vlw ai

lyric mountain
#

dnd

drifting wedge
#

OMFG BEST DAY OF MY LIFE

lyric mountain
#

cool

shadow cipher
#

i getting this error

slender thistle
#

Use a top.gg SDK or basically run a webserver yourself

lusty quest
drifting wedge
#

this took me like 5 days to do

#

๐Ÿ˜ฆ

lusty quest
#

i where scratching my head 1 week for this:

#

well its empty but its generated by a bot

drifting wedge
#

ah

#

id love to use chartjs for my bot

#

but i do py

#

so sad

#

is there a way to do it in py?

#

like an api?

lusty quest
#

where a pain in the ass to get working, but when it worked it where nice. sadly i never made the bot public

drifting wedge
#

like can i make it into an image?

lusty quest
#

the codebase where a mess, and i need to rewrite a large part of the bot

lusty quest
#

but how to do it in py idk, i would probably run a expess server and just make a api for it

#

then answer with either a buffer or a url for the image

drifting wedge
#

how do u turn it into an image?

lusty quest
#

canvas

drifting wedge
#

oh

woeful pike
#

basically the perfect tool for that

drifting wedge
#

dash?

woeful pike
#

look it up

drifting wedge
#

yep just did

#

seems cool

opaque acorn
#
      throw err;
      ^
Error: Cannot find module '/app/node_modules/enmap/src/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:303:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:516:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:867:27)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/app/index.js:6:15)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32) {
  code: 'MODULE_NOT_FOUND',
  path: '/app/node_modules/enmap/package.json',
  requestPath: 'enmap'
}```
#
    "colors": "^1.4.0",
    "discord.js": "^12.5.3",
    "express": "^4.17.1",
    "http": "^0.0.0",
    "images-scraper": "^6.3.0",
    "moment": "^2.29.1",
    "ms": "^2.1.3",
    "node.js": "^0.0.1-security",
    "enmap": "^5.8.5"
  },```
#

wat

pale vessel
feral aspen
stable eagle
#

Is smth wrong with my vps?

When it goes down, it has ssh connection issues. I canโ€™t connect to my machine. Why is that happening?

marble juniper
#

ask your vps provider

#

we sadly can't do anything about it

#

gotta ask them

stable eagle
#

Alright

lost wadi
#

hi

#

Someone explain to me how to know how much CPU a bot consumes?

oak widget
#

there was a module that showed it, I don't remember the name exactly

lusty quest
#

in js you can use ```js
process.cpuUsage()

lost wadi
#

{ user: 312561814, system: 57586572 }
?

#

And as I would know what the limit of the cpu is, it is like making a progress bar

quartz kindle
#

depends on the bot size, your intents, and what your bot does

#

for example, the presences intent costs a lot of cpu

#

5000 guilds with presences on would use about 10-20% cpu just from being online

#

without presences it would use about 1-2%

#

but it depends on many other factors

prime glacier
#
run: (client, message, args) => {


    if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send(":x: You need `MANAGE_MESSAGES` perms to use this command")

    let cmdname = args[0]

    if(!cmdname) return message.channel.send(`:x: You have to give command name, \`addcmd <cmd_name> <cmd_responce>\``)
    let okembed = new discord.MessageEmbed()
    .setDescription(args.slice(1).join(" "))

    let cmdresponce = `${okembed}`

    if(!cmdresponce) return message.channel.send(`:x: You have to give command cmd responce, \`addcmd <cmd_name> <cmd_responce>\``)

    let database = db.get(`cmd_${message.guild.id}`)

    if(database && database.find(x => x.name === cmdname.toLowerCase())) return message.channel.send(":x: This command name is already added in guild custom commands.")

    let data = {
      name: cmdname.toLowerCase(),
      responce: cmdresponce
    }

    db.push(`cmd_${message.guild.id}`, data)

    return message.channel.send("Added **" + cmdname.toLowerCase() + "** as a custom command in guild.")


  }```
error ```DiscordAPIError: Cannot send an empty message```
lusty quest
cinder patio
#

why are you turning the embed into a string, what the hell is going on with that code

#

String literals are all over the place, you're using template literals when you don't need them, and regular strings when you do need template literals

coarse topaz
#

Hi there, I'd like to get some help:

So if for example I send a message like this:

Age: 27
Country: United States``` How can I make my bot to get the values that are next to the "**:**" sign, store them for a moment and send them to other channel?
summer torrent
coarse topaz
cinder patio
#

That will work only for the first pair

#

well nvm

feral aspen
#

Goodness.

#

I need help with this.

#
const bugHunterModelExample = {
    userID: "528256079101034506",
    bugs: [{ approved: false }, { approved: true }, { approved: false }, { approved: true }, { approved: false }, { approved: true }]
};
#

How can I calculate the amount of true in approved: true ?

#
const trueAmount = /* Calculation on the amount of "true" in the value of a property in a nested object in an array. */
pale vessel
#

array.filter and array.length?

feral aspen
#

Oh.

#

One second, let me try.

lyric mountain
#

wouldn't it be better to save a numeric field?

#

instead of individual objects

feral aspen
lyric mountain
#

still

feral aspen
#

There's like reason and more.

lyric mountain
#

use a separate table for that

feral aspen
#

MongoDB.

lyric mountain
#

because that json would become huge

lyric mountain
lusty quest
#

just make a new collection for the bughunter thing, add the userid and the approved stat as fields, maybe a unique id for the bug they reported

lyric mountain
#

thats what I said...

lusty quest
#

so you have a document for each thing, then you can just search for the userid

#

i know, but i guess he doesnt get it otherwise

lyric mountain
#

I see

feral aspen
#

I'm-.. ah.

lusty quest
#

see

feral aspen
#

Goodness, dude, give me some time to understand.

lyric mountain
#

instead of one big fat bughunter object

feral aspen
#

I think a class would work for an object maker...

lyric mountain
#

have many smaller bughunter objects

lusty quest
#

i dont think it would be a good idea to have 1 document that is 1GB in size

#

how did you start the cluster?

earnest phoenix
#

Lol docs are limited to 16mb

feral aspen
lyric mountain
#

20 objects yet

feral aspen
#

.. I made a check if array.length > 20 return

lyric mountain
#

oh

#

why?

feral aspen
#

I don't need some no life people just sweat on finding bugs.

#

20 is maximum.

#

.. but.

#

.. to answer my question.

earnest phoenix
#

Like this:

feral aspen
#

Can I do something like this.

opal plank
#

thats one rough way to treat people who find bugs for you

lyric mountain
#

I was thinking about that

#

like, isn't the whole idea of bughunting to find bugs?

#

why limit 20 per user?

lusty quest
feral aspen
#

So.. the strategy I'm doing is wrong, right?

#

.. since each bug will push an object to the array.

#

.. and the array will keep getting filled and filled.

lyric mountain
#

that's why we said to use smaller individual objects instead of a big fat one

#

remember json gets loaded to memory

lusty quest
#

yes bcs it doesnt run in a replica set

#

if you want to remove it you have to drop the local table from the master node

#
db.dropDatabase();``` in the mongod shell
feral aspen
lusty quest
earnest phoenix
#

Oof, i have few users setup

lyric mountain
lusty quest
#

wait nvm they are in the admin collection

lyric mountain
#

like, instead of getting all bughunts everytime you want to get the amount, just have a numeric field on the user object

lusty quest
#

increment a number if the bug got accepted or so

feral aspen
#

Mhm.. alright!

lusty quest
#

if you break down the one large document into its own collection you could refer the user to the bug he reported, if you plan to add rewards for reporting bugs it could be helpful

earnest phoenix
lusty quest
#

but why did you want to get out of the replicaset?

#

you give up high aviability and better i/o distribution

earnest phoenix
#

I wanted to use a different replica

lusty quest
#

ok?

lavish bramble
#
if(command === "start"){
      const game = []
      const data = Schema.find({Guild: message.guild.id})
      if(!data) return message.channel.send("**Game is not setup yet**")
      if(data.length < 2) return message.channel.send("**You can't play alone\nMaximum player is 2! **")
     data.forEach(g => {
       console.log(g)
       game.push(g)
     })
      const gamer = Math.floor(Math.random() * game.length)
      console.log(game)
      message.channel.send(game[gamer])
    }```
Error : data.forEach is not a function
#

I'm using mongodb

lyric mountain
#

uh oh, forEach

#

isn't Schema.find async?

lusty quest
#

it returns a promise

lavish bramble
#

I get this

#

When I use await

lyric mountain
#

that's the data

lavish bramble
#

Working thnx

#

A lot

fresh bluff
#

for my bot support website i use wix

#

bc i can't make websites

#

so i made this embed is there anything i should change on it bc i think it looks bad

zenith terrace
#

@earnest phoenix any error?

pale vessel
#

Remove the image @fresh bluff

#

or the thumbnail, either one Should be the image

fresh bluff
earnest phoenix
fresh bluff
#

Looks better

zenith terrace
fresh bluff
#

i made my bots with botghost

zenith terrace
#

console log the stuff in botinfo

lusty quest
#

just get vsc and learn how to use the debugger

prime glacier
#

can someone help me ?

earnest phoenix
prime glacier
#
run: (client, message, args) => {


    if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.channel.send(":x: You need `MANAGE_MESSAGES` perms to use this command")

    let cmdname = args[0]

    if(!cmdname) return message.channel.send(`:x: You have to give command name, \`addcmd <cmd_name> <cmd_responce>\``)
    let okembed = new discord.MessageEmbed()
    .setDescription(args.slice(1).join(" "))

    let cmdresponce = `${okembed}`

    if(!cmdresponce) return message.channel.send(`:x: You have to give command cmd responce, \`addcmd <cmd_name> <cmd_responce>\``)

    let database = db.get(`cmd_${message.guild.id}`)

    if(database && database.find(x => x.name === cmdname.toLowerCase())) return message.channel.send(":x: This command name is already added in guild custom commands.")

    let data = {
      name: cmdname.toLowerCase(),
      responce: cmdresponce
    }

    db.push(`cmd_${message.guild.id}`, data)

    return message.channel.send("Added **" + cmdname.toLowerCase() + "** as a custom command in guild.")


  }```
error ```DiscordAPIError: Cannot send an empty message```
fresh bluff
#

ima try to make a game on botghost

earnest phoenix
lusty quest
prime glacier
lusty quest
#

you know what breakpoints are?

#

if no did you use a IDE that got a buildin debugger?

feral aspen
#

There's this thing where you perform a command like !test and then you can input something without having to type the !.

#

What do you call it?

prime glacier
#

hm

fresh bluff
#

should i make any changes to the website??

prime glacier
feral aspen
#

Anyone..

odd sapphire
#

What do you guys to get your bot stats? For example, most used commands

prime glacier
lusty quest
#

or if you are lazy there is a easy way

odd sapphire
#

Which actually works

lusty quest
#

well statcord works

#

you just have to set it up properly

#

if they fucked the API beyond repair you have to make something yourself i guess

#

then i guess use prometheus and grafana

lusty quest
prime glacier
lusty quest
#

VSC?

prime glacier
#

yeah

lusty quest
#

good, there is a Buildin debugger

prime glacier
#

ok

lusty quest
#

this is how you use it

#

you can then just add breakpoints to the code and if the code runs over them the process is halted and you can inspect what is going on

prime glacier
#

didnt got it tbh ohshit coz never had used that

lusty quest
#

its the fancy console.log("works")

odd sapphire
lusty quest
#

did you have an api key?

odd sapphire
#

Yes

fresh bluff
#

does anyone know a what i could use to make a good website

earnest phoenix
fresh bluff
#

nope

#

well HTML kinda

lusty quest
# odd sapphire
statcord.on("autopost-start", () => {
  // Emitted when statcord autopost starts
  console.log("Started autopost");
});

statcord.on("post", status => {
  // status = false if the post was successful
  // status = "Error message" or status = Error if there was an error
  if (!status) console.log("Successful post");
  else console.error(status);
});

``` adding these 2 evens might help you debugging
#

also it can take a while until stats show up and make sure to use beta.statcord the live version is bugged iirc

odd sapphire
#

Alright

#

Added those

lusty quest
#

but if you have more issues, better join the support server from them

odd sapphire
#

I used to be staff for them, support isn't the best.

lusty quest
#

lol and why did you then struggle with setting it up?

odd sapphire
#


const Statcord = require("statcord.js");

const statcord = new Statcord.Client({
    client,
    key: "statcord.com----",
    postCpuStatistics: true, /* Whether to post memory statistics or not, defaults to true */
    postMemStatistics: true, /* Whether to post memory statistics or not, defaults to true */
    postNetworkStatistics: true, /* Whether to post memory statistics or not, defaults to true */
});
 
// Client prefix
const prefix = "!";
 
client.on("ready", async () => {
    console.log("ready");
 
    // Start auto posting
    statcord.autopost();
});


statcord.on("autopost-start", () => {
    // Emitted when statcord autopost starts
    console.log("Started autopost");
});

statcord.on("post", status => {
    // status = false if the post was successful
    // status = "Error message" or status = Error if there was an error
    if (!status) console.log("Successful post");
    else console.error(status);
});

```javascript
pale vessel
#

Cool key ๐Ÿ‘

lyric mountain
#

lul

lusty quest
#

does it work?

odd sapphire
#

o yea very nice key

lyric mountain
#

reset

odd sapphire
#

I just did

lyric mountain
#

editing is not enough

odd sapphire
#

I reset it

lyric mountain
#

ok, you're fine then

terse lynx
#
const express = require('express')
const Topgg = require('@top-gg/sdk')

const app = express() // Your express app

const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)

app.post('/dblwebhook', webhook.listener(vote => {
  // vote is your vote object
  console.log(vote.user) // 221221226561929217
})) // attach the middleware

app.listen(3000) ``` can i get this like if i used it i will get role if i vote
lyric mountain
#

you're not supposed to show your top.gg webhook auth

terse lynx
#

its from https://www.npmjs.com/package/@top-gg/sdk

#

._.

lyric mountain
#

ah, sure

terse lynx
#

i am stucked at it

lyric mountain
#

no, you need to assign the role just like you'd do with a command

#

the wbhook will give u the user id

terse lynx
#

like voting rewards

lyric mountain
#

yes

terse lynx
#

is there any tutorial available?

lyric mountain
#

maybe, but you'll need to search for it

#

do note that tutorial <> copypaste

terse lynx
#

can you share the code pls..?

lyric mountain
#

no

#

give it a search

#

google time

terse lynx
#

i am searching from last few hrs

earnest phoenix
#

Who knows how to erase all data on quick db ?

lyric mountain
#

just delete the db

earnest phoenix
#

Didnt work

lyric mountain
#

how didn't it work?

earnest phoenix
#

Quick db doesnt work like that

#

No need database.json

lyric mountain
#

bruh

#

quickdb is a sqlite wrapper aint it?

near stratus
earnest phoenix
lyric mountain
#

just delete the database file

earnest phoenix
#

There is a file named as sqlite

near stratus
#

SQLite saves the db as a file
just delete it

earnest phoenix
#

Lol thanks you it worked

lyric mountain
#

delete that url

#

quickly

near stratus
near stratus
terse lynx
#

it wasnt real tho

#

but

lyric mountain
#

discord webhooks don't require you to be a member of the server or have any perm

#

all you need is the url to mass spam it

#

and no, it won't work the way you're thinking

#

top.gg webhooks <> discord webhooks

fresh bluff
#

i finished my website for now

near stratus
fresh bluff
#

it was hard

terse lynx
lyric mountain
fresh bluff
terse lynx
lyric mountain
#

actual webhooks, as in "http request listeners"

near stratus
#

in this case votes

#

and discord Webhooks are just the opposite
We're sending the request and they're listening to it

terse lynx
#

oh

#

can i get code for reference pls?

#

i am struggling

lyric mountain
#

tbh it's a shitty name discord team chose to use for it

#

it has almost 0 similarity with webhooks

terse lynx
#

oh

near stratus
# terse lynx can i get code for reference pls?
const express = require('express')
const Topgg = require('@top-gg/sdk')

const app = express() // Your express app

const webhook = new Topgg.Webhook('topggauth123') // add your top.gg webhook authorization (not bot token)

app.post('/dblwebhook', webhook.listener(vote => {
  // vote is your vote object
  console.log(vote.user) // 221221226561929217
})) // attach the middleware

app.listen(3000) // your port
terse lynx
#

i have this

#

but

#
  // vote is your vote object
  console.log(vote.user)```
#

/dblwebhook

#

how to get this name.

#

anyone?

pale vessel
#

vote.user would be a user ID

#

Ah

fresh bluff
#

added this to my bot

pale vessel
#

You mean the path?

terse lynx
#

yea

#

like this

pale vessel
#

The path can be anything

terse lynx
#

for path i mean Weebhook Url

#

http://you.server.ip:3000/dblwebhook

pale vessel
#

It's your server IP and webhook port, as it says

#

So your VPS IP and the port would be the port you use for express

terse lynx
#

and last one?

#

/dblwebhook

pale vessel
#

That's the path, like this

#

It doesn't have to be dblwebhook

terse lynx
#

oh i can name it anything

#

right?

pale vessel
#

Yes

terse lynx
#

ohh getting it lemme try

fresh bluff
#

the tag turned out to be DiscordLmao

solemn latch
#

hey, you keep showing stuff with links to your bots. its kind of becoming ads.

earnest phoenix
#

hi

#

help?

#

js v12

fresh bluff
#

no im showning my dev progress of my bot

sudden geyser
#

which is an ad

fresh bluff
#

i only have embeds right now

solemn latch
#

its still an ad

fresh bluff
#

ok sorry

#

i'll take it down

solemn latch
#

if you want to update people, do it in your support server. not random development channels

earnest phoenix
#

I am doing an add role command, I want to know how I can use the highest property, for example, if a user has a higher role than mine, I cannot add or remove roles with the bot

lyric mountain
#

just check role index

fresh bluff
#

i took all my images with links down

terse lynx
#

my reward role option is still not working

earnest phoenix
#
if (!highest) return message.channel.send(`Your role is lower than the user menetioned`);
lyric mountain
#

check role index

#

lower index = higher role

earnest phoenix
#

how can i do that

terse lynx
earnest phoenix
#

@lyric mountain can u help me in md?

#

ill send u my code

lyric mountain
#

no, just check role index bruh

#

it's literally a one-liner

earnest phoenix
#

aaaa

#

okok

#

im not english, I did not understand

#

ill check it

fresh bluff
#

i only have a few commands right now any ideas guys??

lyric mountain
#

I don't think that's enough

fresh bluff
#

i need ideas

lyric mountain
#

3 of the 5 are just fixed text

fresh bluff
#

im adding more

lyric mountain
#

isn't your bot about moderation?

fresh bluff
#

yes and it can be for fun too

lyric mountain
#

just create commands around those two categories

fresh bluff
#

ok

lyric mountain
#

think what you'd use in a bot

fresh bluff
#

ok

terse lynx
#

can anyone give me or help me with server voting code

fresh bluff
#

i added a y/n command

terse lynx
#

i am new to js pretty much

fresh bluff
lyric mountain
#

also 8ball is yes/no

fresh bluff
#

oh

lyric mountain
#

8ball, choice, dice, ping, help, etc etc

#

those are generic commands

fresh bluff
#

im adding better commands

#

like this??

pale vessel
#

That's one tall embed

fresh bluff
#

it shows mod commands*

#

im still making the bot ok!

pale vessel
#

coolio

opal plank
pale vessel
fresh bluff
#

there's only a few commands right now

pale vessel
#

It's still not too late.

opal plank
#

better switch to detritusjs before you get too far

pale vessel
fresh bluff
#

what is it??

pale vessel
#

It's a library

opal plank
#

a better js lib than discord.js

fresh bluff
#

uh guys i use bot ghost

opal plank
fresh bluff
#

i have said that many times

opal plank
#

@pale vessel tag, you're it

pale vessel
#

No, no.

opal plank
pale vessel
#

@opal plank reverse

fresh bluff
#

i have made it so you can make memes

#

it gives a few templates

#

to make a meme

earnest phoenix
#
if (!message.mentions.members.first().roles.highest.position) return (`Your role is lower than the user menetioned.`)

how can i fix it

pale vessel
#

It actually looks good for a BotGhost bot. Did you pay for a subscription?

fresh bluff
#

nope

#

i don't money

#

have*

#

ima make a game

#

its gonna be hard

sudden leaf
#

i like people i like people

#

i like

fresh bluff
#

ima make soccer on my bot

#

then hockey

#

and more

lyric mountain
#

ain't that too much for botghost?

fresh bluff
#

nope

#

i know how to do it with random response commands

lyric mountain
#

yeah but...it's not the same thing for interactive games

fresh bluff
#

ima try

quartz kindle
#

why are there 3 goals

fresh bluff
#

oh

#

its meant to make 1 big net

earnest phoenix
#

actually you could use custom emoji

opal plank
lyric mountain
#

that last shot didn't look so straight

fresh bluff
lyric mountain
#

nope

fresh bluff
lyric mountain
#

bots don't need nitro for custom emotes

fresh bluff
#

oh

#

ok

#

like this??

#

ima edit out the white

lyric mountain
#

no

#

just make a long goal out of 3 emotes

fresh bluff
#

ok

#

then ima have to edit three net emojis

#

well that failed

amber wraith
#

Hahaha

earnest phoenix
#

๐Ÿฅ…

#

Almost like there is already a goal emote

#

Just grab that picture and stretch it ez

cosmic forum
#

Hi! I'm making a profanity filter, and I'd like the bot to send a webhook with the author's profile picture and username if my function returns true. Anyone know how I could go about automatically creating the webhook?

quartz kindle
#

which library?

cosmic forum
#

discord.js

quartz kindle
cosmic forum
#

thx

lyric mountain
#

profanity filters are impossible to make without blocking every message

lyric mountain
#

for example

#

lets say you want to block the word "cock"

#

I can write it as:

  • c0ck
  • cรตck
  • cรณck
  • cรฒck
  • c[]ck
  • cรดck
  • c@ck
  • cยบck
  • cยฐck
  • cรถck
  • c()ck
  • c-ock
  • cqck
#

that only changing 1 letter

#

and only using alfanumeric

#

you can imagine how much variation each word can have

zenith terrace
#

ofc thats the word you use lol

lyric mountain
#

and that not even considering other langs

sudden geyser
#

143859^4

lyric mountain
#

mihoyo for example blocks the word "dog"

#

because that's a bad word in some lang

woeful pike
#

language filters are a stupid idea

solemn latch
#

depending on the audience I don't disagree with the idea when used appropriately.

opal plank
#

just get more mods/admins

zenith terrace
#

just ban erwin

stiff lynx
#

guys

#

I get an err, but idk y

#

because always worked

#

and not now

#

2021-06-16T00:28:36.140469+00:00 app[Worker.1]: (node:4) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message

#

this is my help command made with pages

#

but messages are not empty lol

#

I've tried with 2 packages

#

and no one worked

torpid marsh
#

oi

#

algum dev Br

stiff lynx
torpid marsh
opal plank
torpid marsh
#

tem como um bot entra call e compartilha tela

opal plank
#

nao

torpid marsh
#

รฉ imposivel ??

opal plank
#

nao, mas nao รฉ documentado e contra o ToS

#

ou seja, nem tente

torpid marsh
#

ata vlw

#

era sรณ isso

opal plank
torpid marsh
stiff lynx
#

!erwin

#

if I send the command u can tell me y this doesnt work anymore?

solemn latch
#

if you send the error if one exists, or whats not working, and the relevant code here youll probably get an answer.

stiff lynx
#

error: 2021-06-16T00:34:33.315698+00:00 app[Worker.1]: (node:4) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
2021-06-16T00:34:33.315705+00:00 app[Worker.1]: at RequestHandler.execute (/app/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
2021-06-16T00:34:33.315705+00:00 app[Worker.1]: at processTicksAndRejections (internal/process/task_queues.js:95:5)
2021-06-16T00:34:33.315706+00:00 app[Worker.1]: at async RequestHandler.push (/app/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
2021-06-16T00:34:33.315706+00:00 app[Worker.1]: at async ReactionCollector.<anonymous> (/app/node_modules/reconlx/src/functions/embedpages.js:34:13)
2021-06-16T00:34:33.315736+00:00 app[Worker.1]: (node:4) 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: 3)

#

I've tried also with reconlx package, and same errore

#

error

solemn latch
#

or well, it seems to attempt to replace them at minimum.

#

honestly though i dont see where a message is being sent without content

lyric mountain
#

Replace ALL reactions just for a single button click?

solemn latch
solemn latch
#

djs might internally keep track of this and not readd them all?

#

only if needed

lyric mountain
#

Like, my lib has a optional mode where it deletes the user reaction after he clicks, but doing that for all reactions sounds way too unnecessary

solemn latch
#

yeah, this library seems developed for bots which are intended to only be in one guild, the errors are all caught and sent into console.log.
which makes no sense for any public bot.

lyric mountain
#

Lul

solemn latch
#

for what the library seems to be made for its fine though. but its so close to being pretty decent.

earnest phoenix
#

i need a help if u can help

#

@client.command()
@commands.guild_only()
async def mod(ctx):
    embed=discord.Embed(color=discord.Color.blue())
    embed.add_field(name="test",value="testing the test .",inline=False)
    embed.add_field(name="testing ",value="not sorryshdiuhsdh",inline=False)
    message = await ctx.send(embed=embed)
    await message.add_reaction("โœ…")
#

i want the bot to dm the person who reacrted

#

reacted*

solemn latch
#

๐Ÿ‘€ i still dont know python

sudden geyser
#

They have an example on waiting for a user to react to a message.

shadow cipher
#

pls see

shadow cipher
#

why it not working

solemn latch
#

I still don't know python

shadow cipher
spark blade
#

How do i fix this? It happens with every command
I tried regenerating the token
I tried changing the code
I tried deleting and remixing the code
I tried RESETTING the code
But its replying twice

solemn latch
#

Do you have two help commands in code?

shadow cipher
solemn latch
#

Nope

spark blade
#

No

#

Theres only one {name}.js file for each command

zenith terrace
#

would be better to show the code

spark blade
#

Some guys saying its running multiple instances

earnest phoenix
#

can you synchronously use import in mjs files like require

solemn latch
spark blade
#
 

//Message
client.on("message", async msg => {
  if(msg.author.bot) return;
    if(msg.channel.type === 'dm') return;

    let prefix = await db.get(`prefix_${msg.guild.id}`);
    if(prefix === null) prefix = config.prefix;

  //Mention Bot For Prefix
  if (msg.content.startsWith(`<@${client.user.id}>`)) {
    let tagEmbed = new MessageEmbed()
      .setAuthor(`${client.user.username}'s Prefix`)
      .setThumbnail(client.user.displayAvatarURL())
      .setDescription(
        `This Server's Prefix: **${prefix}**\nGlobal Prefix: **${config.prefix}**`
      )
      .setColor("RANDOM")
      .setFooter(`Help command: ${prefix}help\nGuild Name: ${msg.guild.name}`)
      .setTimestamp();
    msg.channel.send(tagEmbed);
  }
  if (!msg.content.startsWith(prefix)) return;
  const args = msg.content.slice(prefix.length).trim().split(/ +/g);
  var sender = msg.author;
  var ownerlist = config.owner;
  const command =
    client.commands.get(args[0]) ||
    client.commands.find(
     c => c.help.aliases && c.help.aliases.includes(args[0])
    );
#

And i cant show more

earnest phoenix
#

I saw the problem

spark blade
#

What is it

#

Even with non happens

earnest phoenix
#

nevermind it's not the actual bug

spark blade
#

Uh

#

Some guys say "use killall node" but my phone cant open terminal it freezes

#

But tomorrow ill get a pc maybe so i could try

earnest phoenix
#

u using replit?

spark blade
#

Im not prepared for replit

earnest phoenix
#

there goes your problem

#

using glitch

spark blade
#

always blaming glitch...

#

But 2 days ago bot worked fine replied once

earnest phoenix
#

even discord hates them and mass banned most of their server ips THRICE

spark blade
#

Even after making the music commands still worked fine

#

I tried using fs cmd handler

#

I tried using glob cmd handler

earnest phoenix
#

are you sure the prefix is NOT a bot ping?

spark blade
#

No

#

Prefix is stored on db or else its k!

zenith terrace
#

you already asked this

#

and were already answered

earnest phoenix
#

if the bot crashes because it's not ready yet, its declined

spark blade
#

The bot ping is to make users know prefix

earnest phoenix
#

no quesions asked

lethal trout
#
module.exports = {
    name: 'link',
    description: '**ONLY DEVELOPER**',
    run: async (client, message, args) => {
const guild = message.guild.id
const channel = guild.channels.cache.find(ch => ch.type == "text" && ch.permissionsFor(ch.guild.me).has("CREATE_INSTANT_INVITE")).createInvite({
maxAge: 0,
maxUses: 100,
}).then((invite) => {
message.channel.send(invite.url)})
}
}```
err: cant read property of cache
earnest phoenix
#

your choice when to submit

earnest phoenix
spark blade
#

I think its wrong

#

Its msg.guild

#

So then msg.guild.channels.cache

#

Cuz it would be

#

msg.guild.id.channels.cache

#

So its wrong

#

Delete the .id

earnest phoenix
#

even better: let { guild } = message

lethal trout
#

umm

earnest phoenix
#

saves you from retyping guild

spark blade
#

@lethal trout ill send u

earnest phoenix
lethal trout
# earnest phoenix another problem: you arent checking if the find function returned nothing so if ...
module.exports = {
    name: 'link',
    description: '**ONLY DEVELOPER**',
    run: async (client, message, args) => {
if(message.guild.me.hasPermission("CREATE_INSTANT_INVITE")) {
const guild = message.guild
const channel = guild.channels.cache.find(ch => ch.type == "text" && ch.permissionsFor(ch.guild.me).has("CREATE_INSTANT_INVITE")).createInvite({
maxAge: 0,
maxUses: 100,
}).then((invite) => {
message.channel.send(invite.url)})}else return
}
}```
#

is this ok

earnest phoenix
#

still no

#

channel overwrites exist

spark blade
#

I sent him the correct code

earnest phoenix
#

you should store the value of find in a variable then check if it's empty

earnest phoenix
#

this is why people never learn

#

they just get spoonfeeded

spark blade
#

This is why i cant fix the double reply

west spoke
lethal trout
earnest phoenix
lethal trout
#

i am coding on the host it self so it wont be neat

earnest phoenix
#

every ide has a formatter

west spoke
earnest phoenix
#

replit has one that ignores the entire country of jsx but ok

swift cloak
#

ay if i upgrade my macos to big sur what would change?

sudden geyser
#

A lot of stuff.

#

I'm using it and there are some stuff I like and don't like.

swift cloak
#

so is there anything, like my node, java, lavalink, or anything vsc or terminal related?

#

that will change?

#

im at macos mojave rn

sudden geyser
#

It depends, 'cause it always does. But you should be able to use them (I use Node.js, Java, VSC, etc.). It's good practice to keep your operation system up to date.

near stratus
lethal trout
#

i thought snipe command was like banned right?

swift cloak
#

no more sudo!?

near stratus
sudden geyser
#

sudo still exists

swift cloak
#

oh

#

ok

#

well

swift cloak
#

ima update

#

lets see what happens

swift cloak
#

privacy terms i think

near stratus
lethal trout
sudden geyser
#

I'm not sure if it's disallowed, but their privacy policy may conflict given the definition of user consent.

swift cloak
#

dam i need 16 gb

#

whats safe to clean out in my mactonish

#

cause i have a tb

#

hard drive

sudden geyser
#

Apple Logo > About This Mac > Storage > Manage