#development

1 messages · Page 1423 of 1

earnest phoenix
#

can u hop in a call?

sudden geyser
#

nah

earnest phoenix
#

ok

cinder patio
#

Do you have a package.json file? node . won't work without one afaik

grave drum
#

is there a self promo

earnest phoenix
sudden geyser
#

nah

grave drum
#

oh ok

sudden geyser
#

so you still haven't installed it

earnest phoenix
#

im still doing it look

quartz kindle
#

what did you type to run this ^

#

not node .

sudden geyser
#

see, you need to show the whole console

grave drum
sudden geyser
#

looks okay

surreal sage
#

No, no. I don't have the indexes of those values, i need the second last. thats all

young flame
earnest phoenix
#

thats i click onn

sudden geyser
#

Maybe it could look like this: ```js
let keys = collection.lastKey(2); // the last two keys in the collection.
let value = collection.get(keys[0]); // second to last

Unless I'm misunderstanding.
#

like tim's one

earnest phoenix
#

anyone

#

which one do i load

quartz kindle
#

did you read my question? @earnest phoenix

young flame
#

who

quartz kindle
young flame
#

oh

earnest phoenix
#

i ran the .bat for it

quartz kindle
#

what bat file

earnest phoenix
#

the install tool

young flame
#

this is how i saved it

earnest phoenix
#

one

young flame
#
let wrole = args[1]
 
 if(isNaN(wrole)) return message.channel.send({ embed: { color: ('#ff3636'), description: ("`![RosesNo](https://cdn.discordapp.com/emojis/782971149260685312.webp?size=128 "RosesNo") | You must provide a valid role id, check to make sure the one provided it valid") } });
     
 db.set(`whilelistedil_${message.guild.id}`, wrole)
 
 message.channel.send({ embed: { color: ('#63f736'), description: ("![RosesYes](https://cdn.discordapp.com/emojis/782971149403422750.webp?size=128 "RosesYes") | You have Configured the whitelisted role, is now set to <@&" + wrole + ">") } });
quartz kindle
#

you're not supposed to do that lol

#

but whatever it doesnt hurt

earnest phoenix
#

what do i do ahah

quartz kindle
#

how did you install node

#

did you download it from the node.js website?

earnest phoenix
#

ye

quartz kindle
#

did you install it using the installer?

#

or did you download a zip version?

earnest phoenix
#

zip

quartz kindle
#

download the installer

earnest phoenix
#

ok

young flame
#

timmm

earnest phoenix
#

cheers

quartz kindle
young flame
#

O

#

brb

earnest phoenix
sudden geyser
#

Yes, but that's a very basic welcome announcement.

earnest phoenix
#

i know

#

but for some reason it aint working

#

i did npm install

sudden geyser
#

Do you have the intents enabled for guild member join events?

earnest phoenix
#

me?

sudden geyser
#

No.

#

You used your token like an idenitifer.

earnest phoenix
#

wdym?

sudden geyser
#

do you know what a variable is

earnest phoenix
#

back when i did it, all i did was just putting the code in

#

no

#

:/

sudden geyser
# earnest phoenix uuhhh...how do i check that

You need to enable server member intents on the developer portal. You then need to pass it as a client option ({ ws: { intents: [...] } })

See the docs for what intents you can add: https://discord.js.org/#/docs/main/stable/class/Intents?scrollTo=s-FLAGS

sudden geyser
# earnest phoenix no

Variables are primitive to JavaScript, so it's hard to explain your answer if you don't know what one is.

earnest phoenix
#

so what do i have to do to get it working as i did the node dowload and now when i do npm install i get a error

quartz kindle
sudden geyser
#

To get it working, you should spend more time learning JavaScript in the meantime. It'll be easy to solve future errors as well.

earnest phoenix
#

so how can i get it up working?

quartz kindle
#

aka "i dont want to learn i just want you to fix it for me"

slender thistle
#

Pretty much

earnest phoenix
#

ahah

#

can u link me anything that i can learn java then please

quartz kindle
#

java is not javascript

earnest phoenix
#

can u send me sommat to help me then please

sudden geyser
#

Martino if you want help you need to help yourself first. Here's a good resource for learning JS: https://learnjavascript.online/

pulsar bone
#
let m = await gchannel.send(gembed)
    m.react(":tada:")

it is saying await is only valid in async (the video i see it in work well without async)
and when i use it without await it says m is not defined

devout frost
#

You need to make the function that line is in async.

slender thistle
#

Ok then the video did that in an async function and you are not

latent cave
#

oof

sudden geyser
#

ah yes, jquery

latent cave
#

I can't find it that where I had to put the bot token

#

Can someone help me with that?

slender thistle
#

Wdym where

earnest phoenix
#

hello, why <collection>.findOneAndUpdate({}, {}, {returnNewDocument: true}) dont return the new document?

#

mongodb

hollow sedge
#

@earnest phoenix i think it's just new: true

earnest phoenix
#

i go to try

earnest phoenix
hollow sedge
#

idk then

earnest phoenix
#

got all first 2 pages right but stuck on this like i dont get string length at all

hollow sedge
#

you spelled length wrong in your function: length not lentgth

earnest phoenix
#

oha haha

#

my bad lmao

latent cave
#

Umm how can I add client object and login function?@hollow sedge

hollow sedge
#

why did you @ me lol

latent cave
#

Sorry if I'm acting weird about this it's my 2nd day

#

I'm sry

latent cave
hollow sedge
#

look at that

livid lichen
#
npm ERR! code 1
npm ERR! path C:\Users\NAME\Documents\DiscordBots\Ch1ll Bot\node_modules\canvas
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c "node-pre-gyp install --fallback-to-build"
npm ERR! The system cannot find the path specified.
npm ERR! node:internal/modules/cjs/loader:922
npm ERR!   throw err;
npm ERR!   ^
npm ERR! 
npm ERR! Error: Cannot find module 'C:\Users\node-pre-gyp\bin\node-pre-gyp'
npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:15)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:763:27)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
npm ERR!     at node:internal/main/run_main_module:17:47 {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: []
npm ERR! }

npm ERR! A complete log of this run can be found in:
-- Here it shows other stuff --
young flame
#

uh

#

for my server info command

#

im trying to filter out humans and boots

#

bottums*

#

so rn when i did it bots was 0

#
${message.guild.members.cache.filter(member => !member.user).size}
#

this was my thing for getting the bots

hollow sedge
#

i think you can do member => member.user.bot

#

to check if they're a bot

young flame
#

thats for members

#

i want it to filter out the members

#

so its only bots

hollow sedge
#

yes

#

but instead of filtering out the members why not just check if they're a bot?

young flame
#

i'd rather filter out

hollow sedge
#

!member.user this doesnt even filter out bots

#

every bot is still a user

#

i dont understand why you cant use the one i sent

young flame
#

that gives me

#

all the humans

#

i dont want humans

#

i want bots

sterile lantern
#

so rn i have a cmd that gives a random amount of coins:
Math.floor(Math.random() * 1000) + 1;

#

how would i make it so theres a

#

5% chance of getting -50 coins

#

or like 1% chance

#

basically chance stuff

hollow sedge
young flame
#

no you dont

hollow sedge
#

member.user.bot wont be true for actual pepole

young flame
#

ok

livid lichen
#

Anyone know alternatives to Node-Canvas?

#

It's a pain to install.

young flame
#

ig

hollow sedge
#

legit just try it

young flame
earnest phoenix
young flame
#

if its in a filter it filters out whats in a !

#

so !member.user.bot wont work

