#development

1 messages · Page 1410 of 1

sage bobcat
#

One message removed from a suspended account.

pure lion
#

Lmfao

#

Wouldn't that be slower

earnest phoenix
#

functional language ™️

sage bobcat
#

One message removed from a suspended account.

pure lion
#

I mean it does

earnest phoenix
pure lion
#

Why the fuck are there separate packages for is-odd and is-even

earnest phoenix
#

meme packages ig

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

please i'm going insane i need a break

pure lion
#

What's hard about num % 2 === 0

earnest phoenix
#

i spent most of my awake hours today making electron inject over a fullscreen opengl app

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

spoiler alert

pure lion
#

Ew electron

earnest phoenix
#

it's minecraft

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

pure lion
#

Pgo

earnest phoenix
#

disaster

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

pure lion
#

I can imagine

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

im working on an array-like storage class based on strings lmao

pure lion
#

ph

#

Huh

quartz kindle
#

because they slow af

#

for my use case

flat pelican
#

ph

sage bobcat
#

One message removed from a suspended account.

pure lion
#

Oh yeah you said

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

does js has vectors?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

quartz kindle
#

not afaik

earnest phoenix
#

you'd surely need a native module

#

vectors go lowlevel

#

at least the ones in .net that is

flat pelican
#

Thanks

pure lion
#

So apparently the delete keyword is the fastest thing associated with arrays

quartz kindle
#

do vectors support strings?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

idfk i never used mongo

#

lol

steel dirge
#

Hi

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

efcore + sqlite/postgres is my togo

steel dirge
#

If My Bot In 76 server well prove?

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

entity framework core

#

an ORM

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

hey guys

steel dirge
#

If My Bot In 76 server well prove?

pure lion
#

@steel dirge it should

earnest phoenix
#

wait for the automated DM

gritty sinew
#

I need help fixing this it says

