#development

1 messages ¡ Page 1790 of 1

opal plank
#

@earnest phoenix need ur help with android shit

#

termux on android

#

like what the fuck is going on

earnest phoenix
opal plank
#

have u used termux?

#

u the only person i know that uses mobile too much

earnest phoenix
#

I always do

opal plank
#

perfect

earnest phoenix
#

So what exactly is the problem

opal plank
#

its a rooted device

#

i need to monitor file changes in a folder

earnest phoenix
#

You have to give root access to termux itself

opal plank
#
#!/usr/bin/ksh

# Directory in which you want to detect file change
DIRECTORY=/root/data/data
cd $DIRECTORY

list1=`(ls -ltr)`
echo "----- List 1 -----"
echo "${list1}"

while true; do

echo "Sleeping 5 sec!"
sleep 5

list2=`(ls -ltr)`
echo "----- List 2 -----"
echo "${list2}"

if [[ $list1 != $list2 ]]
then
    echo "----------------------- File changed -----------------------"
    diff <(echo "${list1}") <(echo "${list2}")
fi

list1="${list2}"

done```
#

attemping to run this

#

and how do i give root access to termux?

#

(complete noob btw)

earnest phoenix
#

Have you setup a storage on Termux before this?

opal plank
#

never

earnest phoenix
#

If not try running termux-setup-storage

opal plank
#

asked me to allow it

#

and i just did

#

no other feedback frmo that

earnest phoenix
#

Then that should work

opal plank
#

now run the originals script?

earnest phoenix
#

Sure go ahead

opal plank
#

aight lets see

#

is there no ls in termux?

earnest phoenix
#

There is, you probably messed up the bash file syntax

opal plank
#

straight up from here

#

just changing the directory

#

to /root/data/data

earnest phoenix
#

hmm, "syntax error near unexpected token ls"

opal plank
#
#!/usr/bin/ksh

# Directory in which you want to detect file change
DIRECTORY=/root/data/data
cd $DIRECTORY

list1=`(ls -ltr)`
echo "----- List 1 -----"
echo "${list1}"

while true; do

echo "Sleeping 5 sec!"
sleep 5

list2=`(ls -ltr)`
echo "----- List 2 -----"
echo "${list2}"

if [[ $list1 != $list2 ]]
then
    echo "----------------------- File changed -----------------------"
    diff <(echo "${list1}") <(echo "${list2}")
fi

list1="${list2}"

done```
#

this is what i used

#

prob cd directory failed?

#

i assume the path is right

#

let me test it rq

earnest phoenix
#

Probably

opal plank
#

pog

earnest phoenix
opal plank
#

now what

#

hmm

#

seems like i cant go any higher than storage

earnest phoenix
#

Wait lemme see something real quick

opal plank
#

aight

earnest phoenix
#

Did it ask for storage permission or root access when you did termux-setup-storage?

opal plank
#

hmmm i can run again

#

1 sec

#

is this fine?

earnest phoenix
#

Perhaps

opal plank
#

sketchy

#

yes it is then

#

yeah i did grant it perms

#

i think it asked for media and something tho

#

media and photos?

earnest phoenix
#

Did it not ask for root access?

opal plank
#

dont think so, no

#

hmmm

earnest phoenix
#

Install tsu through apt by

$ apt install tsu -y

and run tsu, it should ask for root access

opal plank
earnest phoenix
opal plank
#

after i typed su

earnest phoenix
#

Exit from that cell mode, either by exit or force closing the app then run what I said

opal plank
#

ah, perfect

earnest phoenix
#

Seems like you're using the old repos of apt

opal plank
#

apt-get update ?

earnest phoenix
#

apt update -> apt upgrade -y -> apt install root-repo -y -> apt install unstable-repo -y -> apt install x11-repo -y

opal plank
#

well that was quick to error

#

legit the first one

earnest phoenix
#

Yep, called it; apt install apt -y

opal plank
#

got bad news for you chap

earnest phoenix
#

Wait what the fuck

opal plank
#

if you're clueless, im even more

earnest phoenix
#

Try apt upgrade -y

opal plank
earnest phoenix
#

That's really strange

opal plank
#

is 1.4.10-6 the latest?

earnest phoenix
#

Nope

#

The latest is 2.3.5-1

opal plank
#

wew

#

check this

earnest phoenix
#

Run termux-change-repo and select another main repo

opal plank
#

4 minutes ago

#

everyone is on this post

#

check that rq

earnest phoenix
#

hmm, that issue only happened to me once a long time ago

#

Really strange

#

@opal plank run apt purge game-repo -y and try updating again

opal plank
earnest phoenix
#

You gotta run apt update to receive the new updates

opal plank
#

same thing

#

the dev was mentioning what u said

#

about switching repos

#

termux-change-repo

earnest phoenix
#

Did you try changing it tho?

opal plank
#

nah

#

should i go science?

earnest phoenix
#

yes

opal plank
#

uncheck the first one?

#

it multiple choice

earnest phoenix
#

Try choosing both and see what happens I guess

opal plank
#

aight

earnest phoenix
#

You can check all of them if its multiple choice

#

If not thr first one

opal plank
#

this one is single choice

#

going for the fisrt one

#

should i try the other mirrors?

earnest phoenix
#

Try unselecting the main repo from termux-change-repo

#

Man, a lot has changed kekdoggo

opal plank
#

same thing

#

pog the mirror worked

#

3rd try

earnest phoenix
#

Big pog

opal plank
#

now try tsu?

earnest phoenix
#

Did you update those?

opal plank
#

which?

#

apt update?

earnest phoenix
#

38 packages can be upgraded