hollow sedge
#

so dont put in the !?

#

i never even said to put that in

hollow sedge
earnest phoenix
hollow sedge
#

OH MB

earnest phoenix
#

xd

silent cloud
#

Yo

#

Can somebody help

#

My code

#

I have this error

#

Why ?!?!

earnest phoenix
#

toISOString()?

#

wtf

silent cloud
#

Ohhh sec

#

Idk lol

#

Maybe this part is from module

earnest phoenix
#

oh

delicate shore
#

works in runkit

#

not in eval

#

why

#

Promise doesn't get resolved

#

why

drifting wedge
#

just messing around in js

#

anyone can help?

#
const friends = ["Alex", "Joe", "Bob", "Jeff", "Im super cool"];
if friends[7] === undefined {
    console.log("poop")
}
else:
    console.log(friends[7]);```
#

unexpected indentifier

sudden geyser
#

else {...}

#

or else console.log(...)

#

or even no brackets, which will rely on whitespace

drifting wedge
#

if friends[7] === undefined {

#

error came up here

sudden geyser
#

you need () around it

drifting wedge
#
if (friends[7]) === undefined {
                ^^^

SyntaxError: Unexpected token '==='```
#

isnt js ifs ===?

sudden geyser
#

if (condition) {...}

valid grotto
#

if(friends[7] === undefined)

drifting wedge
#

o ok

#

im new to js

#

so sorry if i do dumb quesitons

rustic nova
#

@reef carbon use inspect element for the css selectors

drifting wedge
#

trying to learn js without yt vids lmao

delicate shore
#

Mind if I post question again

drifting wedge
#
const friends = ["Alex", "Joe", "Bob", "Jeff", "Im super cool"];
var friendcount = 4;
if (friends[friendcount] === undefined) {
    console.log("poop")
}
else {console.log(friends[friendcount])}```
#

see im a pro

#

😎

delicate shore
#

Yes damn

silent cloud
#

Lol

delicate shore
#

Doesn't work with bot

#

But works with runkit

#

Promise isn't resolving

reef carbon
rustic nova
reef carbon
#

oh ok

delicate shore
#

Wait nvm I figured it

fierce ether
#

db pushes twice yet console.log is once playerqueue: [ '543900991569789016' ] const queue1Config = await QueueConfig.findOneAndUpdate({guildId: message.guild.id}, {"$push": {"playerqueue": message.member.id}}, function(err) { if (err) throw (err); }).catch(console.error)

void shadow
silent cloud
#

Bot dont understand what file

lavish forge
#

hello

silent cloud
#

Const bot

void shadow
#

ohhh

#

thx

silent cloud
#

Give me a sec

void shadow
#

ok

#

no Const bot to find file

silent cloud
#

Try this

#

for (const file of commandFiles) {
    
	const command = require(`./commands/${file}`);


    bot.commands.set(command.name, command);
}```
#

Change folder and other

void shadow
#

ok 1 sec

silent cloud
#

It should work

#

i used bot for client

#

=> client.commands.set.....

void shadow
#

@silent cloud

past needle
#

the folder command is for the commands

#

not to have the message or ready event

#

copy/paste them into your main file

void shadow
#

no

#

im trying to have some commands in difrent files

#

like music code will be in Music.js
ban code will be in ban.js

#

like that

#

@past needle

old latch
#

ys

#

but you don't have to make new listeners then

#

follow the discord.js tutorial on their website, it's good

void shadow
past needle
# void shadow like that

yes, you write the code of your commands in individual files, but since it's the main.js file that is going to be read, you have to make the bot understand what do to with those commands

old latch
#

it's better to look at there website I think

past needle
#

@void shadow ^

old latch
#

yeah

#

right

void shadow
#

ok

silent cloud
#

He

#

Ho

#

Ha

#

What?

past needle
#

So yeah i have a question too

#

x)

silent cloud
#

Give me it all

drifting wedge
#

how do i do an if "str" is in a var?

past needle
#

So i don't want to cause the ratelimit problem and i have thaugh of an idea to make an array of functions to do individually, this way whenever a function executes. The problem is that i also want it to wait a little bit before doing the next question and, it might be simple but i don't get how q---------q

drifting wedge
#

js

past needle
#

if its a string ?

drifting wedge
#

yes

#

if a str is in a var

past needle
#

if(typeof("str") === "string"){}

drifting wedge
#

so like if "e" in "reee"

past needle
#

oh

drifting wedge
#

thats typeof?

past needle
#

if "reeeee".includes('e')

waxen obsidian
#

Webhook oluşturmayı bilen Türk varsa dm gelebilir miw

drifting wedge
#

whats typeof tho?

past needle
#

it gives you if the variable is an object, undefined, string, int

#

the data type

drifting wedge
#

oh ok

drifting wedge
#

how can i make a str lowercase?

#

in js?

past needle
#

str.toLowerCase()

#

you can find in google all functions to do to a string

#

wait hold on i'll search for you

drifting wedge
#

ty

past needle
#

@drifting wedge

drifting wedge
#

thanks

past needle
#

^^

#

np

proud pond
#

commando still the 1 or ?

past needle
#

,_, ?

waxen obsidian
#

Webhook oluşturmayı bilen Türk varsa dm gelebilir mi

livid lichen
#
npm ERR! path C:\Users\NAME\Documents\DiscordBots\Ch1ll Bot\node_modules\canvas
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c "node-pre-gyp install --fallback-to-build"
npm ERR! The system cannot find the path specified.
npm ERR! node:internal/modules/cjs/loader:922
npm ERR!   throw err;
npm ERR!   ^
npm ERR!
npm ERR! Error: Cannot find module 'abbrev'
npm ERR! Require stack:
npm ERR! - C:\Users\node-pre-gyp\node_modules\nopt\lib\nopt.js
npm ERR! - C:\Users\node-pre-gyp\lib\node-pre-gyp.js
npm ERR! - C:\Users\node-pre-gyp\bin\node-pre-gyp
npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:15)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:763:27)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:991:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:92:18)
npm ERR!     at Object.<anonymous> (C:\Users\node-pre-gyp\node_modules\nopt\lib\nopt.js:10:14)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1102:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:967:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:807:14)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:991:19) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     'C:\\Users\\node-pre-gyp\\node_modules\\nopt\\lib\\nopt.js',
npm ERR!     'C:\\Users\\node-pre-gyp\\lib\\node-pre-gyp.js',
npm ERR!     'C:\\Users\\node-pre-gyp\\bin\\node-pre-gyp'
npm ERR!   ]
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\NAME\AppData\Local\npm-cache\_logs\2020-12-01T17_35_07_099Z-debug.log
PS C:\Users\NAME\Documents\DiscordBots\Ch1ll Bot>``` This makes me mad.
#

Anyone know how to fix all this crap?

drifting wedge
#

how can i check if the message author isnt the bot in js?

pale vessel
#

Like in dpy

drifting wedge
#

module not found

pale vessel
#

message.author.bot

drifting wedge
pale vessel
#

Yes

drifting wedge
#

dont do

#

ok

pale vessel
#

use !==

drifting wedge
#

whats "return" in js?

#

like just stop

pale vessel
#

yes

#

just stop

#

depends on the scope

past needle
#

if(condition) return; if the condition is true then it won't read the rest of the code in the scope

#

pogey and there is google to understand scope (honestly i'm not 100% sure neither lol)

#

o uh

#

So i don't want to cause the ratelimit problem and i have thaugh of an idea to make an array of functions to do individually, this way whenever a function executes another starts. The problem is that i also want it to wait a little bit before doing the next question and, it might be simple but i don't get how q------q

void shadow
molten yarrow
void shadow
#

oh

past needle
#

@void shadow did you see

#

the entire

#

video

#

?

void shadow
#

ohh i found why

#

ok

past needle
#

because it could of him changing what did he do

#

oof

void shadow
#

now ik

molten yarrow
#

dont copy events into your command
make an event handler, when you making command handler

void shadow
#

yes

past needle
#

he found out

latent cave
#

Can someone help me with this? I can't find the issue that this is not working

past needle
#

@-@

umbral zealot
past needle
#

I WAS ABOUT TO SAY THAT

umbral zealot
#

no one wants to have to download a file to help you ^_^

latent cave
#

But how can I send it like u guys?

past needle
#

in the website

#

and then you can share the link

past needle
#

oh

#

use code blocks

latent cave
#

wa

umbral zealot
#

```js
your code here
```

past needle
#

the language is optionnal

latent cave
#
const Discord = require('discord.js');
const bot = new Discord.Client();

bot.once('ready', () => {
    console.log('Ready!');
});
const groupID = 8239314,
      discordServerID = "783359880466792488";

async function getUserRoles(robloxUserID) {
    const targetGroupList = (await axios.get(`https://groups.roblox.com/v1/groups/${groupID}/relationships/allies?model.startRowIndex=0&model.maxRows=100`)).data.relatedGroups.map(guild => guild.id);
    const aliaseGroup = (await axios.get(`https://groups.roblox.com/v2/users/${robloxUserID}/groups/roles`)).data.data.filter(group => targetGroupList.includes(group.group.id)).map(data => data.role);
    const mainGroup = (await axios.get(`https://groups.roblox.com/v2/users/${robloxUserID}/groups/roles`)).data.data.filter(group => group.group.id == groupID).map(data => data.role);
    return {mainGroup: mainGroup, aliaseGroup: aliaseGroup}
}

