#development

1 messages · Page 1887 of 1

slow ibex
#

i mean.. its kinda easy to understand/learn.. but after years of working with it.. i would consider learning JS

cinder birch
#

<html>
<body>

Welcome <?php echo $_POST["Name"]; ?><br>
Your email address is: <?php echo $_POST["Email"]; ?>

</body>
</html>

#

It was this before

slow ibex
#

And nooooow?

cinder birch
#

It should work like this I believe

boreal iron
#

Is your file even a PHP file?

cinder birch
#

Yes

#

I suck at that so please don't bully topggPensive

boreal iron
#

Has name and email capital letters in your html tags as well?

slow ibex
#
<?php

var_dump($_POST);
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <body>

    Welcome <?php echo $_POST["Name"]; ?><br>
    Your email address is: <?php echo $_POST["Email"]; ?>

    </body>
</html>
#

Try this

#

wait..

cinder birch
#

pepowot waits

slow ibex
#
<?php
error_reporting(-1);
var_dump($_POST);
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <body>

    Welcome <?php echo $_POST["Name"]; ?><br>
    Your email address is: <?php echo $_POST["Email"]; ?>

    </body>
</html>
#

This

boreal iron
#

Answer the question please

slow ibex
#

yes

#

it has Capital

cinder birch
#

It's same

slow ibex
#

i hope you changed the method to "POST"

#

and your webserver is capable of parsing PHP?

#

Normally its a 500.X error

#

When you fcked up something in PHP

boreal iron
#

No it’s not a 5xx error if the method isn’t allowed

slow ibex
#

So.. let me clarify that

#

You have these files on a webserver

#

right?

cinder birch
#

Yes

#

Same issue still

slow ibex
#

You have your Page with the form and your action file in the same dir?

boreal iron
#

Just open the php file in the browser and show the results

#

In a screenshot

slow ibex
#

Thats kinda strange. ngl.

boreal iron
#

Before debugging his code make sure he has PHP installed and configured

boreal iron
#

And the webserver even knows how to deal with PHP files

slow ibex
#

VS Code Live Server?

cinder birch
#

Doesn't work on live server and hosting server both

slow ibex
#

Welp.. Problem diagnosed

cinder birch
#

One of my friend got a domain and it somehow works for him

#

Almost same way

boreal iron
#

Let me ask you once again why do you need PHP?
Use GET as method and work with the query string after in the language you’re familiar with

#

I mean installing PHP on Linux servers and enabling it isn’t complicated but it is a little on Windows.

spark flint
#

just use html

boreal iron
#

lol

slow ibex
#

i mean. on a windows server you can use the IIS. On Windows Desktops use xampp

#

pls. never install xampp on a public windows server -.-

boreal iron
#

Wow suggesting XAMPP and IIS

cinder birch
#

These things are going over my brain but I will figure out them in sometime pepowot

slow ibex
tardy hornet
#
node:internal/process/promises:246
          triggerUncaughtException(err, true /* fromPromise */);
          ^

[UnhandledPromiseRejection: 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(). The promise rejected with the reason "#<Collection>".] {
  code: 'ERR_UNHANDLED_REJECTION'
}
boreal iron
cinder birch
#

That site is in Chinese

boreal iron
#

Download Apache and install the server yourself instead of using that buggy and vulnerable trash

cinder birch
#

Oh

#

I know Apache

slow ibex
#

I dont really have any problems with it. I think that are just preferences.

#

i never use that stuff for prod. but for quick coding its ok.

boreal iron
#

It’s trash, had tons of vulnerabilities and a bad default setup

boreal iron
slow ibex
#

i stay with that until my AV Software tells me something different.. or until i managed to convert all my webapps to JS

boreal iron
#

Additionally download PHP, put the symbolic ini link into the bin path of Apache and configure your httpd.conf

slow ibex
#

Not saying that Installing everything yourself is bad.. hell no.. i setup most of my stuff myself. But i like that tool and thats it.

boreal iron
#

Suggesting XAMPP and using AV omg
Armageddon is close okeh

slow ibex
#

AV = Antivirus Software

boreal iron
#

Yea what else should it mean?

slow ibex
#

Idk xD

#

I guess you use Windows Defender?

#

Its a great AV.

boreal iron
#

It’s not but it has system permissions already

cinder birch
#

Well

boreal iron
#

No need to let any other application infect my system files and permissions

cinder birch
#

I'm gonna sleep for now it's late night for me. Will annoy/ask you people tomorrow.

#

Have a great day/night

slow ibex
#

As i said.. preferences xD

#

Have a great night c:

#

But its nothing to fight about.

prime mist
#

$Hey, $I $heard $you $are $using $PHP? $Good $luck $with $that.

cinder birch
#

$thanks

boreal iron
#

You can’t speak about a logical decision if the disadvantages are more than advantages but it’s your system not mines

cinder birch
#

Don't argue you both spongerino

#

I'm just dumb and can't understand what you people said XD

slow ibex
#

You are right. Its my System ^^
And i also know a thing or two about the Windows OS... I have some exams for that.

boreal iron
#

The mix of NoScript, a network wide ad- and malware blocker and the internal defender is more than enough for an experienced user

cinder birch
slow ibex
#

But well.. Opinions.. its like arguing because someone put pineapple on a pizza

rose warren
#

There's nothing wrong with using PHP smh

slow ibex
cinder birch
#

I thought that was Chinese XD

slow ibex
#

Nah

boreal iron
#

As I’m the last supporter since flow got banned

slow ibex
#

but enough of that. I like xampp for local testing and development and thats it

rose warren
slow ibex
#

same. i make some "small" 💵 with that

boreal iron
#

Still the superior leader in backend tech around the net

rose warren
split hazel
#

i wish my school gave us some web project course work

boreal iron
#

Oh nvm then

split hazel
#

i'd write mine in php

rose warren
#

Have you tried Laravel @boreal iron?

split hazel
#

but nooo we have to make a stupid game in some game engine no one uses in lua

boreal iron
#

I think you asked me before already but no I didn’t touch it yet

slow ibex
boreal iron
#

No use case for any of my projects

rose warren
split hazel
#

yeah last year for my course work I had to make some kind of dice game in python that ran for like 5 years so there were answers for it online everywhere

#

they dont do it anymore though

#

discontinued it right before me

boreal iron
#

But dealt with ReactPHP for some live RCON projects

boreal iron
#

But since it’s not my job to code it won’t happen

slow ibex
#

Was a fun project.

split hazel
#

lucky bastard

