#development
1 messages · Page 1733 of 1
Yes, but the port you specify needs to be open on your network for it to work
like just i have to do remove my current putted webhook from https://top.gg/bots/mybotid/webhook and then i put the webhook path as /dblwebhook and a open port?
right?
Then
the Webserver will make a webhook
the url would be http://<your public ip>:5000/dblwebhook
Yes
Tyy sm
@dusky sundial it didn't work
i putted the webhook_path as https://0.0.0.0:8080/dblwebhook and port as 8080
and on top.gg webhook page the same webhook path and tested But Nothing printed in my console
Again, is port 8080 open?
And please tell me you put your IP, and not actually 0.0.0.0
No, your public IP address
Hm
Or the public IP of whatever you're hosting it on
i was hosting it on repl
i have alrdy
i am confused at vote webhooks
Ah
@lavish minnow u know anything about it?
No
kk
Holy crap this server keeps crashing
yup i just figured it too
@dusky sundial you here?
http://REPLPROJECTNAME.YOURREPLUSERNAME.repl.co
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.
Pretty sure canvas can't export a pixel image as a vector image
Remember svg MUST be composed of coordinates and curves
How do I make an .env file on node.js? I'm on the Secrets already (i'm not a coder sorry)
That's simple. Just give a name in the key and give your token in value
ok here's an example https://streamable.com/ox7oht
Thanks I already changed my bot's status
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?
@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
discord bot maker?
I dont know much about it
youll have to google it
i know a lot of people use it though
I prefer coding one
There's also Scratch-For-Discord
Coding lets you customize
How can ı destroy that
¯\_(ツ)_/¯
botbeam.org I use it and it's amazing
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
how to setup a bot for logs Sx4 bot
its supposed to be
const {inspect} = require('util')
not utils
node.js' built-in package
How can I use any command using eval
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?
Trying to use mod commands in my friend server without roles for testing eval
eval doesn't... uhm... bypass stuff