client.user.setActivity("playing" H!help"});

When it gets to that part of the code it says client is an unknown identifier

quartz kindle
pure lion
#

Damnnnn

gritty sinew
earnest phoenix
#

is it concurrent though 👀

quartz kindle
#

time taken to match all occurences of a string in 500k items

pure lion
#

Let's see some code

#

@gritty sinew it needs to be in a string

#

Also tip, windows + shift + s to take screenshots

gritty sinew
#

I only use discord on phone

pure lion
#

Ah

earnest phoenix
#

if there's a red line under your code then it's clearly indicating something is wrong about it

gritty sinew
#

So put () around it

pure lion
#

No

#

Learn js

#

Hissss

quartz kindle
#

im gonna make this into another npm package lul

pure lion
#

You need some " "s

#

Wait no

#

` `

hollow sedge
#

@earnest phoenix is there a way to see solutions on the css website you shared

gritty sinew
#

Cause that's the part of the code that's acting up idk if it's because a learned from a really old guide or what

earnest phoenix
quartz kindle
#

that disableEveryone.token makes no sense

hollow sedge
#

oh ok ill have to try and find that

pure lion
#

@gritty sinew I think you should learn js

#

Just a hunch

quartz kindle
#

you cant mix them

#

this one is also completely wrong

gritty sinew
#

I'm using videos cause all the freaking courses cost money or are way to out of date that the dont work with VSC anymore

#

And ty tim

earnest phoenix
#

welcome to capitalism

#

want resources? pay for it

quartz kindle
#

well, the people who wrote/produced the resoures have to eat too

#

if only there was some kind of fund for people who work open source

pure lion
#

Yes, if only

#

That would be such a wonderful thing

hollow sedge
#

AWS Open

#

stackoverflow is now a fund for people who work open source

quartz kindle
#

its been years since i last logged in to SO lmao

pure lion
#

I just realised they're using ' and a template literal

#

Or at least the syntax for a template literal

quartz kindle
#

ye lul

pure lion
#

And all the types of quotes

hollow sedge
#

<img style=box-shadow:0+0+0+2in#b5e0ba,0+0+0+5in#5d3a3a> i love how this is the top solution for the first exercise

quartz kindle
#

wat

gritty sinew
#

Also I was able to make it work without arguments but I need arguments to use commands

quartz kindle
#

dafuq is that box-shadow syntax

pure lion
#

@gritty sinew learn js first, at least learn basic syntax and formatting and linting

hollow sedge
#

who knows

earnest phoenix
#

if only there was some kind of fund for people who work open source
fun fact about this, FSF will glady protect any properly licensed open source code

if someone breaks the license for your open source project and you take them to court, FSF will most likely assist you (financially)

quartz kindle
#

cool

#

my most important code is in private repos tho lul

wise quartz
#

How do i make some sort or mail bot or whatever they're called

#

Aka track my bot dms

#

(Py)

hollow sedge
#

you should say what you've tried first

#

asking how to make a bot is too general

wise quartz
#

I haven't i want the general idea

#

Of how to do it

#

Like the module i should be using

#

So i can start doing it

quartz kindle
#

just listen to messages from dms

hollow sedge
#

well you should be using the discord.py or discord.js module

#

lol

quartz kindle
#

he said hes using dpy

wise quartz
#

Method or whatever its called

#

Like u know for checking msgs on a guild its on_message or wait_for

quartz kindle
#

well he only said py, im assuming dpy

wise quartz
#

For dms what is it?

hollow sedge
#

yeah

#

well method makes more sense

#

i think you can just do user.send

quartz kindle
#

on_message should work for dms as well

hollow sedge
#

yeah

wise quartz
#

But how do i see if the msg is from the bots dms?

#

Lemme see docs actuslly

hollow sedge
#

good thinking

opal plank
#

@quartz kindle

#

first, hi

quartz kindle
#

hi

opal plank
#

second, do you happen to know if a bot that stops recieving events past its verification limit?

#

say, bot is at 74 servers, its already connected, hits 76, i assume it wont lose its updates until it reconnects?

pure lion
#

If it hit 100 servers it might

#

I doubt it tho

opal plank
#

since that shit is done via gateway

#

on identification

pure lion
#

No reason other than scepticism

quartz kindle
#

it should work until it disconnects

opal plank
#

okay good

pure lion
#

I could be completely wrong

opal plank
#

fuck this bot is giving me more headache that it should

quartz kindle
#

noob

#

lmao jk

opal plank
#

suffering from success

pure lion
#

Secondly,,,,,

#

Learn rust

quartz kindle
#

lmao

opal plank
#

rust too wack

jaunty surge
#

hey guy

pure lion
#

Secondly,,,,,

#

Uwj

opal plank
jaunty surge
#

can I ask a question about writing code?

opal plank
#

yes

pure lion
#

You can indeed

jaunty surge
#

thank you, I want to ask you about the webhook

opal plank
#

its in the topic though

#

WHICH weebhook?

jaunty surge
#

how do I write a webhook that can delete the user message and set the webhook name as the user name. I also see someone did the webhook that work on every channels too. For example: /hook @jaunty surge Hi and it will print Hi in custom channel with my name as a bot

pure lion
#

Like

opal plank
#

which language you using?

jaunty surge
#

the webhook for bot, like people doing..suggestion, or something like

#

java script

pure lion
opal plank
#

discord.js?

jaunty surge
#

yes

quartz kindle
#

discord.js has a section in their docs about using webhooks

pure lion
#

I'd use quick.hook

jaunty surge
#

@pure lion yes like that

opal plank
#

lemme grab it

jaunty surge
#

@quartz kindle but it's not really detailed

quartz kindle
#

you'd need to create a webhook, then send the message through it, then delete the webhook afterwards

opal plank
wise quartz
#

Will

async def on_message(message):
    if message.channel == client.message.DMChannel:
        # blah
    else:
        pass

work?

opal plank
#

webhooks are legit the same as channel. Same payload and format. The only different is that you're using a webhook rather than a channel

quartz kindle
#

no

pure lion
#

What does pass mean

jaunty surge
#

I also see someone use 1 webhook that work in every channel

wise quartz
#

@quartz kindle why?

opal plank
#

im fairly certain webhooks are channel bound

pure lion
#

@wise quartz you wanna check the channel.type

#

@opal plank bot webhooks are a one time thing

opal plank
#

you'd need to change the webhook to a different channel or create one for every channel

#

nah, webhooks you can use

pure lion
#

Or use quick.hook

opal plank
#

they stay for as long as you like

pure lion
#

D.js makes it stinky

opal plank
#

it creates an integration iirc

jaunty surge
#

because I seen people write their message with the bot sign next to their name and it's really interesting so I want to try

quartz kindle
pure lion
#

Why not dm

#

This is a scam

opal plank
#

was about to ask

quartz kindle
#

because py

opal plank
#

and why not ===

pure lion
#

Oh

opal plank
#

reeee

pure lion
#

Because py

quartz kindle
opal plank
#

poopyPy

#

np @jaunty surge

jaunty surge
#

@quartz kindle thank too

agile lance
#

== is kinda the same as === right?

pure lion
quartz kindle
#

does python have ===?

wise quartz
#

What about this?

async def on_message(message):
    if isinstance(message.channel,discord.DMChannel):
        #balh
pure lion
#

@agile lance == doesn't check for type (in js)

#

@quartz kindle not that I'm aware of

wise quartz
#

Alr

agile lance
#

Also whats the difference between
!== and ==!

wise quartz
#

What should === do btw?

quartz kindle
#

==! doesnt exist

opal plank
#

^^

wise quartz
#

What is !== ?

agile lance
#

Somebody used it inside the code and it seemed to work for them

wise quartz
#

Jeez so much new things

agile lance
#

But eh, I’ll stick to !==

opal plank
#

!== different than

pure lion
#

@agile lance !== is not exact and ==! is what a drink person does

opal plank
#

but checks type too

pure lion
#

They were probably doing if (true ==! false)

opal plank
#

1 != '1' => false
1 !== '1' => true

quartz kindle
#

the difference between === and ==, which is also the same as the difference between !== and !=, is that the shorter version converts types, the longer version doesnt.
for example 1 == "1" is true, but 1 === "1" is not true

pure lion
#

In layman's terms

#

Typing in js is very stinky

opal plank
#

hence why we use Ts

quartz kindle
#

fek your ts

pure lion
#

Or rust

opal plank
#

no frick u tim

#

>:(

quartz kindle
#

no fork u

pure lion
#

Nooo! Don't Frick Tim!!!!

opal plank
#

nah faka u

quartz kindle
#

spoon you

pure lion
#

Lmfaofiaofj

agile lance
#

So will this work

if (message.author.id !== "MY ID HERE") {
message.reply(`You can not access the **eval** command!`)
} else {
// code here
}```
opal plank
#

spoonfeedin! @ mods!

pure lion
#

That made me exhale

agile lance
#

Thanks :-)

opal plank
#

you could 300 iq though

pure lion
#

When writing an eval, is it wise to write a try catch blocc for the eval or is there a better way?

quartz kindle
#

yes

#

try catch it

pure lion
#

Okay cool

opal plank
#

just eval().catch(() => {}); mmulu

pure lion
#

I didn't know if you meant yes or yes

umbral zealot
#

So is if(message.author.id !== 'myid') return message.reply("You're not the boss of me"); 400 IQ then?

quartz kindle
#

error catch is not a function

pure lion
#

Tim,,,,

opal plank
quartz kindle
#

lmao

pure lion
#

Is it okay for me to get angry at people who use async (callback func) or await function().then(...)?

quartz kindle
#

i mean, await function().then() is a valid use case

pure lion
#

Like why would you evermixsyncandasyncitslikeincest

opal plank
#

you cant chain .then() on await iirc

quartz kindle
#

you can

opal plank
#

u sure?

pure lion
#

I hate mixing sync and async

quartz kindle
#

yes

pure lion
#

It makes me cry

opal plank
#

hmmm

pure lion
#

I don't like chaining methods

#

It's mesi

opal plank
pure lion
#

I use async where possible

jaunty surge
#

@pure lion how do you change webhook name to user name for the webhook message

opal plank
#

that makes no sense though

pure lion
#

South Texan farming university

opal plank
#

await is technically then, it waits for the promise to fullfill

quartz kindle
opal plank
#

arent you technically splitting into different threads?

quartz kindle
#

no?

#

promises are not multithreading

sudden geyser
#

js is event-based

opal plank
#

hmmm, time for more booze, one sec

quartz kindle
#

promises are a glorified timeout

pure lion
sudden geyser
#

.and_then

quartz kindle
#

await awaits for all promises to fulfill

#

if your function returns a promise, it awaits it, if the promise returns another promise, it awaits it as well

#

until there are no more promises left

pure lion
#

.await? very sexy mmm

pure lion
opal plank
#

hmmm thats a bit odd

pure lion
#

No it's not

opal plank
#

it is

pure lion
#

It's not rocket science it's computer science

sudden geyser
#

I don't think it's like that, because it would look like Promise<Promise<Promise<T>>>

opal plank
#

const a = await promise.then(console.log(a));
what would happen on this case?

#

does await finish before then?

quartz kindle
#

it would error because console.log(a) doesnt return a function

#

xDDD

opal plank
#

reeee

pure lion
#

Wouldn't it be promise.resolve nekohuh

#

.then

#

Unless I'm mistaken

opal plank
#
const a = await promise.then(() => console.log(a));```
pure lion
#

Because I'm a mere mortal

opal plank
#

there

pure lion
#

Oh I hate that

quartz kindle
#

a will be undefined

pure lion
#

So much

opal plank
#

then finishes before await, then?

pure lion
#

Ok well gn

opal plank
#

gn

quartz kindle
#

it resolves the promise, then resolves the .then()

#

.then() doesnt return anything

#

so a is undefined

opal plank
#

well yeah but a is the return from the promise

#

say that promise returns 'b'

quartz kindle
#

a is the return from the .then()

opal plank
#

wait what

#

holdup

quartz kindle
opal plank
#

that makes absolutely no sense

quartz kindle
#

await returns the value of the final promise in the chain

opal plank
#

but you arent returning anything

#

you'd need brackets there

#

without a return

#

lemme write dummy code

quartz kindle
#

arrow function without brackets = implicit return

umbral zealot
#

yep

#

^_^

quartz kindle
#

xD

#

evie's website to the rescue

umbral zealot
opal plank
#
async function test() {
let a = 0;
await setTimeout(() => a = 1, 2000);
return a;
}
const b = await test().then(() => {console.log(b)})
#

logic would dictate b should be 1, and then should log either 1 or undefined

honest perch
#

Jesus you spent a lot of time writing that page

quartz kindle
#

that setTimeout wont work lul

umbral zealot
#

Not a lot, I was very inspired 😂

opal plank
#

you get the idea though

#

either a promise or something

quartz kindle
#

b will be undefined

umbral zealot
#

yeah it would be

opal plank
#

and if i were to add a console.log(b) below?

quartz kindle
#

undefined

#

unless you return something inside the .then()

opal plank
#

it makes no sense

umbral zealot
#

The best example I have of chaining promises is fetch(). ```
fetch(url).then(res => res.json()).then(json => console.log(json))

#

Or, ```js
const jsonData = await fetch(url).then(res => res.json());

opal plank
#

.then() should simply run a function on the output, not change the value of the variable its in

umbral zealot
#

Promise chaining requires every part of the chain to return something

quartz kindle
#

think about a promise chain as a reduce function, the returned value is the accumulator, after all items have been processed, except with promises there is no accumulator unless you return it on every then()

umbral zealot
#

.then(() => {console.log(b)}) returns undefined so awaiting it would give you undefined on b

opal plank
#

hmmm i understood it, but i still dont think its logic

quartz kindle
#

it is logical because otherwise how else would you properly wait for something, then wait for something else that needs the first thing?

gritty sinew
umbral zealot
#
const wait = require("util").promisify();

async function test() {
  let a = 0;
  await wait(2000);
  a = 100;
  return a;
}
const b = await test().then(result => {
  console.log(result);
  return result;
});
console.log(b); // 100
gritty sinew
#

Which makes no sense since I have what there saying is missing

opal plank
#

first log is undefined

umbral zealot
#

@gritty sinew might wanna learn some javascript before writing a bot. It seems blatantly obvious you don't understand basic syntax right now

opal plank
#

second is 100

#

actually

#

no

#

both are 100

umbral zealot
#

yes, both are 100

opal plank
#

like i said, i understood it, but its still confusing

umbral zealot
#

let's clarify it. ```js
const wait = require("util").promisify();

async function test() {
let a = 0;
await wait(2000);
a = 100;
return a;
}
const b = await test().then(result => {
console.log(result); // 100
});
console.log(b); // undefined

What's the difference? The promise function didn't *return* anything.
quartz kindle
#

if it didnt work like it does, you wouldnt be able to do something like this ```js
finalResult = await promise().then(result1 => promise2(result1)).then(result2 => promise3(result2));
console.log(finalResult)

umbral zealot
#

honestly it's the same as chaining normal functions. If you don't return a value from the function you can't assign that "nothing" to a variable. it'll be undefined.

opal plank
#

well yeah

umbral zealot
#
const add = (a, b) => { a + b };

This won't work, add(2+2) gives you undefined

#

Same happens with promise chaining.

opal plank
#

yeah im aware of the scopes

#

its not about the scopes thats confusing

umbral zealot
#

in fact, ```js
const add = async (a, b) => { a + b }; // resolves to undefined
const add = async (a, b) => { return a + b }; // resolves to a + b

opal plank
#

is how .then() manipulates the value of the promise it originating from

umbral zealot
#

I'm not talking about scopes

#

I'm talking about returning something from a function so that it can be used later.

opal plank
#

yeah that part i know

umbral zealot
#

The callback in the .then() is no different than any other function

opal plank
#

like i said

#

its the fact that .then() manipulates the value from the orinigator

umbral zealot
#

It "manipulates" it only as any other function would

#

it's just a callback function, nothing more.

quartz kindle
#

it doesnt "manipulate" the value, it receives the value

#

the promise returns a value

#

.then() receives the returned value

#

as an argument

opal plank
#
const jsonData = await fetch(url).then(res => res.json());
umbral zealot
#

Also, ```js
const wait = require("util").promisify();

async function test() {
let a = 0;
await wait(2000);
a = 100;
return a;
}

const handleResponse = (result) => {
console.log(result); //100
return result;
}

const b = await test().then(handleResponse );
console.log(b); // 100

#

since it's "just a function"

opal plank
#

when you return res.json(), that itself becomes the value

umbral zealot
#

well, res.json() returns a promise

#

which await then resolves.

opal plank
#

and after that, if you attach ANOTHER .then(), it'll get the value from that already parsed .json() from the privous then

#

thats whats confusing

umbral zealot
#

why? res.json() returns a promise that resolves to a value.

#

¯_(ツ)_/¯

opal plank
#

await getOne(1).then(one => one++).then(two => return two);
expected, 1
actual return, 2

#

getOne returns 1

umbral zealot
#

wait wait why would you expect 1?

#

you're incrementing it.

opal plank
#

thats the bit i was talking about, it IS manipulating the output of getOne

umbral zealot
#

It's not...

#

It's a function that returns a value

opal plank
#

two in the second .then() is already 2

umbral zealot
#

that returned value is one ++

#

Yes, it is, because you're chaining functions

opal plank
#
.then(one => {one++; console.log(one)}); //2

.then(one => one++).then(two => console.log(two)) //2
umbral zealot
#

Look, ignore the promise for a second. ```js
const getOne = () => 1;
const one = getOne();
const two = one++;
console.log(two)

What's your value?
opal plank
#

yeah i understand that

umbral zealot
#

Ok but it's the same thing

opal plank
#

ik, i told u, i understood it lmao, its still doesnt make sense to me

quartz kindle
umbral zealot
#
const async getOne = () => 1;
const one = await getOne();
const two = await one++;
console.log(two)

This is the exact equivalent of await getOne(1).then(one => one++).then(two => return two);

#

I mean, as far as order of operations go

#

This is why I prefer async/await by an order of magnitude. Because there's no confusion callback chains.

opal plank
#

either js whack as fuck or im not drunk enough

umbral zealot
#

It's real hard for a senior to be able to even comprehend the confusion you're feeling now, so I'm sorry if I can't relate anymore

opal plank
#

its the carrying value of .then() and assignment based on the .then()'s and not the promise itself

#

.then() is a type of callback

#

i get that

umbral zealot
#

Yes, it's chaining them.

#

Just like the pipe operator in bash.

#

the output of one goes to the next in the chain

opal plank
#

what i dont get is why the value changes while chaining them

#

its intended

#

im aware

#

but its ilogical imo

umbral zealot
#

because the callback function returned a modified value and that's what's being sent down the chain, not the original promise.

#

It's not passing the original promise resolution, it's passing the new promise resolution.

#

serial, not parallel.

opal plank
#

hmmm that makes sense

umbral zealot
#

I gotta say it took me a long time to really grok promises.

#

a few months at least.

opal plank
#

i've used promises for a while now, hands down its completely fine specially cuz i despise .then() unless browser doesnt support async

quartz kindle
#
a = await promise() // resolves to 10
  .then(result => { // result is 10
    return 20;
  }) // resolves to 20
  .then(whatever => { // whatever is 20
    return 999;
  }) // resolves to 999
a // 999
opal plank
#

.then()'s just causes callback hells

umbral zealot
#

I think what really made me understand is when I had used promises for a few months and I ended up making one. that's when it sort of clicked for m.e

quartz kindle
#

^ same

opal plank
#

i do make promises

#

i actually promisifed IPC for my clustering

umbral zealot
#

here actually this might help visualise.

opal plank
#

that actually explains

umbral zealot
#

funny how a simple image can say so much

opal plank
#

true that

#

yeah that gets rid of the .then tbh

#

ty @umbral zealot @quartz kindle

umbral zealot
quartz kindle
#

get rid of it

#

throw it out the window

#

like im doing to js arrays

#

friendship ended with array, string my new best friend

boreal iron
#

lmao

opal plank
umbral zealot
#

come to graphql and you'll say that, but for graphql

opal plank
#

i was actually looking into it

#

culling seemed really nice

#

and import for rest

wise quartz
#
    def owner(ctx):
        return ctx.author.id == ctx.guild.owner_id

    @commands.group(invoke_without_command=True, aliases=['manager', 'm'])
    @commands.check(owner)
    async def managers(self, ctx):
        setup = db.child("guilds").child(ctx.guild.id).child("setup").child("managers").get()
        setupval = setup.val()
        if setupval == None:
            await ctx.send("You have no managers yet")
            return
        q = 0
        msg = ""
        while True:
            if q < len(setupval):
                msg = msg + f"<@{setupval[q]}>/n"
                q += 1
                return True
            else:
                return False
        await ctx.send(msg) 
``` Why does this not work? (py)
hollow sedge
#

it returns before the message is even sent

#

perhaps you mean to break instead of return False and just remove return True

#

@wise quartz

#

also you should just be iterating over the list instead of using a while loop with the length

wise quartz
#

i thought return False would break the loop

#

stop*

hollow sedge
#

use a for loop

#

if you dont know what that is, you should learn python before making a bot

wise quartz
#

i know what a for loop is

#

and i tried it before using a while loop

#

but it didnt work

#

idk why

hollow sedge
#

can you show what you tried

wise quartz
#

i dont have a copy of it but imma try to write it

sudden geyser
#

I hate Apollo so much but it's the only decent option.

wise quartz
#
i = 0
msg = ""
for i in len(setupval):
    msg = msg + f"<@{setupval[i]}>\n"
    i += 1
await ctx.send(msg)
``` @hollow sedge something like that
hollow sedge
#

you can just do for manager in setupval

#

to get setupval[i]

wise quartz
#

that wont work tho

hollow sedge
#

why not?

wise quartz
#

setupval is a list inside my db

#

setupval is ["idididididiiddiid","ididididididid"]

#

so i use i as an index

#

to get all of them

hollow sedge
#

how does that change anything

wise quartz
#

idk

#

i am not that advanced in python so not sure

#

this works tho imma keep it

#

the while loop

#

lol

hollow sedge
#

it's bad but ok

wise quartz
sudden geyser
hollow sedge
sudden geyser
#

enjoy your suffering

#

unless you plan on hard-coding the query as a string

#

then really good luck

opal plank
#

imagine not slapping any everywhere in ts

sudden geyser
#

any notlikenoot

red coral
#

why is my node isnt reconized?

#

on my terminal

wise quartz
#

1 line code

#

fancy ass

red coral
#

any help?

hollow sedge
wise quartz
#

ye i dont trust these

#

i like simplicity

hollow sedge
#

those are literally there for simplicity

#

im pretty sure Lite was joking with that

#

msg = "\n".join(f"<@{id}>" for id in setupval)

#

it'd be like that though

wise quartz
#

no thats complex

#

its simple for ur level

#

not me

#

tho its kinda understandable

#

anyways so how i do ur for loop excatly cuz i dont get it

#

for manager in setupval:

#

setupval[manager]

#

?

hollow sedge
#

no

#

manager is setupval[manager]

#

manager is not the int count

wise quartz
#

aaaaaaaaa

#

a little more explaination?

hollow sedge
#
list1 = ["a", "b", "c"]
for letter in list1:
  print(letter)
#

this will print "a"

#

then "b"

#

then "c"

wise quartz
#

ah

#

so letter is basically list1[0]

#

got it

#

imma try that

hollow sedge
#

yes

wise quartz
#

how do i convert a string to an int?

#

int(setupval)

#

ye

hollow sedge
#

yes

wise quartz
#

imma try do it 1 line

#

lol

hollow sedge
#

uh ok have fun

#

they're called list comprehensions if you want to look it up

wise quartz
#

alr

#

ty

lucid prawn
#

how do i make a api

hallow hill
# lucid prawn how do i make a api

In this video, I will show you how to create a Youtube API Key.

Go to: https://console.cloud.google.com
Sign up for service and follow the step by step video.

If you liked it consider liked and share it - https://youtu.be/sVEytWDWYwM

Follow on the Telegram - https://t.me/wordpressforbeginners

#YoutubeAPI #createYoutubeAPI #getYoutubeAPI

▶ Play video
wise quartz
opal plank
#

the worst part isnt the API key

#

its the Auth screen that needs to be verified by google

#

you thought verifying on discord was lenghty and annoying?

#

hahaha, cute

drifting wedge
#

the chnanel needs to be in the guild?

#

deos that wrok?

#

@hollow sedge

hollow sedge
#

Uh

#

I think it has to be in the cache

#

Or in the guild

earnest phoenix
#

the guild i guess

#

both actually

lucid prawn
bronze bramble
#

hey\

#

anyone able to walk me thru hosting the main file, separate from my other files because i am using cogs

#

py

earnest phoenix
#

h-

#

huh?

neon heart
#

Hi, i want ask about search song command. When I use the search command, why do I always get an error ```
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'voice' of undefined
at Object.execute (/app/src/commands/play.js:22:40)
at Object.execute (/app/src/commands/search.js:47:45)

#

but when I use play command, I don't get any error and it works

hallow hill
sudden geyser
#

because whatever you're trying to use dot notation to access on .voice is undefined.

#

And it's coming from src/commands/play.js line 22

#

@neon heart *

neon heart
sudden geyser
#

so message.member is undefined.

#

there are cases where message.member can be undefined. I recommend checking if it's equal to undefined and considering the user not in a voice channel.

neon heart
#

hmmm

earnest phoenix
#

it won't ever be undefined because discord sends you the member - you need to have server member intent enabled

neon heart
#

i have enable from discord developer portal

earnest phoenix
#

are you using the intent in your code though

#

djs uses gateway v7, you need to specify your intents

wide flicker
#

Can someone help me with getting data from DSL? So I got a simple webhook server but I’m confused how exactly I need to go about getting this to work. I’m using Python by the way

earnest phoenix
wide flicker
#

Well it’s not an API though..

sudden geyser
wide flicker
#

Yea.. DSL uses webhooks it doesn’t have an API.. DBL has an API

neon heart
earnest phoenix
#

take a guess

neon heart
#

i am confused

pale vessel
#

it's enforced on v8, no?

earnest phoenix
#

yes

pale vessel
#

So on v7 intents are still optional

earnest phoenix
# neon heart i am confused

i asked you to take a guess because it's a really logical solution, take a guess and i'll tell you whether you're right or not

pale vessel
#

What the fuck happened to v7 anyway

earnest phoenix
#

a product of switching 60 different developers within a month

#

they just abandoned it altogether and went to v8

pale vessel
#

yikes

earnest phoenix
#

the only difference between v7 and v6 is... fancier error codes in v7

#

close enough, GUILD_MEMBERS

neon heart
#

then what should i do?

earnest phoenix
#

specify the intent in your client and it should work

neon heart
earnest phoenix
#

yup

#

I don't think it accepts intents like that tho, maybe a bitfield or an array of intents

neon heart
#

after using the intent, the command doesn't work

earnest phoenix
#

because message intent isn't enabled?

neon heart
earnest phoenix
#

What does it log in console is the question

#

Any errors?

neon heart
#

nope

earnest phoenix
#

May i see how you exactly used the intents

neon heart
#
const client = new Discord.Client({
    disableMentions: 'everyone',
    ws: {
       intents: ['GUILD_MEMBERS', 'GUILD_MESSAGES']
     }
})
earnest phoenix
#

It's like addition, start from 0 and add the bitfield of the intents you gonna use to it

neon heart
#

is it wrong?

earnest phoenix
#

Just use this

const client = new Discord.Client({
disableMentions: "everyone",
ws: {
intents: (new Discord.Intents().add(<array of intents>))
}
});```
sudden geyser
#

or just [intent 1, intent 2, ...]

neon heart
earnest phoenix
#

I guess but you shouldn't use intents that you don't have access to

#

GUILD_MEMBERS and GUILD_PRESENCES are privileged intents and needs whitelisting

neon heart
#

uh

#

this is simple question but why go to hard question? my search song command cannot run because message.member.voice is undefined at play.js

earnest phoenix
#

What's the error you exactly got? + Stacktraces

neon heart
#
at Object.execute (/app/src/commands/play.js:22:40)
at Object.execute (/app/src/commands/search.js:47:45)
    at processTicksAndRejections (internal/process/task_queues.js:88:5)
(node:1488) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1488) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
earnest phoenix
#

Oh wait, i think i know why this is happening

#

It's because of wrong parameter order

#

Can you show me the first parts of play.js

neon heart
#
const { channel } = message.member.voice;
stark abyss
#
  client.on("typingStart", function(channel, user){
    if(channel.guild.id != 718234815320817746) return;

    var typedUsers = []
    if(typedUsers.includes(user.id)) console.log(`This user ${user.id} is already in db!`)
    if(!typedUsers.includes(user.id)){
      channel.send("I see you typing little boy").then(d => d.delete({ timeout: '3000' }))
      typedUsers.push(user.id)      
    }
  });

I see you typing little boy is being sent more then once while the other message is never console logged

earnest phoenix
#

No no no, the object that contains the command name/description or whatever @neon heart

neon heart
#

ahh sorry

stark abyss
#

I only want it to say I see you typing little boy once for each user

neon heart
#
module.exports = {
  name: "play",
  description: "Play command.",
  usage: "play <song[title/url]>",
  cooldown: 5,
  async execute(client, message, args) {
earnest phoenix
#

And can you show how you execute your commands in your main file?

neon heart
#
try {
      command.execute(client, message, args);
} catch (error) {
    console.error(error);
    message.reply('there was an error trying to execute that command!'); 
}
earnest phoenix
#

whatNOyoucantdothis Wait that looks correct, how is message.member undefined then

#

Well i got an idea

#

console.log(message) in your play command file

neon heart
stark abyss
#

anyone got idea for me?

neon heart
earnest phoenix
#

As you can see, the places of the message and args are swapped

#

Try to console.log(args)

neon heart
#

console.log(args) get result undefined

earnest phoenix
#

Huh, what about console.log(client)?

stark abyss
#

I know no one cares but it was a scope issue the array needed it outside the event ASfacepalm

drifting wedge
#

is this a valid like submit form thing for html? html <input type="submit" class="btn btn-success" value="Save">

earnest phoenix
#

Hi

#

I need command play plss

sudden geyser
#

I see you typing little boy is being sent more then once while the other message is never console logged
because the variable's scope is bound to the listener function.

#

@stark abyss you should move the typedUsers array to a higher scope outside the typingStart event.

stark abyss
#

yeah

sudden geyser
earnest phoenix
stark abyss
#

lmao

earnest phoenix
#

Paste it here

drifting wedge
#

any1? is this a valid like submit form thing for html? html <input type="submit" class="btn btn-success" value="Save"> lol

stark abyss
#

i think he looking for source code lol

agile lance
#

Is it possible to change a embed text color? (Not embed color bc Ik how to do that, I mean the text color)

hollow sedge
#

You can only color text using syntax highlighting and code blocks

#

@agile lance

agile lance
#

What type of code blocks?

#

And will the color change for Mobile people?

earnest phoenix
#

probably, but it won't be the same color ig

agile lance
#

Mobile for js doesnt work

#
message.author
#

Yeah doesnt change color

earnest phoenix
#

doesn't even change on desktop client

agile lance
#

Oh

#
test
#

That doesnt either

#

Anyways, Thanks for the help! :-)

#

I received a error stating: Provided intent is not enabled or whitelisted

#

Any ideas?

earnest phoenix
#

you mean Privileged? Ig you need to enable it on dev portal

agile lance
#

Things arent going my way at all for some reason all of a sudden

#

if (message.mentions.users.first().id == client.user.id) return message.reply(':wave: Hey! My prefix is `:`')

#

Whatever reason jt isnt working either

rare aspen
#

Hei Guys

#

What About Building a Bot Without PC.Using Termux and Text Editor?

#

Waste of Time?

rustic nova
#

waste of time/effort

#

and pure pain

#

tl;dr bad idea

rare aspen
#

🥲

wide flicker
#

Can someone help me get the public url of my flask webhook server?

#

I can connect to it locally but not remotely..

earnest phoenix
#

where is it running at

wide flicker
#

It’s running in Sublime

#

On my local PC

earnest phoenix
#

huh

#

oh

#

run ipconfig in cmd

#

grab the public ip

#

and stick the webserver port on it

#

if it doesn't work you either aren't listening for it or the firewall is cockblocking you

#

I want to switch to wio.db Do you recommend it ?

wide flicker
#

Ok that worked.. let me see if my webhook on DSL will be able to send to it

#

There’s my server code as well

pale vessel
#

Uh I don't think that's how request works

#

Python smh my head

wide flicker
#

Yea lol

earnest phoenix
#
    throw err;
    ^
Error: Cannot find module 'discord.js'
Require stack:
- /app/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
    at Function.Module._load (internal/modules/cjs/loader.js:526:27)
    at Module.require (internal/modules/cjs/loader.js:666:19)
    at require (internal/modules/cjs/helpers.js:16:16)
#

error

pale vessel
#

So you can import request from flask and just use it straight up and get a response? What kind of magic is this

wide flicker
#

Yea from my understanding you can. This is how I was told to do it. I’m able to connect to it with devices on the same network but can’t connect to it from anything not on it

pale vessel
wide flicker
#

Just to let everyone know.. I ran it from my Ubuntu server and everything worked properly so I’m assuming it’s a firewall issue on my local windows machine

earnest phoenix
#

Update your Node.js Version

unborn ridge
#

(node:4916) UnhandledPromiseRejectionWarning: RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number.

rustic nova
#

Code

tribal siren
#
const player = new Player(bot);
  bot.player = player;
  
  let track = await bot.player.play(message.member.voice.channel, message.content.split(" ").slice(1).join(" "), message.member.user.tag);
  const embed = new Discord.MessageEmbed()
    .setTitle(`Now playing ${track.name}`)
    .setColor('RED')
    .addFields(
      {name: `Requested By:`, value: `${message.member}`, inline: false},
      {name: `Length:`, value: `${track.length}`}
    )
    .setTimestamp()
  message.channel.send(embed)```
#

what did i do wrong here?

tight scaffold
#

is there any documentation on how topgg css works?

pale vessel
#

No problem Hope

tight scaffold
#

Yeah but, the background color part doesnt work

pale vessel
#

uh oh

rustic nova
#

give me a second

tight scaffold
#

when tried in the editor, and previewed nothing is changed

rustic nova
#

yup i see it

#

yeah fixing

#

the css selector is #bot-details-page

#

so without the .page

tight scaffold
#

ah

unborn ridge
#
const db = require("quick.db")


module.exports.run = (bot,message,args)=>{
let channel = message.mentions.channels.first()
if(!message.member.hasPermission("MANAGE_SERVER")) {
    return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") You are not allowed or do not have permission to set the channel")
  }
    
if(!channel) {
return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") Please Mention the channel first**")
    }
    
    
    db.set(`welchannel_${message.guild.id}`, channel.id)
    
    message.channel.send(`**![Mee6hehe](https://cdn.discordapp.com/emojis/781525686157574164.webp?size=128 "Mee6hehe") Welcome channel for this guild is now set to ${channel}`)
  }


module.exports.help ={
    name:"setw-channel"
}```
#

@rustic nova

#

pls

#

@rustic nova

slender thistle
#

It's MANAGE_GUILD, no?

unborn ridge
#

sure?

sonic lodge
#

yes, it is MANAGE_GUILD

rustic nova
#

the rest css should work on the page

quaint rover
#

!help

#

-help

pale vessel
#

Help yourself.

unborn ridge
#

hi can i get help related to memberadd event

#

i want to set message for welcome with quick.db

#

and i want that

#

if i set

#

welcome ?member

#

?member should be replaced by ${member.username}

#

pls

tight scaffold
#

is it possible to set mobile specific images?

pure lion
#

Nyet

tight scaffold
#

am i able to chnage the short description color

rustic nova
tight scaffold
#

that only says long

rustic nova
#

oh good grief, lemme add the short description part

tight scaffold
#

lol

rustic nova
#

the css selector is called #bot-details-page .bot-description

tight scaffold
#

alright thx

lyric lynx
#

My code :-

      //make it "2D"
      const ctx = canvas.getContext('2d');
      //set the Background to the welcome.png

      const background = await Canvas.loadImage(`https://i.redd.it/e1jefsd54tq41.png`);
      ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
      ctx.beginPath();

var gradient = ctx.createLinearGradient(0, 0, 170, 0);
gradient.addColorStop("0", "magenta");
gradient.addColorStop("0.5" ,"blue");
gradient.addColorStop("1.0", "red");

ctx.lineWidth = "70";
ctx.strokeStyle = gradient;
ctx.rect(0, 0, canvas.width, canvas.height);
ctx.stroke();```

Error :-
```(node:3249) UnhandledPromiseRejectionWarning: TypeError: offset required
    at Client.<anonymous> (/home/runner/SR2-support/index.js:275:10)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:3249) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3249) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