#

i wont enjoy making a game in lua

#

if it was at least unity then maybe

slow ibex
#

It also had a desktop app.. it was a C# File with an Chromium browser that opened the site xD

boreal iron
#

Used to create graphs with PHP for years before switching to CanvasJs

slow ibex
#

You did graphs with PHP?

boreal iron
#

As people nowadays wanna interact with charts for some TeamSpeak

#

Sure easy

#

Never heard of phplot?

slow ibex
#

Nope

boreal iron
#

It’s old but pure PHP

slow ibex
boreal iron
#

Still works of course

split hazel
#

they wont even teach us web development

boreal iron
#

An example

#

100% PHP

slow ibex
#

noice

boreal iron
#

Yes it is

#

Old as I said

slow ibex
#

Do you know how i did that graph? Its so dirty.. you cant even clean that with a powerwasher

boreal iron
#

But nowadays things need to be fancy for some reason

slow ibex
#

Fancy sells

boreal iron
#

Better don’t tell me can’t view code on mobile anyways

slow ibex
#

It was a fix "Customer paid already and i wanna go to bed"

boreal iron
#

Looks like CanvasJS

slow ibex
#

ChartJS

boreal iron
#

Ah hmm looks similar

slow ibex
#

It was already in that CSS Framework so..

#

i took whats already there

boreal iron
#

Looking at your screenshot reminds me of a SAMP panel like idk 15y ago

slow ibex
#

It is a SAMP Panel

boreal iron
#

At least regarding that title

#

lmao

slow ibex
#

Re-done in 2020

#

Selled in 2021

boreal iron
#

I knew it

slow ibex
#

xD

#

For some reason there are still people making/copying Samp servers

boreal iron
#

Yeah because there are still young people playing it

slow ibex
#

As long as i can sell panels like these.. i don't mind

boreal iron
#

lol yeah why not

#

Cash is cash, going to work or rob old grandmas… who cares

slow ibex
#

Exactly

#

Robbing old Grandmas prefered

boreal iron
#

At least 3 people again defending PHP in this weird Discord server

#

I fucking hate auto correct

#

Should open my window and throw the phone on the highway

slow ibex
#

Yup

#

Okay. going to bed now. I know that tomorrow a 10gbit/s Network for a customer will fail so..

#

Yeah

#

Bye

boreal iron
#

👋

earnest phoenix
#

how can i change the message content? like MeSsAgE to message, uppercase would be MESSAGE if i'm not wrong

boreal iron
#

Lowercase?

earnest phoenix
#

k

#

oh yeah exists

#

.toLowerCase()

boreal iron
#

Correct

