#development

1 messages · Page 1733 of 1

earnest phoenix
#

It creates automatically?

dusky sundial
#

Yes, but the port you specify needs to be open on your network for it to work

earnest phoenix
#

right?

#

Then

#

the Webserver will make a webhook

dusky sundial
#

the url would be http://<your public ip>:5000/dblwebhook

earnest phoenix
#

Hm

#

Webhook Url

#

?

dusky sundial
#

Yes

earnest phoenix
#

Oh

#

lemme check

distant ledge
#

Tyy sm

earnest phoenix
#

@dusky sundial it didn't work

dusky sundial
#

Again, is port 8080 open?

#

And please tell me you put your IP, and not actually 0.0.0.0

earnest phoenix
#

IP? you mean this?

#

the 172.18.0.1 Thing

dusky sundial
#

No, your public IP address

earnest phoenix
#

Hm

dusky sundial
#

Or the public IP of whatever you're hosting it on

earnest phoenix
#

i was hosting it on repl

lavish minnow
#

@earnest phoenix u need the keep_alive code?

#

I host on repl also

earnest phoenix
#

i am confused at vote webhooks

lavish minnow
#

Ah

earnest phoenix
#

@lavish minnow u know anything about it?

lavish minnow
#

No

earnest phoenix
#

kk

lavish minnow
#

Holy crap this server keeps crashing

earnest phoenix
#

@dusky sundial you here?

tacit sequoia
#

http://REPLPROJECTNAME.YOURREPLUSERNAME.repl.co

cosmic forum
#

Anyone know how to get an svg data uri for nodejs canvas? I know how to do it for a png output but not for an svg output.

lyric mountain
#

Pretty sure canvas can't export a pixel image as a vector image

#

Remember svg MUST be composed of coordinates and curves

dense forge
#

How do I make an .env file on node.js? I'm on the Secrets already (i'm not a coder sorry)

earnest phoenix
dense forge
#

Thanks I already changed my bot's status

ancient vault
#

hey, so I wanna make a bot for my friend, but I dont wanna code it, is there a way to make a bot without coding other than botghost.com and botdesigner?

earnest phoenix
#

@ancient vault I mean if you really want to, you can use botghost or discord bot maker

#

But learning isnt hard

#

and its a useful skillset

ancient vault
#

discord bot maker?

earnest phoenix
#

I dont know much about it

#

youll have to google it

#

i know a lot of people use it though

earnest phoenix
#

I prefer coding one

earnest phoenix
clear marlin
#

Coding lets you customize

sacred juniper
#

How can ı destroy that

umbral zealot
#

¯_(ツ)_/¯

#

that's not really a development question

sacred juniper
#

¯\_(ツ)_/¯

vivid fulcrum
#

destroy

#

lmfao

lavish bramble
#

How can I use try in execute method

#
const {inspect} = require("utils")

module.exports = {
	name: "eval",
	async execute (client, message, args){
		if(message.author.id !== "769077060944658452") return 
		const code = args.join(" ")
		if(!code) return message.channel.send("please specify your code!")
		
		const result = await eval(code)
		let output = result
		if(typeof result !== "string"){
			output = inspect(result)
		}
		message.channel.send(output, { code: "js" }).catch((e) => {
		message.channel.send("Evaluated content is too long to send!")
	})
		
}
}

My eval command is not working
Error :- inspect is not a function

cedar smelt
#

how to setup a bot for logs Sx4 bot

clear marlin
summer torrent
#

node.js' built-in package

lavish bramble
#

How can I use any command using eval

umbral zealot
#

eval just literally runs any javascript you give it

#

in the context of whatever is running eval

#

so... how do you normally use any command in your code?

clear marlin
#

inspect converts your object into a string

#

like that's what you are tryin to do

lavish bramble
#

Trying to use mod commands in my friend server without roles for testing eval

umbral zealot
#

eval doesn't... uhm... bypass stuff

lavish bramble
umbral zealot
#

it's not a hacking tool

#

smh

lavish bramble
#

Oki

#

SMH = ?

clear marlin
#

unless you wanna hack your bot

umbral zealot
#

"shaking my head"

lavish bramble
#

Ok sir

umbral zealot
#

eval doesn't bypass anything that you bot can't already do on Dicsord basically

earnest phoenix
#

Can anyone will tell me I have submitted my bot on topbot.gg so when will I receive the message from them?

umbral zealot
earnest phoenix
#

?

lavish bramble
#

1 more question
When I use $eval message.channel.send("hlo")
It sends me error :- DiscordAPIError: Invalid Form Body content: Must be 2000 or fewer in length.

#

But its send hlo

umbral zealot
#

because it's trying to actually send the response of the eval to discord

#

and the response to message.channel.send is a message object

#

which has a lot more than 2000 characters

lavish bramble
#

But hlo

umbral zealot
#

no

#

nono

#

the RESPONSE... the... return value

#

when you send a message

lavish bramble
#

Oo

clear marlin
#

JSON RESPONSE

umbral zealot
#

if you did const res = await message.channel.send('hlo') and outputted res it would be a large object made of the message and all its propeties

#

including functions, the client, author, member props, etc etc etc

lavish bramble
#

Ok sir

clear marlin
#

sir

umbral zealot
#

No problem, madam

eternal osprey
#

hey

#

how do i fetch a custom discord emoji?

clear marlin
#

to fetch a custom emoji

cinder patio
#

<Client>.emojis.fetch(id)

