#development

1 messages · Page 1361 of 1

quartz kindle
#
.then(async wb => { 
const hook = new Discord.WebhookClient(wb.id, wb.token); 
await hook.send(yazi)
return hook;
}).then(hook => hook.delete({ timeout: 2000, reason: 'HOOK silinmesi' }) )

or simply 

.then(async wb => { 
const hook = new Discord.WebhookClient(wb.id, wb.token); 
await hook.send(yazi)
await hook.delete({ timeout: 2000, reason: 'HOOK silinmesi' })
})
obtuse jolt
#

??

#

:(

quartz kindle
#

@obtuse jolt idk looks correct, and the third image shows that it worked before, did you change anything?

obtuse jolt
#

I remove a line from the shard sending

#

that defined it as something

#

idk whyt but it's not outputting anything to console

subtle kiln
#

@blissful coral it's all good I just mixed 2 roles because I'm a bit dumb

#

thanks

blissful coral
#

Ok

#

Np

quick ridge
#

how can i fix this

cinder patio
#

A channel cannot have more than 10 webhooks

#

When you create a webhook for a channel, save it's ID in a database, so you don't create a new one every time

quick ridge
#

how can i do that

When you create a webhook for a channel, save it's ID in a database, so you don't create a new one every time
@cinder patio

#

in v11 i was use js message.channel.createWebhook(isim , avatar) .then(webhook => webhook.edit({name: isim, avatar: avatar} ) .then(wb => { const hook = new Discord.WebhookClient(wb.id, wb.token); hook.send(yazi) }).then(a => { a.delete({ timeout: 2000, reason: 'HOOK silinmesi' }) })

obtuse jolt
quick ridge
#

but its not works in v12

cinder patio
#

This has nothing to do with the library, it's a discord limitation, you cannot have more than 10 webhooks in a single channel

quick ridge
#

how do i do to fix it

cinder patio
#

You shouldn't create a new webhook every time

#

use an existing one

quick ridge
#

How can I take the previous one

cinder patio
#

You can either:

  1. Store the webhook's ID somewhere, if the ID is missing create the webhook, then use fetchWebhook to get the webhook
  2. Get all webhooks fetchWebhooks and select one from there.
blissful coral
#

You can get the webhooks from the channel and if there are over 10 return

celest frost
#

A friend of mine is looking to pay someone to make a custom (rather simplistic) bot. DM if interested or if you have any questions.

solemn latch
#

Fiverr has a lot of devs who will make it.

radiant vigil
#

I made this command for webhook creations with my bot

 message.delete()
const user = message.mentions.users.first() || message.author
const args = message.content.slice(33)
          if (user.bot) return;
         if (!user && !args.length) { message.channel.send("Utilizzo: gs.webhook <optional:utente> <testo>")}
         const webhook = message.channel.createWebhook(user.username, {avatar: user.displayAvatarURL({ format: 'jpg', dynamic: true })}).then(webh => {
                const webhookClient = new Discord.WebhookClient(webh.id, webh.token);
         webhookClient.send(args)    
         webh.delete()      
    }```
So why the cmd gives me an error?
#

Made with discord.js

solemn latch
#

What's the error?

upbeat sentinel
#

why wont it go online

sudden geyser
#

Because you call client.login(...) in the message event.

#

But you won't get any messages if you aren't logged in.

upbeat sentinel
#

What do I replace it with?

#

im new to coding

sudden geyser
#

You call it in the global scope. Aka move it out of the event body.

upbeat sentinel
#

So, what would I put?

#

like what code

sudden geyser
#

}) before client.login(...)

upbeat sentinel
#

like this?

sudden geyser
#

Hover over the underlined red text and see you got yourself a syntax error.

upbeat sentinel
sudden geyser
#

You shouldn't have an extra }) there because you closed the scope already.

upbeat sentinel
#

kk

#

1 more error.

blissful coral
#

syntax

#

you are missing a } ] or ) somewhere

#

or have to many

#

of one

sudden geyser
#

You're probably missing a } to cover the last if statement in your event body

upbeat sentinel
#

err

#

fixed

sudden geyser
#

Can you run it now.

upbeat sentinel
#

ill test

#

Yes.

#

It works.

sudden geyser
#

Great

#

But I recommend you spend more time learning JavaScript, as scopes & syntax are fundamental traits to the language.

earnest phoenix
#

@sudden geyser Hey, I broke my help command, including my warn could u possibly help?

sudden geyser
#

Maybe

#

Explain more in detail please

earnest phoenix
#

alright my help command does not respond and has 0 errors

#

my warn command I think I only set for 1 guild which I thinbk broke it and im not sure how to fix it

sudden geyser
#

Did you mean to use === instead of !== when checking the guild ID?

earnest phoenix
#

o ye good spot, i was thinking of keep my bot so it only worked in one guild but i wanna change it

blissful coral
sudden geyser
#

When you want to make a program that works in a number of environments (in this case, guilds), it's more reliable to think dynamically. In your case, it's probably not the best idea to hard-code a check into your command for a specific guild.

There are a number of other possible errors in your code:

  • await message.mentions.members.first() - Did you forget to do .cache.first()?
  • Line 28: Similar issue as the one I pointed out in the screenshot.
  • You shouldn't need to do the checks you do at the top (prefix, bot, etc.) Your command should only hold the logic of your command.

There are a number of other errors that may be present, but I don't think I have the time to look over all your code. The idea is what matters more. @earnest phoenix

earnest phoenix
#

@sudden geyser alr thanks

upbeat sentinel
#

why is this

sudden geyser
#

It couldn't find the module.

upbeat sentinel
#

How do I fix that?

sudden geyser
#

Aka the path doesn't point to that file.

upbeat sentinel
#

err im not too good at coding

#

how would i fix this

sudden geyser
#

You supply a path that exists. The current file your code is being executed from also plays a role.

upbeat sentinel
#

im so confused rn

sudden geyser
#

Can you show your directory structure on the left side

queen needle
#

You're trying to access a file but pointing to the wrong file or no file

upbeat sentinel
sudden geyser
#

See, file doesn't exist.

solemn latch
upbeat sentinel
#

oh ye

#

i forgot to download it

#

LMAO

#

sorry

sudden geyser
#

Yeah we all make mistakes, but you should still take the time to learn JS

upbeat sentinel
#

just trying to make a bot with help of here and github

queen needle
#

You should always learn the language before using a library with the language

upbeat sentinel
#

shouls that fix it?

sudden geyser
#

GitHub and this channel won't always be here to hold your hand. It's your code, so you need to take the time to learn the language if you want to make a bot.

upbeat sentinel
#

kk

queen needle
#

^

upbeat sentinel
#

ill do that then

sudden geyser
#

It seems the error is coming from await getInfo(args)

#

Which tells us it's coming from the ytdl-getinfo library.

earnest phoenix
#

What should I do ?

tardy hornet
#

how do i make that if a user use a command it will start a timer

#

and he could not use the command till the timer is up

queen needle
#

The way you are getting into isn't how ytdl.getInfo function works the method works by video id so you need to get the video Id then use that in the get info method

earnest phoenix
#

The way you are getting into isn't how ytdl.getInfo function works the method works by video id so you need to get the video Id then use that in the get info method
@queen needle What should I do ?

sudden geyser
#

No, you should be able to use the video title.

queen needle
#

Really?

sudden geyser
queen needle
#

I'm dumb then I've never seen that lmao

#

I've always used id

restive furnace
#

then don't spread false information, thank you.

sudden geyser
#

It was just a mistake free.

restive furnace
#

but they still should check README/docs before saying something.

earnest phoenix
#

😤

indigo flax
#

lmao

#

someone help this dude

#

hes been trying the whole day

restive furnace
#

why he won't fetch the channel

#

maybe that's the problem

indigo flax
#

k

#

ill reply

restive furnace
#

anyways he should debug himself though

blissful coral
#
let size2 = '='
size.forEach({
   size2 = `${size2}=`
})
#

size2 = ${size2}=
^^^^^^^^^^^^^^^^^^^

SyntaxError: Invalid shorthand property initializer

sudden geyser
#

What language is that supposed to be

#

You probably forgot the () => {...}

solemn latch
#

I was going to say python, but it makes more sense than python

sudden geyser
#

It looks kind of like Swift

#

except the no mutability let

quartz kindle
#

kinda looks like shit

sudden geyser
#

javascript

quartz kindle
#

jabbascript

sudden geyser
#

jabba

tardy hornet
#

how do i make that the bot will know what time is it>

#

?

earnest phoenix
upbeat sentinel
#

anyone got an eval code for me

solemn latch
#

we dont spoonfeed here

sudden geyser
#

Not how it works Star

quartz kindle
#

eval("10+10")

upbeat sentinel
#

kk

#

lol

sudden geyser
#

1010

quartz kindle
earnest phoenix
tardy hornet
#

how do i make that the bot will know what time is it?

solemn latch
tardy hornet
#

i saw so many bots

quartz kindle
#

@tardy hornet depends, what timezone?

tardy hornet
#

GMT +2

quartz kindle
#

new Date().toLocaleString("en-US",{timeZone:"Etc/GMT-2"})

tardy hornet
#

so like

#

how do i make him know, what time the user sent the message, like it will say in the footer, today at bla bla

quartz kindle
tardy hornet
#

ty guys

celest schooner
#

theres also message.createdAt

keen drift
#

Greetings, I'm here to inquire if anyone has implemented a distributed shard system, with a centralized cache w/ shared data for de-duplication.

I'm currently re-evaluating my current strategy for self-coordination among pods to elect master nodes, and distribute M shards across N clusters.

Thanks.

blissful coral
#

Brain go brrrr

quartz kindle
#

i have never implemented it because i have no need for it, but i have pondered about it before

keen drift
#

My current cost regarding scaling on a single machine is becoming non-feasible, which is my motivation to seek better solutions.

quartz kindle
#

whats your current setup?

keen drift
#

Self-coordination among shards, using a central redis instance to communicate among shards to obtain key locks w/ TTL heartbeats up to M shards.

Abstracted router layer that feeds compressed data into central redis store, and an internal queue to distribute/balance requests to microservices. I believe the tradeoff of CPU cycles for ~35% memory compression saving was worth it.

quartz kindle
#

personally i would go for a centralized sharding manager/coordinator to which individual shards can connect to via tcp/etc and obtain shard ids to connect with, this way its easy to load balance them among machines

#

your microservice queue sounds good, the redis store also sounds ok, although i would personally look into non-memory database to avoid having non-hot data hogging the memory

keen drift
#

Are there any insights on the larger bots on the 16 multiple sharding systems are handling it? Would be great to get some inspirations.

quartz kindle
#

unfortunately i dont have any information about how they're doing it, but they are likely using similar ideas

#

the only tricky part about a multi-machine setup is sharding coordination, which can only be reliably done with a centralized manager

#

to avoid multiple shards trying to connect at the same time

keen drift
#

The current manager/coordinator is the redis instance, obtaining locks on keys would be the method of obtaining shard ID

quartz kindle
#

sounds good enough

tardy hornet
#

i know its not working like that but

#

if(new Date().toLocaleString("en-US",{timeZone:"Etc"}) !== new Date().toLocaleString("en-US",{time:"10:00 - 12:00"})) return message.channel.send('F')

quartz kindle
#

yeah no that makes no sense

tardy hornet
#

ik

wintry elk
#

hello

earnest phoenix
#

hi

wintry elk
#

how i can make a guess game like dank memer?

earnest phoenix
#

well you have to make it yourself, we aren't gonna give you the code. I can, however, help you. What library are you using?

wintry elk
#

discord.js

earnest phoenix
#

ah ok

wintry elk
#

and i have Q

#

i can make money with bot development?

earnest phoenix
#

uh you can ask people to donate i guess

#

and what particular command from dank memer are you wanting to have in your bot

wintry elk
#

@ionic dawn what is funny in my Q?

earnest phoenix
#

lol its cuz bot development usually takes money from you

wintry elk
#

uh you can ask people to donate i guess
@earnest phoenix ok no another way to make money?

ionic dawn
#

Get a job

#

Thats how normal people earn their money

wintry elk
#

no i can get money from bot development?

earnest phoenix
#

discord isn't gonna pay you for making bots xd

wintry elk
#

ok

#

?

solemn latch
#

paying for advertisement

wintry elk
#

ok

crystal yew
#

So the errors are gone now!

#

How does the webhooks help with the voting rewards?

#

I have it as the running script and now its checking of the user voted

ionic dawn
#

no i can get money from bot development @wintry elk
you can build a bot and somehow make it generate moneh using patreon tiers or any kind of PREMIUM features

#

But thats difficult

crystal yew
#

Can someone acknowledge my existence please?

wintry elk
#

you can build a bot and somehow make it generate moneh using patreon tiers or any kind of PREMIUM features
@ionic dawn ok my brother thank you very much 🌹

crystal yew
#

@earnest phoenix are you there to help me?

errant perch
#

is it possible to create a hyperlink inside of discord that when once you click it, it copies text

crystal yew
#

Please help me, ANYONE

errant perch
#

what

boreal iron
#

is it possible to create a hyperlink inside of discord that when once you click it, it copies text
@errant perch That would require at least JS, so nope it’s not possible

errant perch
#

ok

crystal yew
#

I have the script running so a webhook is sent when a user votes and now my bot isnt giving me my voting reward

opal plank
#

copies text?

errant perch
#

like ctrl+c ctrl+v

solemn latch
#

are you receiving the vote webbook?

opal plank
#

i guess you could hyperlink a website that does on load

uneven estuary
crystal yew
#

are you receiving the vote webbook?
@solemn latch I dont even know where the web hook is even going

solemn latch
#

well, first you need to receive the webhook in the webhook event

opal plank
#

@errant perch check onload for html/js

errant perch
#

ok i'll look into it

opal plank
#

window would probably be my recommendation

boreal iron
#

@errant perch check onload for html/js
@opal plank he spoke about Discord, it’s unfortunately not possible in discord to trigger event on the client side

opal plank
#

again, load it on a website

#

use the bot to fetch previous msg or something

#

is it possible to create a hyperlink inside of discord that when once you click it, it copies text
that was the question, if its your website, yes, it can @boreal iron

#

you got access to the bot, therefore the chat too

#

limited but functional

crystal yew
#

well, first you need to receive the webhook in the webhook event
@solemn latch ?

solemn latch
#

is the webhook event logging when you testvote

crystal yew
#

???

solemn latch
#

check your console

#

is anything there

boreal iron
#

@opal plank Nah I think he meant to copy a specific text in discord by clicking on a link

crystal yew
#

Whats a console?

errant perch
#

oh no

opal plank
#

@boreal iron then no, the way he phrased makes it seem like something else

boreal iron
#

Huh

#

Then I probably misunderstood him

opal plank
#

he just say copies text

#

he didnt specify what text, nor where it is from

#

if you simply want a copy function from a link, its doable with onload and copy function

boreal iron
opal plank
#

thats as simple as it gets

errant perch
#

what about text generated from the bot

opal plank
#

if its your bot, you can do logic to log what it sent

errant perch
#

o

#

k

opal plank
#

i assume text generated from the bot you mean on the go

#

not chat history from the bot

errant perch
#

yes

opal plank
#

as long as you have a domain, you can simply put a path on your domain and have it with whatever text you wish

#

and then send that link in chat

subtle kiln
#

Is it possible to send message and reactions at the same time? Because if I send the message before reacting to it, I need the READ_MESSAGE_HISTORY permission

solemn latch
#

you only need read message history if you dont cache the message afaik

subtle kiln
#

you only need read message history if you dont cache the message afaik
@solemn latch It's not working

solemn latch
#

caching the message isnt?

opal plank
#

example

bot generates text: "Hello World"

Bot creates a new path on your domain with a router
mydomain.com/Hello

bot adds the generated text onto the onload function on that page


Bot sends mydomain.com/Hello

User clicks that hyperlink and loads a page, instanly have the text on their clipboard

@errant perch @boreal iron

#

you'd probably generate a page for each generated text

subtle kiln
#

caching the message isnt?
@solemn latch the error come from the API itself, and yes the message is cached

solemn latch
#

why do you need to get the message from the api if its cached?

subtle kiln
#

re-read my message I dropped some words

earnest phoenix
boreal iron
#

@opal plank yeah, as I said thought he speaks about an event like onclick in discord not external

solemn latch
#

I dont see where you cant just add the reaction to the cached message

opal plank
#

apart from that, no, theres no way unless you using client mods

cunning tendon
#

ehm im tryna use css and stuff in the bot description, but when I click preview it doesnt work, console says "[Error] ReferenceError: Can't find variable: preview
onclick (new:316)"

boreal iron
#

You can’t use JS in the description

cunning tendon
#

I didnt

subtle kiln
#

I dont see where you cant just add the reaction to the cached message
@solemn latch The message is sent, so even if it's cached and I know everything about it, Discord consider it as an old message and I need the READ_MESSAGE_HISTORY permission, I got a DiscordAPIError: Missing Access

solemn latch
#

whats your code look like?

boreal iron
#

Then save ur changes and clear your cache and reload the site

cunning tendon
#

tried that

boreal iron
#

Tried a different browser already?

cunning tendon
#

not yet

subtle kiln
#

whats your code look like?
@solemn latch something like that

const message = await channel.send(/* */)

// stuff here

for (const reaction of /* */) {
    // stuff here
    await message.react(reaction)
}
solemn latch
#

and const message = await channel.send(/* */) is in the same scope as the for loop?

cunning tendon
#

chrome gives me this

Uncaught ReferenceError: preview is not defined
    at HTMLButtonElement.onclick (new:316)```
subtle kiln
#

and const message = await channel.send(/* */) is in the same scope as the for loop?
@solemn latch yes

cunning tendon
#

so the same thing as safari

boreal iron
#

Then head to #support and report the issue please

#

And probably ping the moderators once

clever vector
#

Hey guys

#

If my bot status online like we use desktop how can we change to phone online status

obtuse thistle
#

Any idea what the rate limit for deleting emotes is?

clever vector
#

@earnest phoenix bruh

#

Any idea what the rate limit for deleting emotes is?
No idea 😓

sudden geyser
#

@obtuse thistle it's about 1+ second(s). Though, you shouldn't rely on the number being constant as it can change. The library you use will probably handle rate limits for you, but if you're trying to protect against rate limits a bit more, then setting a limit like 1-2 seconds is fine.

obtuse thistle
#

👌 Thanks

clever vector
#

Hey @sudden geyser
Do you know how to make bot status to phone online status

solemn latch
#

@subtle kiln turns out cached messages cant be reacted to without view message history Thonk
actually something I didnt know.

sudden geyser
#

I think some bots have done that. What library are you using

clever vector
#

D. Js

solemn latch
#

I swear users could do it

clever vector
#

??

subtle kiln
#

@subtle kiln turns out cached messages cant be reacted to without view message history Thonk
actually something I didnt know.
@solemn latch yes because Discord don't care if you cached the message or not. All it see it's that it's an old message and you don't have the permission to know about it

clever vector
#

@sudden geyser You found smth?

sudden geyser
#

Not yet

#

I didn't find it in the Discord.js documentation, so I'm looking in Discord's documentation.

clever vector
#

I know it's gonna put in ready.js

opal plank
#

dont do it

#

its undocumented

clever vector
#

?

opal plank
#

its done in the identification payload

#

mobile status is not documented and shouldnt be used

sudden geyser
#

So that's why I can't find it

#

grr

opal plank
#

i've done it, its in the identification payload

#

you'd have to hack the library to change it

faint prism
#

Ty

drifting wedge
#

in a nested dict in python, if i do dictname["module"] dictname["module2"] will it get from the same dict?

#

its like a dict inside a parent dict

sudden geyser
#

A bit confused. What is the nested & parent dict (dictname)? Whatever variable your dict is supposed to be you access (and isn't changed) is the dict you read from, so it should be the same dict.

tranquil condor
#

Hello

clever vector
#

@opal plank So it's illegal right

opal plank
#

basically, dont do it @clever vector , yes

boreal flume
#

I was making a bot(discord.js), and I went for the guild's member cache, and as I called to search the cache, it could not find my ID. So I did a little bit of digging and found that the bot is the only member in the member cache... can someone help me?

sudden geyser
#

You probably don't have intents.

boreal flume
#

What are those?

solemn latch
#

the things you receive from discord. intents are what you choose to get

clever vector
#

Hey guys
I got 1 more problem

boreal flume
#

How do I fix that though

clever vector
#

I enabled server member intent but the user count still unstable

opal plank
#

did u require that on your bot verification?

#

if not, do so

sudden geyser
#

This article may interest you: https://dis.gd/gwupdate

clever vector
#

Ahh I see

#

Soo that why it's not stable

#

Thanks

boreal flume
#

Did discord have an update that changed the way caching worked?

sudden geyser
#

Yes, those are intents.

opal plank
sudden geyser
#

I swear you just had nitro.

boreal flume
#

Where do I enable intents?

opal plank
#

i did, not anymore

#

though i still have a database of over 17k emotes

sudden geyser
#

Impassive check your bot's dashboard on the developer portal.

#

Click on the Bot tab and scroll to Privileged Gateway Intents

boreal flume
#

Where on the dashboard?

sudden geyser
boreal flume
#

Thanks

sudden geyser
#

You may also need to change some of your code, as I think there's an intents field in the client constructor's option object.

boreal flume
#

I dont think there are

#

I checked and it didn't appear so

opal plank
sudden geyser
#

sad

opal plank
#

its 19k

sudden geyser
#

still sad

opal plank
#

wdym still sad?

sudden geyser
#

sad

opal plank
boreal flume
#

It still does not cache all of the members

#

@opal plank What is the size of your emotes folder?

clever vector
#

Hey guys what is the verification do

#

Is it verify on top.gg or discord

solemn latch
#

top.gg and discord have seperate validations

opal plank
#

like, storage size?

#

@clever vector

clever vector
#

Noo I mean

opal plank
#

how many emotes?

clever vector
#

The Verification mentioned on the intent

opal plank
#

what?

#

oh, wrong person

solemn latch
#

intents are discords side

clever vector
#

Ohh so

opal plank
#

@boreal flume as in storage megabytes or how many files inside of it?

clever vector
#

It's must be verified by discord in order let it stable again?

boreal flume
#

storage megabytes

solemn latch
#

if your bot is in over 100 guilds, and needs a privileged intents

clever vector
#

Then?

solemn latch
#

then you need to be validated by discord to make it work

clever vector
#

Ohh

opal plank
#

ngl i had to search for the flags, i forgot about em'

boreal flume
#

Smaller than I thought

opal plank
#

i think the database compresses it with the hash

boreal flume
#

ahh

opal plank
#

thats just the backup

#

database table should be around 200 iirc

earnest phoenix
#

—I have a question

#

when does my bot get the check before bot?

opal plank
#

@earnest phoenix when it passes Discord verification

earnest phoenix
#

oh

#

how

#

my bots verified

opal plank
#

it isnt

earnest phoenix
opal plank
#

top.gg is not Discord affiliated

earnest phoenix
#

Oh

#

ok

opal plank
#

Discord is different than top.gg

earnest phoenix
#

oh

#

how to get the check tho

opal plank
#

after 75 servers you will get a dm explaining it

earnest phoenix
#

oh ok

opal plank
#

aight, time to go grind more genshin and bother shiv

clever vector
#

Hey guys how do I change var = 0 to numbers ?

#
var i = 0
var a = i++
bot.guilds.cache.map(guild => `${a}. ` + guild.name + " - " + guild.memberCount).join("\n")
#

when the command come out it's 0

#

All

#

I wanna put it to like

#

1

#

2

#

3

#

It's maybe because of EEMBED

#

@earnest phoenix

digital ibex
#

wut?

slate oyster
#

Bruh pinged oliy

solemn latch
#

not like he asked a question

blissful coral
#

It isn't the real one

#

lmao

slate oyster
#

lol

stable snow
#

how do i get the stats of a bot using dblpy?

grand iron
#

client.channels.cache.size only print 1-3

#

only

#

any help?

celest schooner
#

can you read a yml file like you read a json file with require()

grand iron
#

So I can't use client.channels.cache.size anymore?

sudden geyser
#

If you don't have the intents for it.

#

can you read a yml file like you read a json file with require()
@celest schooner you need to parse it with a library.

grand iron
#

oke i can use fs

#

but i can't use client.user.cache.size

#

i wrong paste sorry

#

client.user.cache.size only print 1 / 2 /3 only user

celest schooner
#

alright

sudden geyser
#

@grand iron it's better you rely on the number of members in the guild provided by the API. In your case (since you're using Discord.js), you should iterate over every guild and add up its .memberCount property, which is the number of members in the guild.

For example: js guilds.cache.reduce((total, guild) => total + guild.memberCount, 0)

warm marsh
#

@grand iron client.users.cache.size

grand iron
#

yeah client.users.cache.size

#

means I have to query everytime the bot is on, right?

crystal wigeon
#

hey guys, does anyone know how should i approach to create a hp bar? in the embeds description

grand iron
#

#

use that?

#

▄▄▄▄▄▄▄

earnest phoenix
#

That'll work

inner badger
#

can someone tel me why command promt is telling me this

#

C:\Users\L26jo\Desktop\disc bot\main.js:30
Messege.channel.send('(text)');
^

ReferenceError: Messege is not defined
at Client.<anonymous> (C:\Users\L26jo\Desktop\disc bot\main.js:30:9)
at Client.emit (events.js:314:20)
at MessageCreateAction.handle (C:\Users\L26jo\Desktop\disc bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (C:\Users\L26jo\Desktop\disc bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (C:\Users\L26jo\Desktop\disc bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
at WebSocketShard.onPacket (C:\Users\L26jo\Desktop\disc bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
at WebSocketShard.onMessage (C:\Users\L26jo\Desktop\disc bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
at WebSocket.onMessage (C:\Users\L26jo\Desktop\disc bot\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:314:20)
at Receiver.receiverOnMessage (C:\Users\L26jo\Desktop\disc bot\node_modules\ws\lib\websocket.js:797:20)

crystal wigeon
#

i mean

#

in embeds?

grand iron
#

▰▰▰▰▰▰▰▰▰▱

#

that i found it

earnest phoenix
#

Hmm...

crystal wigeon
#

i need to send them in embeds

#

during fights

grand iron
#

yeah

#

try use thats message

#

▰▰▰▰▰▰▰▰▰▱

blissful coral
#

@inner badger Messege is not defined

crystal wigeon
#

and how could i add color to it?

rose warren
#

@inner badger message.channel.send('are your ready to die?')

grand iron
#

message not Message

blissful coral
#

Incorrect @grand iron

crystal wigeon
#

waht are these blocks? i need to put them in discordjs bruh

grand iron
#

case sesi

crystal wigeon
#

▰▰▰▰▰▰▰▰▰▱

blissful coral
#

It is whatever he defined it as

#

Copy and paste @crystal wigeon

crystal wigeon
#

▄▄▄▄▄▄▄

inner badger
#

oh its an a

#

not an e

crystal wigeon
#

waht exactly is this called?

#

;-;

#

and color

earnest phoenix
#

I have to finish a line of code before they review my bot so imma head out

inner badger
#

ty

rose warren
#

And a lowercase m usually...

crystal wigeon
#

and need to increase size?

grand iron
#

U+25B0

blissful coral
grand iron
crystal wigeon
#

U25B0

#

meheheh

grand iron
#

JavaScript and JSON \u25B0

crystal wigeon
#

ye just saw that

#

\u25B0

#

:\u25B0 :

#

mmm

#

how

#

do i

#

why is it not converting? xD

blissful coral
#

\U200B

#

@crystal wigeon

ionic dawn
crystal wigeon
#

\U200B

#

;-;

sudden geyser
#

has to be a lowercase u

blissful coral
#

oh ye

crystal wigeon
#

\u200B

#

\u200b

sudden geyser
#

You'll use it in the string to create a zero-width space.

crystal wigeon
#

i mean, why isn't it being detected as markdown here?

#

or will it work if i send it in embeds?

#

from the bot

grand iron
#

From Javascript To Client = ▰
From Client To Javascript = \u25B0

crystal wigeon
#

ahh

#

thanks mate i'll try it, but how would i add colors to it?

grand iron
#

i dont know but i think we can't

crystal wigeon
#

i guess they using something else, on anigame then

#

this what im trying to achieve

#

the health bar

grand iron
#

static image

ionic dawn
#

those are images

grand iron
#

use static image

#

not unicode

ionic dawn
#

you can also build it using custom emojis

crystal wigeon
#

you can send multiple in one embed?

grand iron
#

yep

ionic dawn
#

not images

rose warren
#

Use custom emojis

ionic dawn
#

you cant embed mroe than one image

#

you have to use emojis instead

grand iron
#

Oh

ionic dawn
#

you can also build a canvas with all the elements

crystal wigeon
#

Mm

#

yeah

#

i tried a canvas

#

but

#

since i can send only

#

one

ionic dawn
#

yeah don't emojis seems simpler

crystal wigeon
#

it made no sense to use

ionic dawn
#

and easier

crystal wigeon
#

yeah i see

#

thanks

ionic dawn
grand iron
crystal wigeon
#

but how would i "fill" the appropriate color values? ;-; sorry im noob

grand iron
crystal wigeon
#

hehe

#

yep

sturdy star
#

so i tried doing this

#
   const argsforvideo = message.content.split(" ").slice(2).join(" ")
   const embed = new Discord.MessageEmbed()
            .setTitle(`${argsforid}`)
            .setAuthor(`${argsforvideo}`)
  message.channel.send(embed)```
#

now i do b!message hi hello

#

it sends hello as argsforvideo

ionic dawn
#

but how would i "fill" the appropriate color values? ;-; sorry im noob
@crystal wigeon what?

grand iron
#

add await before message.channel.send

sturdy star
#

and hi hello as the argsforid

#

add await before message.channel.send
@grand iron i mean it works

grand iron
#

oke

sturdy star
#

but not how i want

grand iron
#

maybe you can use args[0]

sturdy star
#

it sends hi hello as the argsforid

grand iron
#

you can find how to make args on github or google maybe

sturdy star
#

no i know how to do it

#

lemme try

ionic dawn
#

angga, why you sending all to google?

#

this channel is to help people and discuss about dev

crystal wigeon
#

xD

ionic dawn
#

No... I mean they should google first but answering them: go google

#

isnt gonna solve nothing

grand iron
#

Okay im wrong

crystal wigeon
#

can we get on a call or something?

#

im sure im not googling properly

#

i cant find anything

#

related to what i want

ionic dawn
#

What do you want

#

any kind of leveling bar ?

crystal wigeon
#

i want a health bar. but if i use emojis

#

hwo would i change the color

#

?

#

like green bar and yellow, red

ionic dawn
#

emojis with diferent colors

#

just make a red emoji and then a rek lighter

crystal wigeon
#

i mean, its like a progress bar

ionic dawn
#

I know

crystal wigeon
#

from 0/100

zinc talon
#

what is this channel for?

ionic dawn
#

What I mean is, you can use 2 color patterns for every bar

crystal wigeon
#

how would i get the exact points required for the moji to show the colors?

ionic dawn
#

and use the ligher for empty and stronger for fill

crystal wigeon
#

mm

ionic dawn
#

work on a 100% and when the progress is higher just swap an emoji or pushit using arrays

crystal wigeon
#

yes sir, i'll try that

#

thanks a lot!

ionic dawn
#

what is this channel for?
@zinc talon chat about development, you can also read the desc for more info

drifting wedge
#

how can i find the shard my bot is on?

#

dpy?

drifting wedge
#

ty

celest schooner
#

for typescript I keep on getting this error
Property 'cmds' does not exist on type 'Client'

#

here client.cmds = new Discord.Collection()

#

i tried adding ```import { Client, Collection } from "discord.js-light";

declare module "discord.js" {
export interface Client {
cmds: Collection<unknown, any>
}
}``` into the typings folder but

#

¯_(ツ)_/¯

#

i still need help

#

I think its a problem with tsconfig

#

so this is my tsconfig

#
{
    "compilerOptions": {
      "target": "es6",
      "module": "commonjs",
      "lib": ["dom", "es6", "es2017", "esnext.asynciterable"],
      "sourceMap": true,
      "outDir": "./dist",
      "moduleResolution": "node",
      "removeComments": true,
      "noImplicitAny": true,
      "strictNullChecks": true,
      "strictFunctionTypes": true,
      "noImplicitThis": true,
      "noUnusedLocals": true,
      "noUnusedParameters": true,
      "noImplicitReturns": true,
      "noFallthroughCasesInSwitch": true,
      "allowSyntheticDefaultImports": true,
      "esModuleInterop": true,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "resolveJsonModule": true,
      "baseUrl": ".",
      "skipLibCheck": true       
    },
    "exclude": ["node_modules"],
    "include": ["./src/**/*.tsx", "./src/**/*.ts"]
}```
#

ping me pls

quaint peak
#

how do you use custom emojis for reactions in discord.py?

#

i currently have this <a:name:id>

#

but it gives me this error discord.ext.commands.errors.CommandInvokeError: Command raised an exception: HTTPException: 400 Bad Request (error code: 10014): Unknown Emoji

silk ledge
#

Hey I am in my messageReactionAdd event and trying get the following to work ever since this new update:

let reactmember = reaction.message.guild.members.fetch(user)

that returns a guildMember which is perfect.

when I go to do: reactmember.roles.add(role1)
Role1 is defined and works already tested
it says:

Cannot 'add' of undefined

tame ginkgo
#

Yo I need some help with discord.js 11.4.2

#

I'm trying to use discord-giveaway.js wit it

#

And when ever I run the token it says its invalid and cant catch the token

#

I've even reset the token multiple times

#

Anyone know how to fix this?

earnest phoenix
#

you cant use djs versions older than v12

#

not anymore

#

what's a boolean matrix

#

how cn i get a mono db url pls tell me

#

as i dont now more about mono db

#

@earnest phoenix are you using mongodb atlas or normally hosting it on localhost?

#

for localhost: http://localhost:port-for-mongodb
for atlas: Copy the URI for the specific cluster

crystal wigeon
#

the colored emoji is getting a white bg even when the bg is trasnparent, waht i tried ehre is i took the empty shape, filled a color, the empty one belnds in correctly but idk why the same image with color is acting weird ;-;

earnest phoenix
#

the colored emoji is getting a white bg even when the bg is trasnparent, waht i tried ehre is i took the empty shape, filled a color, the empty one belnds in correctly but idk why the same image with color is acting weird ;-;
@crystal wigeon or did you upload it as a JPEG instead of a PNG (JPEGs can't have transparency only PNG)

#

send file here

#

(not code send the emoji picture)

crystal wigeon
#

the non colored one works fine

#

but the red

#

or yellow

#

is adding that white bg

earnest phoenix
#

the picture has no transparent background smh

crystal wigeon
#

the white one does ;-;

earnest phoenix
#

this also has no transparent background and it's not even discord

crystal wigeon
#

yeah i tried to "fill" color with paint which is adding taht white bg i presume

earnest phoenix
#

send me the link to that

earnest phoenix
#

yeah i tried to "fill" color with paint which is adding taht white bg i presume
@crystal wigeon microsoft paint does not work with PNG transparency

crystal wigeon
#

ahh

earnest phoenix
#

it will delete the transparency upon saving

crystal wigeon
#

is there any other online tool?

earnest phoenix
crystal wigeon
#

thanks

solemn latch
#

How does paint not support rgba MegaThonk

earnest phoenix
#

How does paint not support rgba MegaThonk
@solemn latch it is what it is (deprecated)

solemn latch
#

True

earnest phoenix
#

fuck class started bye guys

crystal wigeon
earnest phoenix
#

paint.net isn't free? ;-;
@crystal wigeon you want them to just spend a billion years making a good image editor and give it away for free?

#

ok nevermind they actually give it away for free

crystal wigeon
#

😂

halcyon pecan
#

Hey

earnest phoenix
#

yes

young flame
#

@earnest phoenix

#

there

#

@earnest phoenix u still here?

earnest phoenix
#

yes

#

kk

solemn latch
agile lance
#

Wont let me publish my NPM package no matter what the name is

grand iron
#

any one know how to make loop for getting all guild id

#

for(let i = 0; i < guild.size; i++)
{
const gID = ?
const channel = Guildconf[gID]
message.member.voice.channel.join();
}

#

i only know the loop

#

how to implemented it?

#

any know?

earnest phoenix
#

is there a way to filter bot mentions?

ionic dawn
#

wdym by filter

earnest phoenix
#

so i have a thing where it replies to all bot mentions. but i want to filter some user.id and add different replies

pale vessel
#

can you show your code?

earnest phoenix
#

um

#

lets say

ionic dawn
#

check the user id

#

of who sended the message

earnest phoenix
#
  if(message.mentions.has(client.user.id)) {
  message.channel.send("hello")
}
pale vessel
#

well, you kinda already answered your question

#

replace the id with other member's id?

earnest phoenix
#

i want a reply for all users

#

do you understand what im saying? xD

pale vessel
#

no, sorry

earnest phoenix
#

ok wait

#

so lets say

if a normal user mentions the bot - they get hello as a reply

now if a special user mentions the bot - they get how are you as a reply

pale vessel
#

if else, i guess?```js
if ([id1, id2].some(x => message.mentions.has(x)) {
// special user
}

else {
// ordinary user
}```

earnest phoenix
#

let me try

#

nope, it doesn't work

young flame
#

@earnest phoenix @earnest phoenix

earnest phoenix
#

kk

#

Wont let me publish my NPM package no matter what the name is
@agile lance capital letters are forbidden

#
[id1, id2].some(x => message.mentions.has(x)

@pale vessel message.mentions? aren't you supposed to check message.author.id?

pale vessel
#

wut

earnest phoenix
#

you're checking if the special user is mentioned

#

while the guy wants it so if the messages sender IS the special user

sick fable
pale vessel
#

oh

#

bruh

#

change it to [id1, id2].includes(message.author.id) then

earnest phoenix
#

@pale vessel

pale vessel
#

no

#

i don't use glitch, sorry

#

i don't think glitch supports go?

green kestrel
#

isnt glitch js only?

pale vessel
#

glitch supports python too

#

not officially

#

iirc

earnest phoenix
earnest phoenix
crystal wigeon
#

can i send a createReadStream(filename) as an image in the embeds?

hoary nymph
#

did any of yall have problems getting mysql to work on your vps? just give me a ton of errors authentication errors

dense haven
#

is there a way to check if i got a promise as return after a function is executed

earnest phoenix
#
const express = require('express');
const app = express();
app.get("/", (request, response) => {
  console.log(Date.now() + " Ping Received");
  response.sendStatus(20000);
});
app.listen(process.env.PORT);
setInterval(() => {
  http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
}, 20000);```
#

server.js

pale vessel
#

it's 200

#

not 20000

sick fable
#

So I made one Client event on which if it joins any server, it will send an embed to a designated channel but it keeps on sending the error that the guild is not defined. If I define the guild like guild = ctx.guild. it will send me my server's info whereas I want the serverinfo of the server which my bot entered it

#

Sending the code

#
async def on_guild_join(guild):
	channel = client.get_channel(772723143261028432)
	embed = discord.Embed(title = "New Guild Joined!" , colour = discord.Colour.red())
	embed.add_field(name = "**Guild Name**" , value = f"{guild.name}")
	embed.add_field(name = "Guild Id" , value = f"{guild.id}")
	embed.add_field(name = "**Owner Name**" , value = f"{guild.owner_name}")
	embed.add_field(name = "**Owner Id**" , value = f"{guild.owner_id}")
	embed.set_image(url = "https://cdn.discordapp.com/attachments/772723143261028432/772736709124948008/200.gif")
	embed.set_footer(text = f"Requested by {ctx.author.name}" , icon_url = ctx.author.avatar_url)
	await channel.send(embed=embed)```
#

@slender thistle Can you help me up? PeepoFlushed

#

Everyone is afk lol

slender thistle
#

nani

sick fable
#

Come on 🥺

slender thistle
#

embed.set_footer(text = f"Requested by {ctx.author.name}" , icon_url = ctx.author.avatar_url)

#

ctx doesn't exist in this case

sick fable
#

Ok

#

And I have another more problem

#

Read it carefully

slender thistle
#

guild doesn't have an owner_name attribute unless that's new

#

I have zero clue why it would do that

#

Wait

sick fable
#

Mhmmm

slender thistle
#

it will send me my server's info whereas I want the serverinfo of the server which my bot entered it
Make sure you don't have another event fucking it all up somehow

sick fable
#

I don't have another event

#

I have only three. First is async Def on_ready():

#

Second is this

#

Third is async def on_raw_reaction_add

slender thistle
#

Weird

sick fable
#

Not weird lmao

young flame
#

yes?

sick fable
earnest phoenix
#

anyone know imaghash

slender thistle
#

Anyone using VBA here? Got a weird type mismatch in my array

cold grotto
#

anyone wanna make a bot? dm me.

unique nimbus
#

Malicous/Bot entries only please 🙂

#

that sounds bad mmLol

earnest phoenix
#

i hope you're not serious about the forms thing

#

cause if so... yikes

cerulean salmon
#

how to mention someone by id in an Embed message

earnest phoenix
#

<@id>

cerulean salmon
#

u sure ?

earnest phoenix
#

yes

carmine magnet
#

You cant ping in a embed but you can send a mention <@id>

cerulean salmon
#

i tried

earnest phoenix
#

that's not what i sent

cerulean salmon
#

u didn't understand the question

carmine magnet
#

<@> not @<>

#

You didnt understand the answer

cerulean salmon
#

😅

#

all good now

#

GG 👍

carmine magnet
#

:+1:

cerulean salmon
#

how do u check if a member is in the server or not ?
i tried by guild.members.fetch(id)
problem is discord sends the message before i get the result from promise

earnest phoenix
#

then block it by awaiting

#

or use then pattern

#
0|AudioLab |     at Object.module.exports [as GUILD_CREATE] (/root/audio/node_modules/discord.js/src/client/websocket/handlers/GUILD_CREATE.js:33:14)
0|AudioLab |     at WebSocketManager.handlePacket (/root/audio/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
0|AudioLab |     at WebSocketShard.onPacket (/root/audio/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22)
0|AudioLab |     at WebSocketShard.onMessage (/root/audio/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)
0|AudioLab |     at WebSocket.onMessage (/root/audio/node_modules/ws/lib/event-target.js:125:16)
0|AudioLab |     at WebSocket.emit (events.js:315:20)
0|AudioLab |     at Receiver.receiverOnMessage (/root/audio/node_modules/ws/lib/websocket.js:797:20)
0|AudioLab |     at Receiver.emit (events.js:315:20)
0|AudioLab | Error: No tracks were found.
0|AudioLab |     at ErelaClient.<anonymous> (/root/audio/node_modules/erela.js/dist/lib/ErelaClient.js:267:31)
0|AudioLab |     at Generator.next (<anonymous>)
0|AudioLab |     at fulfilled (/root/audio/node_modules/erela.js/dist/lib/ErelaClient.js:5:58)
0|AudioLab |     at runMicrotasks (<anonymous>)
0|AudioLab |     at processTicksAndRejections (internal/process/task_queues.js:93:5)```
#

🤔 🤔

cold grotto
#

using python, how do i log stuff people input, example.

input = 'Enter A Number>'

and then the number they enter would be logged to a text document

zinc fable
#

something like number = int(input("Enter a number"))
should work

#

if i remember correctly

#

then you can save number to the text doc

cold grotto
#

how

#

i mean, if i gave someone something and i wanted to record answers. example.

input = ("enter a suggestion")

and then the suggestion would get saved to a txt called suggestions.txt on MY COMPUTER

earnest phoenix
#

@zinc fable does flirt(Nicole) work

#

😳

cold grotto
#

and only my computer'

zinc fable
#

@cold grotto google how to save to a text file in python

#

its pretty simple i just suck at explaining

#

@earnest phoenix yoflushed

earnest phoenix
#

no you're going to save it on someone elses computer smart

zinc fable
#

the way of inputting would be the same though, just without the int bracket as itll be a string not a number

#

lmao

cold grotto
#

could someone write the script for me so i understand, not in depth or anything. im not using it for anything. (just yet) but i dont understand at all.

sage bobcat
#

One message removed from a suspended account.

cold grotto
#

xD

sage bobcat
#

One message removed from a suspended account.

sick fable
#

@slender thistle what's VBA bro?

cold grotto
#

@sage bobcat not like i was asking anything to hard, it would have taken like 10 seconds

slender thistle
#

Visual Basic for Applications

#

Basically my Excel shit

#

open() with w mode will create a new file if one doesn't exist under provided name @cold grotto

sage bobcat
#

One message removed from a suspended account.

cold grotto
#

i dont know how to, im trying to learn how to log text

#

but i dont understand

slender thistle
#

Beep boop are you familiar with open()

cold grotto
#

no

#

im kinda new to it all

slender thistle
#

Have you tried searching for "write user input to file"

#

P.S. input() returns a string. Use the returned string and write into a file

sick fable
#

Beep boop are you familiar with open()
@slender thistle no lol

cold grotto
#
input = ("enter a number")
open(number.txt, w)

would this work?

sick fable
#

I heard these type of functions in py

#

Yes

#

I hard it

#

Heard

#

**

slender thistle
#

w would be a string

#

And

#

No

#

input is a function

#

It takes a string to output when the program wants the user to input something

cold grotto
#

how should it be written then?

sick fable
#

open() with w mode will create a new file if one doesn't exist under provided name @cold grotto
@slender thistle it's import Py autogui lib

zinc fable
slender thistle
#

?????

#

Nicole, int is unnecessary here from what I understand, but the idea is there

cold grotto
#

number = int(input("Enter a number"))
open(number.txt, w)

zinc fable
#

o h

cold grotto
#

would this work

zinc fable
#

Ic

slender thistle
#

Put w in a string

#

quotes or apostrophes, whatever you choose

cold grotto
#

oh ok

#

number = int(input("Enter a number"))
open(number.txt, 'w')

slender thistle
#

Same goes for number.txt

cold grotto
#

number = int(input("Enter a number"))
open('number.txt', 'w')

earnest phoenix
#

open it with context manager mmLol

zinc fable
#

and w

#

yee

cold grotto
#

that would work?

sick fable
#

Lmaoo I don't know file handling with py

#

@slender thistle Selfi asked something lol

cold grotto
#

@zinc fable
number = int(input("Enter a number"))
open('number.txt', 'w')
@slender thistle
this would work?

slender thistle
#

open() returns the opened file

#

so either use a context manager (please use google for this) or assign it to a variable and then use .write on it

#

If you don't use a context manager, you'll have to .close the file manually

cold grotto
#

file = open('some_file', 'w')
try:
file.write('Hola!')
finally:
file.close()

#

@slender thistle

slender thistle
#

I really regret opening this chat when I'm busy

#

You got the gist of it, yes

cold grotto
#

what is the hola part do?

#

/ file.write

earnest phoenix
#

pretty self-explanatory

cold grotto
#

not really

#

it writes in the file im guessing

sudden geyser
#

yes

zinc fable
#

yes

cold grotto
#

file = open('some_file', 'w')
try:
number = int(input("Enter a number"))
finally:
file.close()

#

would that work?

sudden geyser
#

You open the file, you parse the input, but you aren't writing to the file.

slender thistle
#

what why when who

#

Common sense: you need to .write like I said before. The returned number (or whatever) must actually be of datatype "str" (string) and not anything else

#

The Hola part in the snippet you sent before was a literal text that would be saved in the file

cold grotto
#

bruh, can someone just all save us a little bit of time and correct it for me?

earnest phoenix
#

everything you need to know has been told

cold grotto
#

i dont get it tho

slender thistle
#

The proper question would be "Am I willing to learn or be spoonfed everything?"

#

Then take a step back, learn the basics, then come back to it

cold grotto
#

file = open('some_file', 'w')
try:
file.write(number = int(input("Enter a number")))
finally:
file.close()

#

would this work

earnest phoenix
#

write takes no keyword argument

#

and why do you keep asking if that would work when you can try it yourself

cold grotto
#

he said to use .write tho

earnest phoenix
#

i didn't tell you not to use it, i said, it takes no kwarg

cold grotto
#

shivaco did

#

he said u need to use .write

slender thistle
#

Yes I did

earnest phoenix
#

man

#

you're not getting what i'm saying

zinc fable
#

You do, just not like that

slender thistle
#

I said use .write method on the file object

#

I never said specify a number argument in the function

sage bobcat
#

One message removed from a suspended account.

sudden geyser
cold grotto
#
number = int(input("Enter a number"))
import json
with open('WhateverFileName.json', 'w') as f_object:
  json.dump(number, f_object)
#

would this work?

sonic pilot
#

Relie.Script/Responses/List2+=Words "How are you" "What can you do" "mute {user}" "Ban {user}" "Kick {User}" "Please stay active during night" "activate Online charge" "can you save your battery" "Greet {user}" "Show battery" "go offline" "charge" "8ball {Question}" "Show dev bots" Read More.

sudden geyser
#

@cold grotto try it out and see.

cold grotto
#

it works but i cant do .'s space's

#

etc etc etc

#

only numbers

#

no letters

sudden geyser
#

Then make it accept any text.

#

Your first test should be to not wrap input(...) in int(...)

merry thunder
#

Why i cant connect mongo.db

#

İf u know can ping me

prisma bramble
#

Hey, I'm implementing an Economy System on my bot and I'm confused if i should use quick.db or quickmongo.
both are almost identical (btw i have a free mongo cluster) All i wanna know is which one will manage higher loads better?

#

@merry thunder why don't you use mongoose?

midnight blaze
#

@prisma bramble mongoose

#

dont use quick.db

#

nor quickmongo

prisma bramble
#

im familiar with quick.db , it'll be hard for me to work with mongoose

midnight blaze
#

trust me, it is easy

merry thunder
#

i make a dashboar so i need mongoose

midnight blaze
#

and it is worth it

#

quick db sucks

merry thunder
#

quick db sucks
@midnight blaze+

#

But i can't connect what should i do?

edgy leaf
#

Hello, I will have a small question, I switched the bot from glitch to vds everything works fine, but I am confused in the bot panel part, we can look at the show part in a little glitch.I threw the panel files to the server where the domain is located, but index js does not have app.listen codes, I wonder if I set the env port

midnight blaze
#

@merry thunder show your code

#

I can help you with it

#

I use mongoose

#

a lot

merry thunder
#

wait

#

a

#

sec

#
const { Client } = require('discord.js');
const { Token } = require('./config.json');
const GuildModel = require('./models/Guild');
const { connect } = require('mongoose');

const client = new Client;

client.on('ready', () => console.info(`Loffend in at  ${client.uset.tag}`));

client.on('message', async (msg) => {
    if (!msg.guild) return;
    if (msg.content === '!hello') {
        return msg.reply('Hello!');
    } else if (msg.content === '!create') {
        const doc = new Guildü({ id: msg.guild.id })
        await doc.save();
        msg.reply("made row document!")
    } else if (msg.content == '!prefix') {
        const reg = await GuildModel.findOne({ id: msg.guild.id});
        if (!req) return msg.reply('sorry! doc dosent exits.');
        return msg.reply(`found a document! prefix: ${req.prefix}`);
    }
    }
    
);

(async () => {
    await connect('mongodb://localhost/mongodb-demo', {
        useNewUrlParser: true,
        useFindAndModify: false
    });
    return client.login(Token);
})()
prisma bramble
#

i mean, quickmongo connects and saves data in the same database in which mongoose does

midnight blaze
#

that doesnt look good at all

#

the connection part

merry thunder
#

how i can do?

#

acttly it is my first try mongoose

#

so i dont know to much

midnight blaze
#

yes, but this is completly wrong 😦 you need to change a lot of things

merry thunder
#

Can u give me the expamle?

midnight blaze
#

ok, one sec

#

I cant log in in my project right now

merry thunder
#

unlucky dayy!

midnight blaze
#

I dont have that part by heart

#

but wait a little bit

merry thunder
#

I didnt download the local host of mongo.db. Could it be because of this?

midnight blaze
#

mongoose
.connect("mongodb://filip:test@ds135196.mlab.com:35196/dev")
.then(() => console.log("MongoDB Connected"))
.catch(err => console.log(err));

#

for example

#

if you go on your mongo db account you get a link

#

you need to copy replace that link

#

with the one I have just posed

merry thunder
#

eee

midnight blaze
#

you have localhost

#

that is not the right way to do it

#

you get a link on mongo db

#

that is connected to the database

#

that you created

merry thunder
#
(async () => {
  .connect("blalalalallaa")
  .then(() => console.log("MongoDB Connected"))
  .catch(err => console.log(err));
    });```
#

like that?

midnight blaze
#

stop async

upper gyro
#

+invite

midnight blaze
#

no need async in this one

#

just use it the way I did it

merry thunder
#

Look like that?

midnight blaze
#

yeah, but I found my own code

merry thunder
#

i will change

midnight blaze
#

module.exports.database = function () {
try{
mongoose.connect(mongodb+srv://${mongo_username}:${mongo_password}@"yourdatabasename".yourlink, { useNewUrlParser: true,useUnifiedTopology: true }).then(() => console.log("db online")).catch(err => console.log(err));
}catch(err){console.log(err)}
}

merry thunder
#

can do in `

#

this

sudden geyser
#

There's no need for the try {...} catch (...) {...} by the way.

#

You're already handling the promise via .then/.catch

midnight blaze
#

yeah

#

I know, but still just for saftey reasons xD

merry thunder
midnight blaze
#

if there is still an error

merry thunder
sudden geyser
#

error should be self-explanatory

merry thunder
#

İ didnt see problem here

tight plinth
#

@merry thunder define guild

#

lol

merry thunder
#

i will fixed

#

know no error but

#

dosent working

static saffron
#

how can i play music from spotify?

merry thunder
#

This commands

#

@static saffron In bot ?

static saffron
#

yes

tight plinth
#

@static saffron you cant

merry thunder
#

You need spotfiy api

#

He can

tight plinth
#

no

#

you cant play songs directly from spotify

#

a solution is to parse the song title in youtube and play it

static saffron
#

🤔 but rythm can

warm marsh
#

No

warm marsh
#

It uses the API to get song data then with that uses youtube to find and play the song.

static saffron
#

oh ok, thanks

slender thistle
#

@cold grotto why json.dump

tight plinth
#

question can the client.users.fetch fetch users that are not in any guild the bot is

faint prism
#

I'd imagine not since the user isn't cached

#

Or available in any way

dense patio
#

is there any way to have a join log (server owner name, guild icon, member count) and a welcome message without either of the intents?

pale vessel
#

question can the client.users.fetch fetch users that are not in any guild the bot is
@tight plinth yes

#

all user ids

solar oxide
#

What is a good permission to require for a set prefix command?

dense patio
#

admin

solar oxide
#

dont the rules say that it cant require admin perms?

dense patio
#

a set prefix command is not required

pale vessel
#

@dense patio lmao

faint prism
#

Lool

pale vessel
#

@solar oxide manage server

solar oxide
#

ah ok thx

faint prism
#

Minimum permissions needed

pale vessel
#

ah yes, send messages

faint prism
#

Send and view msgs tbh

#

Having admin is just a disaster waiting to happen if the token is leaked imo

dense patio
#

the bot doesn't have to have admin

#

but you would have to be an admin to change the prefix

earnest phoenix
#

.