upbeat shadow
#
# This example uses topggpy's webhook system.
bot.topgg_webhook = topgg.WebhookManager(bot).dbl_webhook("/dblwebhook", "password")```
can someone help me how can i get these two params. for my bot?
dense flame
earnest phoenix
#

It's fully up to you. If you set the first param to /dblwebhook. You'll be able to access 0.0.0.0:PORT/dblwebhook (what the SDK binds to). If you set the second param to "password" then any POST requests to /dblwebhook must have "password" present as the Authorization value

earnest phoenix
#

That's the API key

dense flame
#

authorization

upbeat shadow
#

oh

dense flame
#

you'll have to set it

upbeat shadow
#

okay thanks

upbeat shadow
boreal iron
#

The IP or hostname to your endpoint and the path you specified

dense flame
#

^^

boreal iron
#

And port if it’s not 80

#

As valid URL

upbeat shadow
#

mhm didn't quite get it

#

any example?

boreal iron
#

http://your-endpoint-or-ip.com:999/dblwebhook

#

The public IP or hostname of your webserver

#

Nobody can send you a letter if he doesn’t know your address

upbeat shadow
#

i don't have any webserver but i tried with the free host i'm using rn.(heroku)
but when i tried sending a test vote it's kinda spamming in the shell with some error

boreal iron
#

The code is creates a webhook listener which is a webserver listening to POST requests

quartz kindle
#

where is your bot running right now?

upbeat shadow
#

heroku

boreal iron
#

I dunno Heroku but remember other people asking for it
You should have a project URL or something like that

quartz kindle
#

then you need to enable a web dyno

boreal iron
#

Ah Tim’s here nvm

quartz kindle
#

and your url should be YOURPROJECTNAME.herokuapp.com/dblwebhook

upbeat shadow
#

yeah i have something like that

quartz kindle
#

yes

#

thats what you need to put in top.gg

upbeat shadow
#

i put

#

then sent a test vote

quartz kindle
#

you need to enable a web dyno

upbeat shadow
#

oh wait lemme check

shy turret
#

anyone know any good email sending tool, which...?

  1. is free (or very cheap, free preferably)
  2. can at least send emails, i dont need to read them
  3. has an api i can automate email verification emails
#

I had no idea gmail api was actually a thing and not just reverse engineering.

boreal iron
#

Use a mail library/framework in your language to send mails.
Keep in mind without a proper set up mail server, SPF, DKIM, DMARC, RDNS etc. most providers will flag your mails as spam or block them entirely.

It makes sense to setup a proper mail server or use a relay service like Amazon, Google etc.

#

Not sure if they’re free or not but I think you will find out

#

And if you wanna authenticate an email put a link into the body targeting your endpoint and send the mail to the recipient.

shy turret
#

well gmail api has 1 bil emails/day is free (i think) so i might use gmails api

#

i was considering using mailgun but its not free forever nor i will spend money on the small project im making

boreal iron
#

There are tons of SMPT libs/frameworks out there to build an email and send it

#

To a recipient or a relay service

pale vessel
#

Huh, SMPT? SMTP?

boreal iron
#

driving

#

The anytime excuse you know

pale vessel
#

Seems to be effective

boreal iron
#

Number two is auto correct

boreal iron
#

Details? Language etc.

quartz hawk
#

use the .leave method

boreal iron
#

As aqua said leave the guild
guild.leave()

quartz hawk
#

wait this isnt general

pale vessel
#

You're working with slash commands

#

Why would **!**ping work?

#

Also IDs should be in strings, not number

unborn mesa
#

._

earnest phoenix
#

Yo guys how’s this btn

pale vessel
#

it's npm, not NPM

#

But it looks good 👍

drifting shell
#

So I've just installed redis-server, but I can't find 'requirepass' in my config (/etc/redis/redis.conf)

#

there is a configuration there

#

just requirepass isn't there

pale vessel
#

Wdym, add it?

drifting shell
#

i dont know if there's a specific section its meant to go under onesieKEKW

pale vessel
#

Are they grouped by sections

drifting shell
#

ok it appears you can just put it anywhere

#

nvm

#

was just weird it wasn't there when every guide in the world says it should be

mint rain
#

How to make that if i use a command and i willl have to wait for seconds so i can use the same command again?

lyric mountain
#

Store the user ID somewhere and remove after a set time

#

Id stored = can't use command yet

mint rain
#

Idk how to do that

lament rock
#

store it in a db along with a timestamp of when it should be deleted and compare that timestamp with the current Date and if it's past that date, delete the entry

mint rain
#

Ok

lament rock
#

Depending on your DB, you could possibly even set it up in such a way so that the db auto deletes it for you, so you only have to check if the user ID exists

woeful pike
#

why auto delete? just insert a row with the current date and query the db to see if there was a command run by that user earlier than X seconds ago

lament rock
#

And leave stale entries in the database?

woeful pike
#

that way you have detailed stats on how your bot is being used and can work on adding better features to things that users aren't using (or are using more than others)

woeful pike
#

how do you know what you need to work on if you don't have detailed analytics on what your users are doing on your bot?

#

this is why people add random moderation commands to music bots lol

lament rock
#

If your bot has a specific purpose and less need for statistics like that, then it's just a waste of space. Or if that metric is already being tracked elsewhere, then that kind of design is also useless.

I'd also add that your suggestion was inefficient as you'd have to loop over all of that tables entries to gather that metric. Depending on how large your bot is, that could take forever. I'd rather just have a table keyed by a command name and a use count BigInt you increment

woeful pike
#

nope you don't have to do that, you can index your table by userid and date to make that lookup near instant

lament rock
#

Why per user metrics?

#

What does that mean in the face of possibly millions?

woeful pike
#

I can assure you bots that get thousands of commands run a second all record command usage details

#

millions of rows is a spec of dust for relational databases

lament rock
#

Profiling users though is useless to the developer and only serves as a means to sell to advertisers

#

Aggregated data can achieve the same thing

mint rain
#

How to make cooldowns for bot?

woeful pike
#

up to you what data you want to persist but having a record of command usage outweighs the cost of space every time

#

userids helps you do lookups for individual usage. You can separate that data into an auto expiring cache if you want. It's clearly not only for selling to advertisers what a ridiculous claim

#

you can also aggregate data past a certain date into less specific data entries to save space but thats not necessary until you start having problems querying the db with indexes which imo would take hundreds of millions of rows depending on how you're storing data

lament rock
#

Having to spend more time creating an index for that specific kind of data which you can just increment an int if all you're looking for is usage just seems like poor design to me. Why go through all that trouble if you just want to know how often each command is used if not used to profile users

woeful pike
#

Not always a bad choice to trade in architectural complexity for space in a db. Incrementing an int isn't as simple in distributed systems

#

you could stuff it in redis if you want, they're both valid choices just depends on your needs

lament rock
#

Incrementing an int isn't as simple in distributed systems

Please explain

whole surge
#

@lament rock Which ide you use to make software's?

lament rock
#

depends on your language. If you use C# or Cpp or compiled languages in general (Ik cs isn’t compiled), you would use Visual Studio, for all else, I'd just use Visual Studio Code

whole surge
#

this is 1 of my software

lament rock
#

Then you're fine. Visual Studio is strong

whole surge
woeful pike
# lament rock > Incrementing an int isn't as simple in distributed systems Please explain

when you have multiple processes that need to sync state you need to move that data outside the process so they're not all storing their own copy of it. If you're concerned about using too much space in a db then you must be at a scale where you're operating on multiple machines. Setting up something like redis just to implement rate limits when you could query a db is a lot of work and an extra point of failure

#

that's definitely an investment worth making at some point but I'm saying you can achieve the same thing by just querying a table (that you should already have) and adding an extra column

lament rock
#

Depending on how you query updates, there's no longer an issue of racing states since you can set that job to the db where the state change would not be subject to race changes. Like in sql, you can do value = value + amount

#

but I can understand race conditions being a issue under specific designs

woeful pike
#

Incrementing ints in a db doesn't help you know when a command was last used though

rose warren
#

Just store message timestamp and user ID

woeful pike
#

you really don't need to be that scared of throwing a ton of data into into a db

#

the more granular the data you're collecting is the better insight you have into your product

lament rock
#

Perhaps. That's where your design would be preferable if you needed that kind of information

rose warren
#

You can actually see what your users enjoy the most and make more of it

#

Instead of guessing

woeful pike
#

for example if you're at a point where you have hundreds of shards and a very predictable command usage pattern throughout the day you could set up your cluster to scale up and down based on that timestamp-based demand

#

that's a little far fetched for most devs but it's an option for sure

whole surge
#

@lament rock Which language you use to make softwares?

lament rock
woeful pike
#

space is one of the cheapest things you can purchase and a million measly rows isn't going to cost you much either

whole surge
woeful pike
#

I think we pay like less than 15 bucks for storing a couple hundred million rows of analytics for topgg? Though it's hard to tell how that pricing works out for shitty digitalocean

lament rock
#

Perhaps one of the cheapest, but I can only reiterate that my budge is very small and has been a net negative for a while

rose warren
woeful pike
#

that's an understandable concern

lament rock
#

Most of my data is occupied by images

woeful pike
#

it just doesn't grow out to be that big for the most part

#

well images don't go in a db so that shouldn't be a concern

lament rock
#

of course, just not much storage space

rose warren
lament rock
#

was tempted to move to an in memory relational db since my apps use less than 100MB each

lament rock
woeful pike
#

but you just throw that into something like s3 and store the link

rose warren
woeful pike
#

the pricing of image storage is kind of a pain on its own though

#

I pay $6/month for Wasabi which gives me 1TB of image storage

lament rock
#

I'd have to download the image each time and cover to specific dimensions. It's easier on data to just cache a smaller res version

#

My vps provider only offers like 1TB of I/O which I kind of need to start doing something about because 💀 audio kills it

woeful pike
#

why do you need to download users banners though?

#

oh you can't just pass a url for attachments right

lament rock
#

Image generation

#

nope

#

has to be the image data

woeful pike
#

I see

whole surge
#

@lament rock Do you work for any company for software development?

lament rock
#

Nope. Independent contractor

whole surge
#

ok

lament rock
#

I just only store 800x500 images which isn't terribly large in data space, but volume matters

#

I need a cdn or my own NAS

royal herald
lament rock
#

Currently used up around 90% of my 500GB of storage

royal herald
#

i have nas which is 20tb

lament rock
royal herald
#

i have my entire life in it lmao

rose warren
#

I'd never host off my own NAS. My ISP is too unreliable dog_Joy Earlier this year I went for 3 months without internet because they did work on the line and forgot to plug my fiber optic connection back in.

royal herald
#

but it still uses %3 of the storage

rose warren
#

I have a NAS for storing all my files though and I share files to clients from it rather than using a 3rd party service like Dropbox or Google Drive. Very useful when working remotely.

rose warren
royal herald
rose warren
#

Nah I like using my NAS

royal herald
#

the internet is so fast

rose warren
#

But I wouldn't host a site / bot off it

royal herald
#

i host my bot and my website on aws

rose warren
#

Yeah I got 500mb up and down when they remember to plug me back in after maintenance dog_Joy

royal herald
#

turkish telekom

rose warren
#

Pain

royal herald
#

0.63 upload

#

wtf is this 1999?

royal herald
#

my wifi sucks

delicate shore
#
    const user_id = interaction.user.id;
    console.log(user_id)
    const userdetail = await userinfo.findOne({
      UserID: user_id,
    })
    if (!userdetail || userdetail.voter !== "yes") {
      return await interaction.reply(
        `Filter command is only available for those who have voted for me (voting is free) or for those who have purchased the premium version. You can vote for me: `
      );
    }

this doesn't work

rose warren
# royal herald i use mobile hotspot alot

I had to do that when my fiber optic was down for 3 months. Luckily my mobile provider is the same company so they sent me loads of free data. I got 500gb per month for free so I could carry on working.

#

But it was a pain having to upload client files to Dropbox etc

rose warren
#

Having your own NAS is so practical and fast

delicate shore
#

?

royal herald
#

no one uses sms

#

my mobile provider is vodafone

delicate shore
rose warren
#

I don't use sms either... 👀 I don't understand what you mean? dog_Joy

rose warren
#

Lol imagine sending clients files by sms? dog_Joy

#

That would be pretty funny

delicate shore
#
        const VOTER = (await userinfo.findOne({
          UserID: interaction.user.id
        }))?.voter || "no";
   if(VOTER !== "yes")
// something

like this?

royal herald
#

no i mean since i dont use smses i turn them to mobile data

rose warren
#

"here's your HD logo"

pale vessel
royal herald
#

poor top

rose warren
#

Lost his gg

#

Sadge

whole surge
#

@rose warren do you make softwares?

rose warren
#

No

whole surge
#

web dev?

royal herald
rose warren
#

Mhmm

whole surge
rose warren
#

VSC

whole surge
#

ok

crystal wigeon
#

So um quick question, can I run 6 shards on a 4cpu machine? I hope there won’t be any advert effects or something? Because I keep seeing that my shard keeps crashing for some reason mmmm

#

Also it auto sharded to 6 since my bot is in 5k servers now

whole surge
crystal wigeon
#

Half of 7.5gb

#

Around 4max

whole surge
whole surge
whole surge
#

@spare goblet which ide you use to make the mimu bot site?

tulip ledge
whole surge
tulip ledge
#

I didnt make it

whole surge
#

oh

#

sorry i thought it was iara's message

tulip ledge
#

But u dont need a specific ide to make a website

tulip ledge
#

An ide is just a fancy text editor

whole surge
#

i am a web dev, software dev, a game dev, bot dev

#

my site

tulip ledge
#

Could use some work on the responsiveness

#

The navbar is halfway of the screen

whole surge
whole surge
tulip ledge
#

Nah im good thanks for the offer tho

whole surge
errant flax
earnest phoenix
#

if I await a (promise.finally) will it return the value from .finally or just the value from the resolved promise? (since finally is just .then and .catch combined together)

#
const moderator = await context.guild.fetchMember(p.moderatorId).finally(mod => mod ? `${mod.name}#${mod.discriminator}` : "Unknown");