tight scaffold
#

is there a way to make a different image on mobile or no, seems like there should be a way

slender thistle
#

Media queries

tight scaffold
#

@slender thistle no idea how to use that

slender thistle
#

Google

unborn ridge
#

listen pls

#
  let chx = db.get(`welchannel_${member.guild.id}`);
let autorole = db.get(`autorole_${member.guild.id}`)
  if (chx === null) {
    return;
  }
  if (autorole === null) {
    return;
  }
  
   let data = await canva.welcome(member, { link: "https://i.pinimg.com/originals/f3/1c/39/f31c39d56512dc8fbf30f9d0fb3ee9d3.jpg" })
 
    const attachment = new discord.MessageAttachment(
      data,
      "welcome-image.png"
    );
  
  

  member.addRole(autorole)
  bot.channels.cache.get(chx).send("Welcome to our Server " + member.user.username, attachment);
});```
#

this is my member add event

pale vessel
#

Okay?

#

addRole is not a thing

unborn ridge
#
const db = require("quick.db")


module.exports.run = (bot,message,args)=>{
let role = message.mentions.roles.first()
if(!message.member.hasPermission("MANAGE_GUILD")) {
    return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") You are not allowed or do not have permission to set the autorole**")
  }
    
if(!role) {
return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") Please Mention the role first**")
    }
    
    
    db.set(`autorole_${message.guild.id}`, role.id)
    
    message.channel.send(`**![Mee6hehe](https://cdn.discordapp.com/emojis/781525686157574164.webp?size=128 "Mee6hehe") Autorole for this guild is now set to ${role}**`)
  }