function getPrefix(rawRoleName) {
    if (rawRoleName.startsWith("|")) {
        let roleName = [],
            endLine = false;
            spiltedText = rawRoleName.split(" ");
        if (3 > spiltedText.length) return null;
        for (let i = 0; i < spiltedText.length; i++) {
            roleName.push(spiltedText[i]);
            if (spiltedText[i].replace(" ", "") === "|" && endLine) break;
            if (spiltedText[i].replace(" ", "") === "|" && !endLine) endLine = true;
        };
        return roleName.join(" ");
    } else {
        switch(rawRoleName) {
            case "Field Marshal": return "| FM |";
            default: return rawRoleName;
        }```
#

Sending more hold on

umbral zealot
#

no wait

past needle
#

@-@

umbral zealot
#

if it's larger than this, USE HASTEBIN

past needle
umbral zealot
#

we do not want a spam of 12 different messages. Please, just paste to hastebin and send us the URL.

latent cave
#

I'm so sorry guys I'm new

#

I'm so sorry guys I'm new

past needle
#

np

latent cave
#

Here

drifting wedge
#

i made a really small and simple bot in js

#

if anyone wants it lmk, not even sure if i can

#

but its just th ecode

latent cave
#

Uhh nice what did you make

drifting wedge
#

not the bot

#

umm

#

it sends elmo hell gifts

#

gifs

latent cave
#

What is the bot about*

drifting wedge
#

and says stfu when u say anything

#

basicalyl

latent cave
#

Great job!

#

EHhhh

umbral zealot
#

alright so what's the issue with the code? question?

latent cave
#

Umm the bot is not working :/

drifting wedge
#

lang?

umbral zealot
#

how is it not working?

latent cave
#

Can I send you the invite link to the server?

#

Also I hired a scripter to make me this

umbral zealot
#

Surely you can describe the problem with words?

distant light
#
        .setTitle("**POLL STARTED!** " + `${message.author.tag}`, (message.author.displayAvatarURL()))
        .setTimestamp()
        .setColor("#1fff00");
        message.channel.send(embed2);
        newMessage = await message.channel.send(embed2)
        message.react('🟢').then(() => message.react('⚪').then(() => message.react('🔴'))).catch(error => console.log(error))
        const filter = (reaction, user) => {
            return ['🟢', '⚪', '🔴'].includes(reaction.emoji.name) && user.id === message.author.id;
        };
        message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
            .then(collected => {
        const reaction = collected.first();

        if (reaction.emoji.name === '🟢') {
            message.author.send(`You reacted: **YES**!`).catch(error => console.log(error))
        } if (reaction.emoji.name === '⚪') {
            message.author.send(`You reacted: **CANNOT DECIDE**!`).catch(error => console.log(error))
        } else {
            message.reply('You reacted: **NO**!').catch(error => console.log(error))
        }
    }```
SyntaxError: await is only valid in async function
What did I do wrong this time? I added the *newMessage = await message.channel.send(...)*
umbral zealot
#

IF you hired someone and the thign they delivered is broken, then they should fix it. not us...

latent cave
#

But If I tell him one last thing he will block me

modern sable
#

you did insert the bot token, right

umbral zealot
latent cave
#

At the end of the code
You get the client object and use the login function
And put your token as your parameter
Bye, blocked.
Marine SensorToday at 6:27 PM
Bruh it's my 2nd day easssssy tell me step by step
Clyde
BOT
Today at 6:27 PM
Your message could not be delivered because you don't share a server with the recipient or you disabled direct messages on your shared server, recipient is only accepting direct messages from friends, or you were blocked by the recipient.
Only you can see this • Dismiss message.
Marine SensorToday at 6:45 PM
um
hayperToday at 6:45 PM
Stop dming me
And ask people in development or use googlr
Marine SensorToday at 6:45 PM
Okie so do I have to script at the end of the code so I can put the token?
hayperToday at 6:45 PM
Or else i gonna block you again
Marine SensorToday at 6:45 PM
ok
So the token is not added yet is it safe to copy it and paste it in the development chat?
hayperToday at 6:46 PM
Yes
Marine SensorToday at 6:46 PM
Okie
Marine SensorToday at 8:04 PM
Umm hayper I'm not experienced like you, I didn't find what I wanted

Can you teach me?
teach

#

This is what he said

#

And I

reef carbon
#

is there a way I change the short description color?

latent cave
reef carbon
#

I tried .shortdescription but it's not working

valid grotto
#

Put your bot token. @latent cave

latent cave
#

I did

#

Sorry if I removed it in the text :/

valid grotto
#

Explain the error.

modern sable
#

whats the error you get when running the code?
otherwise people cant help you

latent cave
#

It doesn't even give error

#

It's not working when I say !update

modern sable
#

did you invite the bot to your server?

latent cave
#

Yes

#

Can I invite you?

umbral zealot
#

Is it online?

latent cave
#

Yes

#

I'll invite both of you?

valid grotto
#

I'll try out your code

latent cave
#

It says bot is runing

umbral zealot
#

what it should say is 'Ready!'

#

in the console

latent cave
#

no it should give me the roles that's connected to my roblox group

modern sable
#

nope, it should give Ready!

#

literally just checked the code

latent cave
#

Okay that's weird

modern sable
#

as soon as it successfully logs in, the console should display Ready! and then the bot should work

latent cave
#

So what should I say

#

That it should say ready?

umbral zealot
#

when you run the bot, using node index.js for example, it's supposed to print Ready! in the console where you run it

latent cave
#

wth

#

I said node bot.js to run the bot

#

Say*

umbral zealot
#

right great, so when you do that, it should say Ready!, in that place where you ran this

latent cave
#

No it's not saying

reef carbon
#

@rustic nova is there a way I change the short description color?

umbral zealot
#

then it's not running that code.

valid grotto
#

I tried it and it doesn't work, pretty sure this prevents it from running it

if (message.guild.id != discordServerID) return;
You're supposed to have a database? @latent cave

rustic nova
#

Like i told you

reef carbon
#

oh ok

valid grotto
#

Is discordServerID your server ID? @latent cave

reef carbon
#

but isn't there a .shortdescription like .longdescription?

latent cave
#

Hold up

rustic nova
#

Inspect element can tell you which are which

latent cave
#

Now it gives me this error

#

Error: Cannot find module 'C:\Users\Marine sensor\Desktop\discord-roblox-bot\index.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []

valid grotto
#

npm i

latent cave
#

Huh?

valid grotto
#

quickdb isn't even defined in your code, did you give the full code or is the raw exactly that? @latent cave

latent cave
#

Hold up I fixed it I had to say node bot.js

#

I said node index.js

#

Just wanted to see if it works now

latent cave
valid grotto
#

Try out the command then

latent cave
#

ok

#

Nop

#

Not working

molten yarrow
#

axios is also not defined

latent cave
#

Can I screen share with u guys?

#

@umbral zealot ^^

valid grotto
latent cave
#

Yes I paid him

valid grotto
#

That's fucked.

umbral zealot
#

We're not really here to support code someone else wrote to be honest. If @earnest phoenix can't be bothered to make this work, that's not our responsibility.

latent cave
#

He's like if you message me again I'll block you

valid grotto
#

You paid for a service, not sure how much but that's just fucked up.

latent cave
#

At the end of the code
You get the client object and use the login function
And put your token as your parameter
Bye, blocked.

#

This is what he said

umbral zealot
#

ok but that's not our fault or responsibility ¯_(ツ)_/¯

#

we can't start telling you how to run random code made by someone - member or not

latent cave
#

Yes you're right

#

Can you talk to him?

#

Because I'm scared if getting blocked

umbral zealot
#

We don't moderate private transactions.

valid grotto
#

That's your risk man, sorry to say. @latent cave

latent cave
#

That's fucked

valid grotto
#

I'd refund if someone gave me an unfinished project whether it's just missing a simple line of code or whatnot. But eh 🤷‍♂️

umbral zealot
#

See with requesting a refund through whatever method of payment was used, if you want.

latent cave
#

It was roblox gamepass

#

My brain is blowing rn

young flame
#

isis there a way

umbral zealot
#

Sounds like you got fucked on that, if they don't want to tell you how to use it.

young flame
#

to check each message sent for a regex in maps?

umbral zealot
#

the solution is unfortunately to at least learn the basics of nodejs and how it works, and fix it yourself ¯_(ツ)_/¯

latent cave
#

is there anyone else to make me that bot? I'll pay :/

rustic nova
#

No

#

Again, ask on fiverr or freelancer

earnest phoenix
#

How can you fetch the args for a command (python)

#

fetch

#

🤔

ebon mango
#

hi

how can i upload my css file for top.gg page ?

distant light
#
        .setTitle("**POLL STARTED!** " + `${message.author.tag}`, (message.author.displayAvatarURL()))
        .setTimestamp()
        .setColor("#1fff00");
        message.channel.send(embed2);
        newMessage = await message.channel.send(embed2)
        message.react('🟢').then(() => message.react('⚪').then(() => message.react('🔴'))).catch(error => console.log(error))
        const filter = (reaction, user) => {
            return ['🟢', '⚪', '🔴'].includes(reaction.emoji.name) && user.id === message.author.id;
        };
        message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
            .then(collected => {
        const reaction = collected.first();

        if (reaction.emoji.name === '🟢') {
            message.author.send(`You reacted: **YES**!`).catch(error => console.log(error))
        } if (reaction.emoji.name === '⚪') {
            message.author.send(`You reacted: **CANNOT DECIDE**!`).catch(error => console.log(error))
        } else {
            message.reply('You reacted: **NO**!').catch(error => console.log(error))
        }
    }```
SyntaxError: await is only valid in async function
**What did I do wrong this time?**
umbral zealot
ebon mango
umbral zealot
#

it should cover what you need

ebon mango
#

heartbeat_anim thank you

distant light
young flame
#

like i have the regex already

lyric mountain
#

then apply the regex for each entry in the map

umbral zealot
#

with a loop

young flame
#

so like

leaden lake
#

how is it possible to do a unique cooldown for multiple commands without cogs file ?
python language

young flame
#
let mention = /<@(.*?)>/;

const userData = usersMap.get(message.author.id);
        const { lastMessage, timer } = userData;
        const difference = message.createdTimestamp - lastMessage.createdTimestamp;
        let msgCount = userData.msgCount;
warm marsh
#

That would depend on how your current code is setup.

young flame
#

how would you spesify it?

#

ig

umbral zealot
#

you can use Map.forEach()

young flame
#

O

lyric mountain
young flame
#

so like

lyric mountain
#

you test the regex against the words inside ur map

young flame
#
usersMap.forEach(mention);
lyric mountain
#

no

umbral zealot
#

it takes a function

lyric mountain
#

unless mention is a matching method you've declared somewhere

umbral zealot
young flame
umbral zealot
#

then you need a function

lyric mountain
#

it'll be something like ```js
let regex = someregex;
theMap.forEach((key, value) => {
if (regex.test(value)) {
//Execute here if true
} else {
//Else execute this
}
});

#

note that idk how regex is tested in js

#

this is just a raw example

#

note the word raw, it'll probably not work if you just copy-paste it

young flame
#

not going to

livid lichen
#

Who pinged me?

viscid gale
#

yo guys it works for all the async events i tried it out on so far.. so how it works is that it takes 3 functions

first param(function) that returns true if success(that you define) is achieved

second param(function) that returns true if failure(that you define) is achieved

thir param(async function) that is a function that returns whatever async activity you're trying to do

as per every async function.. just put the .then and or the .catch after you run this function to move on

//async looper EXPERIMENTAL
async function asyncLoop(totalSuccess,totalFail,asyncFunction){
  var fails=0, errors=0
  var paramErrors=[
    typeof totalSuccess!="function",
    typeof totalFail!="function",
    typeof asyncFunction!="function",
    !asyncFunction.toString().split('{')[0].includes("async")
  ]
  if(paramErrors.includes(true)){
    return Error("all three parameters MUST be functions with the last one BEING ASYNC function")
  }
  //errors are actual errors, fails are situations which you deemed unsuitable
  //in this function, a resolve is passed ONLY if it matches your demands
  //however a reject is passed ONLY if it is a total fail according to you
  
  function looper(r,j){
    asyncFunction()
    .then(t=>{
      if(totalSuccess(t,fails,errors)){r(t)}
      else if(totalFail(t,fails,errors)){j(t)}
      else{fails++;looper(r,j)}
    })
    .catch(c=>{errors++
      if(totalSuccess(t,fails,errors)){r(c)}
      else if(totalFail(t,fails,errors)){j(c)}
      else{fails++;looper(r,j)}
    })
  }
  var p=new Promise(looper)
  return(await p)
}
#

sry that it looks spammy

earnest phoenix
#

that seems... overengineered

lyric mountain
#

btw, ain't that doing the same as the cascade lib?

viscid gale
#

bru i didnt copy paste

#

i didn't even google it

lyric mountain
#

ik

#

let me see if I understood what you're doing

viscid gale
#

ok im gonna put an example of running the function

lyric mountain
#

start with task A
if A suceeds, move on to next task
else stop execution

#

right?

viscid gale
#

there r 2 params which YOU define what's a totalwin or a totalloss

#

what i mean by this.. is that sometimes there are gonna be values/situations that don't fit either bill

#

and if it aint a complete fail or a complete success..

#

try again

#

so yea u were close.. but that extra detail took a bit of work

lyric mountain
#

could u give an example use-case?

viscid gale
#

mhm

lyric mountain
#

like, a scenario

earnest phoenix
#
Traceback (most recent call last):
  File "/home/container/.local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/container/bot.py", line 374, in play
    voice_channel.play(player, after=lambda e: print('Player error: %s' % e) if e else None)
  File "/home/container/.local/lib/python3.9/site-packages/discord/voice_client.py", line 561, in play
    self.encoder = opus.Encoder()
  File "/home/container/.local/lib/python3.9/site-packages/discord/opus.py", line 231, in __init__
    raise OpusNotLoaded()
discord.opus.OpusNotLoaded

How Do I Fix This?

tiny oak
earnest phoenix
viscid gale
#
asyncLoop(
  function(t){return t.text=="xD"},
  function(t,f,e){return f>e},
  async function(){return fetch(sryImTooBoredToPutExampleParamshere)}
).then(console.log).catch(console.error)
lyric mountain
#

that's....not what I was expecting lul

earnest phoenix
#
@client.command(name='play', help='This command plays songs')
async def play(ctx):
    global queue

    server = ctx.message.guild
    voice_channel = server.voice_client

    async with ctx.typing():
        player = await YTDLSource.from_url(queue[0], loop=client.loop)
        voice_channel.play(player, after=lambda e: print('Player error: %s' % e) if e else None)

    await ctx.send('**Now playing:** {}'.format(player.title))
    del(queue[0])
viscid gale
#

part boredom part THIS HELPS MAKE A WHEN FUNCTION

#

async while loop :}}

lyric mountain
#

no, I mean

viscid gale
wanton junco
#

Hello

lyric mountain
#

ik, I didn't mean a code example

earnest phoenix
#

i did...

lyric mountain
#

I meant an usage example

#

like

#

will you use that for what?

viscid gale
tiny oak
wanton junco
#

Do you have a Turkish official?

tiny oak
earnest phoenix
#

ok

wanton junco
#

@earnest phoenix where are you from

earnest phoenix
#

wdym

#

hows that development related

#

yea

lyric mountain
#

ig he wants turk help

#

he asked about that earlier

earnest phoenix
#

i am not from turk

viscid gale
#

so I began working on it when i saw a stackoverflow question and just walked right past it today

the thing is that their question was of how to loop again an axios request and his reason was that sometimes the result was undesireable and they wanted to efficiently repeat the async call until they get their desired result @lyric mountain

wanton junco
#

my bot has been denied for not having the help menu

earnest phoenix
#

make a help command then?

lyric mountain
umbral zealot
lyric mountain
#

a function that calls itself until you tell it to stop

earnest phoenix
#

that seems to be a lot of bloat and overhead for a loop though
what makes that better over a simple async function, i.e.

async function doThisThing() {
   let fails = 0;
   let success = 0;
  //loop of your preference
  {
    try {
      await doAnotherThing();
      /* handle success */
    }
    catch { /* handle fail */}
  }
}
umbral zealot
#

So yes you might want to make a help command, something that explains how to use your bot.

umbral zealot
#

yes I think we're all clear on that at this point 😄

viscid gale
viscid gale
lyric mountain
#

make a recursion limit then

earnest phoenix
#

loop for more than 15 times?

#

or limit it

quartz kindle
#

i mean, isnt that why you're counting successes and fails?

#

if(fails > 15) return;

lyric mountain
#

if success OR (fails > 15) return

viscid gale
#

so it aint some malignant thing as it looks

viscid gale
#

lemme show u the code example again..

earnest phoenix
#

it can be boiled down to

async function doThisThing(limit) {
  let fail = 0;
  while(fail < limit)
  {
    try { await doAnotherThing(); }
    catch { fail++; }
  }
}
#

your way uses way too much processing power for a loop

#

because of method overhead

viscid gale
earnest phoenix
#

so handle the result

quartz kindle
#

he wants to pass a callback to define what makes the call fail, it might be wrong result instead of 404 for example

lyric mountain
#

if the data isn't the desired one just throw an exception

earnest phoenix
#

if the result is not what you expect, count up the fail

lyric mountain
#

it'll fall into the loop's catch block

#

and increase the fail counter

earnest phoenix
#

or that

viscid gale
#

I did say it's short.. this is it if im not expecting you to put in wrong stuff```js
async function asyncLoop(totalSuccess,totalFail,asyncFunction){
function looper(r,j){
asyncFunction()
.then(t=>{
if(totalSuccess(t,fails,errors)){r(t)}
else if(totalFail(t,fails,errors)){j(t)}
else{fails++;looper(r,j)}
})
.catch(c=>{errors++
if(totalSuccess(t,fails,errors)){r(c)}
else if(totalFail(t,fails,errors)){j(c)}
else{fails++;looper(r,j)}
})
}
var p=new Promise(looper)
return(await p)
}

earnest phoenix
#

yes but why i'm saying it's bad is because there's a fuckton of method overhead

#

if you're going async, go async all the way

lyric mountain
#

no

#

it'd try until you don't throw an exception

#

or until fail counter reaches the limit

earnest phoenix
#

if you want to return a result... you can

#

returning will break the loop and exit the function

viscid gale
viscid gale
# lyric mountain no

so calling a while loop and await at same time? but mine takes more processing?

#

also it only works for that one condition of if you're using amount of times

lyric mountain
#
async function doThisThing(limit) {
  let fail = 0;
  let checklist = {exit: false};
  while(fail < limit && !checklist.exit) {
    try { 
      await doAnotherThing(checklist); 
    } catch { 
      fail++; 
    }
  }
}
bold tartan
#

How do I start creating bots?

lyric mountain
#

idk if JS is able to pass variable references, so this is as far as I could think

viscid gale
#

use a library is quickest good way

bold tartan
viscid gale
#

others

#

there's a c library for discord kek

earnest phoenix
bold tartan
earnest phoenix
#

calling .then() and .catch() does cost more than going async all the way

#

general rule of thumb when working with async code anywhere is "go async all the way down"

viscid gale
earnest phoenix
#

what

viscid gale
#

i mean let's say each time

#

it takes 100 ms

#

to get an answer

#

to even ++

#

a while loop small like that would execute hundreds of times per ms

earnest phoenix
#

i don't think you understand what blocking means

viscid gale
earnest phoenix
#

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

quartz kindle
#

Lol

viscid gale
#

like lag..

#

bruh

earnest phoenix
#

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

viscid gale
#

👀

earnest phoenix
#

you're making absolutely zero sense

viscid gale
#

ok bru

quartz kindle
#
while(bla) {
  await something()
}
#

the while loop will not continue and not block, while it waits for something

viscid gale
#

ik in theory it shudnt but prob just a coincedence then

#

but i wasnt just speaking off my ass with that one

earnest phoenix
#

you might be confusing method blocking with serial vs parallel execution

viscid gale
#

me wondering how much my brain died already

#

u might be right..

viscid gale
earnest phoenix
#

lets say something is an async method

while(bla) {
  await something()
}

is serial execution, it executes the method, blocks, waits for it to finish, then does it again

while(bla) {
  something()
}

is parallel execution, it's going to run without blocking until the while loop is broken, it won't wait for something to finish

#

can you install opus without root permisisons?

earnest phoenix
viscid gale
#

i never tested the difference of those

#

very interesting

viscid gale
earnest phoenix
#

async programming is very funky, it took me a while to figure it out

quartz kindle
#

@earnest phoenix ever messed with the proxy object?

earnest phoenix
#

in node?

quartz kindle
#

in js

#

in general

earnest phoenix
#

oh, no

#

i've seen it on MDN though

viscid gale
lyric mountain
#

var

quartz kindle
#

i discovered a pretty drastic optimization flaw

distant light
# umbral zealot did you check the answer I gave you before
        .setTitle("**POLL!**")
        .setDescription(q)
        .addFields(
            { name: 'OPTION 1: :green_circle:', value: 'Add this reaction if you want to vote: **YES**', inline: true },
            { name: 'OPTION 2: :white_circle:', value: 'Add this reaction if you want to vote: **CANNOT DECIDE**', inline: true },
            { name: 'OPTION 3: :red_circle:', value: 'Add this reaction if you want to vote: **NO**', inline: true },
        )
        .setFooter(`Started by: ${message.author.tag}`, (message.author.displayAvatarURL()))
        .setColor("#ff1d00");
        embed.setTimestamp()
         const embed2 = new MessageEmbed()
        .setTitle("**POLL STARTED!** " + `${message.author.tag}`, (message.author.displayAvatarURL()))
        .setTimestamp()
        .setColor("#1fff00");
        message.channel.send(embed);
        async function myFunc() {
        const response = await message.channel.send(embed)
        console.log(response)
        }
        message.react(':green_circle:').then(() => message.react(':white_circle:').then(() => message.react(':red_circle:'))).catch(error => console.log(error))
        const filter = (reaction, user) => {
            return [':green_circle:', ':white_circle:', ':red_circle:'].includes(reaction.emoji.name) && user.id === message.author.id;
        };
        message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
            .then(collected => {
        const reaction = collected.first();

        if (reaction.emoji.name === ':green_circle:') {
            message.author.send(`You reacted: **YES**!`).catch(error => console.log(error))
        } if (reaction.emoji.name === ':white_circle:') {
            message.author.send(`You reacted: **CANNOT DECIDE**!`).catch(error => console.log(error))
        } else {
            message.reply('You reacted: **NO**!').catch(error => console.log(error))
        }
    }

            )}
}```
#

I used it, the bot started 🙂 but the old issue (the bot reacts to wrong message) still persists. The bot should react the embed, not embed2.

viscid gale
#

hi

earnest phoenix
umbral zealot
#

I...

#

You shouldn't have created a new function

#

you could have just, y'know, added async to the client.on("message", (message) => { function

lyric mountain
#

async is all fun and games until:

-> This
-> message!
-> test
-> is
-> a
quartz kindle
#

@earnest phoenix check this ```js
const obj = {
str: "a",
test1() {
for(let i = 0; i < 9999999; i++) {
this.str + this.str;
}
},
test2() {
let str = this.str;
for(let i = 0; i < 9999999; i++) {
str + str;
}
}
}

