#development

1 messages · Page 1070 of 1

earnest phoenix
#
await fillTextWithTwemoji(ctx, profileDB.Bio, 40, 400)
``` ok how to make this if it is null or undefined make it say **No Bio**
tight plinth
earnest phoenix
#

do a ```html
<a href="limn">kek</a>

and style in css
tight plinth
#

hmm

stone elm
#

i added a bot but the commads dont work

earnest phoenix
#

eg

a:hover {
background-color: pink;
}
stone elm
#

commands*

regal edge
#
const randomPuppy = require("random-puppy");

module.exports = {
    name: 'holomeme',
    description: "Sends a hololive meme.",
    usage: "r!holomeme",
    run: async (message, args) => {
        try {
            throw new Error('Error');
         } catch(e){}
        const subReddits = ["hololivememes", "Hololive", "VirtualYoutubers", "hololive", "Nijisanji"];
        const random = subReddits[Math.floor(Math.random() * subReddits.length)];

        const img = await randomPuppy(random);
        const HoloMeme = new Discord.MessageEmbed()
        .setColor("RANDOM")
        .setImage(img)
        .setURL(`https://reddit.com/r/${random}`);

        message.channel.send(HoloMeme);
    
        }
}``` Need help, getting a "UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded" error.
earnest phoenix
#

these bitches still use random puppy

sudden geyser
#

what

regal edge
#

well imma noob, so that's the first thing I found

earnest phoenix
#

node fetch 💯

sudden geyser
#

The error usually means you have some infinite loop or recursion running.

#

Do you have a stacktrace to go with the error

tight plinth
#

to be eaxct im searching to do some text that doesnt look like a link but which is in reality a link

sudden geyser
#

Also why are you throwing an error then catching it. js try { throw new Error('Error'); } catch(e) {}

tight plinth
#

but once again my brain is too slom to do that

regal edge
#

Also why are you throwing an error then catching it. js try { throw new Error('Error'); } catch(e) {}
@sudden geyser Well, that was my "trying" to fix the error.

sudden geyser
#

That's not responsible for the error.

regal edge
#

Do you know what is?

sudden geyser
#

It would be easier to spot if you had a stacktrace.

restive furnace
#

could you give us full stack?

#

^^^^

regal edge
#

oh

#

sorry

#
    at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:4:22)
    at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
    at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
    at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
    at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
    at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
    at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
    at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
    at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
    at rand (E:\Users\Richard\Documents\Visual Code\Rushia Bot\Rushia\node_modules\unique-random\index.js:6:47)
(node:14152) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated 
either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14152) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
torn ravine
#

index.js line 4 column 22

sudden geyser
#

You have some infinite recursion running in a dependency of yours.

regal edge
#

What you mean by an infinite recursion? Can you give an example?

sonic lodge
#

a function that calls itself

#
var name = function() {
  return name();
};```
#

something like that is happening

sudden geyser
#

^ In this case, it's an issue with a dependency. The actual flow is your project -> random-puppy -> unique-random-array -> unique-random

regal edge
#

unique-random

#

hmmm

regal jacinth
#

hey so my bot just got approved and i am getting this error in heroku
ik heroku isn't good but i can't offer paying money rn
so since the bot got approved and the bot goes online and offline continuously
idk why this is happening
it's a 1st
so this is the error i get ig

Stopping all processes with SIGTERM```
regal edge
#
module.exports = function (min, max) {
    var prev;
    return function rand() {
        var num = Math.floor(Math.random() * (max - min + 1) + min);
        return prev = num === prev && min !== max ? rand() : num;
    };
};```
Index.js in unique-random
restive furnace
#

hey so my bot just got approved and i am getting this error in heroku
ik heroku isn't good but i can't offer paying money rn
so since the bot got approved and the bot goes online and offline continuously
idk why this is happening
it's a 1st
so this is the error i get ig

Stopping all processes with SIGTERM```

@regal jacinth signterm = ctrl + c in my knowledge

regal jacinth
#

wat?

#

but i didn't do that

#

i don't get it @restive furnace

restive furnace
#

look for close codes so u get it

regal jacinth
#

hmmm

#

but how will close codes help me solve this?

misty sigil
#

anyone know any good text uploaders for longer than 2000 eval outputs

sudden geyser
#

There was a good one I remember using but I can't remember the name sadly. To be honest I'd just send the text as a file instead of up to a service

misty sigil
#

i wanna do it in an embed tho

pale vessel
#

you shouldn't, are you sure what you're uploading is completely fine to be public?

#

by the way, embed description can store up to 2048 characters, just in case you want to increase it a little

misty sigil
#

2048, then i'll implement pages

gleaming willow
#

(node:7047) 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(). (rejection id: 19)
(node:7047) UnhandledPromiseRejectionWarning: Error: Client network socket disconnected before secure TLS connection was established
at TLSSocket.onConnectEnd (_tls_wrap.js:1088:19)
at Object.onceWrapper (events.js:277:13)
at TLSSocket.emit (events.js:194:15)
at endReadableNT (_stream_readable.js:1125:12)
at process._tickCallback (internal/process/next_tick.js:63:19)

#

help

misty sigil
#

code pls

gleaming willow
#

consol erorr

misty sigil
#

where did the error come from

gleaming willow
#

thx

#

❤️

misty sigil
#

just saying help and providing an error isn't enough

gleaming willow
#

ok

misty sigil
restive pebble
#

cool

solid falcon
#

Can someone fix my code? I use discord.py and @bot.command() is not working...

from discord.ext import commands
bot = commands.Bot(command_prefix="!")

@bot.command()
async def ping(ctx):
    await ctx.send("Pong!")
slender thistle
#

Is that your entire code?

solid falcon
slender thistle
#

Full code please

thorny plover
#

is there a way to host Discord python bot on a cpanel ??)

jade quest
#

cpanel? What

pale vessel
#

a panel like plesk

jade quest
#

sorry I don't know what that is

#

lol

misty sigil
#

isn't cpanel for web?

rapid tapir
#

hello, i'm trying to fix my editsnipe command, i wanna show edit snipes only for server that i'm using the command, but it shows me message edited from all servers that bot is in, that's my code

#
async def editsnipe(ctx):
    embed = discord.Embed(colour=bot.org_message.author.color, description=f"**Original message:** {bot.org_message.content}\n**Edited message:** {bot.ed_message.content}", timestamp=ctx.message.created_at)
    embed.set_author(name="Last edited message from: {}".format(bot.org_message.author), icon_url=bot.org_message.author.avatar_url)
    embed.set_footer(text=f"Sniped by: {ctx.message.author}")
    await ctx.send(embed=embed)```
pale vessel
#

it's possible to deploy a python application

#

but i don't think it's suitable for discord bots

misty sigil
#

collected.first() is the first detected reaction right?

slender thistle
#

What is bot.org_message

rapid tapir
#