unless you wanna hack your bot
"shaking my head"
Ok sir
eval doesn't bypass anything that you bot can't already do on Dicsord basically
Can anyone will tell me I have submitted my bot on topbot.gg so when will I receive the message from them?
?
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
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
But hlo
Oo
JSON RESPONSE
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
Ok sir
sir
No problem, madam
to fetch a custom emoji
<Client>.emojis.fetch(id)
const emoji = <client>.emojis.cache.get("emoji_id")```
cache is a collection
it is
could i ask about customising css in topgg page in this channel?
they want to fetch it
right
yeah you can
forgot discord.js caches absolutely everything
lol
so im wondering if you could customise css in buttons like invite, vote etc
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
you can do that.....the best thing is maybe you should inspect element on the top.gg page
ah
to see what you can customize
is there any resources on it?
I have no idea about them
Inspect element is all you need to get the class names
yea
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?
const Owner = await message.guild.members.fetch(message.guild.ownerID)
I want this in tag but its mentioning that person
Like ᵈʳᵉᵃᵐ乡𝓟𝓻𝓲𝓷𝓬𝓮★᭄ꦿ᭄☆#1646
setTimeout(async()=> {isn't this how you make a settimeout async?
yeah
alrighty, much love!
addd a .tag at the end
After id?
const Owner = await message.guild.members.fetch(message.guild.ownerID).tag
or .username
for username
Its showing undefined
Owner?
users???????
members aren't users
hey, i want to use a custom emoji in my message, can i just do: :emoji-name:
so why not just fetch the user directly
Nope in id of emoji
await client.users.fetch(message.guild.ownerID)
Or in tag?
no I mean fetch the user directly if you want their username or tag
okay so i need to :emoji-id:
OR, get the .user property from the member
.user
<:emoji_id:emojiname>

wait what so you need to supply an id and name?
:-:emoji_name: then you will get the id copy that and paste it
somethin like this
It's the other way around no?

Like this
Bye
no
okay i am confused as hell

Just do *:emoji_name:* then you will id of emoji just copy that
<:emoji_name:emoji_id>
that's it
that's 100% correct

alright
There's no : at the end of the ID
Lmao

its <:emoji_name:emoji_id>
now go do coding
break a bot and then tell me you broke it
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
How do I make a support website for my bot?
by learning html/css
what
is the emoji located in the server you are using?
⬆️
it should work then
it doesn't tho
well idk then cause works fine for my bot
it is
aha right!
@eternal osprey how did you get the emoji name and ID, did you do
\ :emoji_name:
(no space)
may i ask you how you make such little clips btw?
sharex
alright thanks
so you got the emoji fine now?
yup!
alright
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
In your DNS settings
add text
fill it out with the code / text they give
the name text?
does anyone here knows html? I have a question regarding it
The text that starts with google-site-verification
I guess around 80% knows html here
just ask
ok, so I'll send it here[
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
alright got that
you didn't close the div tag
<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>
thx
^°^
protip, copy the emoji url
the url contains the emoji id
you can also view it through inspect element
that's even harder
okay so i verified my website on google
but now i can't access my website
it's like not existing anymore
thanks! Will note that
Actually
You gotta get to the Emoji >
Right Click >
Inspect Element >
Find the url >
Select it >
Copy
🙄
hmmm
okay i really need some help here
When you can
Get to the Emoji >
Click >
Add a slash >
Copy
literally open the emoji window
do ctrl+shift+i
click on the element target tool
click on your emoji
and there you go
i verified my website but it simply just doesn't exist anymore
you have access to the emoji url
Then I gotta separate the id from it
and name
then write it again
oh my god stfu
ERR_NAME_NOT_RESOLVED
That doesnt make sense
idk what happened i verified by adding a DNS record
the url method is for people without nitro
Unless you created an issue in Cloud Flare
and poof, this happened
Mine shows a warn but works
@near stratus the button is not working yet
What should i do now lmao
@eternal osprey Does it look like this ?
removing the dns record
ignore the www
wait let me ss real quick
wait f
you set button as className not ID
oh
<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>
@near stratus it worked, but now what should I do with the button color configs and stuff?
use css
but after it got verified, it disappeared from the web
I have it, but not working anymore bacuse ID was changed
.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;
}```
obviously
Did you connect to your host ?
#button
uhh not sure
ok, thx
what host do you mean
Where are you hosting the website files ?
on my vps
nginx or Apache ?
I couldn't find any solution with the data you gave me (I tried with nginx and it is working I guess)
ah fuck, alright thanks for trying.
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
<style>
body {
background-color: green;
background-repeat: no-repeat;
}
</style>```
no-repeat doesn't work for colors?
Colors dont repeat
but how can I make the color only show up in a specific place?
Then apply it to that "specific place"
Not the whole body
Like set background color property of a div to that color
ok, I'll try
thx
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
How can I have instead of ➕ this, this \➕ in my embeds?
I tried \ and \emoji\
this is all that i have got
\emoji should work
nope does not work
can you show your code
just by sending the unicode version it should parse to discord emoji
oh nvm
cool, worked thx! 
maybe the inventory property will get a object,which is defined in a variable on the upgrade thingy...
No example.
there is
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.
it's already fast enough, you can refactor it a bit though
create the inventory object and the fill it based on conditions
I'd do sometthing like this:
const inventory = {};
if (...) inventory["..."] = ...;
// More if checks...
const newInventory = new Inventory({userId: ..., inventory);
extract both the object creation and the saving part
Hm..
then just modify the obj property based on whether the conditions are true
you could also use ternaries to remove all those ifs
Those? a ? b : c
My Suggestion in English: #development message
ye
Like I add the properties depending if the value is true?
Ohh.
yep
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?
anyone know how to turn an svg buffer into an svg data uri using nodejs?
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));
Yup! 🎉
Also ['upgrades'] => updates
same with mysterybox
you're trying to have arrays as keys
it will still work though
but it's pointless
though you should only use it for variables
I think for bracket notation and using a value of a variable.
Do I remove the bracket notation?
yes
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)
}
})```
What should I do
show code first
There is a problem in module ig
no that is the place where the error gets called, but not the place where it occured.
Jenny Knuth’s Block 222825e315d45a738ed9d6e04c7a88d0
What do you exactly mean by that? That should create the channel first then send the embed to that created channel, what happens on your end? Errors? Or what exactly?
No it's your commandhandler
Read the error
it just sends the 2 embeds in the normal chat
even if i don't respond
let me show you a ss
i didn't even respond to it (the reaction emoji)
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
The JavaScript exception "can't access property" occurs when property access was
operated on undefined or null values.
Ty guys
I wonder how long approval takes
Read pins in #support
So it sends that second embed without you clicking on the reaction? I don't get what you're trying to say
read it
yeah exactly
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
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
I'm not sure how that's even happening, are you doing all this in the messageReactionAdd event?
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
bruh
@earnest phoenix
@zenith terrace
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);
}
})
}```
Scopes @eternal osprey
const variable = ...;
if (...) { ... }
if (...) { ... }```
Or
let variable;
if (...) {
variable = ...;
...
}
if (...) { ... }```
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.
good job!
thanks
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
Great
What lib?
Discord.js or what other thing do u mean?
yes I meant that, you can just use <Message>.reply() to mention the user
Or just mention them with <Message>.channel.send(), e.g.
<Message>.channel.send(`${<Message>.author} Hello!`);```
Ooh thanks
yes, this is the #development channel.
As the topic says:
Channel for chatting about development.
oh they removed "(bot)" from the topic
probably mostly me tim million and a couple others abusing chat with purposefully shit code. That probably makes up 20% of the chat
#development message like this