let a = new Proxy(obj, {
get(target, key, receiver) {
return Reflect.get(target, key, receiver);
}
})

earnest phoenix
#

twice as much?

quartz kindle
#

test2() takes exactly the same, or even faster, test1() takes 1000x more

lyric mountain
earnest phoenix
#

what in the literal fuck

quartz kindle
#

exactly

#

im pretty sure this is a v8 bug

#

copy and paste this anywhere ```js
obj = {
str: "a",
test1() {
for(let i = 0; i < 9999999; i++) {
this.str + this.str;
}
},
test2() {
let str = this.str;
for(let i = 0; i < 9999999; i++) {
str + str;
}
}
}

a = new Proxy(obj, {
get(target, key, receiver) {
return Reflect.get(target, key, receiver);
}
})

b = new Proxy(obj, {
get(target, key, receiver) {
return target[key];
}
})

c = new Proxy(obj, {
get(target, key, receiver) {
return target[key].bind(target);
}
})

d = new Proxy(obj, {
get(target, key, receiver) {
return obj[key];
}
})

e = new Proxy(obj, {
get(target, key, receiver) {
return obj[key].bind(obj);
}
})

console.time(); obj.test1(); console.timeEnd()
console.time(); obj.test2(); console.timeEnd()

console.time(); a.test1(); console.timeEnd()
console.time(); a.test2(); console.timeEnd()

console.time(); b.test1(); console.timeEnd()
console.time(); b.test2(); console.timeEnd()

console.time(); c.test1(); console.timeEnd()
console.time(); c.test2(); console.timeEnd()

console.time(); d.test1(); console.timeEnd()
console.time(); d.test2(); console.timeEnd()

console.time(); e.test1(); console.timeEnd()
console.time(); e.test2(); console.timeEnd()

#

the difference it makes is absurd

earnest phoenix
#

jesus

quartz kindle
#

and literally the only difference is reassign this.str to a local var

#

lmfao

earnest phoenix
#

all it needs now is a mem leak

quartz kindle
#

i didnt notice a leak, but i also didnt really test for it

#

but im gonna post this in the v8 issues

#

and see what they say

viscid gale
# earnest phoenix lets say something is an async method ```js while(bla) { await something() } `...

ok one last question... when u mean waits for it to finish i know that the await would only return when it has a resolve or reject state.. but would the while loop keep executing?

example1.. while loop starts.. begins waiting on something.. runs again and again and again until something is returned and then re-calls something

example2.. while loop starts.. begins waiting on something.. ONLY runs again when something returns

which is it??

quartz kindle
#

the results are the same in node 12, 14, 15 and browser

viscid gale
#

sry for the 4 questions but that was my final one

lyric mountain
#

await will block the while loop

earnest phoenix
#

^

viscid gale
#

so example 2?

#

okok

quartz kindle
#

yes example 2

lyric mountain
#

await is like "I don't care what you're doing next, but you won't go anywhere until I finish my stuff"

quartz kindle
#

its not synchronously blocking, so it doesnt lock the code

#

but while and for loops do respect the await keyword

distant light
lyric mountain
#

oh my

earnest phoenix
#

gh actions is still having a stroke 😔

quartz kindle
#

probably caused by that one guy who hosts his bot in github actions

earnest phoenix
#

yikesss

#

it's been down for over three hours and i all want is just to release a new version of an app pls

lyric mountain
#

btw for some reason I can't not see a Clicker in ur pfp cry

earnest phoenix
#

LOL

viscid gale
earnest phoenix
#

it'a rose 😭

viscid gale
#

@distant light ⏫

viscid gale
earnest phoenix
#

uh

quartz kindle
#

thats so wrong lmao

earnest phoenix
#

that effectively did nothing

viscid gale
#

what?? how??

#

that executes an async function anonymously is all

fierce ether
#

how would i grab the player queue? const config = await QueueConfig.aggregate( [{ $unwind : "$playerqueue" }, { "$sample": { "size": 1 } } ]); console.log(config)

earnest phoenix
#

that's going to do the same with or without the async function being there

quartz kindle
#

the inner function is still sync, you just put everything in an async wrapper

#

for no reason

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

})
viscid gale
#

ah u said it

#

lol i didnt understand it the way it was said first

fierce ether
#

wb just the id?

#

that returns name and id, is there a way to get the id?

#

const queue1Config = await QueueConfig.findOneAndUpdate({guildId: message.guild.id}, {"$push": {"playerqueue": message.member.user.username + "|" + message.member.id}})

quartz kindle
#

split it

fierce ether
#

oh yeah

#

thx

distant light
#
        .setTitle("**POLL!**")
        .setDescription(q)
        .addFields(
            { name: 'OPTION 1: :green_circle:', value: 'Add this reaction if you want to vote: **YES**', inline: true },
            { name: 'OPTION 2: :white_circle:', value: 'Add this reaction if you want to vote: **CANNOT DECIDE**', inline: true },
            { name: 'OPTION 3: :red_circle:', value: 'Add this reaction if you want to vote: **NO**', inline: true },
        )
        .setFooter(`Started by: ${message.author.tag}`, (message.author.displayAvatarURL()))
        .setColor("#ff1d00");
        embed.setTimestamp()
         const embed2 = new MessageEmbed()
        .setTitle("**POLL STARTED!** " + `${message.author.tag}`, (message.author.displayAvatarURL()))
        .setTimestamp()
        .setColor("#1fff00");
        message.channel.send(embed);
        client.on("", async message => {
            await message.channel.send(embed2)
        })
        message.react(':green_circle:').then(() => message.react(':white_circle:').then(() => message.react(':red_circle:'))).catch(error => console.log(error))
        const filter = (reaction, user) => {
            return [':green_circle:', ':white_circle:', ':red_circle:'].includes(reaction.emoji.name) && user.id === message.author.id;
        };
        message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
            .then(collected => {
        const reaction = collected.first();

        if (reaction.emoji.name === ':green_circle:') {
            message.author.send(`You reacted: **YES**!`).catch(error => console.log(error))
        } if (reaction.emoji.name === ':white_circle:') {
            message.author.send(`You reacted: **CANNOT DECIDE**!`).catch(error => console.log(error))
        } else {
            message.reply('You reacted: **NO**!').catch(error => console.log(error))
        }
    }

            )}
}```
#