bot original message

solid falcon
misty sigil
#

or is it just the one that it collected

rapid tapir
#

it shows the message before edit

slender thistle
#

@rapid tapir Are you sure you are restricting the event to your server?

rapid tapir
#
async def on_message_edit(before, after):
    bot.org_message = before
    bot.ed_message = after```
#

actually not

slender thistle
#

Boom

rapid tapir
#

i've tried to put message.channel in bot.org

#

like bot.org_message.channel

solid falcon
#

@slender thistle version 1.3.1 by Rapptz

misty sigil
#

how do I get the most recent reaction on a message using awaitReactions? (📖 : discord.js | js)

slender thistle
#

Any errors you get, Kee?

solid falcon
#

@slender thistle Nope, it doesn't show any errors

slender thistle
#

@solid falcon How are you using the command

#

Are you sure you are running the bot also :^)

solid falcon
#

!ping
and yes i'm running it

slender thistle
#

Are you running it under the right bot account

gilded monolith
#

Hello everyone.
I've been testing different permissions sets for my bot and I'm getting 'Missing Access' error even when I enable every single permission except admin.
Bot makes permissions overrides for users when they join/leave certain voice channel.
I've been discussing the issue with one of the moderators, and he said that everything should be working without admin permission.
Am I doing something wrong?

solid falcon
#

I don't know why @bot.command() not working

slender thistle
#

Which event is that?

solid falcon
#

on_message

slender thistle
#

Do you currently have one?

solid falcon
slender thistle
#

What is bots

#

Anyhow, you need await bot.process_command(message) at the very end of your on_message

#

it allows for @bot.command to be used

solid falcon
#

bots is a variable that contain bot user id

#

Ok lemme try

slender thistle
#

...just a side question

#

could you please send me the actual up-to-date code you run the bot with

quaint hornet
#

i want to do a eval command for my bot, but i have no ideia how to start, can someone pls give a hint of how can i start?

solid falcon
slender thistle
#

Anyhow, you need await bot.process_command(message) at the very end of your on_message

solid falcon
#

I'm not edit it yet...

pale vessel
#

chunk them

misty sigil
#

won't you be ratelimited?

pale vessel
#

depends on how many messages

thin stump
#

yes

pale vessel
#

loop or regex

summer acorn
#

would this work with dbl.webhook? Since, when I use express, the url I get is just the ip and port without the path.

viral iris
#
if(message.author.bot) return;
#

can i do the same thing like this for only guild owner ?

restive furnace
#

@viral iris yes

viral iris
#

how ?

#

@restive furnace

pale vessel
#

compare the id to guild#ownerID

viral iris
#

explain ?

#

please

pale vessel
#

i just-

restive furnace
#

He just did. Comparing values literally are like 1 == 2; // returns false

viral iris
#

no

#

i mean if u have the ownership can use this command

#

if u don't return ;

summer acorn
#

!==

#

that checks for if it is not equal to

viral iris
#

dont get it?

summer acorn
#
1 !== 2 // returns true
pale vessel
viral iris
#

what 1 & 2

summer acorn
#

the ! means false

#

just examples

pale vessel
#

that's a bitwise operation

viral iris
#
if(message.guild.owner === message.member)
pale vessel
#

almost

viral iris
#

what's wrong ?

summer acorn
#

extremely close, 1 letter incorrect

pale vessel
#

owner sometimes needs to be fetched, it's safer to use ownerID and compare it with message.author.id

viral iris
#
if(message.guild.owner) return ;
summer acorn
#

and the ===

#

what is he even at at this point, if I may say so.

earnest phoenix
#

So made a function that shows the actual uptime of the client... All works but i want it to slice off the s off of the hours and minutes or whatever if the number is 1, this doesn't work...

_eval Discord.Client.prototype.Uptime = function Uptime(){
let time = ms(this.uptime);
return Object.entries(time).filter(u => u[1] > 0 && u[0] !== "milliseconds").map(up => `${up[1]} ${up[0].toProperCase()}`).join(", ").replace(/(\d?1\s\w*)/gi, gTS => gTS.slice(0, -1));
}```
Output:
```2 Hours, 7 Minutes, 1 Seconds```
For example i want that `1 Seconds` to be `1 Second`
summer acorn
#

check if it's 1, if it is, slice -1

earnest phoenix
#

facepalm What am i exactly doing there

viral iris
#

still don't get it ?

amber fractal
#

w h a t

earnest phoenix
#

Bruh wtf

pale vessel
summer acorn
#

you use an if statement to check if it's 1, if it is 1, you will remove the last letter using string = string.slice(0,-1);

#

that is how I would do it

earnest phoenix
#

Do you think that's more efficient that the regex

#

Wait

#

I got an idea

#

Brb

viral iris
#
  if (!message.guild.owner) return false ;
summer acorn
#

I never use regex, so my methods are just using JS

misty sigil
#

how do i split strings after X characters?

summer acorn
#

you check if it's that amount of characters

#

if it is

#

you make it the string but split it at that place

finite bough
#

I would just do date.getUTCHours + " hour " ...

#

lol

misty sigil
#

alr got that

summer acorn
#

I would make more variables by slicing

misty sigil
#

i want it in an array

summer acorn
#

for each of the times it reaches x

viral iris
#