#

apt upgrade -y

opal plank
#

working thus far

earnest phoenix
opal plank
#

bet

#

almost done

#

erm which do i pick?

earnest phoenix
#

Y

opal plank
#

--yolo

#

i see

#

aight all 3 commands ran

earnest phoenix
#

poggers, install tsu and run it

opal plank
#

pog?

earnest phoenix
#

yes very

#

Now run the script

opal plank
#

already fucked up

#

why there no folders here

earnest phoenix
#

Perhaps you entered the wrong place idk, try ls -a

opal plank
#

oh hidden files

earnest phoenix
#

yep

opal plank
#

hmmmmm

#

there should be quite a few things here

earnest phoenix
#

I think it puts you in the wrong root dir wth

opal plank
#

literally the path at the top

earnest phoenix
#

Wait a second, why not just sudo KEKW

opal plank
#

hmmm

#

what

earnest phoenix
#

Outside of tsu shell

opal plank
#

ah

#

apparently thats as far as it goes

#

im pretty sure i know where im at

#

but theres a lot of shit missing

#

thats the pc's windows folder

#

it might be putting me here

#

i need 1 up

earnest phoenix
#

Try cd /?

opal plank
#

fucking legend

earnest phoenix
opal plank
#

reeeee

#

sudo it is

#

pog now it works

#

so i might need to switch that script path and use sudo

earnest phoenix
#

yep

opal plank
#
#!/usr/bin/ksh

# Directory in which you want to detect file change
DIRECTORY=/data/data
sudo cd /
sudo cd $DIRECTORY

list1=`(sudo ls -ltr)`
echo "----- List 1 -----"
echo "${list1}"

while true; do

echo "Sleeping 5 sec!"
sleep 5

list2=`(sudo ls -ltr)`
echo "----- List 2 -----"
echo "${list2}"

if [[ $list1 != $list2 ]]
then
    echo "----------------------- File changed -----------------------"
    diff <(echo "${list1}") <(echo "${list2}")
fi

list1="${list2}"

done```
#

lets try that[

#

fml

#

i need sudo to run that

earnest phoenix
#

alright we back

opal plank
#

we back

earnest phoenix
#

But no idea about that KEKW

#

I think its referring to the backticks

#

Or parentheses (?)

opal plank
#

i mean it was there before

#

but without sudo

#

let me try running the original

#
#!/usr/bin/ksh

# Directory in which you want to detect file change
DIRECTORY=/data/data/com.grumpyrhinogames.idleapocalypse
sudo cd /
sudo cd $DIRECTORY

list1=`(ls -ltr)`
echo "----- List 1 -----"
echo "${list1}"

while true; do

echo "Sleeping 5 sec!"
sleep 5

list2=`(ls -ltr)`
# echo "----- List 2 -----"
# echo "${list2}"

if [[ $list1 != $list2 ]]
then
    echo "----------------------- File changed -----------------------"
    diff <(echo "${list1}") <(echo "${list2}")
fi

list1="${list2}"

done```
#

which is this one

charred shuttle
#

I have a question about shutting down my bot. If, hypothetically speaking, I needed to shut down my bot for some reason but I wouldn't want to wait for the current running commands to finish, how would I go about doing that? Here's my code now but when I run the code this command will only run after the current running command is over.

command(client, 'emergencybutton', message => {
        if (message.author.id == me) {
            message.channel.send('Shutting down...').then(m => {
                console.log('Shutting down...')
                client.destroy();
            });
        }
    })
earnest phoenix
sudden geyser
#

hold up you need sudo to access /

opal plank
earnest phoenix
#

sudo cd /

opal plank
#

you'll never guess the big brain i done

earnest phoenix
#

What was the big brain move

opal plank
#

what would happen, if, per se, completely hypotetically, i copied the WHOLE thing? (aka including the backticks for the codeblock)

sudden geyser
opal plank
sudden geyser
#

I wouldn't recommend doing that.

#

Since many users can be running commands simultaneously.

charred shuttle
opal plank
#

ctrl + a
ctrl + v moment

#

aight this seems to works

#

now i just gotta monitor that janky ass folder

#

ty so much voltrex

#

saved my neck here

earnest phoenix
#

aight, glad to help ya on your way sp_pat

opal plank
sudden geyser
#

You should try incorporating asynchronous processing (async/await) into your bot. Though, the client.destroy() may be problematic for shutting down a bot.

opal plank
earnest phoenix
#

I sure will join the detritus cult

opal plank
charred shuttle
sudden geyser
#

All it does is destroy the websocket connection and set the token as null.

#

So unless you have the right checks in place, what it usually results in (from my experience) is a session failure (usually triggering an unhandled / uncaught exception).

#

But I haven't used Discord.js in a while.

#

A lot of users shut down their bot by killing their Node.js process (process.exit())

charred shuttle
#

Ok

#

Thanks for the help!

#

For the async part, do i just put an async in front of each function?

#

Nevermind, I can figure it out 😅

#

Thanks again

boreal iron
#

Destroying the client makes sense if you shutdown the (node) process for example.
Instead of let the client time out, destroying him will immediately close the session and shows the client as offline in Discord.

drowsy ledge
#

Gib code to ste.. I mean borrow

#

btw

#

it is a joke

opal plank
#

this is just size

#

if you measure the width that they are placed, its the same

#

not the ACTUAL image size, but the embed size

#

it looks bigger cuz the first one is 1x2 scale

#

while the bottom one is 2x1 scale

wintry ice
#

@opal plank

opal plank
#

@wintry ice did u even bother reading what i sent?

#

sending code doesnt change what i said