They're trying to hide secrets from you


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)
<@userid>
doesn't discordjs user class stringify to <@userid>
If the two folders are completely separate projects then you should have two different tsconfig files for each
all of what they said is in js
hi Airwin
hi thousand
hmm, do I've to install ts in each sub-folder?
o
i need an help pls
no*
say na
you should actually install ts globally tbh
you can use ts-loader to compile the two folders separately
Why discord adding stage channels 
so you dont have to install it as a dep every time
cuz they are fun to play with
any one pls help
we already did
,
it cnt work
it does work

thats what we all use
Is it possible to mention the user in code blocks ?
no
it is not
Ok
If you want to mention the user, simply concatenate the user object with a string
1 sec
hmm i cnt under stand
@earnest phoenix https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
Template literals are string literals allowing embedded
expressions. You can use multi-line strings and string interpolation features with
them.
read this
const mentionedUser = 'Your message here, ' + user;
but I don't think you want that
`` > '' + ''
so here's the thing. I've done a bot with discord.js, it was working well and then it crashed.
The reason I get is "guild.channels.set(channel.id, channel);
^
TypeError: Cannot read property '...
change my mind
i want like this
thats likely cuz its outdated
im having a blast with staging channels
const userMention = ("aaa " + message.author).split(' ')[1]``` rate code erwin
i'll eat your life
that would work right?
i feed on bad code
I made you lunch then @opal plank https://github.com/Million900o
i want add here .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)
queue.textChannel.send(thing);
}
.addField(TITLE HERE, TEXT HERE)
wheres flaze? didnt he make a repo just for bad code?
@pale vessel confirm?
.addField(TITLE HERE, TEXT HERE, INLINE?)
i think it was matthew actually
he wont understand what inline is, so i omitted it
If you don't want to update Discord.js a temporary fix would be to add if(channel != null) line 81.
That means node_modules
?

Nude_modules
hmmm valid

#MessageEmbed.addField('TITLE HERE', "TEXT HERE", !!`${INLINE}`)```
lul
what in text
Node *
why wouldnt you update discord js?

dont tell me you're on v11
i wonder if people are going to rush to fork v11 and migrate the gateway to v9 once v7 dies
😂
Didn't v11 break already
i cnt want add any thing
.addField(TITLE HERE, TEXT HERE)
bUt PoRTIng My COdE TaKES EffoRT
wait, you actually using v11?
so does resetting your token when they introduce a breaking cchange
Obviously
bruh
update your code ffs
Hey Tim, which has better performance,
Math.floor(55.5555) vs 55.5555 | 0 vs ~~(55.5555)
@earnest phoenix MessageEmbed.add('NAME', 'VALUE')
huh
what's the point of coding if i can't just copypaste what someone else made!! 🤬
it will only get worse from now on btw
wdym
we can't do that?
i think it was matthew actually
you won't notice either way, but most likely the second one