is it right ?```js
if(!message.guild.owner) return;

earnest phoenix
#

Just

summer acorn
#

in that case, you can push it to an array

#

using for example a for loop

earnest phoenix
#

if(message.author.id !== message.guild.owner.id) return;

#

Jesus

viral iris
#

ok thx lol

pale vessel
#

@earnest phoenix after filter, .map(up => (up[1] + (up[1] < 2 ? up[0].slice(0, -1) : up[0])).toProperCase())

celest schooner
#

has anyone used dashflo for hosting

earnest phoenix
#

I actually... Tried that but imstead of up[1] < 2 i did up[1] === 1

#

Wait

#

Yours doesn't even

#

:waitWhat:

pale vessel
#

better version js .map(up => `${up[1]} ${up[1] < 2 ? up[0].slice(0, -1) : up[0]}`.toProperCase())

#

previous one didn't have a space after the time

earnest phoenix
#

Yours didn't just slice the s off, yours sliced off the entire <Number> Seconds LULW

pale vessel
#

wouldn't up[0] be something like "seconds"?

#

i never used that module so i have no idea lol

finite bough
#

what do u use

#

moment?

pale vessel
#

yeah

finite bough
#

I am the old fashioned js noob

pale vessel
#

cool

finite bough
#

using js functions to get date

celest schooner
#

yea

#

me too

finite bough
#

sadlife

#

O

#

hey brother/sister/selfbot

celest schooner
#

wait doesnt new Date() have date functions

#

so u can format it

pale vessel
#

it does

finite bough
#

yes

#

that's what I mean lol

#

like

#

Date.getUTCSeconds()

pale vessel
#

but some date are complicated so new Date() can't parse it, so that's why people prefer moment

finite bough
#

ye

pale vessel
#

some people*

finite bough
#

sometimes it fucks up as well

celest schooner
#

like wdym cant parse it

pale vessel
#

sometimes people just work with timestamps

finite bough
#

like

pale vessel
#

it's perfectly fine to use new Date()

finite bough
#

sometimes the actual month is 3 but it shows 2

celest schooner
#

oh

finite bough
#

happened to me some times

pale vessel
#

not all dates are like 2020-07-20

finite bough
#

u mean formats?

pale vessel
#

it supports other formats too like 12 Jun 2020 but still

finite bough
#

yea

earnest phoenix
#

https/discord.bots

pale vessel
#

no

earnest phoenix
#

@pale vessel no

celest schooner
#

is there a way to host completely different files on the same server
ex. having two folders with their seperate node_modules

surreal notch
#

how to do when a person do -setup #channel then in that channel whole code execute just like welcome

pale vessel
#

it should detect that automatically [@celest schooner]

earnest phoenix
#

I join server link

sterile thicket
#

Re: When I do let prefix = db.get('prefix_${msg.guild.id}') it doesn't read my command file, but when I do let prefix = botconfig.prefix, it does.. what's the problem?

bot.on("message", async(msg) => {
    if(msg.author.bot) return;
    let prefix = db.get(`prefix_${msg.guild.id}`)
    if(prefix === null) prefix = botconfig.prefix;
    let args = msg.content.split(" ");
    let cmd = args[0];

    if(cmd === `${botconfig.prefix}help`){
        var file = require(`./commands/help.js`);
        file.run(bot, msg, args, prefix);
        msg.reply(prefix)
        }
    });```
#

No errors though

celest schooner
#

it should detect that automatically [@celest schooner]
@pale vessel wdym

#

the server?

pale vessel
#

it should pick the module from the node_modules folder in the same directory/index root

#

it wouldn't pick outside

earnest phoenix
#

@pale vessel omg... My own fucking way worked without needing anything... The function was just assigned and not changing anymore until i restarted the client OMEGALUL

pale vessel
#

but isn't up[0] something like "seconds"?

earnest phoenix
#

Anyone here know how to make a web panel or use dashcord for python?

#

up[0] = keys
up[1] = values

pale vessel
#

if so then my code is shorter and more efficient

earnest phoenix
#

Mine is the same

pale vessel
#

o

#

show yours kinda cool to compare what we came up with

celest schooner
#

it should pick the module from the node_modules folder in the same directory/index root
@pale vessel oh okay thanks!

winged frigate
#

im new to making discord bots what free things do u guys use to code them.

honest perch
#

eris

lusty quest
#

d.js-light

#

brainfuck

honest perch
#

Tbh

#

Deno modules are lighter than eris

earnest phoenix
#

I use Djs

pale vessel
#

i moved from eris

earnest phoenix
#

Just because I like JS and the library is simple

honest perch
#

@pale vessel what to

pale vessel
#

d.js non light

earnest phoenix
#

what's discord.js-light

#

lmfao

pale vessel
#

for now

honest perch
#

discordeno is better

pale vessel
#

detritus better mmLol

earnest phoenix
#

RigidCord is better Hmm

lusty quest
#

d.js-light is is D.js V12 but with no caching. in the base configuration uses less ram than Eris

misty sigil
#

anyone know how i can split string into array in 1500 character chunks?

earnest phoenix
#

yes

pale vessel
#

@misty sigil regex or loops

lusty quest
#

@earnest phoenix i would update soon

misty sigil
#

regex seems more compact

earnest phoenix
#

regex is a bad way

pale vessel
#

could be slower

misty sigil
#

yea

earnest phoenix
#

use a simple for loop

#

i fucked my bot

#

sad

lusty quest
#

again?

misty sigil
#

how would i do that?

earnest phoenix
#

ye

#

😦

lusty quest
#

in october V11 is getting killed

earnest phoenix
#

jk

#

i was changed to v12 like 2 weeks ago

#

make an array
start with an empty string in array
loop through characters (text.split(""))
if last element in array is >= size, add new empty string element
add character to the last element

#

@misty sigil

#

djs-light is the shit

misty sigil
#

i'm probably gonna go with regex

#

although it's splitting linebreaks too