wintry ice
#

nvm

#

i will do it my self

opal plank
#

jesus christ some people are just too much

near stratus
#

excuse me
is that js in kotlin block ?

boreal iron
#

jesus christ some people are just too much
lmao

opal plank
earnest phoenix
small tangle
#

When making slash commands, can i define a valid number interval (like user can only enter 0-5), when i set the datatype to integer?

#

or do i have to make 0-5 as choices to work around that

umbral lake
#

Hey

#

This is my banlist command:

const Discord = require('discord.js');
const { deletionTimeout, reactionError, reactionSuccess, pinEmojiId } = require('../../config.json');
const ms = require('ms');
const db = require('quick.db')
const sourcebin = require('sourcebin');
const disbut = require('discord-buttons');

module.exports = {
  name: 'banlist',
  description: `Affiche la liste des utilisateurs bannis du serveur.`,
  usage: 'banlist',
  requiredPerms: 'BAN_MEMBERS',
  permError: "❌ Tu n'as pas la permission !",
  async run(message, args, prefix) {
        const fetchBans = await message.guild.fetchBans();
        const bannedMembers = (await fetchBans).map((member) => `Pseudo => ${member.user.tag} | Raison => ${member.reason}`).join("\n")
        console.log(bannedMembers)
        if (!bannedMembers) {
          let msg = await message.channel.send("❌ Aucun utilisateur n'est banni du serveur !");
        }
          const bin = await sourcebin.create(
        [
            {
                content: bannedMembers,
                language: 'text',
            },
        ],
        {
            title: `Liste des bannissements du serveur => ${message.guild.name}`,
            description: 'Synapse',
        },
        );
        let button = new disbut.MessageButton()
        .setStyle('url')
        .setLabel('Cliquez ici !')
        .setURL(bin.url);
          
        let componentButton = new disbut.MessageActionRow()
        .addComponent(button);
          
        const embed = new Discord.MessageEmbed()
        .setTitle(`Voici la liste des bannissements du serveur !`);
        
        message.channel.send({component: componentButton, embed: embed})
  }
}

works but
I want to detect the member.reason to do:
if member.reason is null, member.reason = No reason

small tangle
#

i see thanks man peepoBlanket maybe its coming in the future

opal plank
#

as of now, i have not heard anything like setting ranges for ints

#

but theres a feature in the works that will fit just perfectly for ur use case

#

we just been told not to spread about it

#

but soon™️

small tangle
#

sounds good

opal plank
#

dropdowns coming

small tangle
#

FeelsSmartMan but since then im making choices or validation on my bots side

opal plank
#

i'd be much easier in detritus for u to do that

small tangle
#

everyone have to become a member of the detritus church

opal plank
#

legit tho

#

just run the same function in those two spots

small tangle
#

its a discordjs alternative iirc?

opal plank
#

alternative?

#

not even close

#

cant compare garbage to good stuff lmao

small tangle
#

oke oke its written in js

opal plank
#

(pun intended, detritus means debris, trash)

#

js and ts

small tangle
#

yeah im coding in java peepoHappy

#

im safe PES_JesusChristAlt

opal plank
#

jda has some cool shit about slash command handling too iirc

#

kuhaku was mentioning some of ti

small tangle
#

yeah the new version is now a week out

#

so im starting to make slash commands

#

its pretty straight forward

small tangle
#

oh sry for the ping

opal plank
#

its pretty neat

opal plank
small tangle
#

i see

#

but i still dont understand, why replies even have pings

#

normally youre in an active convo when using that

#

at least me

lusty quest
#

sometimes you reply to an days old mention, then its quite helpful

umbral lake
#

I do this:

const bannedMembers = (await fetchBans).map((member) => `Pseudo => ${member.user.tag} | Raison => ` + member.reason || "no reason").join("\n")

when the reason is null, the bot says null and not "no reason"

tulip ledge
#

how do u remove a user's reaction again?

small tangle
umbral lake
small tangle
#

like + (member.reason || "no reason")

umbral lake
#

oh

#

wait

umbral lake
#

works yess

small tangle
#

otherwise its not checking and run the OR

#

without the ()

delicate shore
#

Hello

#

I want help with something

#

I am using express-rate-limit for rate limiting my api

#

but it uses IP address by default

#

I want to use APi key for it

#

they have an option for it in the DOCS but i dont understand it correctly

#

Can anyone explain me how to do it

crystal wigeon
#

anyone know elixir?

#

needed help with the initial setup with supervisor. im new and im kinda confused

delicate shore
#

but since many people use heroku or replit

#

they have same IP

#

causing to cause a problem

steep raft
#

hi

#

im trying to make a music command

#

and there are a command about You are not in a voice channel

#

but, when i join a voice channel during client is ready

#

it says you are not in a voice channel

steep raft
#

can anyone help me ?

boreal iron
#

What an entertaining channel.

boreal iron
delicate shore
royal herald
#

why does ellipsis text dont work on firefox

crystal wigeon
#

man

steep raft
royal herald
earnest phoenix
#