clear marlin
#
const emoji = <client>.emojis.cache.get("emoji_id")```
clear marlin
#

discord v12

cinder patio
#

cache is a collection

clear marlin
#

it is

cinder patio
#

That doesn't fetch the emoji

#

that gets it from the cache

fallow haven
#

could i ask about customising css in topgg page in this channel?

cinder patio
#

they want to fetch it

clear marlin
#

but the cache

#

contains all the emojis from a guild

#

the bot is in

cinder patio
#

right

cinder patio
#

forgot discord.js caches absolutely everything

clear marlin
#

lol

fallow haven
cinder patio
#

If you still want to fetch an emoji by it's id, for example when you don't have access to the client object, you'll have to make a http request yourself

#

cause discord.js sucks

clear marlin
fallow haven
#

ah

clear marlin
#

to see what you can customize

fallow haven
#

is there any resources on it?

clear marlin
#

I have no idea about them

fallow haven
#

i tbh dont have much time doing on this, but i wanna make it fancy lmao

#

ah alr

cinder patio
#

Inspect element is all you need to get the class names

clear marlin
#

yea

eternal osprey
#
const emoji = client.emojis.cache.get("839077814874931210")
setTimeout(() => {
 let rfix = await channel1.send('**Use +rep @user to commend other players!**' + "<@&"+`${vip.id}`+">")
await rfix.react(emoji)
 }, 60000);
    client.on('messageReactionAdd', (reaction, user) => {
      if (reaction.emoji.name === "\u2620") {
        channel1.send(`${user} is ready!`)
      }
    })
```hey, does this require an async function as it is inside the settimeout?
cinder patio
#

you need to make the function inside the setTimeout async

#

so ye

lavish bramble
#
    const Owner = await message.guild.members.fetch(message.guild.ownerID)

I want this in tag but its mentioning that person

#

Like ᵈʳᵉᵃᵐ乡𝓟𝓻𝓲𝓷𝓬𝓮★᭄ꦿ᭄☆#1646

eternal osprey
#