I want the bot to react to embed, not to embed2. What else can I do?

quartz kindle
fierce ether
#

@quartz kindle what would you use to split?

#

.split("|")

#

?

quartz kindle
#

yes

distant light
fierce ether
#

then

#

.get?

quartz kindle
#

[index]

fierce ether
#

wdym?

#

@distant light you copy and paste the code?

quartz kindle
#

Astrah is first index

#

the id is the second index

#

first index is 0

#

second index is 1

reef carbon
#

How do I edit the color of the bot description text?

distant light
viscid gale
#

how do u not know what copy and paste mean?

#

im confused no cap

fierce ether
#

making canvas?

distant light
viscid gale
#

so ur saying the parts which ur showing us are the parts u pasted

fierce ether
#

that is the worst code ive ever seen

viscid gale
#

so then ur answer would be yes

fierce ether
#

how do i grab the id? const config = await QueueConfig.aggregate( [{ $unwind : "$playerqueue" }, { "$sample": { "size": 1 } } ]); let player = config[0].playerqueue.split("|") console.log(player)

distant light
#

const embed = new MessageEmbed()
.setTitle("POLL!")
.setDescription(q)
.addFields(
{ name: 'OPTION 1: 🟢', value: 'Add this reaction if you want to vote: YES', inline: true },
{ name: 'OPTION 2: ⚪', value: 'Add this reaction if you want to vote: CANNOT DECIDE', inline: true },
{ name: 'OPTION 3: 🔴', value: 'Add this reaction if you want to vote: NO', inline: true },
)
.setFooter(Started by: ${message.author.tag}, (message.author.displayAvatarURL()))
.setColor("#ff1d00");
embed.setTimestamp()
const embed2 = new MessageEmbed()
.setTitle("POLL STARTED! " + ${message.author.tag}, (message.author.displayAvatarURL()))
.setTimestamp()
.setColor("#1fff00");