#
/.{1,2000}/g
``` is what i have so far
earnest phoenix
#

how do i cut the line into 2 lines

#

i want the css a

#

but it needs to be in 2 lines

lusty quest
#

add \n

feral aspen
#

Hi Guys

#

Question

#

So I want to make a website for my bot.. what's the best website makers I should use?

#

I heard about nicepage and Mobirise4

hidden lynx
#

If you don't wanna code it yourself, I think the best way of doing it is just grabbing a template. I don't recommend website makers. But that's just my opinion.

honest perch
#

@feral aspen something called html

#

its a nice website maker

feral aspen
#

Is Mobirise good?

honest perch
#

no

#

but html is

feral aspen
#

Ok.

#

I stopped using mobirise then started using Nicepage

pale vessel
#

its a nice website maker
@honest perch mhmm

summer torrent
#

smh

feral aspen
#

😮

honest perch
#

@pale vessel html is the best website maker, no doubt

pale vessel
#

agreed

honest perch
summer torrent
#

don't use website makers

pale vessel
slender thistle
#

WYSIWYG ftw

honest perch
#

haha @pale vessel 40 servers

#

brrrr

pale vessel
#

didn't update

#

brrr

honest perch
#

seen my server count?

#

its amazing

earnest phoenix
#

oof

honest perch
feral aspen
#

Very cool

earnest phoenix
#

mine almost 1k in 2 weeks

hidden lynx
#

Nicee

feral aspen
#

How?

earnest phoenix
#

i own a game

#

and a server with 18k members

honest perch
feral aspen
#

didnt you just said earlier that..

#

you know

#

whatver

abstract crow
#

Would there be a way I can create an object in javascript in a separate file like I could in C# or Java?

#

Then do like new Object();?

sudden geyser
#

sounds like a class

abstract crow
#

I'm stupid sorry

#

Yes

#

It's been a long day for me 🤣

hidden lynx
#

No just go like so:

const object = {
property1: "nonsense"
}

sudden geyser
#

big brain.

but yes, you can create a new class with class MyClass {...}, export it, then just import it and use new MyClass(...)

abstract crow
#

Gotcha

#

For something like this do I need a constructor?

module.exports = (id, name, status) => {


    class todo {
        
    }
}
quartz kindle
#

the constructor goes inside the class

#
module.exports = class todo {
  constructor(id,name,status) {

  }
}
abstract crow
#

Ahh gotcha

earnest phoenix
#

ugh

#

why is the class name

#

lowercase

quartz kindle
#

because who cares

earnest phoenix
#

:/

quartz kindle
#

lmao

hidden lynx
#

I do ;)

sudden geyser
#

Your strict linter will scream at you

summer torrent
#

isn't Vinniehat old mod?

sudden geyser
#

yes

split hazel
#

does anyone know a simple way of debugging a memory leak? i found its coming from arrays but that doesn't tell me much tbf, it seems to be a lot of tiny arrays combined to form that but yeah im not doing to look through that many elements

ruby talon
#

Heyo,
I'm trying to split a message using a delimiter that is more than one char long without removing the char.
I know how to do this with a delimiter that is 1char long (/([c])/, 'c' gets split)
An example of what I'm trying to achieve:

>>> let foo = "b-=a-=r";
>>> console.log(foo.split(/smth here that does that splits by '-=')/));
..< ["b", "-=", "a", "-=", "r"]
``` Here's another (simpler) example: ```
IN: HE|LL|O
OUT: ['HE', '|', 'LL', '|', 'O']
``` So basically this (<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split#Splitting_with_a_RegExp_to_include_parts_of_the_separator_in_the_result>) but with multiple characters.
earnest phoenix
#

Really

#

I am not online only for 1 day

#

And you loking my bot when I cant look internet

sudden geyser
#

are you self hosting it on your computer or something

earnest phoenix
#

Must am I wait 2 month more

#

are you self hosting it on your computer or something
@sudden geyser a hosting application

#

I've been waiting for 2 months. I wish we could be prepared whenever you let me know when my turn would come. 2 months of labor wasted

sudden geyser
#

@ruby talon I tried experimenting a bit, and came up with the answer: <String>.split(/(YOURDELIMITERHERE)/). For example, "this is a string".split(/( )/) returns [ 'this', ' ', 'is', ' ', 'a', ' ', 'string' ]. However, I don't really see the point in this unless you really need the separator in the middle. I'd just use .split(mydelimiter) and .join it later if you want it as a string.

#

Also Mehmet I'd talk to the moderator who denied your bot, but I doubt it would do good since your bot is expected to be online and I don't run this.

slender thistle
#

"2 month more"?
You mean a few weeks

ruby talon
#

@ruby talon I tried experimenting a bit, and came up with the answer: <String>.split(/(YOURDELIMITERHERE)/). For example, "this is a string".split(/( )/) returns [ 'this', ' ', 'is', ' ', 'a', ' ', 'string' ]. However, I don't really see the point in this unless you really need the separator in the middle. I'd just use .split(mydelimiter) and .join it later if you want it as a string.
@sudden geyser That returns an invalid Regex expression for me, I wouldn't be asking this if I didn't need it ehj x)
I think I found a solution tho, lemme test it ^^

slender thistle
#

it was close to a month but not 2 months

sudden geyser
#

For me the regex works shrug

honest perch
#

hello fellow humans

#

im showing servers using ejs and it works for servers using normal icons but if a server doesnt have one

#

would i replace it with the discord asset server side or in the ejs file?

earnest phoenix
#

64553578736037507368736034680468349th time to add the discord bot Yurian#6082 :(

quartz kindle
#

is that your bot?

earnest phoenix
#

yes

quartz kindle
#

did you add it through the website?

earnest phoenix
#

yes

quartz kindle
#

then wait for approval

earnest phoenix
#

but it's declined

quartz kindle
#

then fix the issue, and add it again

honest perch
#

TIM

#

help pls

earnest phoenix
#

it's declined because of a f...ing command shows a server list :(

quartz kindle
#

@honest perch check if document.icon exists, if not, replace it with the default icon's url

earnest phoenix
#

i changed the usage permissions of this command

honest perch
#

in the ejs file or server side smart person

quartz kindle
#

either, probably easier to do in the ejs

#

@earnest phoenix you need to add it through the website again

#

and wait for verification again

pure lion
#

Tim is it okay to host an ejs server on my own laptop?

quartz kindle
#

besides slow internet and downtimes, yes its ok

pure lion
#

Lol

ruby talon
#

@sudden geyser found a little solution:
message.split("splitter").join(",splitter,").split(",")
😄

sudden geyser
#

hmm

untold folio
#

hey after how much time should i change my bot's presence?

#

iirc discord's fine with 10x per minute? i'm doing it 4x per minute tho. thats fine?

honest perch
#

@quartz kindle im stuck, i dont know how to both have a for each and an if

quartz kindle
#

cant you simply do document.icon || "defaulticonurlhere"

honest perch
#

wait, that works?

quartz kindle
honest perch
#

would src="https://cdn.discordapp.com/icons/<%= document.id %>/<%= document.icon %>.png?size=256 || https://discordapp.com/assets/dd4dbc0016779df1378e7812eabaa04d.png"

#

work

#

or am i being stupid

#

im being stupid

quartz kindle
#

^

#

lmao

#

in your case, you can use ternary

honest perch
#

a what what

quartz kindle
#
document.icon ? `http://ppiwjpfiwe/${document.icon}/ouwehofuwhe` : "http://defaulturl"
pale vessel
#

ah yes, ppiwjpfiwe

sudden geyser
#

iirc discord's fine with 10x per minute? i'm doing it 4x per minute tho. thats fine?
@untold folio I think it was at minimum, 5 per minute, but I can't find it in the documentation anymore. I'd recommend you come up with something reasonable, as you probably don't need to update it every X times per minute.

honest perch
#

what am i supposed to replace ppiwjpfiwe with lmao

pale vessel
#

the url

#

condition ? <if true> : <else>

naive river
#

v

misty sigil
#

how do i split a string into array every 1500 chars
My code currently is js let array = evaled.split(0,1950)

pale vessel
#

i thought you used regex

misty sigil
#

It splits into a few lines but nothing close to the specified amount of chars

#

I decided to try other methods flaz

pale vessel
#

use a loop

honest perch
#

im still being stupid somewhere

#

i have a low braincell count

pale vessel
#

nah

quartz kindle
#

@misty sigil wdym nothing close to the specified amount of chars

misty sigil
#

idk i think that should split it every 1950 chars afaik

quartz kindle
#

split works with delimiters, not length

#

for length you need slice/substring/substr

misty sigil
#

ah right im just using the wrong things

honest perch
#

@quartz kindle where do i put that

pale vessel
#

uh...

quartz kindle
#
src="https://<%= document.id && document.icon ? `cdn.discordapp.com/icons/${document.id}/${document.icon}.png` : `discord.com/assets/woeugwouehowueg.png` %>"
honest perch
#

thank you kind sir

#

now time to filter permissions GWcorbinHolyFuck

#

how do permissions work as a user

#

is 2147483647 admin?

summer torrent
#

is this bitfield?

honest perch
#

dont have a clue but it returns this lmao

digital ibex
#

its bitfield yeah

#

its not hard

#

how r u showing the users guilds?

#

just the loop

honest perch
#

just res.json(req.user);

slender thistle
#