setTimeout(async()=> {isn't this how you make a settimeout async?

cinder patio
#

yeah

eternal osprey
#

alrighty, much love!

lavish bramble
clear marlin
#
  const Owner = await message.guild.members.fetch(message.guild.ownerID).tag
#

or .username

#

for username

cinder patio
#

that won't work, you need to wrap the await in parentheses

#

(await ...).tag

lavish bramble
#

Its showing undefined

umbral zealot
#

members don't have usernames or tags, guys

lavish bramble
#

Owner?

clear marlin
#

users???????

umbral zealot
#

members aren't users

eternal osprey
#

hey, i want to use a custom emoji in my message, can i just do: :emoji-name:

umbral zealot
#

so why not just fetch the user directly

umbral zealot
#

await client.users.fetch(message.guild.ownerID)

lavish bramble
umbral zealot
#

no I mean fetch the user directly if you want their username or tag

eternal osprey
umbral zealot
#

OR, get the .user property from the member

earnest phoenix
#

.user

clear marlin
cedar crow
clear marlin
#

that's what it is

#

I think

eternal osprey
lavish bramble
clear marlin
#

somethin like this

earnest phoenix
#

It's the other way around no?

lavish bramble
#

![ytho](https://cdn.discordapp.com/emojis/588492551577796615.webp?size=128 "ytho")

#

Like this

clear marlin
#

its the other way around

#

nvm

#

I'ma go to sleep

lavish bramble
#

Bye

clear marlin
#

no

eternal osprey
#

okay i am confused as hell

lavish bramble
lavish bramble
clear marlin
#

that's it

#

that's 100% correct

lavish bramble
eternal osprey
cinder patio
#

There's no : at the end of the ID

tacit sequoia
#

Lmao

clear marlin
#

I must go to sleep

#

my mind's giving up

lavish bramble
eternal osprey
#

wha

#

wait what is it now/

clear marlin
#

its <:emoji_name:emoji_id>

#

now go do coding

#

break a bot and then tell me you broke it

hot star
#

in free plan i get 550-1000 hrs

#

if i buy hobby will i get unlimited hrs or same 550-1000 hrs limit

#

can't seem to find this on google

dense forge
#

How do I make a support website for my bot?

zenith terrace
#

by learning html/css

eternal osprey
#

i tried using the things you guys said

#

it didn't work

zenith terrace
#

what

eternal osprey
zenith terrace
#

is the emoji located in the server you are using?

clear marlin
#

⬆️

eternal osprey
#

yup

clear marlin
#

it should work then

eternal osprey
#

it doesn't tho

zenith terrace
#

well idk then cause works fine for my bot

clear marlin
#

ok wait

#

is it a animated emoji?

eternal osprey
#

it is

clear marlin
#

use <a:emoji_name:emoji_id>

#

for animated emojis

eternal osprey
#

aha right!

zenith terrace
#

@eternal osprey how did you get the emoji name and ID, did you do

\ :emoji_name:

#

(no space)

eternal osprey
#

yeah i see

#

i don't have nitro tho

#

so i had to quick capture it

eternal osprey
zenith terrace
#

sharex

eternal osprey
#

alright thanks

zenith terrace
eternal osprey
#

yup!

zenith terrace
#

alright

eternal osprey
#

hey i tried actually to verify my domain as it wasn't showing up on google

#

and i had to use a dns or something that they provided

#

however, i have no clue where to use that

#

nvm i am stupid and ugly

#

sorry

near stratus
#

add text

#

fill it out with the code / text they give

eternal osprey
near stratus
median moss
#

does anyone here knows html? I have a question regarding it

near stratus
#

The text that starts with google-site-verification

near stratus
#

just ask

median moss
#

I'm trying to make a button but it's not working

#
   <link rel="stylesheet" href="//brick.a.ssl.fastly.net/Roboto:400"/>
    <div class="button">
  <p>Invite Me!</p>
<script type="text/javascript">
    document.getElementById("button").onclick = function () {
        location.href = "https://discord.com/oauth2/authorize?client_id=773308821518680084&scope=bot&permissions=8";
    };
</script>```
#

it also has color configs, which are working properly

eternal osprey
near stratus
median moss
#

lmao

#

🤦‍♂️

#

didn't saw that

#

thx

near stratus
#
   <link rel="stylesheet" href="//brick.a.ssl.fastly.net/Roboto:400"/>
    <div class="button">
  <p>Invite Me!</p>
    </div>
<script type="text/javascript">
    document.getElementById("button").onclick = function () {
        location.href = "https://discord.com/oauth2/authorize?client_id=773308821518680084&scope=bot&permissions=8";
    };
</script>
median moss
#

thx

near stratus
#

^°^

median moss
#

well, the button is not working yet

#

😔

vivid fulcrum
#

the url contains the emoji id

#

you can also view it through inspect element

near stratus
#

that's even harder

vivid fulcrum
#

how come

#

it's two clicks

eternal osprey
#

okay so i verified my website on google

#

but now i can't access my website

#

it's like not existing anymore

eternal osprey
near stratus
vivid fulcrum
#

🙄

distant bramble
#

hmmm

eternal osprey
#

okay i really need some help here

near stratus
#

When you can

Get to the Emoji >
Click >
Add a slash >
Copy
vivid fulcrum
#

literally open the emoji window
do ctrl+shift+i
click on the element target tool
click on your emoji
and there you go

eternal osprey
#

i verified my website but it simply just doesn't exist anymore

vivid fulcrum
#

you have access to the emoji url

near stratus
#

and name

#

then write it again

vivid fulcrum
#

oh my god stfu

eternal osprey
#

ERR_NAME_NOT_RESOLVED

tacit sequoia
eternal osprey
#

idk what happened i verified by adding a DNS record

vivid fulcrum
#

the url method is for people without nitro

tacit sequoia
#

Unless you created an issue in Cloud Flare

eternal osprey
#

and poof, this happened

near stratus
median moss
#

@near stratus the button is not working yet

eternal osprey
near stratus
#

@eternal osprey Does it look like this ?

eternal osprey
#

removing the dns record

near stratus
#

ignore the www

eternal osprey
#

wait let me ss real quick

near stratus
median moss
#

oh

near stratus
#
   <link rel="stylesheet" href="/link" />
    <div id="button">
        <p>Invite Me!</p>
    </div>
<script type="text/javascript">
    document.getElementById("button").onclick = function () {
        location.href = "https://discord.com/oauth2/authorize?client_id=773308821518680084&scope=bot&permissions=8";
    };
</script>
median moss
#

ok

#

thx

eternal osprey
median moss
#

@near stratus it worked, but now what should I do with the button color configs and stuff?

eternal osprey
#

my page got verified

#

that is what google shows me

eternal osprey
#

but after it got verified, it disappeared from the web

median moss
#
.button {
  background-color: #1eb346; /* Green */
  border: none;
  color: white;
  padding: 1px 12px;
  text-align: center;
  text-decoration: underline double green;
  display: inline-block;
  font-size: 14px;
}```
near stratus
eternal osprey
median moss
eternal osprey
#

what host do you mean

near stratus
eternal osprey
#

on my vps

near stratus
eternal osprey
#

yeah nginx

near stratus
#

I couldn't find any solution with the data you gave me (I tried with nginx and it is working I guess)

eternal osprey
#

ah fuck, alright thanks for trying.

near stratus
#

Did you configure CSR certificate and CNAME ?

#

correctly ?

eternal osprey
#

yeah

#

i guess it is because i am actually port forwarding my ip of my vps to the domain name

#

and i changed the dns record, so maybe that is the issue?

#

yeah it removed my ip

near stratus
#

Are you even using cloudflare ?

#

Cuz I used RSA keys

median moss
#
    <style>
body {
  background-color: green;
  background-repeat: no-repeat;
}
</style>```
#

no-repeat doesn't work for colors?

old cliff
#

Colors dont repeat

median moss
old cliff
#

Then apply it to that "specific place"

#

Not the whole body

#

Like set background color property of a div to that color

median moss
#

thx

eternal osprey
#

alright i just switched domains and am just using the one that came with my galaxygate vps

#

however, the strange thing is that i want to verify using the html-file

#

but where do i have to put it

tired panther
#

How can I have instead of ➕ this, this \➕ in my embeds?
I tried \ and \emoji\

eternal osprey
#

this is all that i have got

tired panther
vivid fulcrum
#

can you show your code

lyric mountain
#

oh nvm

tired panther
lyric mountain
#

use \\

vivid fulcrum
#

you're escaping the character inside of your code

#

yeah

tired panther
feral aspen
#

Hi.

#

Is there a faster way to do this code?

tired panther
# feral aspen Hi.

maybe the inventory property will get a object,which is defined in a variable on the upgrade thingy...

feral aspen
#

No example.

lyric mountain
#

there is

feral aspen
#

I have two randoms, a and b. Suppose a and b was true, and I want to make two properties for them. but sometimes one of them is true, so idk how the code would be.

#

I did the code above in the link, but got lost.

lyric mountain
vivid fulcrum
#

it's already fast enough, you can refactor it a bit though

create the inventory object and the fill it based on conditions

cinder patio
# feral aspen https://srcb.in/wCblTpw0SL

I'd do sometthing like this:

const inventory = {};
if (...) inventory["..."] = ...;
// More if checks...
const newInventory = new Inventory({userId: ..., inventory);
lyric mountain
#

extract both the object creation and the saving part

lyric mountain
#

then just modify the obj property based on whether the conditions are true

#

you could also use ternaries to remove all those ifs

feral aspen
#

Those? a ? b : c

lyric mountain
#

ye

feral aspen
#

Like I add the properties depending if the value is true?

feral aspen
#
const newInventory = new Inventory({
    userID: message.author.id,
    inventory: {
        ['upgrades']: (upgrade >= 1 && upgrade <= 5) ? 1 : 0,
        ['mysterybox']: received === true ? 1 : 0
    },
});

await newInventory.save().catch(err => console.log(err));
#

Does that work?

cosmic forum
#

anyone know how to turn an svg buffer into an svg data uri using nodejs?

lyric mountain
#
const newInventory = new Inventory({
  userID: message.author.id,
  inventory: {
    ['upgrades']: received ? 1 : 0,
    ['mysterybox']: upgrade >= 1 && upgrade <= 5 ? 1 : 0
  }
})

await newInventory.save().catch(err => console.log(err));
feral aspen
#

Yup! 🎉

cinder patio
#

Also ['upgrades'] => updates

#

same with mysterybox

#

you're trying to have arrays as keys

lyric mountain
pale vessel
#

it will still work though

cinder patio
#

but it's pointless

pale vessel
#

though you should only use it for variables

feral aspen
#

Do I remove the bracket notation?

cinder patio
#

yes

feral aspen
#

Alright.

#

Thank you!

eternal osprey
#

why does this directly send the embed2 into the normal channel and it doesn't await the channel creation and then sending it there

if (reaction.emoji.name === ":tickets:" && message.author.id == user.id) {
        const channel1 = await message.guild.channels.create(`${message.author.tag}-ticket`, {
     
            type: 'text',
            permissionOverwrites: [
              {
                id: message.author.id,
                allow: ['VIEW_CHANNEL']
              }, {
                id: message.guild.id, 
                deny: ['VIEW_CHANNEL']
              }
            ]
          });
         await channel1.send(embed2)
        }
        })```
cobalt mauve
#

What should I do

eternal osprey
cobalt mauve
#

There is a problem in module ig

eternal osprey
earnest phoenix
tacit sequoia
#

Read the error

eternal osprey
#

even if i don't respond

#

let me show you a ss

#

i didn't even respond to it (the reaction emoji)

earnest phoenix
# cobalt mauve What should I do

TypeError: Cannot read property 'bar' of undefined
The variable you're trying to access the property bar of is undefined, not bar itself! | foo.bar - foo's value is undefined.
The stack trace points exactly to the line the error occurs on.
For more information: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Cant_access_property

cobalt mauve
#

Ty guys

wind mural
#

I wonder how long approval takes

earnest phoenix
earnest phoenix
# eternal osprey

So it sends that second embed without you clicking on the reaction? I don't get what you're trying to say

wind mural
#

read it

eternal osprey
#

i just use !ticket

#

it sends me one embed to create the ticket channel.

#

and i want the embed2 to be sent within that ticket channel

#

however, it now just sends it to my main channel

zenith terrace
#

you are telling the bot to send the embed into the channel you run the command in, not the channel where the ticket was created

#

or wait

#

one moemnt

#

hhhhh nvm

#

ignore me

earnest phoenix
eternal osprey
#

hey no my bad actually, i forgot one specific line. I had to delete it

#

message.channel.send(embed2).then(m => m.react(`:wastebasket:`));

#

oopsuie

#

sorry guys

earnest phoenix
#

hmmrun bruh

zenith terrace
#

@earnest phoenix

earnest phoenix
#

@zenith terrace

eternal osprey
#

is there any way to define this channel1 so that it is also usable in the second if statement?

#
client.on('messageReactionAdd', async (reaction, user) => {
    if (reaction.emoji.name === "🎟️" && message.author.id == user.id) {
        const channel1 = await message.guild.channels.create(`${message.author.tag}-ticket`, {
     
            type: 'text',
            permissionOverwrites: [
              {
                id: message.author.id,
                allow: ['VIEW_CHANNEL']
              }, {
                id: message.guild.id, 
                deny: ['VIEW_CHANNEL']
              }
            ]
          });
          channel1.send(embed2).then(m => m.react(`🗑️`));
       
        }
        
            if (reaction.emoji.name === "🗑️" && message.author.id == user.id) {
                channel1.send(userEmbed)
                .setTimeout(() => {
                    channel1.delete()
                    logsChannel.send(staffEmbed)
                }, 15000);
              }
            
            })
        
}```
earnest phoenix
#

Scopes @eternal osprey

#
const variable = ...;

if (...) { ... }

if (...) { ... }```
#

Or

let variable;

if (...) {
  variable = ...;
  ...
}

if (...) { ... }```
eternal osprey
#

yeah alright i got it fixed

#

thanks

#

i've a quick question

#

my website got verified on google console

#

and i tried to find it on google serach, but it doesn't pop up.

wind mural
#

finally made some new changes to my bot

#

it now has a feature called levels

#

yay!

eternal osprey
#

good job!

wind mural
#

thanks

brittle hamlet
#

I made a chatbot and I want it to mention the users while it replies like cathy does can someone help me
Programming language = javascript
Api used = snowflake api
Thanks for helping

feral kernel
#

Great

brittle hamlet
earnest phoenix
#

Or just mention them with <Message>.channel.send(), e.g.

<Message>.channel.send(`${<Message>.author} Hello!`);```
brittle hamlet
#

Ooh thanks

ember wraith
#

Hello guys?, i want ask about bot developing

#

Are this is the place

umbral zealot
#

As the topic says:

Channel for chatting about development.

lyric mountain
#

oh they removed "(bot)" from the topic

opal plank
#

probably mostly me tim million and a couple others abusing chat with purposefully shit code. That probably makes up 20% of the chat

umbral zealot
#

weird flex but ok

opal plank
earnest phoenix
lyric mountain
#

I digress

sudden geyser
#

They're trying to hide secrets from you

velvet spade
rocky hearth
#

In ts I've this project setup. how do I make the compiler to know that the subfolders are not related, and should treat them as individual folders?

#

right now the ts files are complaining for defining function of same name in individual sub-folders. (This is web-based project)

earnest phoenix
#

how mention user in js

#

cn any say

#

like this

quartz kindle
#

<@userid>

crimson vapor
#

doesn't discordjs user class stringify to <@userid>

earnest phoenix
#

onlu this in js

#

na

cinder patio
# rocky hearth

If the two folders are completely separate projects then you should have two different tsconfig files for each

opal plank
crimson vapor
#

hi Airwin

opal plank
#

hi thousand

rocky hearth
#

hmm, do I've to install ts in each sub-folder?

cinder patio
#

o

earnest phoenix
#

i need an help pls

cinder patio
#

no*

earnest phoenix
#

say na

opal plank
#

you should actually install ts globally tbh

cinder patio
#

you can use ts-loader to compile the two folders separately

earnest phoenix
#

Why discord adding stage channels spongery

opal plank
#

so you dont have to install it as a dep every time

opal plank
earnest phoenix
#

any one pls help

opal plank
opal plank
earnest phoenix
opal plank
#

it does work

earnest phoenix
opal plank
#

thats what we all use

brittle hamlet
#

Is it possible to mention the user in code blocks ?

crimson vapor
#

no

opal plank
#

it is not

brittle hamlet
#

Ok

earnest phoenix
#
.addField(song.title, true)
#

see where i want add

opal plank
#

yeah, and we told you

#

use string templates

rocky hearth
opal plank
#

1 sec

opal plank
#

read this

cinder patio
#

That field doesn't have a value

#

only a title

#

actually the value is true I guess

rocky hearth
cinder patio
#

but I don't think you want that

opal plank
#

`` > '' + ''

earnest phoenix
opal plank
#

change my mind

earnest phoenix
earnest phoenix
#

all done but mention

#

cnt

opal plank
#

im having a blast with staging channels

crimson vapor
#
const userMention = ("aaa " +  message.author).split(' ')[1]``` rate code erwin
opal plank
#

i'll eat your life

crimson vapor
#

that would work right?

opal plank
#

i feed on bad code

crimson vapor
earnest phoenix
quartz kindle
opal plank
#

wheres flaze? didnt he make a repo just for bad code?

crimson vapor
#

@pale vessel confirm?

opal plank
#

i think it was matthew actually

quartz kindle
#

he wont understand what inline is, so i omitted it

earnest phoenix
#

?

#

Nude_modules

earnest phoenix
crimson vapor
#
#MessageEmbed.addField('TITLE HERE', "TEXT HERE", !!`${INLINE}`)```
quartz kindle
#

lul

earnest phoenix
opal plank
earnest phoenix
opal plank
#

dont tell me you're on v11

vivid fulcrum
#

i wonder if people are going to rush to fork v11 and migrate the gateway to v9 once v7 dies

earnest phoenix
crimson vapor
#

what are you doing on v11

earnest phoenix
#

Didn't v11 break already

earnest phoenix
#

.addField(TITLE HERE, TEXT HERE)

earnest phoenix
#

😕

opal plank
#

bUt PoRTIng My COdE TaKES EffoRT

opal plank
crimson vapor
#

so does resetting your token when they introduce a breaking cchange

earnest phoenix
#

Obviously

opal plank
#

bruh

earnest phoenix
#

OMEGAlul v11 crashes upon encountering a stage channel

opal plank
#

update your code ffs

rocky hearth
#

Hey Tim, which has better performance,
Math.floor(55.5555) vs 55.5555 | 0 vs ~~(55.5555)

crimson vapor
#

@earnest phoenix MessageEmbed.add('NAME', 'VALUE')

pale vessel
vivid fulcrum
#

what's the point of coding if i can't just copypaste what someone else made!! 🤬

opal plank
#

it will only get worse from now on btw

opal plank
cinder patio
opal plank
#

👏 update👏 your👏 code

cinder patio
#

the first one calls a function

crimson vapor
#

math.floor probably calls num | 0 with some built in checks

earnest phoenix
cinder patio
#

but ye the difference is minimal

quartz kindle
#

functions are not slow

opal plank
earnest phoenix
#

😕

crimson vapor
#

its safer tho

earnest phoenix
#

The second one would be the fastest, but the difference is so little that you won't notice it

#

Any solution

crimson vapor
#

to what?

opal plank
#

suffering is one

earnest phoenix
opal plank
#

he doesnt want to update to v12

earnest phoenix
cinder patio
#

while an operator gets compiled to bytecode instantly

quartz kindle
#

functions get inlined

opal plank
crimson vapor
#

@earnest phoenix update your code. We can't tell you a good solution because no one here is still running a year old library

opal plank
#

you think staging channels are bad?

earnest phoenix
opal plank
#

wait till you get buttons, threads and a bunch of other shit

#

not bad as in a feature

#

bad as in breaking your code

#

you wont even be able to parse your message event anymore

#

fix your code, thats all i gotta say

#

update it to v12

earnest phoenix
#

I know stage channels good but pandasad

opal plank
#

not bad as in a feature

#

bad as in breaking your code

earnest phoenix
#

Why do people hesitate to update to newer versions, I don't get it

opal plank
#

cuz effort

earnest phoenix
#

Laziness?

opal plank
#

fuck that

earnest phoenix
opal plank
#

then why would you NOT update?

earnest phoenix
#

Weit i am giving reason

opal plank
#

go ahead, we waiting

crimson vapor
#

people probably still maintain v11

#

at the very least use someone's maintained fork

opal plank
#

probably a do package

earnest phoenix
#

Await for the reasons, and then the reason will be "because cache"

opal plank
#

My pagination package is in v11

earnest phoenix
rocky hearth
#

what would be new in djs v13?

opal plank
#

100% betting on a dependency

earnest phoenix
#

Bruh

opal plank
#

did he just say he selfbotting?

earnest phoenix
#

That's literally a good thing that they fixed

#

Self-botting is against ToS

crimson vapor
#

@earnest phoenix 1. don't selfbot 2. this isn't a valid reason

opal plank
#

big brain

#

wait a second.... i wonder if....

earnest phoenix
#

Sad lyf

opal plank
earnest phoenix
#

Why do people have the need to selfbot

#

My English is so weak how can i explain pandasad

#

English is not my mother language

#

Then explain it in your native language and use a translator, T -> English

opal plank
earnest phoenix
#

Just do it instead of being lazy and letting a bot do it for you

#

U know i dont have any server or etc

opal plank
#

the whole point is NOT having to look at their shit ads

earnest phoenix
#

Or just manually do it and you could also get them banned from servers

opal plank
#

a developers skill shines in automating boring, arduous and repetitive tasks

earnest phoenix
opal plank
#

always hire a lazy dev, they'll always find a way an easier solution to a problem with less effort

quartz kindle
#

@rocky hearth @cinder patio
bitwise or and not

   18 S> 0000020F7672E4E6 @    0 : 0c 37             LdaSmi [55]
   36 S> 0000020F7672E4E8 @    2 : ab                Return

math.floor

   18 S> 0000035EAF82E51E @    0 : 13 00 00          LdaGlobal [0], [0]
         0000035EAF82E521 @    3 : c5                Star1
   30 E> 0000035EAF82E522 @    4 : 28 f9 01 02       LdaNamedProperty r1, [1], [2]
         0000035EAF82E526 @    8 : c6                Star0
         0000035EAF82E527 @    9 : 12 02             LdaConstant [2]
         0000035EAF82E529 @   11 : c4                Star2
   30 E> 0000035EAF82E52A @   12 : 5a fa f9 f8 04    CallProperty1 r0, r1, r2, [4]
   44 S> 0000035EAF82E52F @   17 : ab                Return

you're right, bitwise is faster, however bitwise fails for numbers bigger than 31 bits and produces wrong results

earnest phoenix
earnest phoenix
#

Same

opal plank
#

a competent, lazy dev

#

not a d.js user

earnest phoenix
#

A Detritus user? KEKW

opal plank
#

no, they are also patient

#

more like me

#

lazy as fuck, knows how to code

cinder patio
#

thought so, Math.floor doesn't get inlined

#

probably because the compiler thinks it's not worth it, inlining is not a cheap task

rocky hearth
#

there isn't any bitwise equivalent for Math.ceil , I think

cinder patio
#

You're better off using Math.floor cause it handles edge cases, it's more readable, and like Tim said it's more accurate for bigger numbers

sudden geyser
#

To blindly optimize

rocky hearth
#

hmm, ok

eternal osprey
#

hey guys, i am having a question regarding simplified c.

sudden geyser
#

Ask away

eternal osprey
#

imagine if i have a float named money, that prompts a user for an input: for example:0.65

#

and i have 4 variables: float pennies = 0.01 float nickels = 0.05 float dimes = 0.10 const quarters = 0.25

#

how would i get the change in the lowest amount of coins possible?

#

not asking for code, just a push in the right direction

sudden geyser
#

You'd need to use the remainder operator

#

I don't have experience with C but I know it's fundamentals for what you want to accomplish are similar

earnest phoenix
#

pls help me

sudden geyser
#

Ask away

earnest phoenix
#

you know js

sudden geyser
#

Yes.

earnest phoenix
#

cn you how mention in embed

#

like this

sudden geyser
#

What library are you using?

earnest phoenix
sudden geyser
#

You could write a raw mention as <@userid> but your library probably offers a convenient feature to write the mention

sudden geyser
earnest phoenix
#

discord

#
     .setAuthor("START PLAYING MUSIC", "https://user-images.githubusercontent.com/80573560/116812778-2296ea00-ab6e-11eb-9e0f-36f2a4e57450.jpg")
      .setThumbnail("https://user-images.githubusercontent.com/80573560/116813395-3859de80-ab71-11eb-9922-4276b966d084.gif")
      .setColor("#fffa69")
      .addField(song.title, true)
      .addField()
      queue.textChannel.send(thing);
    };
#

i want add here

#

Then add it as a description or field

eternal osprey
earnest phoenix
#

cn you pls text it

#

voltrex

#

no spoon-feeding

#

ok what thing i want in filed

#

say

#

Description example:

.setDescription(`${user} hello!`)```

Field example:
```js
.addField('pogging', `Hey there ${user}!`);```
eternal osprey
#

hey i quite don't get the concept of the remainder operator, eventhough i have asked my professor for help.

#

Still don't get it

vivid fulcrum
#

it's division, but you get the amount left over (remainder) from the division

#

if remainder returned 0, it means the left hand side is divisible by the right hand side

eternal osprey
#

okay hmm so this; 12 % 5

#

what would this return

#

12:5 = 2.4

#

so it would return 2?

sudden geyser
#

Yes

eternal osprey
#

5.5 % 2 = 2.75 so it would return 3?

sudden geyser
#

1.5

opal plank
#

imagine this

sudden geyser
#

You can test it for yourself

opal plank
#

2 is your base

#

5.5 is your total

#

2 x 1 = 2

#

2x2 = 4

#

2x3= 6 (passed)

#

so take the previous one 2x2

#

5.5 - 4

#

thats your "rest"

eternal osprey
#

so the 2 is always my base?

opal plank
#

no, its whatever you put after %

eternal osprey
#

aha!

opal plank
#

lets do the same for 3 for example

#

5.5 % 3

#

3x1 = 3

#

3x2 = 6(passed 5.5)

eternal osprey
#

guys i finally understand this!

#

I love you guys, honestly.

opal plank
sudden geyser
#

To solve your problem, you'll start with the amount of money you have. You'll then divide the amount of money you have by quarters to get the amount of quarters. To reflect the remaining money left, you'll apply the remainder to the total amount of money and save it to your remaining money.

If you have 553 ($5.53), you'll have 22.12 (22) quarters and 3 cents leftover. You'd then go in to nickels, dimes, and pennies

sudden geyser
#

No problem, but you should experiment and try to implement it yourself. Else you won't learn how it really works.

eternal osprey
quartz kindle
#

you can also think of it as forcing a number to go around

#

for example, 50 % 40 = force the number to overflow at 40 and start again from 0

#

38, 39, 0, 1, 2, 3

#

9 % 2 = (count until 9 but reset every time it reaches 2)
0 1 2 3 4 5 6 7 8 9
0 1 0 1 0 1 0 1 0 1 (result = 1)
every time it reaches the right hand number, it resets to 0 and starts counting again

eternal osprey
#

aha i see

#

yeah, thanks!

#

float remain = (cents % quarters); it is giving me an error here: error: invalid operands to binary expression ('float' and 'float')

#

so this means that i have to converty it right? To like, an integer?

sudden geyser
#

% only works for integers in C

#

So yes

eternal osprey
#

aha thanks

lyric mountain
#

tbh, modulo is useless unless used with integers/longs

eternal osprey
#

okay i am kinda getting stuck here again. So i've put in 2.76 * 100 = 276.

#
int quarters = (0.25 * 100);

int cents = (money * 100);
float remain = cents % quarters;
printf("%f", remain);```
#

so quarters = 25.

#

how in the world is remain equal to 1?

lyric mountain
#

how much is money?

#

276?

eternal osprey
#

what i had put in, 2,76

#

so 276

lyric mountain
#

remainder is 1

#

look, think this way:

#

you have 276, what's the nearest multiple 25 will reach?

#

275

#

276 - 275 = 1

eternal osprey
#

omg i forgot to - them of each other

lyric mountain
#

no

#

(cents % quarters) / 100

#

will return 0.01

#

actually, it'd be 100f

#

else it'll round to 0

#

don't think about modulo by using decimals, think about it as "nearest multiple"

lyric mountain
#

so, what's 13555 % 10? 5

#

51206 % 4? 2

mental raven
#

oh ok

#

sorry

#

i will move it there

earnest phoenix
#

hmm all ding do but mention

#

cbt haooen

pale vessel
#

cbt happen

eternal osprey
#

answer is 5

#

owh you already wrote the right answer.

#

i think that i get it now

earnest phoenix
#

👏

flat pelican
#

@modest maple hey, you're around? zoomEyes

lyric mountain
#

modulo is the second easiest operation

flat pelican
#

hi qt

#

I was wondering if you did deploy a Flask (web) app with Docker compose before?

glacial trench
#

Can someone tell me how I can make it so the link doesn’t disappear when I send the link only, for example see the message below

lyric mountain
#

try escaping them

#

\

glacial trench
#

I sent the link but it disappeared ^

lyric mountain
#

\https://images-ext-1.discordapp.net/external/soKXmERx5-xHYUU2OOxqYRcCz9Kw4Hym7KM2ZfX0cdc/https/cdn.legendjs.xyz/vBbSJRKT?width=573&height=573

#

nah, doesn't work

#

but you can https://images-ext-1.discordapp.net/external/soKXmERx5-xHYUU2OOxqYRcCz9Kw4Hym7KM2ZfX0cdc/https/cdn.legendjs.xyz/vBbSJRKT?width=573&height=573

glacial trench
#

no I mean like a piece of code I can use

lyric mountain
#
"`" + link + "`"
#

literally what I said

glacial trench
#

bruh I’m talking about something else, I’m trying to figure out how to not make it disappear without having to use anything like that :/

earnest phoenix
#

So, im going to sound stupid when I ask, how do I make it so if someone has a role the command won't proceed.

lyric mountain
#

I literally answered that

lyric mountain
#

if the url is parseable, it'll become an image

#

period

glacial trench
earnest phoenix
#

Thought so.

#

Thats what I had but I wanted to ask before I had tested it.

glacial trench
lyric mountain
#

escape it yourself

glacial trench
#

for example, if I just send https://cdn.legendjs.xyz/vBbSJRKT the link should not disappear and the image should be shown

slender thistle
#

How well does selenium work with async packages?

earnest phoenix
#

TypeError: Cannot read property 'roles' of undefined

Code:

            if (!banMember.member.roles.cache.has("780957206681878580")) return; message.channel.send('Nope...')
glacial trench
lyric mountain
earnest phoenix
#

I just woke up so I probably sound stupid lol

lyric mountain
#

either that or make the link invalid

#

it's just how discord works

clear marlin
#

cdns

sterile lantern
#

Hey

lyric mountain
#

if you remove embed permission from used links won't be parsed

sterile lantern
#

How do i make a field optional

lyric mountain
#

but that's regardless of code

sterile lantern
#

so if i fetch something, and theres nothing, then dont add the field

clear marlin
glacial trench
#

... I’ve literally said the user must not have to escape the link

sterile lantern
#
 let description = await roblox.getBlurb({userId: user.Id})```
if description is null (aka none) then don't add description field, is that possible ?
clear marlin
#

yeah

#

that is

lyric mountain
#

either escape it, make it invalid or remove embed permission

#

no other way

lament rock
#

use an if statement and if the description !== null then Object.assign to some Object

glacial trench
#

Like this

lyric mountain
#

that's an invalid image url

clear marlin
lyric mountain
#

that's why it ain't parsed

sterile lantern
#

ohh

#

alr

glacial trench
#

it is valid

lyric mountain
#

no

clear marlin
lyric mountain
#

that's a page url

#

not an image url

glacial trench
#

but what

lyric mountain
#

the page returns the image, but it still isn't an image url

lament rock
#

URLs which aren't a direct link to an image (i.e. return a 302 REDIRECT) will show the link

glacial trench
#

hmm ok

sterile lantern
clear marlin
lyric mountain
#

yes

clear marlin
#

so what about it?

lyric mountain
#

in that case, the message is not only composed of the url

#

so it won't be parsed also

#

aka "message isn't a valid image url" case

clear marlin
#

it sends response as attachment

lyric mountain
#

if you send only the url

clear marlin
#

yeah

lyric mountain
#

not an image url

clear marlin
#

mhm

lyric mountain
#

it contains one, but itself isn't one

clear marlin
#

yep

lyric mountain
#

basically discord does a simple parsing:

  • if image IS an image url, make it an image
  • else, if it contains one, show as attachment
  • else don't parse it
clear marlin
#

I seee

sterile lantern
#

how can i edit an embed

#

so first the description is

#

"Loading..."

#

then after it sends the info when its ready

#

js

#

discord.js

lyric mountain
#

just edit the message

#

you can reassign the embed

clear marlin
# sterile lantern "Loading..."
const embed = new Discord.MessageEmbed()
.setDescription("loading");
const afterEmbed = new Discord.MessageEmbed()
.setDescription("After Loading");
const msg = await message.channel.send(embed);
msg.edit(afterEmbed)
#

for an embed

#

let me just edit this

sterile lantern
#

oh

#

i got it

#

ty

earnest phoenix
#

how could I receive The developer role
🙃

eternal osprey
#

hey, so i tried to get the lowest amount of coins but at this point i am really lost in what to do: ```c
int pennies = (0.01 * 100);
int nickels = (0.05 * 100);
int dimes = (0.10 * 100);
int quarters = (0.25 * 100);

int cents = (money * 100);
int remain1 = cents % quarters; // amount of quarters
int remain2 = remain1 * 25;
int remain3 = cents - remain2;
int remain4 = remain3 % dimes;
printf("%i", remain4);
}```

#

so what i thought to do was getting the remainder of cents and quarters, which equals to 5.

earnest phoenix
#

and What are the commands forbidden to do in my bot

#

🙂

earnest phoenix
#

Ok

lyric mountain
#

no, nsfw is not forbidden

earnest phoenix
#

🙂

lyric mountain
#

you can't use nsfw command on non-nsfw channels

earnest phoenix
#

send all command is forbidden i think

lyric mountain
#

the only forbidden commands afaik are suicide (or anything like that) and nekos.life

earnest phoenix
#

k

#

thx

clear marlin
#

what is nekos

#

tho

#

like an api

#

or somethin?

eternal osprey
#

wtf i searched that up

#

but it wasn't very pleasant

lyric mountain
#

a neko endpoint that has chance to return nsfw minor pics

eternal osprey
#

i am trying to get the least amount of numbers in exchange

clear marlin
#

also is this C

eternal osprey
#

but i am most definitely lost

#

yeah it is

sterile lantern
#

btw how can i make it

#

so it waits at least 3 seconds

#

before editing

lyric mountain
#

also, you still didn't remember to divide by 100 at the end

sterile lantern
#

acc lemme just use an await

eternal osprey
#

owh no i do remember that

#

but i just wanted to get the base first working

lyric mountain
#
int cents = money * 100; // 2.84 * 100 = 284
int quarters = cents % 25; // 284 - 275 = 9
int dimes = quarters % 10; // 9 - 0 = 9
int nickels = dimes % 5; // 9 - 5 = 4
int pennies = nickels; // 4

// change is 11 quarters, 1 nickel and 4 pennies
//              275     +   5        + 4
clear marlin
#

For 3s

sterile lantern
#

yea

sudden knoll
lyric mountain
#

mine is smaller mmLol

sudden knoll
#

that is true, but mine is easier to comprehend for beginners

clear marlin
#

mine is negligible mmLol

sterile lantern
#
joinDate: 2018-01-21T23:50:45.853Z,```
#