module.exports.help ={
    name:"set-autorole"
}```
pale vessel
#

Yet you have channels.cache

#

You have v11 code

unborn ridge
#

see

pale vessel
#

See what?

unborn ridge
#

welcome work

#

not the role

pale vessel
unborn ridge
#

oh

#

can u send link of documentation

#

if it is there

#

member.roles.add(memberRole)

#

is this how i should do

#

@pale vessel

pale vessel
#

Yes

unborn ridge
#

ok

#

ok it worked

#

but

#

bro

#

are u here

#

@pale vessel

pale vessel
#

Yes brother

#

What is it step bro

unborn ridge
#

what

#

?

#

i want to ask

pale vessel
#

Yes?

unborn ridge
#

like i have written in code that if chx(welcome channe;) is null than return

#

to

#

so

#

if welcome channel is null role is not aded

#
  let chx = db.get(`welchannel_${member.guild.id}`);
let autorole = db.get(`autorole_${member.guild.id}`)
  if (chx === null) {
    return;
  }
  if (autorole === null) {
    return;
  }
  
   let data = await canva.welcome(member, { link: "https://i.pinimg.com/originals/f3/1c/39/f31c39d56512dc8fbf30f9d0fb3ee9d3.jpg" })
 
    const attachment = new discord.MessageAttachment(
      data,
      "welcome-image.png"
    );
  
  

    member.roles.add(autorole)
  bot.channels.cache.get(chx).send("Welcome to our Server " + member.user.username, attachment);
});```
#