________________________________

    message.channel.send(embed);
    client.on("", async message => {
        await message.channel.send(embed2)
    })
    message.react('🟢').then(() => message.react('⚪').then(() => message.react('🔴'))).catch(error => console.log(error))
    const filter = (reaction, user) => {
        return ['🟢', '⚪', '🔴'].includes(reaction.emoji.name) && user.id === message.author.id;
    };
    message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
        .then(collected => {
    const reaction = collected.first();

    if (reaction.emoji.name === '🟢') {
        message.author.send(`You reacted: **YES**!`).catch(error => console.log(error))
    } if (reaction.emoji.name === '⚪') {
        message.author.send(`You reacted: **CANNOT DECIDE**!`).catch(error => console.log(error))
    } else {
        message.reply('You reacted: **NO**!').catch(error => console.log(error))
    }
}

        )}

}
BELOW THE LINE IS THE PASTED PART.
@viscid gale and @fierce ether

reef carbon
#

How do I edit the color of the bot description text on my top.gg page?
I tried:

  .bot-description {
    background: #c33799 !important;
}
``` But this edits the box surrounding the description. I just want to edit the color of the text not the whole box.
fierce ether
#

where do i put index then @quartz kindle

quartz kindle
#

[]

#

you dont know what is an array?

fierce ether
#

players react

#

add to array

#

random user from array grabs user name and id

#

but i need the id

reef carbon
hollow prawn
#

@reef carbon think that's css styling, look up css font colors or something

#

@earnest phoenix whats ur issue about

fierce ether
#

let player = config[0].playerqueue.split("|").index[0] @quartz kindle

hollow prawn
#

ok its because of the size limit for the box that r!youtube is in @earnest phoenix

#

if that column is a bit wider it'll display better

fierce ether
#

(node:14292) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '1' of undefined

hollow prawn
#

instead of like that

fierce ether
#

if i change it to 1

earnest phoenix
hollow prawn
#

no idea, thats more of top.gg thing rather than discord bot development

young flame
#

@quartz kindle sorry about yesterday-

quartz kindle
#

you never used an array before?

fierce ether
#

i have but not like this

#

u said use index to get id

#

tf

quartz kindle
#

how do you get an item from an array?

fierce ether
#

.pull

lyric mountain
#

pull is to add

fierce ether
#

no

#

push is to add

lyric mountain
#

ah, mb

#

anyway

fierce ether
#

mb?

lyric mountain
#

you need to access the index

quartz kindle
#

...

lyric mountain
quartz kindle
#
array = ["a","b","c"]
#

how would you get "b"?

chilly bison
#

@reef carbon instead of background-color use color lol

fierce ether
#

isit db

#

or jus js

quartz kindle
#

just js lol

lyric mountain
#
["A", "B", "C", ...];
  │    │    │    └ index N
  │    │    └ index 2
  │    └ index 1
  └ index 0
#

just a visual example of an array

quartz kindle
#

if you need to learn how to use arrays

lyric mountain
#

ah, it meant the JS array object

#

nvm

quartz kindle
#

they are high level because low level has a lot of different types of arrays

#

js has only one

lyric mountain
#

sometimes I wonder how js is even able to be mostly non-typed

#

like, behind the scenes

quartz kindle
#

they have a bunch of different c++ classes for each js type

#

and adapt to the situation

fierce ether
#

still dosent explain what i needa do

lyric mountain
hollow prawn
quartz kindle
#

for example even a js string behind the scenes is split into like 5 different string types

#

short strings, long strings, concatenated strings, etc

hollow prawn
#

@fierce ether you need to "use" the index right? but you don't understand what the index is?

lyric mountain
quartz kindle
#

xD

lyric mountain
quartz kindle
hollow prawn
#

note, it is quite easy to overlook that ^

#

which has happened to me till i get it

lyric mountain
#

that reminds me of let fruit = "Ba"++"a"

quartz kindle
#

xD

earnest phoenix
#

actions decided to work now!

quartz kindle
#

nice lul

#

i've never used actions before

earnest phoenix
lyric mountain
#

I never fully understood how actions work

earnest phoenix
#

they're super useful

#

when they work that is

lyric mountain
#

ik, they're just obscure

#

I use it for build status and deployment

earnest phoenix
#

CI/CD debugging is the worst

#

this is all from trying to make the workflow work

quartz kindle
#

lmao

lyric mountain
#

"now?"

#

"pls"

#

when your suffering surfaces into patch notes xD

deft lotus
#

Hi, so I was redirected here.

#

I have set my tables' width in bot description on the website to 25%

#

They show up full size

#

Any ideas?

sudden geyser
#

"As a project drags on, my git commit messages become less and less informative"

lyric mountain
lyric mountain
#

% for some reason freaks out in some browsers/containers

#

although vw is relative to page width, it'll work in this case since longdesc is also relative to page width

deft lotus
#

Very insightful. I mainly do backend in python and some javascript once in a while, so my knowledge of HTML and CSS are enough to just make a basic website 😄

#

Appreciate the help.

#

So whenever such problems occur I'm at a loss

lyric mountain
#

always remember:
% = relative to container dimensions
vw/vh = relative to page dimensions

deft lotus
#

And googling such specifics is always a pain

lyric mountain
#

vmin/vmax = relative to smallest/biggest dimension

viscid gale
#

im starting to wonder if this is really unsolveable

hollow sedge
#

there's probably a way to do it, but why

viscid gale
#

because a nodejs console interface

#

the idea hit me when i saw someone on stackoverflow asking about some thing but the answer was some method(that they wouldnt know unless they knew)

#

i mean.. i learned what i learned of js cuz of the nice chrome console

#

not comparitively nice but the interfacing really helped

hollow sedge
#

if you know all the variables being declared why cant you just write those?

reef carbon
#

can you edit the color of the invite and vote buttons?

solemn latch
#

yeah

reef carbon
#

oh

viscid gale
reef carbon
#

I have

    a.votebutton:hover {
        color: #23272A !important;
        background: #c33799 !important;
}
    a.votebutton {
        color: #ffff !important;
        background: #23272A !important;
}
``` But it only changes the color of the review button @solemn latch
#