👏 update👏 your👏 code
most likely zero difference
the first one calls a function
math.floor probably calls num | 0 with some built in checks
I don't want
but ye the difference is minimal
functions are not slow
then suffer
😕
its safer tho
The second one would be the fastest, but the difference is so little that you won't notice it
Any solution
to what?
suffering is one

he doesnt want to update to v12
so here's the thing. I've done a bot with discord.js, it was working well and then it crashed.
The reason I get is "guild.channels.set(channel.id, channel);
^
TypeError: Cannot read property '...
Yeah but they push to the call stack
while an operator gets compiled to bytecode instantly
functions get inlined
unless you wanna maintain the library, its been already deprecated and dont think anyone will give you support for an outdated lib. Bite the bullet already
@earnest phoenix update your code. We can't tell you a good solution because no one here is still running a year old library
you think staging channels are bad?
No
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
I know stage channels good but 
Why do people hesitate to update to newer versions, I don't get it
cuz effort
Laziness?
fuck that
Na
then why would you NOT update?
Weit i am giving reason
go ahead, we waiting
people probably still maintain v11
at the very least use someone's maintained fork
probably a do package
Await for the reasons, and then the reason will be "because cache"
My pagination package is in v11
https://github.com/discordjs/discord.js/issues/3937
This is the main reason 
what would be new in djs v13?
100% betting on a dependency
Bruh
did he just say he selfbotting?
@earnest phoenix 1. don't selfbot 2. this isn't a valid reason
Sad lyf

Why do people have the need to selfbot

My English is so weak how can i explain 
English is not my mother language
Then explain it in your native language and use a translator, T -> English
😂
ngl, i would to instantly reply to new dms with If you came here to: 1) advertise; 2) ask for help; 3) ask me to code something for free for you; Be gone. if(message.content.includes(link)) message.user.block();
Just do it instead of being lazy and letting a bot do it for you

U know i dont have any server or etc
a developers skill shines in automating boring, arduous and repetitive tasks


always hire a lazy dev, they'll always find a way an easier solution to a problem with less effort
@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

"Oh yes I'll just copy this 1k lines of code from StackOverflow, very easy and less effort"
Same
maybe not that level
a competent, lazy dev
not a d.js user

A Detritus user? 
thought so, Math.floor doesn't get inlined
probably because the compiler thinks it's not worth it, inlining is not a cheap task
there isn't any bitwise equivalent for Math.ceil , I think
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
To blindly optimize
hmm, ok
hey guys, i am having a question regarding simplified c.
Ask away
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
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
pls help me
Ask away
you know js
Yes.
What library are you using?

You could write a raw mention as <@userid> but your library probably offers a convenient feature to write the mention
Discord.js, Eris, Distri-something
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
thanks mate
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}!`);```
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
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
okay hmm so this; 12 % 5
what would this return
12:5 = 2.4
so it would return 2?
Yes
5.5 % 2 = 2.75 so it would return 3?
1.5
imagine this
You can test it for yourself
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"
so the 2 is always my base?
no, its whatever you put after %
aha!

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
you are the best man!
No problem, but you should experiment and try to implement it yourself. Else you won't learn how it really works.
yeah of course! That is why i explicit asked to not receive any code.
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
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?
aha thanks
tbh, modulo is useless unless used with integers/longs
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?
remainder is 1
look, think this way:
you have 276, what's the nearest multiple 25 will reach?
275
276 - 275 = 1
omg i forgot to - them of each other
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"
alirghty, thank you!
cbt happen
let me think
answer is 5
owh you already wrote the right answer.
i think that i get it now
👏
@modest maple hey, you're around? 
modulo is the second easiest operation