sseeee

unborn ridge
#

what

#

help u need

#

sorry i use canvas senpai

bright flame
#

If anyone knows how to host a java (.jar) bot for free pls dm me

rustic nova
#

@bright flame you wont be able to host java stuff for free

bright flame
#

ya how much money it need tell me

#

even heroku cant?

#

or glitch

rustic nova
#

get a vps instead

#

install jre and jdk on it

#

and boom

bright flame
#

how much it costs

pale vessel
#

like $3

#

VPSes are cheap nowadays

bright flame
#

prob is that i have money but no international transaction possible

#

i have a rupay card only

#

which is national for india

earnest phoenix
#

help

#

me

#

yardım edin la

rustic nova
cosmic robin
#
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles) {
    const command = require(`./commands/${file}`);
    client.commands.set(command.name, command)
}

client.on('message', message=>{
if(!message.content.startsWith(prefix)) return;
console.log('1');
const args = message.content.split(/ +/g);
const command = args.shift().toLocaleLowerCase();
if(!client.commands.has(command)) return;
console.log('2');
try {
    client.commands.get(command).execute(message, args);
} catch (error) {
    console.error(error);
    message.reply('An error occured. Please make sure you are using the command correctly');
}
})``` I've made this but when I type a command it's only reaching '1'
unborn ridge
#

(node:16724) UnhandledPromiseRejectionWarning: TypeError: channel1.setName is not a function

cosmic robin
#

typo

#

channel1.setname

unborn ridge
#
const db = require("quick.db")


module.exports.run = (bot,message,args)=>{
let channel = message.mentions.channels.first()
if(!message.member.hasPermission("MANAGE_GUILD")) {
    return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") You are not allowed or do not have permission to set the channel**")
  }
    
if(!channel) {
return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") Please Mention the channel first**")
    }
    
    
    db.set(`mcountchannel_${message.guild.id}`, channel.id)
    
    message.channel.send(`**![Mee6hehe](https://cdn.discordapp.com/emojis/781525686157574164.webp?size=128 "Mee6hehe") Member Count for this guild is now set to ${channel}**`)
      const guild = message.guild
      const channel1 = db.get(`mcountchannel_${message.guild.id}`)
      channel1.setname(`Members: ${guild.memberCount.toLocaleString()}`)
    }
  