2147483647 & (1 << 3) returns 8 so I guess that includes admin

#

unless that's not how bitfields actually work and my copy-pasted-from-2018 snippet is wrong

honest perch
#

time to see if my spaghetti works

#

of course not

#

@quartz kindle should one filter guild shown by permission server side or ejs

quartz kindle
#

either

earnest phoenix
honest perch
#

ok, let me think about if im able to do it and then ill most likely come back for help

misty sigil
#

must do one hard think about splitting strings into 1900 char array sections

honest perch
#

tbh, ive ran out of braincells

#

im more stupid now than i was 2 years ago

digital ibex
#

u just

#

do

#

<Guilds>.filter((e) => e.permission & bitrate).whatever

#

imo u probably should do the loop client side instead of server side

honest perch
#

requires extra effort

digital ibex
#

not that much

honest perch
earnest phoenix
#

Anyone want me to buy them a vps?

digital ibex
#

wot

#

misly, what does req.user return?

wicked pivot
#

hi, i just added the aliases to my bot. but i have a little problem when i place a nonexistent order i have those problem

      var args = message.content.slice(prefix.length).trim().split(' ');
      var cmd = args.shift().toLowerCase();
      var command;

      if(bot.commandes.get(cmd)){
        command = bot.commandes.get(cmd);
      }else if(bot.commandes.get(bot.aliases.get(cmd))){
        command = bot.commandes.get(bot.aliases.get(cmd));
      }else{
        return;
      }

      command.run(bot, message, args, prefix)```

```TypeError: command.run is not a function
0|main  |     at Client.bot.on (/root/juzoo/main.js:713:15)
0|main  |     at Client.emit (events.js:203:15)
0|main  |     at MessageCreateHandler.handle (/root/juzoo/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
0|main  |     at WebSocketPacketManager.handle (/root/juzoo/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:108:65)
0|main  |     at WebSocketConnection.onPacket (/root/juzoo/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:336:35)
0|main  |     at WebSocketConnection.onMessage (/root/juzoo/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:299:17)
0|main  |     at WebSocket.onMessage (/root/juzoo/node_modules/ws/lib/event-target.js:120:16)
0|main  |     at WebSocket.emit (events.js:198:13)
0|main  |     at Receiver.receiverOnMessage (/root/juzoo/node_modules/ws/lib/websocket.js:789:20)
0|main  |     at Receiver.emit (events.js:198:13)```
digital ibex
#

command is undefined

quartz kindle
#

you could replace half of that code with a one liner lol

wicked pivot
#

how am I supposed to define command if the command does not exist?

digital ibex
#

command = <Collection>.get(args[0])

quartz kindle
#

let command = bot.commandes.get(cmd) || bot.commandes.get(bot.aliases.get(cmd))
if(command) command.run(...)

wicked pivot
#

I cannot run a file which return example this command does not exist?

quartz kindle
#

the problem is not that command doesnt exist

#

the problem is that a command has no run function

honest perch
#

@digital ibex it returns all user info that i collected with discord oauth

digital ibex
#

thne u can just lke

#

do

#

hru rendering the guilds to the frontend?

honest perch
#

for each

digital ibex
#

like js app.get('fatty', (req) => { // whats here });

honest perch
digital ibex
#

ok

honest perch
digital ibex
#

oh ok

#

u can just like do

#

const fullserverList = req.user.guilds.filter((e) => e.permission & bitrate number);

honest perch
#

yes but

#

what would i define bitrate as

unborn haven
#

does this make sense cause my terminal tells me this is the error

#

let args = message.content.substring(PREFIX.length).split(" ");

#

guys?

digital ibex
#

its the permission bitrate number

unborn haven
#

what do u mean

#

like [0]

#

?????/

summer torrent
#

@unborn haven show error

unborn haven
#

just a sec

honest perch
#

@digital ibex yeah, no

digital ibex
#

what

unborn haven
digital ibex
#

no what?

unborn haven
#

u know what this means?

sudden geyser
#

The error is self-explanatory: message is not a defined variable.

unborn haven
#

@summer torrent u know what this means

#

yes but it says that let args = message.content.substring(PREFIX.length).split(" "); this is wrong

#

apparantly

sudden geyser
#

Yes, so where did you define message

summer torrent
#

where is this code

#

it should be in message event

unborn haven
solemn latch
#

theres a max of 10 message limiters @earnest phoenix

#

thats what the error says

#

says you have 11

unborn haven
#

let args = message.content.substring(PREFIX.length).split(" "); is the problem

solemn latch
#

you really dont need more than one message listener

#

maybe 2 in some unique cases

honest perch
#

@digital ibex what would i define bitrate as? The number?

unborn haven
#

sooooo whats the problem?

solemn latch
#

now what

#

🤔

digital ibex
solemn latch
#

what can i do about that 🤔

digital ibex
#

@honest perch ^^

unborn haven
#

can someone pls help me : (

solemn latch
#

you just gave your code, thats not a problem 🤔

unborn haven
#

the problem is: let args = message.content.substring(PREFIX.length).split(" ");

#

here let me send screenshot

honest perch
#

@digital ibex im aware how permissions work

digital ibex
#

have you read it?

unborn haven
honest perch
#

mhm

digital ibex
#

you're obviously not fully aware,

honest perch
#

i dont understand what im supposed to do lmao

unborn haven
#

can someone help me

digital ibex
#

where are you confused?

honest perch
#

const fullserverList = req.user.guilds.filter((e) => e.permission & 0x80); this here

unborn haven
#

i sent screenshot of this command not working: let args = message.content.substring(PREFIX.length).split(" ");

digital ibex
#

what else?

#

thats all you need to do

honest perch
#

yeah and it wont work

unborn haven
#

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

honest perch
unborn haven
#

ok bye . : (

digital ibex
#

whats not working?

honest perch
digital ibex
#

are you have retard

solemn latch
#

@unborn haven its kinda hard to read your formatting ngl

honest perch
#

are you have retard
@digital ibex yes

digital ibex
#

oh

#

ok

honest perch
#

but still

#

i dont understand

digital ibex
#

you put fullServerlist in the object to render

#

but u defined it as

honest perch
#

oh lmao

digital ibex
#

fullserverList

honest perch
#

did say im stupid

#

now it doesnt show any server

digital ibex
#

the bitwise number is incorrect then

honest perch
#

ah wait

#

permission instead of permissions

#

right

#

nvm

#

fixed

digital ibex
#

ok

honest perch
#

thanks

stark terrace
#

who here uses eris' command framework?

obtuse jolt
#

Hello people I need some help making my bot! I need a confident developer that knows d.js v12 very very well, I am asking for help because I’m noticing it’s incredibly time consuming adding new features recently, I will only accept help from people with a bot dev role here and a bot here coded in discord.js please DM me if you would be interested, this is not a me thing it would be an us thing, thankssss

solemn latch
#

pretty sure the mods will tell you to not ask in this server @obtuse jolt

#

and to ask on fiverr if you need devs

obtuse jolt
#

I’m not asking in Fiverr

solemn latch
#

🤔

#

well, this server isnt the place to recruit devs

obtuse jolt
#

I could see that but people know exactly what I want here

#

And to find that anywhere else it’s the easiest

carmine parrot
#

lul fiverr

solemn latch
#

🤷‍♂️

amber fractal
#

I've made like $80 off of a month in fiverr mmLol

obtuse jolt
#

I made $0

brisk jewel
#

80 in a month that’s pretty decent

#

Was it pretty intensive work?

amber fractal
#

no, someone literally paid me $30 to add a bot to their server when I told him I'd do it for free

solemn latch
#

lol

carmine parrot
#

intense coding I see

amber fractal
#

I didnt even make a bot for it, I added it. I told him I would just do that for free but he said "Your knowledge and time is enough"

#

literally just free money at that point

earnest phoenix
#

did u take it lol

amber fractal
#

I didnt have a choice, people can tip you on fiverr regardless of whether you do anything

#

and idk if there's any way to refund it

crimson vapor
#

lol

carmine parrot
#

life is funny

misty sigil
#

still, trying to split my string correctly

carmine parrot
#

how do you need it to split then

misty sigil
#

1950 characters per array entry

carmine parrot
#

from a single string?

misty sigil
#

well from a eval

modest maple
#

does JS not support string indexing?

misty sigil
#

thats what im trying to do lol

celest schooner
#

does anyone have any vps/server advice

solemn latch
#

get a vos

#

vps

celest schooner
#

no like which one

solemn latch
#

i use galaxygate

carmine parrot
#

I use scaleway

misty sigil
#

i got one from oxide

modest maple
#

contabo are pretty good

misty sigil
#

pretty cheap

#

(cheaper than contabo (i think))

solemn latch
#

contabo i heard oversells pretty bad

carmine parrot
#

don't think it rly matters which one

celest schooner
#

im looking for a cheap one tho

modest maple
#

their cheap ones are a little underpowered but theyre still great on support

celest schooner
#

but scalable

misty sigil
#

oxide is really nice

#

im talking from experience

#

and its quite cheap too

solemn latch
#

honestly, shop for one with features you want

#

everyone will suggest what they use

celest schooner
#

is it virtual servers or website hosting

solemn latch
#

doesnt make it right for you

#

for a bot, vps is what you want

#

typically

digital ibex
#

i wanna learn deno, anyone know any good resources?

misty sigil
#

you can host website on vps

digital ibex
#

use namecheap

celest schooner
#

whats a dedicated server

solemn latch
#

dedicated can mean a few things

torpid valve
#

If my bot adds everyone a role on the server will be it api abuse?

modest maple
#

ytes

#

yes it would

carmine parrot
#

what if you do it slowly tho

digital ibex
#

then no

torpid valve
#

2 seconds will be enough?

modest maple
#

@misty sigil this is the sort of logic you need for splitting every 1950 characters:

text = "a" * 200000
split_on = 1950


length, extra = divmod(len(text), split_on)
if extra != 0:
    length += 1

array = []
for index in range(length):
    section = text[index + index * split_on: index + (index * split_on) + split_on]
    array.append(section)```
this is python just cuz
celest schooner
#

thats google right

misty sigil
#

pithon

digital ibex
#

python is cool

#

i just dont have the time to properly learn it 😩

carmine parrot
#

I've been trying to implement webhooks in dotnet but no success, any good resources to learn?

misty sigil
#

python is cool

#

but js

modest maple
#

you can still take the logic and implement it in js 🙃

#

even i can probably work how todo it in Js and i do very very little js

celest schooner
#

anyone tried to use dashflo

solemn latch
#

VERY small amounts of resources

#

thats very very low

digital ibex
#

wait what

strong tundra
#

which is this?

celest schooner
#

but isnt that enough for small bots

digital ibex
#

64gb of ram??

#

1 euro???

solemn latch
#

MB

digital ibex
#

what

solemn latch
#

not GB

digital ibex
#

oh

#

wow

#

im stupid

#

lmfao

strong tundra
#

small bots maybe

#

just one bot

solemn latch
proven lantern
#

do you get a processor too or just ram? $500 per ghz?

solemn latch
#

^

#

its extremely cheap, but also dumb expensive at the same time

#

your paying for practically no resources

celest schooner
#

i guess

digital ibex
#

what are you looking for, ramen?

celest schooner
#

well im looking for a server that can host my current bot, and in the future, ill maybe want to add a website or more bots on to

#

without having to buy a new one

misty sigil
#

wait

celest schooner
#

also one that can hold sqlite wrappers

digital ibex
#

without having to buy a new what?

celest schooner
#

a new instance

digital ibex
#

instance of?

misty sigil
celest schooner
#

like server

solemn latch
#

new vps

celest schooner
#

im looking at oxide ren

#

*rn

digital ibex
#

how much memory, jeremy?

misty sigil
#

2GB

digital ibex
#

oh

misty sigil
#

it says keklol

digital ibex
#

oh

#

whoops

celest schooner
#

but i dont even know what to look for

misty sigil
#

I'd recommend oxide personally

#

They have super nice customer support

solemn latch
#

🤷‍♂️

celest schooner
#

yea ill compare some more

proven lantern
#

i'd use a managed instance of the database even if you have a vps

strong tundra
#

do is kinda pricey compared to these tbh

#

they're using sqlite haha

celest schooner
#

i'd use a managed instance of the database even if you have a vps
@proven lantern wdym

solemn latch
#

do is a bit more expensive due to being a well known name.

celest schooner
#

couldnt u just use mongodb since its free

strong tundra
#

what sqlite wrapper do u use bro @celest schooner

celest schooner
#

instead of like s3 or rds

strong tundra
#

wait wrong person

digital ibex
strong tundra
#

i meant officiallylost

digital ibex
#

?

strong tundra
#

what sqlite wrapper do you use?

digital ibex
#

i dont use sqlite

strong tundra
#

wait no

#

i pinged the right person first time ugh

solemn latch
#

ruby on drugs

celest schooner
#

i use enmap

strong tundra
#

yeah use mongodb if you can

digital ibex
#

ruby on rails

#

lol

strong tundra
#

or some other hosted db

celest schooner
#

im trying mongodb

#

i would probably have to make another bot to implement mongodb

digital ibex
#

mongodb is amazing

celest schooner
#

i recommend using https://beta.libraryofcode.org, unsure if they support sqlite wrappers though. they're free and they r pretty good for free imo
@digital ibex where do u start for hosting

modest maple
#

its pretty easy to use

digital ibex
#

click it

celest schooner
#

click where

digital ibex
#

the link

#

its a website

celest schooner
#

i did

#

but wheres like the place where its for hosting

digital ibex
#

join the discord server

#

its not just for hosting, they do classes for beginners too

#

u might be able to join a mongodb class which teaches u how to use it

#

everything is all free

celest schooner
#

okay thanks

digital ibex
#

np

celest schooner
#

@digital ibex is it this

digital ibex
#

what

#

no

#

look on the navbar and click on discord

strong tundra
#

looks like you have to dm someone for access

digital ibex
#

wdym?

strong tundra
#

in the discord server

digital ibex
#

a modmail bot

strong tundra
celest schooner
#

is that free tho

digital ibex
#

most likely outdated

celest schooner
digital ibex
#

yeah

celest schooner
#

is it reliable tho

digital ibex
#

yeah

#

i host my website there

#

never had an issue with them

#

only a few downtimes and i've been using them since like dec 2019

celest schooner
#

well how do they make money

#

and not lose money

digital ibex
#

literally

#

the way the internet works

strong tundra
#

donations

digital ibex
#

and ads

#

im pretty sure nearly everything is open sourced and for that, they're getting some kind of sponsorship thing

#

dont quote me on that tho, im not a mod or anything

tulip ledge
modest maple
#

not really

tulip ledge
#

Ok

#

I need different colors for: Statistics, Economic and Gambling any idea for these colors? I just did yellow for them all but it looks odd to have 3 different categories with same color

modest maple
tulip ledge
#

Oh cool

honest perch
#

Imagine using a generator smh

#

Amateurs

amber fractal
#

They're so useful

#

making wave svgs is stupid

honest perch
#

Thats good

#

But color gens are bad

digital ibex
#

y

tulip ledge
#

Oh thats dope

honest perch
#

Rather spend an our finding my own

tulip ledge
#

Well its 1 am

#

I just wanna finish this

#

And not waste an hour

#

xD

honest perch
#

gambling

earnest phoenix
#

Is there a way to write this more compoact

#
map1 = new Map();
map2 = new Map();
map3 = new Map();
map4 = new Map();
digital ibex
#

use a loop?

earnest phoenix
#

christ i want to break up my bots backend into microservices and im already at 5 seperate processes

#

also cant you just do let map1, map2, map3, map4 = new Map()?

misty sigil
#

yea

sudden geyser
#

That only applies to map4

#

The rest will be undefined

misty sigil
#

oh so just

sudden geyser
#

The way they're currently doing it is fine imo

misty sigil
#
let map1 = new Map(), map2 = new Map(), map3 = new Map(), map4 = new Map()

that?

digital ibex
#

is 0.303ms slow or fast to search through 149 users?

honest perch
#

Pretty quick

digital ibex
#

even for nodejs?

#

all i did was just

sudden geyser
#

actually nvm read that wrong

digital ibex
#

and it took 303ms to do that

sick cloud
#

so i made a doc gen thing but run into this issue in my html file where the html comes out as a string and won't render

digital ibex
#

but my bots ping self hosted on a shitty pc 200ms, and im doing more than just that Thonk

#

how r u doing it, tony?

sick cloud
#

storing the html in an object then using it ${object.html}

#

content: '<h1 id="hello">Hello</h1><br /><p>test content</p><br />'

#

its valid html

digital ibex
#

im not sure if this would work

#

but

#

wait no thats stupid

celest schooner
#

whats the diffrence between vCore and vCPU

digital ibex
#

hmm

#

is this react?

sick cloud
#

@celest schooner same thing

#

and no

celest schooner
#

okay thanks

sick cloud
#

its using reef which is similar but its diff

#
#

i have allowHTML set to true

digital ibex
#

oh cool

#

i've never heard of it myself, cant really help much. sorry

sick cloud
#

well any general solutions?

#

i'll try anything rly

#

its just a templating system nothing complex

celest schooner
#

oh scaleway changes their prices to 5 bucks in a month

digital ibex
#

the stupid one i wanted to try was just document.getElementById lol

sick cloud
digital ibex
#

what does the network tab show?

sick cloud
digital ibex
#

oh :/

#

im not sure if this would change anything, but try doing js template: (props, route) => { return '<p>hi</p>'; });