`Moderator: ${moderator}`
#

Can someone put this into so it says embed ```Can you set it in @client.event
async def on_message(msg):
if msg.author.guild_permissions.administrator:
return
for word in filtered_words:
if word in msg.content:
await msg.delete()
await msg.channel.send("You cannot say that!")

await client.process_commands(msg) ```

#

I want it to send a embed not text

#

I've never used python but you probably need to put the text into an embed object's description

earnest phoenix
woven aspen
earnest phoenix
woven aspen
#


@client.event
async def on_message(msg):
  if msg.author.guild_permissions.administrator:
    return
  for word in filtered_words:
    if word in msg.content:
      await msg.delete()
      embed = discord.Embed(title = "bad Word", description = "you cannot say that", colour = discord.Colour.blue())
      
      await msg.channel.send(embed = embed)

  await client.process_commands(msg) ```
split moth
#

what are you guys using to host your bots? Right now im using replit but it has been kinda of unreliable lately

boreal iron
#

Just rent a VPS or cloud server

woven aspen
#

I use plox.host

boreal iron
#

Should be enough for 99% or the user needs

split moth
#

i was thinking of a free solution

woven aspen
#

Heroku

boreal iron
#

You won’t get a server for free without major disadvantages

split moth
woven aspen
split moth
#

per month right?

woven aspen
#

20 days is free

split moth
#

okay

mint rain
#

Wat if i use two programming languages, does it matter?

boreal iron
#

Dude of you wanna keep something online 24/7 without quality issues you have to pay for it

earnest phoenix
#

question: what happens if a user who didn't run the slash command presses a component button

#

do i get the interaction

boreal iron
#

If it isn’t invalid

#

Anyone can use your components.
It’s up to you filter the users.

mint rain
#

How to make a cooldowns for a command

boreal iron
#

Save a timestamp for an user, channel or guild (whatever you need) when the command is being executed and calculate the current time minus the last timestamp

#

Check if the difference is larger than your cooldown

crimson dagger
#

\'

#

like this

#

or use "" or ``

#

instead of ''

#

like this kian\'s

#

the result will be kian's

earnest phoenix
#
guild.members.set(user.id, {
  ...guild.members.get(user.id),
  punishments: []
});
console.log(guild.members.get(user.id));

it isn't replacing the punishments array

#

w

#

owo help me

crimson dagger
#

yess

#

oo for that

#

add this

#

toLocaleString()

#

like ${bal.toLocaleString()}

#

orby's ur bot?

tulip cradle
#

commas

crimson dagger
#

yes

#

can i see?

#

thx

tulip cradle
#

Commas : In large numbers, commas are used to help the reader. A comma is placed every third digit to the left of the decimal point and so is used in numbers with four or more digits. Continue to place a comma after every third digit.

earnest phoenix
#

@earnest phoenix is this what you looking for?

crimson dagger
earnest phoenix
crimson dagger
crimson dagger
earnest phoenix
#

js weird

earnest phoenix
#

Send it in a codeblock

#

```
The actual thing
```

#

Just like how you send your code

boreal iron
#

"'" + data + "'"

#

Ah great mobile wrong quotes

#

Nvm you got what I mean

#

Concating strings or using templates

spark flint
#

this is the process i'm trying to setup

old cliff
#

The member object is a reference

mint rain
#

`import discord
import os
import requests
import json
import random
from keep_alive import keep_alive
from replit import db