module.exports.help ={
    name:"set-mcount"
}```
#

making member count channel with quick.db

#

i will update guilmember add

#

but

#
(node:9368) UnhandledPromiseRejectionWarning: TypeError: channel1.setname is not a function```
cosmic robin
#

ah ic

unborn ridge
#

i want after setting channel with db

#

name should be updated

#

if i used without db

#

it works

#

by giving channel id

#

but cant do hat

#

that

#

pls

hasty mulch
#

How can I make a bot react to its own embed in Python?

unborn ridge
#

sorry

#

i dont know that

earnest phoenix
#

?

unborn ridge
#

pls help me

earnest phoenix
#

Use a different db then

unborn ridge
#

no i cant

#

there is not problem in db

earnest phoenix
#

I got one what’s free

unborn ridge
#

it has been set

#

listen'

#

channel is set

earnest phoenix
#

Okay

unborn ridge
#

but name is not chsnging

rustic nova
#
#

read the docs

unborn ridge
#

changing

#

after lunch i will surely read

rustic nova
#

see what your channel variable is

unborn ridge
#
    return this.edit({ name }, reason);
  }```
#

this is there

#

in documentation

#

about channel name

pale vessel
#

Uh that looks like it came from the source

#

Are you sure you're not looking at their GitHub repo

rustic nova
#
unborn ridge
#

i saw in the repo

#

there is a </>

#

i clicked on it

rustic nova
#

that's a link to the sourcecode

#

that's something you dont need

unborn ridge
#

see

#

if i interchange channel with channel 1 and channel1 with channel it say cannot acces before initialisation

#

@rustic nova

rustic nova
#

then you're doing that before the bot actually initialises (?)

#

not sure

#

i dont code in js pepega

unborn ridge
#

lol

stark widget
#

@unborn ridge hey

#

I can help

pale vessel
#

this is what you didjs channel1; const channel1 = "foo";

unborn ridge
#

pls tell

#

@stark widget

stark widget
#

So, what's ur code rn?

#

I know ur error

unborn ridge
#
const db = require("quick.db")


module.exports.run = (bot,message,args)=>{
let channel = message.mentions.channels.first()
if(!message.member.hasPermission("MANAGE_GUILD")) {
    return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") You are not allowed or do not have permission to set the channel**")
  }
    
if(!channel) {
return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") Please Mention the channel first**")
    }
    
    
    db.set(`mcountchannel_${message.guild.id}`, channel.id)
    
    message.channel.send(`**![Mee6hehe](https://cdn.discordapp.com/emojis/781525686157574164.webp?size=128 "Mee6hehe") Member Count for this guild is now set to ${channel}**`)
      const guild = message.guild
      const channel1 = db.get(`mcountchannel_${message.guild.id}`)
      channel1.setname(`Members: ${guild.memberCount.toLocaleString()}`)
    }
  