sick cloud
#

as in with that content or

digital ibex
#

can be anything, but not dynamic

sick cloud
#

i dont get how that's going to help my issue

#

but it works fine

celest schooner
#

how much ram does like dank memer use

sick cloud
#

ask them

digital ibex
#

i wanted to see if the if it works as its meant to work

#

tbh, i dont know

celest schooner
#

got it

digital ibex
#

cant help much, sorry

sick cloud
#

okay

#

@digital ibex i fixed it by instead passing the markdown to the browser then rendering it inline

#

works now

digital ibex
#

oh cool. nice

misty sigil
#

nobody in here i think

celest schooner
#

how much ram does a bot usually use

#

like say 5k servers

earnest phoenix
#

hey whats the command to give a user a role in discord.js?

summer torrent
#

<member>.roles.add()

celest schooner
#

unless u using v11

earnest phoenix
#

thanks

quartz kindle
#

@celest schooner anywhere from 100mb to 5gb

#

depending on libraries, purpose, caching, optimization, language, etc...

summer torrent
#

mine is 119 MB with 80 guilds

quartz kindle
#

mine is 116 MB with 3800 guilds

summer torrent
#

uhm

celest schooner
#

5 gigabytes damnnn

digital ibex
#

mine is 16.7mb with 6 guilds