client = discord.Client()

@client.event
async def on_ready():
print('bot is ready!')

@client.event
async def on_message(message):
if message.author == client.user:
return

msg = message.content

from discord.ext import commands

bot = commands.Bot(command_prefix= "Poke", intents = discord.Intents.default())

@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.errors.CommandOnCooldown): #check if on cooldown
msg = 'Still on cooldown, please try again in {:.2f}'.format(error.retry_after)
await ctx.send(msg)

@bot.command()
@commands.cooldown(1, 5, commands.BucketType.user)
async def beg(ctx):
#actual code for a beg command
await ctx.send('I have a cooldown. Which means i cant be spammed!')

keep_alive()
client.run(os.getenv('TOKEN'))`

#

am i missing sth

shadow frigate
#

when my bot starts up it emits two guildDelete's, both with nothing to display, coming through as undefined.
How can i stop this? There's nothing emitting it.
only happens in shard 2

earnest phoenix
spark flint
broken harbor
#

Guys

#

I have a problem

#

What can i do ?

earnest phoenix
#

You prolly need to install python3-dev

#

python3.x-dev works too

stiff lynx
#

I need help with my leaderboard command
code: https://srcb.in/oJhSs0voN5

the command can be executed but it dont get the tag of the users

earnest phoenix
#

uh how do u guys append something to a existing dict in js

earnest phoenix
#

we dont have dicts in js

#

just objects

#

yeah thats what i meant

#

sorry im so used to py

#

how do u do that tho

#

how do u append something to a existing obj

earnest phoenix
solemn latch
#

YourObject.newpropertyname = value;

earnest phoenix
#

interesting let me try

#

or if something is an expression, obj[1 + 1] = value

earnest phoenix
#

but didn't work

earnest phoenix
#

is it declared as an object earlier

earnest phoenix
earnest phoenix
#

its an empty obj

stiff lynx
#

I put everything in that folder lol

earnest phoenix
#

a schema is not a model

#

schema.find() will not work

earnest phoenix
solemn latch
earnest phoenix
#

whats that

#

and

#

how do i use it

#

a map is an object on steroids

solemn latch
earnest phoenix
#

djs collections are maps but better

solemn latch
#

Objects are more intended for things you know all the properties beforehand.
Like user.id

Maps are good for things like key value stuff(what you are doing in an object)

earnest phoenix
#

bad:

const obj = {};
obj[message.author.id] = { money: 100 };
console.log(obj[message.author.id]); // { money: 100 }

good:

const collection = new Collection();
collection.set(message.author.id, { money: 100 });
console.log(collection.get(message.author.id)); // { money: 100 }
quartz kindle
#

doesnt really matter

#

objects use less memory as well

earnest phoenix
#

i see

#

but there's a reason djs uses maps right

solemn latch
earnest phoenix
#
collection.first(); // { money: 1000 }
obj[Object.keys(obj)][0] // { money: 1000 }
quartz kindle
#

djs uses collections because they need all those extra methods and the ordering that maps provide

earnest phoenix
#

am i really arguing with the js lord timotej

quartz kindle
#

since objects are unordered

earnest phoenix
quartz kindle
#

i mean, if you need to use map.find or map.filter then it makes no difference

#

but if you can get away with map.first then you have an advantage yes

quartz kindle
solemn latch
#

Ah good to know

earnest phoenix
#
client.afk=new Discord.Collection()
client.afk.set(message.author.id, {'message': message.content.replace(";afk", ""), 'time': new Date()})
message.reply(client.afk);

Output: DiscordAPIError: Cannot send an empty message

#

question: how do i draw an image with a shape

earnest phoenix
solemn latch
#

Ms paint

earnest phoenix
earnest phoenix
solemn latch
#

Like making it a circle?

earnest phoenix
#

yes

quartz kindle
#

you can use arc for circles

earnest phoenix
#

take a user avatar (an Image object), clip a circular path and draw it to the canvas

#

my question is how

quartz kindle
#

clippath

#

and drawimage

earnest phoenix
#

clip the image object or clip the canvas after drawimage?

quartz kindle
#

clip the canvas before drawing the image

earnest phoenix
#

close the path after drawing or before?

quartz kindle
#

before

earnest phoenix
#

I don't understand what im doing wrong ```js
client.afk=new Discord.Collection()
if(message.content.startsWith(";afk")){
client.afk.set(message.author.id, {'message': message.content.replace(";afk", "")})
message.reply(client.afk[message.author.id]);
}

quartz kindle
#

you cant send objects

earnest phoenix
quartz kindle
#

also you cant use a[b] on collections

earnest phoenix
#

it says

quartz kindle
#

because the value is an object

earnest phoenix
#

cannot send empty message

quartz kindle
#

and collection[abc] is undefined anyway

#

so right now you tried to send undefined

earnest phoenix
#
const user = args.user || context.user;
const card = createCanvas(1024, 512);
const ctx = card.getContext("2d");
const avatar = await loadImage(user.avatarUrlFormat("png"));

ctx.beginPath();
ctx.arc(70, 70, 100, 0, 2 * Math.PI);
ctx.clip();
ctx.closePath();
ctx.drawImage(avatar, 70, 70, 50, 50);
#

time to tryitandsee

quartz kindle
#

closepath first

#

then clip

earnest phoenix
quartz kindle
earnest phoenix
#

one more thing, how do i convert the new Date() obj to a timestamp

#

hey tim,
is the x and y args of ctx.arc the center point of the circle or the top left part

quartz kindle
#

Date.now()

#

or new Date().getTime()

earnest phoenix
#

thats it?

pale vessel
#

Date.later()?

quartz kindle
#

xD

earnest phoenix
#

im confused

pale vessel
#