module.exports.help ={
    name:"set-mcount"
}```
#

setting member count channel

#

channel is set

#

just name not changinf

stark widget
#

Hmm

#

I got it

#

U need to do
const mChannel = message.guild.channels.cache.get(channel1)
Then u can change the name of the channel using mChannel@unborn ridge

#

More like mChannel.setname()

unborn ridge
#

but

#

where

#

oo okok

#

i understand

stark widget
#

Ight

unborn ridge
#
(node:8368) UnhandledPromiseRejectionWarning: TypeError: mChannel.setname is not a function```
#

@stark widget

#
const db = require("quick.db")


module.exports.run = (bot,message,args)=>{
let channel = message.mentions.channels.first()
if(!message.member.hasPermission("MANAGE_GUILD")) {
    return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") You are not allowed or do not have permission to set the channel**")
  }
    
if(!channel) {
return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") Please Mention the channel first**")
    }
    
    
    db.set(`mcountchannel_${message.guild.id}`, channel.id)
    
    message.channel.send(`**![Mee6hehe](https://cdn.discordapp.com/emojis/781525686157574164.webp?size=128 "Mee6hehe") Member Count for this guild is now set to ${channel}**`)
      const guild = message.guild
      const channel1 = db.get(`mcountchannel_${message.guild.id}`)
      const mChannel = message.guild.channels.cache.get(channel1)
      mChannel.setname(`Members: ${guild.memberCount.toLocaleString()}`)
    }
  