do you know why?

quartz kindle
#

otherwise there is no way afaik

hollow sedge
#

couldnt you also just use an object?

viscid gale
viscid gale
reef carbon
#

nvm I figured it out

viscid gale
#

if i make a file

var xD=1
require('myFutureReadLineInterface').initiate()
#

there is no list that has variables like xD

quartz kindle
#

remove the var

viscid gale
#

ikik

#

but... where on earth are the consts and vars

quartz kindle
#

nowhere

viscid gale
#

wt

quartz kindle
#

they are not accessible programmatically

viscid gale
#

as in if i enter in the console xD

#

it will return 1

quartz kindle
#

you can access them if you know them

#

but you cant list them

viscid gale
#

according to javascript logic.. it searches from its "local" then goes up all the scopes and only returns undefined if it really isnt defined

#

so logically there must be a scope where the vars and consts are owo

quartz kindle
#

they are hidden somewhere in another world

#

lmao

viscid gale
#

:{

#

time to look to make something else bois

#

hmm.. u seem knowledgeable.. is there a way to "hijack" keywords?

#

like there's a way to edit XMLHttpRequest that pushes all requests made through it into an arr

quartz kindle
#

yes

viscid gale
#

i call it "hijacking" (personal term)

quartz kindle
#

well idk about XMLHttpRequest

#

since its native

viscid gale
viscid gale
#

any thing that aint a const, u can

#

and if that const is an object.. u can play with the keys

#

when it comes to using browsercode.. dependencies ARE weaknesses

#

don't ask.. just trust xD

pure lion
#

the const means it cant change the type

#

example, you can push shit into an object

#

but you cant reassign

viscid gale
#

ik..

pure lion
#

var is broken

livid lichen
#
    const args = Message.content.slice(prefix.length).trim().split(/ +/);
    const command = args.shift().toLowerCase();
    const commandfile = Bot.commands.get(command) || Bot.commands.find(command_ => command_.config.aliases && command_.config.aliases.includes(command));

    if (!commandfile){
      return Message.reply("What? https://media4.giphy.com/media/UnTC9o2HMyUta/200.gif")
    }
...
  } ``` It cannot find the returns that it cannot find the file.
viscid gale
#

var is lovely

quartz kindle
viscid gale
#

const is A$$

green kestrel
#

so this is today's new feature in my bot... i never ever expected this was a thing

pure lion
#

toxic

#

and off topic

#

smh

viscid gale
#

not toxic

#

trolly

#

😈

pure lion
#

same difference

viscid gale
#

not really owo

green kestrel
#

shush filthy millenial 😄

viscid gale
#

xDDD

pure lion
quartz kindle
#

c++ doesnt have a function for locale aware conversion?

green kestrel
#

not that does this, no

young flame
#

lol

green kestrel
#

its not locale aware conversion, its lazy grammar conversion

#

for a specific language

viscid gale
# quartz kindle

well.. not exactly hijacking.. but i guess u know what i mean tho

young flame
#

@solemn latch dev senpai?

viscid gale
#

hijack is when u turn the var itself into ur own

quartz kindle
#

wdym

solemn latch
#

hey

#

im actually here this time

#

not half afk ;p

young flame
#

lol

quartz kindle
#

like delete XMLHttpRequest from existence?

viscid gale
young flame
#

i have a questioN

quartz kindle
#

and use it for something else?

young flame
solemn latch
#

yeah idm rn

viscid gale
#

why i call it a hijack is because lots of functions use those stuff

green kestrel
#

@quartz kindle so, in spanish, young speakers might say 'papa' instead of 'papá'... the first means potato and the second means father

viscid gale
#

so if u hijack them.. u have control

green kestrel
#

so their text would translate to 'today im staying at my potatos'

quartz kindle
#

this ?

green kestrel
#

and the only way anyone is going to know is via context, computers dont do context well

#

but we have to support this lazy typing, where they cba to put in accents

lyric mountain
viscid gale
#

not finished writing

#

*editing

green kestrel
#

so at the same time it lowercases it... it hacks in this laziness, but only for spanish

lyric mountain
#

and a hella lot of getters 'n setters

green kestrel
#

because only spanish do it apparently

long marsh
#

What do you guys leverage for databases? I posed the question in general; however, it may be more suitable for here. I'm leveraging DynamoDB; however, I'm worried that it may cripple me in the longrun as more access patterns emerge 😬

green kestrel
#

i was told by the admin of a huge server that we needed to do this to make it friendly for lazier typists

quartz kindle
#

a lot of languages do that

#

portuguese, french, lots of slavic languages

green kestrel
#

not the same format of laziness though, apparently if i did this in portugese it would break stuff

#

they have different 'lazy' rules

viscid gale
#

ugh why is enter doing that sryyy

quartz kindle
#

i mean, if i understand correctly, you want for example "nao" to be a valid answer for "não"

green kestrel
#

correct

#

but only for ones with a downwards accent

quartz kindle
#

so yeah portuguese people do it all the time

green kestrel
#

the people who do this grammar shortcut only omit vowels with a reverse ` accent

viscid gale
#

@quartz kindle

green kestrel
#

i was on the fence wether to implement it or not

viscid gale
#

@quartz kindle i deleted it now

#

but u saw right?