Date.now(); new Date().getTime(); new Date().valueOf(); Number(new Date());

earnest phoenix
quartz kindle
#

+new Date()

earnest phoenix
#

(require("pretty-ms"))(timestamp)

quartz kindle
#

ew

earnest phoenix
#

i think i messed up

pale vessel
#

Math.round(timestamp / 1000)

earnest phoenix
#

works fine now

#

tysm

#

i also wanted to ask

#

how do i get the whole message content after the <prefix>commandname

pale vessel
#

Slice that part out from the content

earnest phoenix
#

now it's an actual circle

earnest phoenix
pale vessel
#

U should sort your input, like ```js
const prefix = "!";

client.on("messageCreate", message => {
if (!message.content.startsWith(prefix)) return; // stop if it doesn't start with prefix

const args = message.content.slice(prefix.length).split(/\s+/); // get rid of the prefix and split the content by space
const command = args.shift(); // get the first word, which is the command. this also gets rid of it from the original array, `args`

if (command === "commandname") {
    args; // the part after `!commandname`, an array of words that you can join back by using `args.join(" ")`
}

});```It's more organized that way and u don't need to use some hacky way to slice out the prefix and command name

#

U don't need to check for this

#

It'll always be false

#

Since it didn't pass the first if block

#

For this u should check if pre isn't undefined first

#

Yes

#

if (pre) user = pre.user

#

But since you want it to choose the author by default, you can also do user = pre?.user ?? message.author

#

It will check if pre exists. If it does, it'll pick pre.user, otherwise it'll default to message.author

#

check if user exists first

#

How did you define user?

#

So user can be undefined here

#

Because pre can be undefined

#

So user won't be set

#

U need to handle that

#

If pre doesn't exist, set user to message.author

#

Yes that works

#

U don't need to check !pre

#

If it hits else then pre definitely doesn't exist

#

That's how if else works

#

Even though you gave it an ID?

#

That's username

#

Instead of .get() u need to use .find()

#

Yeah

#

Do u want to support IDs too?

#

If not then u can just change it

round turret
#

guys

#

i need help

#

fast

#

pls

#

anyome

#

yea

#

so

pale vessel
#

U don't need to change that, only pre\

round turret
#