module.exports.help ={
    name:"set-mcount"
}```
#

seeee

stark widget
#

?docs

#

I don't know how to change name of a channel

#

Sorry

unborn ridge
#

what

#

then why u said then

stark widget
#

@unborn ridge are u sure, u have set the id to the db?

unborn ridge
#

lol it worked

stark widget
#

Cuz the code is correct smh

pliant orbit
#

how to make description like mee6 on top.gg???

unborn ridge
#

i change name to Name

stark widget
#

Yikes

#

@unborn ridge ok

unborn ridge
#

thanks bro

stark widget
#

Np

unborn ridge
#

thankssssssssssssssssssssssssssssssssssssssssss

pliant orbit
stark widget
#

Use html I think

unborn ridge
#

+set-mcount #hi

#

lol why i testing here

rustic nova
unborn ridge
#
const db = require("quick.db")


module.exports.run = (bot,message,args)=>{
let channel = message.mentions.channels.first()
if(!message.member.hasPermission("MANAGE_GUILD")) {
    return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") You are not allowed or do not have permission to set the channel**")
  }
    
if(!channel) {
return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") Please Mention the channel first**")
    }
    
    
    db.set(`mcountchannel_${message.guild.id}`, channel.id)
    
    message.channel.send(`**![Mee6hehe](https://cdn.discordapp.com/emojis/781525686157574164.webp?size=128 "Mee6hehe") Member Count for this guild is now set to ${channel}**`)

      const guild = message.guild
      const channel1 = db.get(`mcountchannel_${message.guild.id}`)
      const mChannel = message.guild.channels.cache.get(channel1)
      mChannel.setName(`Members: ${guild.memberCount.toLocaleString()}`)
      const updateMembers = (guild) => {
      bot.on('guildMemberAdd', (member) => updateMembers(member.guild))
  bot.on('guildMemberRemove', (member) => updateMembers(member.guild))
  updateMembers(guild)}
    }
  


module.exports.help ={
    name:"set-mcount"
}```
#

lol why its not updating

#

not updating still no error

wintry raptor
#

Is there a limit how often you can change name on a voice channel/text channel?

unborn ridge
#

i think rate limit might be i dont know is it there or not just guessing

wintry raptor
#

There are 10min after two time

terse lynx
#

is there any pokemon popular movesets API available?

unborn ridge
#
const db = require("quick.db")


module.exports.run = (bot,message,args)=>{
let channel = message.mentions.channels.first()
if(!message.member.hasPermission("MANAGE_GUILD")) {
    return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") You are not allowed or do not have permission to set the channel**")
  }
    
if(!channel) {
return message.channel.send("**![XMARK6](https://cdn.discordapp.com/emojis/781751944754233345.webp?size=128 "XMARK6") Please Mention the channel first**")
    }
    
    
    db.set(`mcountchannel_${message.guild.id}`, channel.id)
    
    message.channel.send(`**![Mee6hehe](https://cdn.discordapp.com/emojis/781525686157574164.webp?size=128 "Mee6hehe") Member Count for this guild is now set to ${channel}**`)

      const guild = message.guild
      const channel1 = db.get(`mcountchannel_${message.guild.id}`)
      const mChannel = message.guild.channels.cache.get(channel1)
      mChannel.setName(`Members: ${guild.memberCount.toLocaleString()}`)
      const updateMembers = (guild) => {
      bot.on('guildMemberAdd', (member) => updateMembers(member.guild))
  bot.on('guildMemberRemove', (member) => updateMembers(member.guild))
  updateMembers(guild)}
    }
#

channel name sset

#

bunot updating

#

ls

#

pls

prime glacier
#

can someone tell me how can i do it like if we try to ban a member's who has role position above the bot highest role bot send my role isn't above the member role like dyno do it

unborn ridge
#

i thought u were replyig me

prime glacier
unborn ridge
#

no

#

but it does not update

#

the channel name

rustic nova
unborn ridge
#

where

#
      const guild = message.guild
      const channel1 = db.get(`mcountchannel_${message.guild.id}`)
      const mChannel = message.guild.channels.cache.get(channel1)
      mChannel.setName(`Members: ${guild.memberCount.toLocaleString()}`)
      const updateMembers = (guild) => {
      bot.on('guildMemberAdd', (member) => updateMembers(member.guild))
  bot.on('guildMemberRemove', (member) => updateMembers(member.guild))
  updateMembers(guild)}
    }
#

problem is there in tis one

prime glacier
quick ridge
#

how can i check if a person has a discord nitro

unborn ridge
#

noooooo

#

@prime glacier

#

if iused command

#

ok i understood wait

#

i have to use my desi logic

earnest phoenix
#

i need help

#

i have code its not replying

#

(its with commands folder i dont have any problem at command loaded/handler

#

and how i can make uptime shower to my music bot

hasty mulch
#

How do I get an embed to change the description with reactions in Python?

earnest phoenix
#

idk

#

im node.js developer

wispy pulsar
#

@hasty mulch ?? What do you mean?

hasty mulch
#

You know those pages they have in embeds?

wispy pulsar
#

Ohh

#

Yes