misty sigil
#

idk make one yerself

digital ibex
#

OfficiallyLost :)

earnest phoenix
digital ibex
#

no thonk me

zenith terrace
#

anyone know the v12 version of bot.ping. It use to work back in v11 but idk what the v12 version is

celest schooner
#

@zenith terrace

#

bot.ws.ping

zenith terrace
#

@celest schooner thanks

celest schooner
#

np

earnest phoenix
#

discord.js is not installed

#

run npm i discord.js and report back

celest schooner
#

how do you get the discord ID from patreon?

#

vm

#

nvm

untold folio
#

hey can anyone explain me how does node-cache work? like if i do this
const myCache = new NodeCache( { stdTTL: 100 } ); would every element last 100 seconds in the cache even though i don't specify the ttl when doing .set?

#

and that's for each element right? it would delete a certain element x seconds after it was stored

sudden geyser
#

Yes.

#

stdTTL would set the default timer for how long an object lasts in the cache before being deleted. It's not deleted as soon as the timer reaches zero, as it instead checks during a period of time (better than setting a bunch of setTimeouts)

untold folio
#

ohhh

#

and whats the best relationship between that period of time and ttl?

#

proportion* lol

sudden geyser
#

wdym

untold folio
#

should i just do it like this? new NodeCache( {stdTTL: 1200} ); cause there's another option thats called checkperiod

sudden geyser
#