hi qt
I was wondering if you did deploy a Flask (web) app with Docker compose before?
I'm currently trying to run a Flask (dev) server with DCompose, but I keep getting this error about my app.py file - https://i.imgur.com/ncB6kZw.png https://i.imgur.com/ixwHCMB.png
my Flask app is already defined as app = Flask(__name__)
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
I sent the link but it disappeared ^
\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
no I mean like a piece of code I can use
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 :/
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.
how are you talking about something else then?
I literally answered that
What langauge
if (message.member.roles.cache.has("roleID")) return;
I want it to work without having people to escape them
escape it yourself
for example, if I just send https://cdn.legendjs.xyz/vBbSJRKT the link should not disappear and the image should be shown
How well does selenium work with async packages?
through code?
TypeError: Cannot read property 'roles' of undefined
Code:
if (!banMember.member.roles.cache.has("780957206681878580")) return; message.channel.send('Nope...')
Yeah, I do think there is, I’ve seen some links not disappear
"`" + link + "`"
I just woke up so I probably sound stupid lol
cdns
Hey
if you remove embed permission from used links won't be parsed
How do i make a field optional
but that's regardless of code
so if i fetch something, and theres nothing, then dont add the field
I dont think you need the .member
... I’ve literally said the user must not have to escape the link
let description = await roblox.getBlurb({userId: user.Id})```
if description is null (aka none) then don't add description field, is that possible ?
you 👏 can't 👏 because 👏 discord 👏 parses 👏 valid 👏 image 👏 urls
either escape it, make it invalid or remove embed permission
no other way
use an if statement and if the description !== null then Object.assign to some Object
that's an invalid image url
const embed = new Discord.MessageEmbed;
const description =//whatever it is
if(description){
embed.setDescription(description)
}
that's why it ain't parsed
it is valid
no
and then send it ofc
but what
the page returns the image, but it still isn't an image url
URLs which aren't a direct link to an image (i.e. return a 302 REDIRECT) will show the link
hmm ok
yeah
do you mean this @lyric mountain https://its-the.rhydderchc.rocks/Screen Shot 2021-05-04 at 10.41.03 AM.png
yes
so what about it?
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
it sends response as attachment
yeah
not an image url
mhm
it contains one, but itself isn't one
yep
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
I seee
how can i edit an embed
so first the description is
"Loading..."
then after it sends the info when its ready
js
discord.js
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
how could I receive The developer role
🙃
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.
NSFW
Ok
no, nsfw is not forbidden
🙂
@sterile lantern
you can't use nsfw command on non-nsfw channels
send all command is forbidden i think
the only forbidden commands afaik are suicide (or anything like that) and nekos.life
but read #rules-and-info nonetheless
a neko endpoint that has chance to return nsfw minor pics
what the hell are you tryna do
i am trying to get the least amount of numbers in exchange
also is this C
got it
why
also, you still didn't remember to divide by 100 at the end
acc lemme just use an await
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
Just add a setTimeout() function
For 3s
yea
// if money is in dollars
int cents = money * 100;
int quarters = cents / 25;
cents = cents % 25;
int dimes = cents / 10;
cents = cents % 10;
int nickels = cents / 5;
cents = cents % 5;
int pennies = cents;
mine is smaller 
that is true, but mine is easier to comprehend for beginners
mine is negligible 
joinDate: 2018-01-21T23:50:45.853Z,```
how do i only fetchthe
2018-01-21
from there
and format it to 01/21/2018
I'm pretty sure that's 21/01/2018
what's the code for getting a joindate
that's DD/MM/YYYY
im using a npm package
that returns this info
for a roblox player
usually it's MM/DD/YYYY
yes, month 21
js has built in date formatting
Use moment
hmm
but its
joinDate: 2018-01-21T23:50:45.853Z,
wouldnt it error
actually
maybe i can just
split the join date
that's a date
?
js Date accepts ISO format as input
alr
moment(joindate).format("DD/MM/YY")
any one say how add image in bot decription in command
now that i have the date 01/21/18
how would i round it to the nearest
weeks/months/years
do you mean adda an image to an embed?
or days, but essentially, round to the nearest <> possible
so if its possible thats its one week, return one week
read the docs
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
.setThumbnail("image.png")
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
looking at the docs, yes
ok
can't dates be subtracted from each other?
I did say use moment...
subtract the millis and parse into a duration



v11 crashes upon encountering a stage channel