if (user.voice.streaming) {

How do I know if someone is putting the camera on?

long crow
#

Untill the detrituss documentation is not a mess, I'll stick with djs for now. Yeah2 I know the circlejerk DJS shit around here. But shit, I dont want to work on stuff I dont even understand to look at

sick agate
#

ok sure

prime mist
#

I'm glad I didn't write a beginner friendly discord library lol.

long crow
#

If I'm confident and proficient enough to make my own wrappers, not going to depend on any. Shit, djs taking forever to release v13, lmao and the glorified detritus here have shitty documentation. But that's that

slender thistle
#

Choose between different evils

silent hornet
#

anyone get this error ?
MinigetError: input stream: Status code: 404
at ClientRequest.<anonymous> (dir)
at Object.onceWrapper (events.js:422:26)
at ClientRequest.emit (events.js:315:20)
at HTTPParser.parserOnIncomingClient (_http_client.js:641:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:126:17)
at TLSSocket.socketOnData (_http_client.js:509:22)
at TLSSocket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at TLSSocket.Readable.push (internal/streams/readable.js:223:10) {
statusCode: 404
}

delicate shore
#

Can anyone help me please

inner fulcrum
#

guys is there a way of adding a lot of values in 1 field?

#

in embed obv.

earnest phoenix
#

Does anyone know how to put the live server,member & channelcount in a website?

inner fulcrum
#

oh nvm i got it

#

am pro

#

i just realised i could do \n

delicate shore
#

okay

inner fulcrum
wary flame
#

I would personally choose the latter but that's personal preference

earnest phoenix
wary flame
#

What language does your bot use? @earnest phoenix

flat copper
#
module.exports = async (client, member) => {
	const log = await member.guild.channels.cache.find(
		c => c.id == logsetup && c.type == 'text'
	);
	if (!member.guild) return;
	if (
		!member.guild
			.member(client.user)
			.hasPermission(
				'EMBED_LINKS',
				'VIEW_CHANNEL',
				'READ_MESSAGE_HISTORY',
				'VIEW_AUDIT_LOG',
				'SEND_MESSAGES'
			)
	)
		return;
	if (!log) return;
	const embed = await new Discord.MessageEmbed() // Prettier
		.setTitle(':boost: Server Boosted')
		.setThumbnail(member.user.avatarURL())
		.setColor('RANDOM')
		.addField(
			'User',
			`${member.user.username} [Ping: <@${member.user.id}>], (ID: ${
				member.user.id
			})`
		)
		.setTimestamp()
		.setFooter(member.guild.name, member.guild.iconURL());
	log.send(embed);
};

Would this code work?

#

event: guildMemberBoost

tulip ledge
#

idk try it

flat copper
#

Well if I try
Then my boost will be loss for one week :weirdsip:

earnest phoenix
flat copper
#

Which token i have to provide in

const Discord = require("discord.js");

const client = new Discord.Client();

const DBL = require("top.gg");

const dbl = new DBL('Your top.gg token', client);

 

// Optional events

dbl.on('posted', () => {

  console.log('Server count posted!');

})

 

dbl.on('error', e => {

 console.log(`Oops! ${e}`);

})

pale vessel
#

you need to have one approved bot to get the token

#

ah wait it's in the edit page now my bad

flat copper
pale vessel
#

go to webhook section on your bot edit page

flat copper
lyric mountain
#

you sure?

flat copper
#

Yup

#

1 more thing
I changed my bot profile in application bot still its not showing!

lyric mountain
#

I'm pretty sure you're not yet approved

#

else you'd be a green name

earnest phoenix
flat copper
#

Well its my second account

wheat mesa
#

I’m assuming it’s pretty easy to get a bot approved right, just don’t break any of the rules they set? Haven’t ever applied for my bot to be approved, thinking about cleaning it up for permissions and stuff to do that though

lyric mountain
#

the bar is quite low tbf

flat copper
lyric mountain
#

they aren't going to deny your bot because of minor issues

feral aspen
#
if (args[1] === "reset") {
    server.a = 1;
    server.b = 1;
    server.c = 1;
    server.d = 1;
};

Any faster way to do this?

lyric mountain
#

faster? no
smaller? yes

feral aspen
#

What do you mean smaller?

lyric mountain
lyric mountain
flat copper
feral aspen
#

Demonstration, please?

lyric mountain
#

Object.entries(<obj>).map()

feral aspen
#

Well.. that is going to change all properties of the object to the value I set.. 😐

lyric mountain
lyric mountain
#

but as I said, that'll be a SMALLER method not FASTER

feral aspen
#

👍

flat copper
lyric mountain
#

that takes time

#

because caching

#

also, make sure you changed the bot data not application

pale vessel
feral aspen
#

Nope, some other properties.

#

.. like userID, cooldown, etc etc.

#

Example, not literal properties named those. ^^

pale vessel
#

but you only want to change a b c d?

feral aspen
#

Yes..

#

Instead of writing it over and over.. it will be too long.

#

In addition.

pale vessel
#

for (const prop of ["a", "b", "c", "d"]) server[prop] = 1;

flat copper
feral aspen
#

That works???

lyric mountain
#

one will work, the other wont

feral aspen
#

Thanks KuuHaku and Flazepe. 😊

lyric mountain
#

bot

flat copper
#
const Dbl = new DBL(process.env.TOP_GG, { webhookPort: 5000, webhookAuth: 'pass' });

Dbl.webhook.on('ready', hook => {
  console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
Dbl.webhook.on('vote', vote => {
  console.log(`User with ID ${vote.user} just voted!`);
});
lyric mountain
#

correct

flat copper
#

Ok

lyric mountain
#

did u set the authentication pass in top.gg to be "pass"?

flat copper
#

Yup

lyric mountain
#

is port 5000 open?

flat copper
#

Is there anything else for posting votes and servercounts

#

Etc

lyric mountain
#

well...there're webservers

#

like express and stuff

#

but still, did you check if the address is reachable?

#

use this and see if you can reach ur webhook address

quartz kindle
feral aspen
#

Wait.. wrong reply.

quartz kindle
#

if you want even smaller text size, you could also do ```js
let s = server;
s.a = s.b = s.c = s.d = 1;

feral aspen
#

Yup.

silk ridge
#

Where to get started to make web apps ?
What all Languages to Learn ? What all are necessary ?

feral aspen
#

.. all works.. but I have over 30 properties.. 😔

#

.. a for - in loop works best?

lyric mountain
#

that's why I suggested iteration

quartz kindle
#

yes you can use a loop if there are too many

feral aspen
#

👍

quartz kindle
#

front end is usually html+css+js

#

backend can be anything really, almost every single language out there is capable of running web servers and web frameworks

#

same with databases, there are many to chose from

feral aspen
#

Not sure why people prefer MySQL rather than NoSQL. 👀 😦

#

.. a lot of website uses MySQL, is there an exact reason?

quartz kindle
#

SQL databases are pretty much the best at what they do

silk ridge
quartz kindle
#

react is mostly a frontend framework but also has backend elements

silk ridge
#

ok so we need to learn frontend, backend and database to get started right ?

quartz kindle
#

yes

silk ridge
#

for backend what languages do you suggest ?

quartz kindle
#

whatever you're most comfortable in working with

#

the most popular ones are node.js and php i believe

silk ridge
#

ok

quartz kindle
#

but you could also run java, python, go, etc

silk ridge
#

so we can choose either php or react ?

quartz kindle
#

pretty sure you can use both

#

but react is mostly used with node.js

#

to take advantage of its backend elements

light lodge
#

Hi

silk ridge
#

What is Full Stack Web Development with Flask?

lyric mountain
#

fullstack = frontend + backend + database

feral aspen
#

Can someone just call himself Full Stack Bot Developer?

silk ridge
lyric mountain
#

still

#

fullstack is fullstack

silk ridge
lyric mountain
#

a webserver

silk ridge
#

oh

lyric mountain
#

like express

silk ridge
#

is is a database ?

lyric mountain
#

no

silk ridge
lyric mountain
#

flask, express, springboot, etc are request handlers

#

aka webservers

silk ridge
#

k

#

it's for node.js ?

lyric mountain
#

no

#

flask is python-only

sick agate
#

Yup

silk ridge
lyric mountain
#

yes

silk ridge
#

k which is best framework ?

#

amougst this ?

lyric mountain
#

the one that solves your problem

silk ridge
#

ok

#

i may be mad by studying many programming language

#

__m 🅰️ DonutParrot

earnest phoenix
#

hello

#

wht node js music bot cnt wokring

ocean yew
gilded charm
#

This is my discord bot KEKW

earnest phoenix
rocky hearth
#

what is equivalent of js map, in python?

earnest phoenix
#

nodejs

#

i see 5 bot cnt working

#

all lava link music bot working

#

but no node js music bot

lyric mountain
#

all node js music bots use lavalink probably

near stratus
earnest phoenix
sage bobcat
earnest phoenix
#

👀

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
lyric mountain
#

ok so ALMOST all

near stratus
rocky hearth
earnest phoenix
#

i use ytbl core

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

lol

near stratus
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

not of anu play song

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

and also error cnt come in log

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

with

near stratus
#

@rocky hearth
map() in python takes 2 parameters
like

def square(a):
    return(a*a)
pp = (5,5,4,3,2,3)
result = map(square, pp)
print(list(result))
rocky hearth
#

can the function be anonymous?

#

I mean lambda

earnest phoenix
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

how cn change ip

near stratus
rocky hearth
#

and the map function accepts all three params as js map does, right?

lyric mountain
#

3?

rocky hearth
#

sorry to be unclear, [].map((n, i, a) => {})
And I see, it only takes one param, in python

near stratus
near stratus
#

But you can provide multiple arrays

#

for the second parameter

smoky kestrel
#

PS C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous> npm install quick.db
npm ERR! must provide string spec

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\TAHIR ISLAM\AppData\Local\npm-cache_logs\2021-06-22T13_35_41_713Z-debug.log

#

why quick.db is not installing in my laptop

#

:/

earnest phoenix
#

cn you pls help me @sage bobcat

rocky hearth
smoky kestrel
rocky hearth
#

what npm version u running?

smoky kestrel
#

latest

smoky kestrel
#

see

#

16.3

rocky hearth
#

where?

smoky kestrel
#

in vscode

#

coz create a bot

#

and inthat bot creating a moddlogchannel where i need quick.db

rocky hearth
#

do u hv opened the project folder in vsc

smoky kestrel
#

yes

rocky hearth
#

do u hv package.json file in that?/

smoky kestrel
#

yes

#

i have

rocky hearth
#

try running,
node --version
in terminal

smoky kestrel
#

ok

rocky hearth
#

and npm --version

smoky kestrel
smoky kestrel
#

what should i do now

rocky hearth
#

updating npm, should fix it I think

smoky kestrel
#

already updated

#

still didnt

rocky hearth
#

that's weird then.
may be try, deleting node_modules and intall all packages again

smoky kestrel
#

ok after doing that i will try again

#

node:internal/modules/cjs/loader:941
const err = new Error(message);
^

Error: Cannot find module '.npm ./../utils/structures/BaseCommand'
Require stack:

  • C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\commands\utility\ModlogCommand.js
  • C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\utils\registry.js
  • C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:941:15)
    at Function.Module._load (node:internal/modules/cjs/loader:774:27)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\commands\utility\ModlogCommand.js:1:21)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Module.require (node:internal/modules/cjs/loader:1013:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\commands\utility\ModlogCommand.js',
    'C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\utils\registry.js',
    'C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\index.js'
    ]
    }
rocky hearth
#

@smoky kestrelbro the latest npm version is 7.18.1

#

run npm install -g npm@latest

#

guyz does anybody has experience with yarn workspaces?

smoky kestrel
#

Thanks the older recomendation works

#

Log system is created 😊🙃

#

Thanks for your help

hidden coral
#

Guys welp

#

I put this code In the top of my bot description but nothing happens

<style>
.body{
background-color:#32a852
!important;
}/*!sc*/
</style>

It does not change background color

#

@rocky hearth

#

Help bro

earnest phoenix
#

!important moment

hidden coral
#

I suck In css bro

rocky hearth
earnest phoenix
#

Remove it

hidden coral
#

Ok

hidden coral
#

Still.not working

#

@earnest phoenix

earnest phoenix
#

No idea then

hidden coral
#

@earnest phoenix help me bro pls

#

ALSO my bot is not approved yet

earnest phoenix
hidden coral
#

I don't have pc

#

I am on android

#

@earnest phoenix

zinc wharf
#
.body{
background-color:#32a852
!important;
}/*!sc*/
</style>```

This is basically going off a class. It would work if the class is defined
#

Normally, if you remove the . and just have body that should work

#

@hidden coral

wooden kindle
#

just me or is YTDL down

zinc wharf
#

More than likely so, it goes down every couple of weeks kek2

wooden kindle
#

im trying to apply for it to be verified but i want it working yk lmfao

zinc wharf
#

Where are you trying to do it?

hidden coral
#

<style>
.enity-content_dsscription {
background-color: #32a852;
}

body{
background-color: purple;
}/!sc/
</style>

hidden coral
#

@zinc wharf quick note my bot is not yet approved

grizzled pike
#

What’s my discord

hidden coral
#

@zinc wharf

zinc wharf
#

I just done some testing myself

slender thistle
#

use the .entity-wrapper selector

hidden coral
slender thistle
#

Do you know what CSS selectors are

hidden coral
#

I just want

#

To change the background image

#

Nothing else

slender thistle
#

.entity-wrapper { background: #somecolor; }
😭

hidden coral
#

Lemme try this too

hidden coral
slender thistle
#

Do you have any other CSS

near stratus
hidden coral
#

But it did not work

slender thistle
hidden coral
hidden coral
solemn latch
#

is there actually no way to get dev tools on mobile?

hidden coral
#

Any help is highly appreciated

near stratus
hidden coral
#

How did u get this?

near stratus
solemn latch
#

it probably doesnt help you are mispelling things in your selectors.

near stratus
#

no

#

you need pc for that

hidden coral
hidden coral
#

👍

#

Lemme try

earnest phoenix
#

this happen in every bot

#

why

wooden kindle
#

is there any way for me to see if YTDL is down

earnest phoenix
#

idk show your code

worn sonnet
#

I'm stuck some help me with organizing data

#

more like modeling data and making schema for it

#

i'm using mongodb

near stratus
worn sonnet
#

I'm trying to make a welcome thingy

#
        check: True/False
        channel: channel_id
        greet_data: {    greet_type: "normal_greet"/"embed_greet"
                 normal_greet: {
                    welcome_msg: Text/String
                    image_data: { 
                            check: True/False
                            title: Text/String
                            sub_title: Text/String
                             }
                          }
                embed: "JSON Data"
                           }
        
        
                 }```
#

so far this is how i plan doing things

#

any other way around?

near stratus
#

i give up
i don't know what tf is going on after greet_data

worn sonnet
#

lemme explain

#

in greet_data i check if the greet_type is normal one which is just simple text or embed type

#

then I store the if the greet_type is normal_greet then i take data from normal gree

#

else from the embed one

#

which I'll be storing JSON data in string form

#

kinda sucks right?

near stratus
#

now it can save both types in a object

earnest phoenix
near stratus
#

ykw maybe add a type

worn sonnet
flat copper
#
client.distube = new DisTube(client, {
	searchSongs: true,
	emitNewSongOnly: true
});```
near stratus
flat copper
near stratus
hidden coral
earnest phoenix
hidden coral
flat copper
#

Its written in npm readme

near stratus
hidden coral
#

Discord login page does not load

flat copper
worn sonnet
#

Trying make welcome thingy just like mee6 has

smoky kestrel
#

C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\commands\utility\ReloadmodlogCommand.js:16
if(!args[0].toLowerCase()) return message.channel.send("Please provide a command name!")
^

TypeError: Cannot read property 'toLowerCase' of undefined
at ReloadmodlogCommand.run (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\commands\utility\ReloadmodlogCommand.js:16:17)
at MessageEvent.run (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\src\events\message\MessageEvent.js:33:17)
at Client.emit (node:events:394:28)
at MessageCreateAction.handle (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\TAHIR ISLAM\Desktop\venomous\Venomous\node_modules\ws\lib\event-target.js:132:16)
at WebSocket.emit (node:events:394:28)

#

how to solve this

hidden coral
near stratus
near stratus
near stratus
#

any errors ?

#

or it crashes ?

hidden coral
#

Nothing it just keeps loading

fathom estuary
#

BROOOS

#

I do my bot

hidden coral
near stratus
hidden coral
#

It gives this error

smoky kestrel
hidden coral
#

1sec

fathom estuary
#

I do my bot

smoky kestrel
fathom estuary
#

ZenTan

near stratus
hidden coral
#

This is what comes

near stratus
smoky kestrel
#

it is defined i checked :/

#

even defined twice

near stratus
hidden coral
#

Are there any other dev tools?

hidden coral
hidden coral
smoky kestrel
opal plank
#

imagine using conditional chaining

#

args[0]?.toLowerCase()

#

that simple

near stratus
#

I went for like 10 seconds and my discord crashes WOW

mild agate
#

Noice

near stratus
near stratus
flat copper
#

Anything else?

near stratus
#

no

near stratus
#

That means one thing only
you're defining DisTube wrong

#

or redefining it

#

this is the code I'm using if you're interested

const discord = require('discord.js')
const DisTube = require('distube')

const client = new discord.Client({
	disableMentions: 'everyone'
});
client.distube = new DisTube(client, {
	searchSongs: true,
	emitNewSongOnly: true
})


client.on('ready', () => {
    console.log('Erwin\'s avatar:')
    client.users.fetch('188836645670223872').then(r => {
        console.log(r.avatarURL({ size: 1024 }))
    })
})
flat copper
#

But idk from where

wheat mesa
#

Well, look at the places you’re sending messages at

#

And look for possibilities of those being empty

near stratus
#

like at the bottom of error

#

with character position

flat copper
#

@near stratus btw distube error fixed i just re installed the npm

#

Thnx

lyric mountain
#

that's why you should .catch every single promise

flat copper
#

I catch in every

#

Promise

lyric mountain
#

well, you missed one at least

wheat mesa
#

Yeah... your error tells you that it was an uncaught exception

near stratus
#

owo long time no see

hidden coral
#

@near stratus

#

I used another inspector tool

near stratus
#

and ?

hidden coral
#

And it works when it edit the html in the site and put the code but does not work if I put the same code in description

near stratus
#

in description

hidden coral
#

<style>
My code
</style>

tawny arrow
#

Hey, I am unable to add css to my top.gg page. Any idea? Ping please!

hidden coral
near stratus
tawny arrow
#

I tried with <link rel="stylesheet" type="text/css" href="https://drive.google.com/uc?export=view&id=1_20Ax9hkQpbxNaCP5IdDnSCydlIZ5_WE" />

near stratus
#

Wait a minute
Jelly is your bot verified ?

tawny arrow
#

and with <style></style>

hidden coral
#

My code is this

<style>
     body {
       background-color: purple;
       }
</style>
tawny arrow
#

The bot I am trying to add css to is not verified yet

hidden coral
#

Not even approved in the website

near stratus
tawny arrow
#

I used style tags, and tried both. None work

near stratus
hidden coral
#

Ok thanks for staying with me and helping me

#

Appreciated

near stratus
#

and both of them work somehow

tawny arrow
#

Then its because the bot is not verified. Thanks for the help tho! Appreciate it

near stratus
#

thought it was verified

tawny arrow
#

I have a verified bot. The bot I'm trying to add css to is another one. Its not really mine haha

#

Just helping a friend out

minor slate
#

How to find out the bot commands?

near stratus
minor slate
#

ok ty

smoky kestrel
near stratus
#

I completely forgot about you

near stratus
smoky kestrel
#

no i del that code

#

:/

visual knoll
slender thistle
fleet radish
#

heyy

paper ferry
slender thistle
#

What's your issue

paper ferry
#

well

slender thistle
#

or question

paper ferry
#

I was trying to find the users using my bot in total from all it's servers

fleet radish
#

do u know which all games work on this discord vc thingy

fleet radish
#

brr

slender thistle
fleet radish
#

oh

paper ferry
#

and I did
@sour pine command
async def testing(ctx):
await ctx.send(f"{len(client.users)}")

#

but it says 0

fleet radish
#

length

slender thistle
#

Probably because you don't cache users

#

There's no length in Python

#

Please don't try and help if you don't have any idea yourself

paper ferry
#

how do I do that

fleet radish
#

not that

#

oh nvm I read his len as length

fleet radish
slender thistle
#

You could go over guild.member_count of each guild object and decrement 1 from it to ignore your bot

#

and get the sum of that

paper ferry
#

I don't have intent turned on

slender thistle
#

Fun

#

You should

paper ferry
#

it doesn't let me

slender thistle
#

How

paper ferry
#

it doesn't let me turn it on

#

it does like a cross sign thing

#

when I hover my cursor

#

over it

lofty spoke
#

HELP ME CREATE THE ID IN DURSH

slender thistle
#

You don't need those

paper ferry
#

then which ones

slender thistle
#

or do you

#

hold on

paper ferry
#

ok

lofty spoke
#

HELP ME CREATE THE ID IN DURSH

slender thistle
#

You have to be shitting me

paper ferry
#

??

slender thistle
#

Guild.member_count requires the GUILD_MEMBERS intent to be turned on

#

and since it's privileged, you'd have to apply for it

paper ferry
#

bruh

#

where do I apply

#

for

#

that

worn sonnet
#

aa..

lofty spoke
#

Ok

worn sonnet
#

how long until raptzz include buttons in d.py?

slender thistle
#

Give me a minute, I'll search for a way

near stratus
paper ferry
#

no

near stratus
#

then just turn it on from bot settings

#

no need to apply

#

you'll need to apply when getting verified

#

by Discord

slender thistle
#

They're not available

#

Both intents are greyed out

worn sonnet
paper ferry
#

yeah

#

they are greyed out

near stratus
#

like wtf

fleet radish
#

his bot is verified but no intents

#

He will have to apply for intents

paper ferry
#

it isn't

fleet radish
#

wait then how are they grey

paper ferry
#

idk

near stratus
paper ferry
#

it's in 96 servers

#

maybe that

slender thistle
#

Did you get to 100 servers at some point

paper ferry
#

I don't think so

slender thistle
#

You probably did since the privileged intents are greyed out

paper ferry
#

so what do I do now

near stratus
#

where tf are these greyed out ?

slender thistle
#

Apply for verification along with the Server Members intent

worn sonnet
paper ferry
#

thanks for the help

slender thistle
slender thistle
#

For the guy they are

slender thistle
near stratus
slender thistle
#

It got to 100 servers at one point

worn sonnet
slender thistle
#

And Discord locked them

near stratus
#

probably

slender thistle
worn sonnet
#

lib*

slender thistle
#

The package says they'll be supported in v2.0

#

Don't know if that's true, but 🤷

worn sonnet
#

oh

lament stump
#

I wanna make a class command, that shows all classes for a fighting / roleplay bot, I am coding. However, I'm stuck at sorting the stat values with the actual classes. Could someone help me?

Code: (marked where the error is with comments): https://sourceb.in/RlPrTnYUM9

cinder patio
lament stump
#

Weird, now I get "Unexpected Token: }" for the data thing

woeful pike
#
for (const something of some_iterator) {
    // Use something here...
} 

👀

cinder patio
#

oop

#

Haven't used js in a while

lament stump
#

Still the same error for:

data = {
    name: editedName,
    value: editedValue ? "Unknown..."
};
crimson vapor
#

value: editedValue ? "Unknown..."

#

did you mean ???

lament stump
#

oh

#

well now i get the same error with "??"

#

nvm i am dum dum

signal estuary
#

Do you recommend any of these intents? And why?

sinful belfry
signal estuary
sinful belfry
#

you can request them later i believe, yeah, but it is ideal if you request the ones you need now

#

theyll probs take a while to get back to you

#

i think this question might be better in the server to do with the lib you are using, because different libs will have different needs in terms of how they work and handle caching of these events, and how they can impact other stuff etc

earnest phoenix
#

hello

#

some help?

sinful belfry
#

with?

earnest phoenix
#
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:85548) 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: 43)
(node:85548) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
    at C:\Users\GAMER\Desktop\lypsed\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15
    at C:\Users\GAMER\Desktop\lypsed\node_modules\snekfetch\src\index.js:215:21
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:85548) 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: 45)
#