I have added my bot on top.gg, but it still didnt get added.;(

pale vessel
#

Something like let pre = message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(member => member.user.username === args[0])

#

U can shorten that too const pre = message.guild.members.cache.find(member => member.id === args[0] || member.user.username === args[0])

#

Noice

#

Wanna see how u can shorten the whole code to one line?

#

Ah

#
const user = message.mentions.users.first() ?? message.client.users.cache.find(user => user.id === args[0] || user.username === args[0]) ?? message.author;
earnest phoenix
#

@quartz kindle how do i stop the clip
nothing is being drawn outside of the user avatar

pale vessel
#

ctx.restore()

earnest phoenix
#

ty

pale vessel
#

U need to save it first before clipping

#

ctx.save()

earnest phoenix
#

ok

earnest phoenix
pale vessel
#

That looks like a python code...

earnest phoenix
#

thats not...

#

there u go

#

its js now

#

it was js before but since u couldnt understand

#

i had to remove the start= and end=

pale vessel
#

Yes that works, but it's unorganized and you'd have to do it over and over

wheat mesa
#

Command handlers!

earnest phoenix
pale vessel
#

Also works

earnest phoenix
#

yay

quartz kindle
#

what are you trying to do?

earnest phoenix
#

lemme use it

#

im tryna get the

quartz kindle
#

remove the command name or remove everything else?

pale vessel
#

Please don't

earnest phoenix
#

message content

pale vessel
earnest phoenix
quartz kindle
#

if you know the length of the command name, then .slice(length here)

#

if you dont, then .split(" ").slice(1).join(" ") i guess

pale vessel
#

It just seems like a waste if they had to do that with every command

round turret
#

@atomic skiff

earnest phoenix
stray seal
#

I don't know how to ask for help here.
I made a new Ticket Bot for my friend, and my code had errors. I fixed them all, and the bot is on now. When you do -close , the bot is supposed to CLOSE the ticket, and send a transcript. The transcript is sending, like it is supposed to, but it is not closing. The bot is sending in chat "An error occurred, please try again!". Can someone help me fix this?

quartz kindle
stiff lynx
#

I cant activate slash commands also if I code them, how can I reset the bot permissions and add also slash commands?

quartz kindle
#

your bots invite link needs to have the applications.commands scope

#

and you have to invite it again if it was invited without it

stiff lynx
#

I have to kick it or only click the link and re-invite it?

stray seal
#

I don't know how to change.

rose warren
#

No need to kick

quartz kindle
lyric mountain
stray seal
#

I never have been asked to search one.

earnest phoenix
#

I took my own math test

ctx.fillText(user.name, 300 / 2 + (1024 - 300) / 2 + width / 2, padding * 3, 1024 - 300 - padding);
#

pls help, i can't center text

earnest phoenix
stray seal
cinder patio
earnest phoenix
#

ctx.textAlign means the text will be drawn from the center character (unlike css text-align which centers text based on container width)

eternal osprey
#

does anyone know how i can create a sort of "spinning wheel"

eternal osprey
#

inside of discord? I was thinking about constantly editing the sent message with new items, while saving the previous content too.

cinder patio
#

Okay well instead of the width and height of the canvas use the width and height of the box

#

@earnest phoenix

earnest phoenix
#

🙏 use a gif pls

eternal osprey
#

But i would love to get it randomized basically

#

so not the same video is playing over and over again

#

in my opinion this beats the purpose

earnest phoenix
#

constantly editing a message is api abuse

wheat mesa
#

Yeah

earnest phoenix
#

dank memer uses animated emojis

wheat mesa
#

You’ll hit ratelimits pretty quick

eternal osprey
wheat mesa
#

Still not a good idea

eternal osprey
#

ah nvm that would still hit the limit pretty quick

earnest phoenix
#

that's 10 edits in 1 second

eternal osprey
#

yeah i see

earnest phoenix
#

also edits don't display instantly

eternal osprey
#

I was planning to use timeouts of 2 seconds tho

#

but not a great plan i see

earnest phoenix
#

why not use a gif?

#

more control over the animation

eternal osprey
eternal osprey
#

The same static gif over and over again wouldn't be fun to see

earnest phoenix
#

broken bot from rate limits < repetition

stray seal
#

How do you upgrade npm on replit?

earnest phoenix
#

also who's stopping you from generating a new gif?

earnest phoenix
#

do you want to upgrade discordjs?

stray seal
#

nevermind

stiff lynx
eternal osprey
#

is there a way to send an image as small attachhment?

#

That it becomes the size of a normal emoji

lyric mountain
#

there u normally select "bot" scope, just select also "application.interactions" from now onwards

#

if u re-authorize it'll apply the remaining scopes

pale vessel
earnest phoenix
#

@cinder patio

const { width } = ctx.measureText(user.name);
console.log("x:", 300 - (width * 48));
x:
-8580

the text renders off screen

#

did i replace the wrong parameters?

cinder patio
#

Text with that font size will never fit a box that's 300 px unless the text is very short or the text font makes the text smaller

stiff lynx
#

I dont remember why I need to calculate permissions, I've created my bot like 10 months ago

#

:/

cinder patio
#

That makes no sense

earnest phoenix
#

48px text

cinder patio
#

There's no way that box is 300pz

#

p

#

px

earnest phoenix
#

i said it's x position is 300...

quartz kindle
#

wtf is that *48 for?

cinder patio
#

font size

earnest phoenix
#

it's width is 1024 - 300 - 20

quartz kindle
#

why are you multiplying width with font size?

cinder patio
#

Then use that instead of 300

earnest phoenix
#

im drunk

earnest phoenix
cinder patio
#

Text length * font size

quartz kindle
#

that makes no sense

earnest phoenix
#

user.name.length or ctx.measureText(user.name).width?

rose warren
cinder patio
#

I dunno what the second one does

#

so use length

earnest phoenix
quartz kindle
#

measureText measures the actual pixel width of the text

rose warren
#

Font size is the size of the Y axis of the font. Why would you do that for justifying on the X axis?

cinder patio
#

then use that

#

and don't multiply by font size

quartz kindle
#

you want the text centered inside the white box right?

#

then do this

earnest phoenix
#

tim is a js god moment incoming

rose warren
#

||Tbh a quick search on stackoverflow like Tim is doing right now would have been enough||

quartz kindle
#

lmao

#

im not looking at it

rose warren
earnest phoenix
rose warren
#

||That's debatable||

quartz kindle
#

first find the white box's center point:
box start + (box width / 2)

#

then do box center point - (text width / 2)

earnest phoenix
#

no need to worry about the y axis cuz it's constant

quartz kindle
#

yes

quartz kindle
earnest phoenix
#

well the centering didn't work

#

im gonna give you up leave it at left align

quartz kindle
#

how did it show up?

earnest phoenix
#

@quartz kindle

cinder patio
#

Did you try my solution 🥺

quartz kindle
#

what width did you use?

#

show code

earnest phoenix
#

dont remember

#

because left align looks better

eternal osprey
#

how do i loop through this to search for a keywrod?

#
for (const key in de){
    if(de[key].A.toLowerCase() == maka){
z = de[key].B
    }```i would now want to check if it isn't and then throw an error. But yeah doesn't work.
cinder patio
#

Us de the array? Also jesus these variable / property names

boreal iron
#

for(const [id, val] of array)
{
if(val.A.toLowerCase() === whatever) …
}

cinder patio
#

it's just const val of array

boreal iron
#

It has keys?! Or is this just how his console output looks?

cinder patio
#

Those are the items in the array

#

oh yeah that's just how it's shown

boreal iron
#

lol

#

Can’t be more confusing

stray seal
#

How do i upgrade my Version on npm?

#

on Replit

#

the Console code...

#

@solemn latch lol

#

BWHAHAHA

#

Who is dumb enough to believe that?

spark flint
#

the domains are getting worse

#

istg

stray seal
#

lol

solemn latch
spark flint
solemn latch
#

cloudns?

spark flint
#

their nameserver provider

solemn latch
#

must have already happened, or this is a different person

#

using netbreeze

#

tbh, didnt know nameservers took reports about domains

spark flint
#

its priority if they can confirm many people are facing the same issue

solemn latch
#

even then, they will just move name servers as there are hundreds for free online, and keep the domain

#

I think going for the registrar is better

spark flint
solemn latch
#

ah true

spark flint
solemn latch
#

registrars for .com domains cant do that

spark flint
#

can the people who ddos top.gg just ddos the scammers already

solemn latch
#

if they do, then report it to icann

spark flint
solemn latch
#

icann will remove their registrar perms

#

ah, lately we have been getting a ton of .coms tbh

spark flint
#

and they are looking into blocking domain registrations with the word "discord" in them as its also copyright issues with discord

solemn latch
#

yeah that ones gone now

spark flint
#

they are all registered with nic.ru

solemn latch
#

yeah, nic.ru removed it within 48 hours of being reported the last few times

#

or at least after i reported it.

spark flint
#

yup

#

they just need to block the account from purchasing the domains

solemn latch
#

they got back with me about it within 8 hours. and said they took action against it.
I think dns keeps it up for awhile even after being taken down 😔

boreal iron
#

Scam will never stop as long as people will fail to detect the scam

spark flint
#

thats why i also go for their nameserver companies

#

they pretty much always go for either cloudns or 1cloud.ru

solemn latch
#

this time netbreeze

#

i dont speak russian 😔 '

spark flint
#

me neither

#

google translate built in helps

spark flint
#

because they forgot to get whois privacy

#

@solemn latch

#

oh

solemn latch
#

thanks for the example

#

kek

spark flint
#

yep found it

#

their name, email and number was provided on the whois

solemn latch
#

Potentially not real though

spark flint
#

unless you get privacy

stray seal
#

My bot is unmuting, but not removing the role so people are still muted.

bright thorn
#

ephemeral: true
is not working

#

for me

stray seal
#

Can someone help me?

bright thorn
#
      if (guild.me.voice.channel && !guild.me.voice.channel.equals(member.voice.channel)) {
        return interaction.followUp({ embeds: [new MessageEmbed()
        .setColor(ee.embed_color)
        .setDescription(`:x: You must be in the same voice channel as me to use this command!`)
        ], ephemeral: true });
      }
boreal iron
stray seal
#

lol

stray seal
boreal iron
#

The followUp message can't be ephemeral as only the bot would be able to see it.

#

As the bot's basically "replies" to it's previous message.

bright thorn
#

oh

#

thx

boreal iron
#

The initial message you send to the user can be ephemeral.

#

You can also defer the interaction and use editReply()

#

This method allows to send the message as ephemeral message.

stray seal
bright thorn
# boreal iron The initial message you send to the user can be ephemeral.

any example for this

      if (guild.me.voice.channel && !guild.me.voice.channel.equals(member.voice.channel)) {
        return interaction.followUp({ embeds: [new MessageEmbed()
        .setColor(ee.embed_color)
        .setDescription(`:x: You must be in the same voice channel as me to use this command!`)
        ], ephemeral: true });
      }
#

if you can

boreal iron
#

Why do you send a followUp message in the first place? Does the interaction took more than 3s?

#

If so just defer the reply.

await interaction.deferReply();
// code
return interaction.editReply({ embeds: [embed], ephemeral: true });
tardy hornet
#
 arrayOfItems.forEach(item => {
                if(db.fetch(item.setOnCmd)) {
                  var itemdb = `${db.fetch(item.setOnCmd)}`
                 var ifhaveornot = `(\`x${(itemdb).toLocaleString()}\`)`;
                 
                  if(ifhaveornot === true) {ifhaveornot = `(\`x1\`)`}
                   else {ifhaveornot = `(\`x${(itemdb).toLocaleString()}\`)`}
                  
                    stringInventory += `${item.itemName}: ${ifhaveornot}`;

                  } else {
                    var ifhaveornot2 = `(\`x0\`)`;
                  stringInventory += `${item.itemName}: ${ifhaveornot2}`;

                  }
                })