Yes. I'm just going off the documentation as I've never used the package (though it's very useful). If you wanted to add another option, you'd just add it to the object.

untold folio
#

oh alright! thanks

old pilot
#

ok so like

#

idk how to do anything

#

at all

#

can someone help

#

ah nevermind

earnest phoenix
#
Object.getOwnPropertyNames(p);
})``` how's it possible to run an eval that runs a promise then show the actual result instead of

Promise { <pending> }```

sudden geyser
#

Get the result from the eval(...) function call, and check if it's an instance of Promise. If it is, await it.

earnest phoenix
#

await => you can only use await in async function which turning it into an async function and executing it will cause to not call back the function and still say promise { <pending> }

#

Tried many ways

reef carbon
#
@commands.Cog.listener()
    async def on_dbl_vote(data):
        channel = self.client.get_channel(734610683718664203)
        embed = discord.Embed(
            colour=discord.Colour.purple(),
            description=f"{data}"
            )
        await ctx.send(embed=embed)
#

doesn't show an error

delicate shore
#

i want my bit

#

bot

#

to search if the channel is in server

#

and get it's id

#

and then send the second arg in that channel

restive pebble
#

by name?

delicate shore
#

yes

#

like i do

#

so it send the msg there

#
module.exports = {
    name: "say",

    execute(message, args, bot){
        if (!message.author.id === '<719052008690024469>') {
            message.delete();
            message.reply('You do not have the permissions to use this command.');
            return;
        }
        if(!args[1]) return message.channel.send("Please specify the channel you wish to speak to! i.e `!say #communications`");
        if(!args[2]) return message.channel.send("Please specify what you want to say! i.e `!say [CHANNEL] [SAY]`");
            let say = args.splice(2).join(" ")

            let channel = args.shift().slice(2, -1);
            message.delete();
            bot.channels.cache.get(channel).send(say);
    }
}```
#

this is the code

#

but it says cannot read say

#

of undefined

tired nimbus
#

how would you find the user who reacted in awaitReactions

restive pebble
#

@delicate shore that error is not thrown there

delicate shore
#

e

restive pebble
#

its somewhere else

delicate shore
#

why

#

ok

#

it ppoints here

#

it points*

earnest phoenix
#

@tired nimbus I'm sure the collected after awaiting the reactions is done also returns an array of users

tired nimbus
#

yea It returns a map that seems to have the usre

earnest phoenix
#

Yea but if you want to see who was the user who reacted at the time a reaction was added, you gotta go with <Message>.createReactionCollector()

#

Instead of <Message>.awaitReactions()

sudden geyser
#

await => you can only use await in async function which turning it into an async function and executing it will cause to not call back the function and still say promise { <pending> }
@earnest phoenix I have no idea what you said, but code can speak clearer than words sometimes: ```js
let res = eval(myCode);

if (res instanceof Promise) {
res = await res;
}

This is what I meant by. You simply eval it and check if it's an instance of a promise. If it is, await it so you have the result. If you can't use async since your function is not `async`, simply make it async or use `.then` (may lead to uglier code)
sonic lodge
#

i don't think you have to check if it's an instance of Promise, this just works:

var result = await eval(myCode);
earnest phoenix
#

@sudden geyser i knew of that lol, i was trying to say do that while inside an eval...
Not in the code of the eval command, i already have that... Was just asking if this was possible to resolve it from inside the eval not the code of the eval command itself

delicate shore
#
module.exports = {
    name: "say",

    execute(message, args, bot){
        if (!message.author.id === '<719052008690024469>') {
            message.delete();
            message.reply('You do not have the permissions to use this command.');
            return;
        }
        if(!args[1]) return message.channel.send("Please specify the channel you wish to speak to! i.e `!say #communications`");
        if(!args[2]) return message.channel.send("Please specify what you want to say! i.e `!say [CHANNEL] [SAY]`");
            let say = args.splice(2).join(" ")

let channel = message.guild.channels.cache.get(c => c.name === `${args[1]}`)
            message.delete();
            bot.channels.cache.get(channel).send(say);
    }
}```
#

this is not working

sudden geyser
#

i don't think you have to check if it's an instance of Promise, this just works:
@sonic lodge that works, but if it doesn't return a promise, it's sort of unnecessary (and await works in weird ways even if it's not async).

sonic lodge
#

i see

delicate shore
#

anyone help me too

sudden geyser
#

PGamer what doesn't work about it? your if condition has two issues:

  1. Your not ! operator is on the wrong side. You should remove it and use !== instead of ===. Else, you're comparing a boolean with a string.
  2. .id returns a string of numbers. It doesn't return a mention or <> before or after it.
delicate shore
#

but @sudden geyser error is it says cannto read property send of undefined

sudden geyser
#

then channel is undefined. .channels.cache.get does not accept a function in the first place

restive pebble
#

use find lol

delicate shore
#

ok

earnest phoenix
#

const msg = client.snipes.get(message.channel.id)
Cannot read property 'get' of undefined

#

Can Anyone Help Me?

sudden geyser
#

did you define snipes on the client variable.

earnest phoenix
#

no

torn ravine
#

@earnest phoenix are you use a snipe module?

earnest phoenix
#

ya

torn ravine
#

make sure to read the documents thoroughly

#

what module did you use

earnest phoenix
#

@torn ravine ya it's done

#

i did it

#

np

stone elm
#

i made a bot but i am still working on the commands

earnest phoenix
#
 async execute(message, args, client, users, cashe) {
      message.channel.send("<@&734634711208689674> || <@&724525049607880764>")
     const embed = new Discord.MessageEmbed()
      .setTitle("Reports Command")
      .addField("Report Started", `${message.author.tag} I have alerted staff, Please be patient.`)
            message.channel.send(embed)
    client.users.cashe.get("694367588464984095", "470825695237636107").send(`${message.author.tag} , Has used the ``g+report`` Command. `);
 return;
  }
}```
**It says "Cannot read property 'users' of undefined**
humble gyro
#

means "users" is undefined hehehehe

earnest phoenix
#

and

#

How do I fix that @humble gyro ? O_O

humble gyro
#

check if client actually has a users property

earnest phoenix
#

uh

humble gyro
#

very cashe money

earnest phoenix
#

I meant cache

#

lol

humble gyro
#

nothing wrong with cashe

#

i like it

earnest phoenix
#

I am confused on this...

#

@humble gyro Help pwease

sonic lodge
#

you misspelled cache
oh it's a function parameter lol

humble gyro
#

probably client is invalid

earnest phoenix
#

How do I validate it?

humble gyro
#

console.log it

#

check what object it is

#

and send in the proper one

earnest phoenix
#

(node:11186) 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(). (rejection id: 2)

humble gyro
#

oh well

#

time to nap

#

good luck

earnest phoenix
#

Bruh

#

lol

#

Oof

humble gyro
#

okcat time to learn to read errors

earnest phoenix
swift void
#

gg

earnest phoenix
#

Nice System Lol

#

I posted it on GitHub

#

that's a thing?