when i start my bot, the console starts spamming me 50 errors per second

sinful belfry
#

your bot appears to be trying to do an action it doesnt have permission to do

earnest phoenix
#
// ||||||||||||||||| N S F W
client.on("message", async message => {
const args = message.content.slice().trim().split(/ +/g);
const command = args.shift().toLowerCase();
if(command === "%nsfw") {
    if (args[0] == 'enable') {
    channel.edit(channel, {
                    nsfw: true
                });
    message.channel.send(`Se **activĂł** el NSFW en el canal ${channel.name}`);
    if (args[0] == 'disable') {
        channel.edit(channel, {
                    nsfw: false
                });
    message.channel.send(`Se **desactivĂł** el NSFW en el canal ${channel.name}`);
    }}
}});
```I wanna try to do this
#

activate or disable NSFW in a channel

sinful belfry
#

maybe it doesnt have the manage channel permission?

earnest phoenix
#

yes, it has permission and I'm testing it on my server, the weird thing is that the console spams me 50 errors per second

#

lol

sinful belfry
#

then it might not be that

earnest phoenix
#

and the weird thing is that it gives me a permission error too

sinful belfry
#

try and find what else could be happening 50 times per second, and where it could be erroring on permissions

earnest phoenix
#

the errors started when i tried to do this command from nsfw

sinful belfry
#

Thonk then maybe try commenting out parts of ur code, see if you get errors, then keep doing that until you narrow it down to where it is coming from

#

itll come from an action (like sending a message, or editing a channel), so try from there

earnest phoenix
#
channel.edit(channel, {
                    nsfw: true
                });
sinful belfry
#

its a permission error, the only issue with your code is the lack of permission checking on whether the bot can perform the action or not

sinful belfry
earnest phoenix
sinful belfry
#

it should be

channel.edit({ nsfw: true });
earnest phoenix
#

ill try

sinful belfry
#

make sure to always read the documentation, it honestly helps so much

earnest phoenix
#

ok now the console does not give an error, I'll see if the command works

#

channel isnt defined

#

ill define it like:
let channel = msg.channel ?

sinful belfry
#

no need to create an extra variable for it, assuming youre trying to modify the channel that the message was sent to, you can reference the channel using that:
message.channel

earnest phoenix
#

@sinful belfry ok, enable nsfw works

#

but disable doesnt work

sinful belfry
#

where is channel defined?

earnest phoenix
#

top

earnest phoenix
earnest phoenix
# sinful belfry where is `channel` defined?
// ||||||||||||||||| N S F W
client.on("message", async message => {
const args = message.content.slice().trim().split(/ +/g);
const command = args.shift().toLowerCase();
let channel = message.channel
if(command === "%nsfw") {
    if (args[0] == 'enable') {
    channel.edit({ nsfw: true });
    message.channel.send(`Se **activĂł** el NSFW en el canal -> ${channel.name}`);
//    
    if (args[0] == 'disable') {
    channel.edit({ nsfw: false });
    message.channel.send(`Se **desactivĂł** el NSFW en el canal -> ${channel.name}`);
    }}
}});
humble vortex
earnest phoenix
#

you should use v12 discord.js

humble vortex
#

Go back to the old versions?

sinful belfry
earnest phoenix
earnest phoenix
sinful belfry
#

ah i see your code is a mess

#

watch your if statement brackets

earnest phoenix
#

just update your discord.js version to v12

#

dont use v11

earnest phoenix
earnest phoenix
humble vortex
sinful belfry
earnest phoenix
#

it's nothing serious, it's a bot to hang out on my server only

earnest phoenix
#

i cant see error