how do i only fetchthe

#

2018-01-21

#

from there

#

and format it to 01/21/2018

lyric mountain
#

I'm pretty sure that's 21/01/2018

sudden knoll
#

what's the code for getting a joindate

sudden knoll
sterile lantern
#

that returns this info

#

for a roblox player

sudden knoll
#

usually it's MM/DD/YYYY

lyric mountain
quartz kindle
#

js has built in date formatting

clear marlin
#

Use moment

sterile lantern
#

hmm

#

but its

#

joinDate: 2018-01-21T23:50:45.853Z,

#

wouldnt it error

#

actually

#

maybe i can just

#

split the join date

lyric mountain
#

that's a date

sudden knoll
quartz kindle
#

js Date accepts ISO format as input

sterile lantern
#

alr

clear marlin
#

moment(joindate).format("DD/MM/YY")

quartz kindle
earnest phoenix
#

any one say how add image in bot decription in command

sterile lantern
#

now that i have the date 01/21/18

#

how would i round it to the nearest

#

weeks/months/years

sudden knoll
earnest phoenix
#

this tyoe

sterile lantern
sterile lantern
#

so if its possible thats its one week, return one week

earnest phoenix
#

i use js

#

@sudden knoll

sudden knoll
#

oh

#

mb

earnest phoenix
#

so how

#

bro

clear marlin
#
#

read the docs

sudden knoll
#

there

#

pretty much the same thing

#

if you want an image, use set image

#

but I assume you wanted set thumbnail

#

so that's what I sent

clear marlin
#

.setThumbnail("image.png")

sterile lantern
#

Hmm, so I want to use the date that the command was ran (in this case today) to be minused by the joinDate and then return x amount of days OR x amount of months OR x amount of years

earnest phoenix
#

this work

#

.setThumbnail(url)

sudden knoll
#

looking at the docs, yes

earnest phoenix
#

ok

sudden knoll
lyric mountain