the result:

#

how can i make that if its true it will simply show 1

spark flint
#

how do i get a servers ip using a domain with flask?

#

I'm adding a domain name checker on my api to make sure domains aren't using the known scamming ips

boreal iron
tardy hornet
stray seal
#

CAN SOMEONE HELP ME

#

:c

slow ibex
#

Chill :c

boreal iron
#

my god... follow the chat, please

quartz kindle
boreal iron
#

Told him already, but the response is ... yeah

stray seal
#

Can someone help me.

quartz kindle
#

well, idk whats causing it not to remove the roles

#

but

#

your try caches are mostly useless

#

you're not gonna catch anything like that

stray seal
#

???

#

Your confusing me lol

quartz kindle
#
        try {
        mutee.roles.remove(muterole.id).then(() => {
            mutee.send(`**Hello, You Have Been Unmuted In ${message.guild.name} for ${reason || "No Reason"}**`).catch(() => null)
            let roleadds = rolefetched
            if (!roleadds) return;
            mutee.roles.add(roleadds)
        })
        } catch {
            let roleadds2 = rolefetched
            if (!roleadds2) return;
            mutee.roles.add(roleadds2)                            
          }
``` this try catch will never catch anything
stray seal
#

What do i do then?

quartz kindle
#

try catch only works with sync code or awaited promises

#

it does not catch non-awaited promises

split hazel
#

what if a promise fails inside of a then function

quartz kindle
#

it wont be caught either

split hazel
#

understandable have a great day

quartz kindle
#

lmao

split hazel
#

will it just throw a unhandled rejection or

quartz kindle
#

ye

earnest phoenix
#

guys does anyone knows how to set invite command like $invite and the bot sends the invite link?

quartz kindle
#

literally just make it respond with the link?

earnest phoenix
#

should i make new file

#

in repl

quartz kindle
#

message.channel.send("link here")

earnest phoenix
#

i am a new bot dev

#

i dont know much

quartz kindle
#

literally the same as any other command you made

earnest phoenix
# stray seal Can someone help me.
let role = message.guild.roles.cache.find(role => role.name === "Muted");
member.roles.remove(role.id).catch(err => {
return message.channel.send("Something went wrong! " + err)
});
return message.channel.send("User Sucsesfully Unmuted!")
split hazel
#

by the way that'll log both user successfully unmuted and something went wrong if something goes wrong

quartz kindle
earnest phoenix
#

Then change it to muted

#

i don't remember so some help would be good, how was it to do this thing? like if the if matches with one of the array contents, it'll show but if no then no (if you didn't understand me then see)

let cardss = ["Archers","Barbarians","Goblins","Minions","Knight","Arrows","Spear Goblins", "Bomber","Skeleton Dragons","Fire Spirit","Skeletons","Elite Barbarians","Rascals","Firecracker","Zap","Mortar","Tesla","Royal Delivery","Giant Snowball","Cannon","Bats","Ice Spirit","Skeleton Barrel","Electro Spirit","Minion Horde","Goblin Gang", "Musketeer","Three Musketeer","Giant","Wizard","Battle Ram","Valkyrie","Mega Minion", "Mini P.E.K.K.A","P.E.K.K.A", "Electro Giant","Golem", "Royal Recruits", "Lava Hound", "Mega Knight", "Royal Giant"]
 
· I have a array here

else if(args[0].toLocaleLowerCase() === )

· and i want it to match with the args[0] if it doesn't match then it'll not respond, it's the following thing?'

else if(args[0].toLocaleLowerCase() === cardss)
earnest phoenix
stray seal
#

Where do i add this?

earnest phoenix
#

It will show your error

quartz kindle
# earnest phoenix bruh

i have no idea what your existing code looks like, if i give you something to copy and paste, 99% chance it wont work

earnest phoenix
#

hmm

#

ok

quartz kindle
earnest phoenix
#

ok

quartz kindle
#

so you have to transform both

#

cardss.find(card => card.toLowerCase() === args[0].toLowerCase())

earnest phoenix
#

LocalLowercase

quartz kindle
#

doesnt matter

earnest phoenix
#

k

#

how do i get the mentioned users id in message.mentions

quartz kindle
#

message.mentions.users.first().id

earnest phoenix
quartz kindle
#

message.mentions.users.map(user => user.id)

quartz kindle
earnest phoenix
#

bet bet

#

i'll just remove LocaleLowerCase

#

works without the lowercase

lament stump
#

i want this avatar to be round using canvas. How would I apply the arc() function to it?

const avatar = await loadImage(interaction.user.displayAvatarURL({ format: 'png' }))
ctx.drawImage(avatar, 65, 60, 120, 120)
earnest phoenix
#

:)

ancient nova
#

why doesn't this work?

                    const guild = await client.guilds.fetch(GuildID);
                    guild.name = `${guildname}`;
quartz kindle
#

why do you want to replace a guild name?

earnest phoenix
ancient nova
#

and then I do guild = "name"?

ancient nova
quartz kindle
#

what are you trying to do?

ancient nova
#

a command that changes name of the guild

quartz kindle
#

you cant change the name of a guild like that

ancient nova
#

how come?

quartz kindle
#

because that would just change the name of the guild object in the cache

ancient nova
#

.setIcon works though