#development
1 messages · Page 1617 of 1
that's like, common sense
just like how you brush ur teeth to go see the dentist
im not sure, is this a compliment? lmao
idk
i never started with python
compare this to this 
my first programming lang was PHP
same
i don't regret it either honestly
PHP taught me a lot of valuable insight to OOP programming
and i was able to transfer a lot of my knowledge from PHP to other langs really easily with classes and such
php is kinda weird to me
php is a freaky language to begin with
php is kinda weird
it's also just abhorrently messy
good enought for me
i feel like you have to be comfortable with writing a little messy if you want to make PHP work on your side
i did atrocious things with php and wordpress back then, not proud xd
getting it to look clean is really important to me imo because i care a lot about not only maintainability but accessibility
we all did :v
i've done atrocious things in all languages
i did shit like ```php
$something = abc;
$something2 = $something + zyx;
$something3 = somefunc($something2, somethingelse);
$something4 = ...
lmao
is this php?
ye
cringe
$$something?
xD
they're horrifying
also
since when
string concatentation in php
huh
"abc".$something."xyz"
yeah
if you use \" it should work too
i used "$something aa"
i quit php long before i learned about string formatting, so all my php uses concatenation xd
i might go back to php since it has arrow functions now (since 7.4?)
mhm
i love those
with PHP 8 being out it really feels proper
php 8 has the new match expression, which is amazing
i wish js had something like that
oh yeah it does
I promise I'll use PHP when they are gonna remove the $ signs and add Variable type
xD
Python is going to have that, isn't it
not sure
also i see nothing wrong in $ variable declaration
it's just like JS using let
variable type also just forces a type condition and nothing more, so i don't see too much into why this is important
$myvar = match (5) {
1 => "Oh no!",
2 => "This is what I expected",
3 => "hehehe",
4 => "nope",
5 => "yes",
};
echo $myvar // yes
indeed
its a switch that returns the case
i can imagine so many uses
bruhh
i need to use this in TopPHP
that's insanely good
does it still support die though?
idk, but i dont think so
i appreciate the existence of the die statement a lot
bruh
let is for declaration
like ```js
let p = "ggg";
console.log(p);
But you have to use $ every single time you use that variable in PHP
```php
$p = "ggg";
echo(p); //Won't work
echo($p);
its like selecting a value from an array, but instead of indexes, using a switch statement
It's ugly
the issue is that smaller codes range from "meh" to "ok"
but larger codes (10 lines) are unreadable
why code no work?php £foo = "a"; echo £foo;
because cringe php
yeah
definitely
im starting to think lua might just be slightly better than php
lmao
y e s
which language
idk man
nah
yes this lmao
lua is cringe
replace all $ with £
lua has an interesting way of handling pairs though
because £ is worth more than $ and €
i have to give lua that
lua is yikes
lua with an actual relative path require system would be alright
agreed
lua has a built-in iterator method that can be stated or stateless
that's fairly nice
Imagine everyone dumping every other language and working with discord.php
How does an iterator be stateless
oh its just img class
inspect element
then edit with tag name
img {
// stuff here
}
lol
$nomention $onlyPerms[Manage server;Do you think you can mute without permission you scrub] $mute[Muted] $title[Muted] $description[<@$mentioned[<]> was successfully muted]
ew
But when i have that i apparently dont have a muted role
@severe pike COME BACK
WHATS UP
My bot has problems istg
Legenddd thanks
I have a muted role and it says i dont have one
@severe pike
i have very similar code
ok, php syntax looks beautiful compared to bdfd
tf is this language ?
bdfd
BDFD ?
Cry i hate html
.entity-header__image:hover{
border-radius: 10px;
}
</style>``` Shouldn't this be doing anything to the logo
and you guys are losing it over 1 dollar sign in php 
when it'll be hovered
you mean @Annotations?
ignore me
remove the :hover
thank you
nah, they're fine
tf is light theme ?
I mean they're called Decorators in js, and they're just... bad. eww 100%
idk, random google image
...
have you tried hovering...? lol
<style>
.entity-header__image{
border-radius: 20px;
transition: width 2s, height 4s;
}
</style>
How do transitions work?
you don't need an animation to make transitions work
oh?
oo yeah
i've always done an animation for my transitions 😳
.entity-header__image {
border-radius: 10px;
animation: animate 3s;
animation-iteration-count: infinite;
}
@keyframes animate {
transition-timing-function: ease-in-out;
0% {transform:}
40% {transform:}
60% {transform:}
85% {transform:}
}
^
Discord died with formatting for code blocks on iOS kekw
i really like discord's reply feature
One message removed from a suspended account.
i like that honestly
most people have small attention spans it seems here on discord
so the ping helps give a visual clue
One message removed from a suspended account.
One message removed from a suspended account.
it is
idk
Just hit the @ on the right and then it doesn’t ping
i don't think too many people are bothered
I think it stays that way too
Boop
nah it doesnt
test
.myclass {
width: 10px;
height: 10px;
background-color: blue;
transition: all ease-in-out 2s;
}
.myclass:hover {
background-color: red;
width: 50px;
height: 50px;
}
Example without using animation
nope
hmm
well
if it at least remembered your choice
i think people would stop complaining
i mean in general a ping on discord is like the unholy spirit
@everyone when
i like how typing @everyone on here angers people even when it doesn't work
Ah why did you ping me
Ive just tried that but nothing is really happening
Hey, I created a tempban command, how to add "when his ban is finished, the bot unban him"?
my code
Have to have a scheduled task that repeats and then checks for the current time being past the expiration time
lmao
What did i do ahha
lmfao ok thank you ill have a look at some w3 schools
jus wait
bro w3 schools lit
my childhood
save me on the daily
yeup
W3schools is Poggers
Hello I can't reduce my iframe I would like some help because on the top.gg site you need 300 characters
my childhood programming was from a youtuber named Tinkernut
If you have to google how to add 1+1 youve got other issues
hah nicee
^
i stg
i wonder how i learned coding from tinkernut tutorials
back when he used nothing but MS Notepad and IDLE
Anyone else remember minecraft and thebcbroz 
now i spend my time watching Sebastian Lague's videos on coding adventures
lmao
i still use idle to run scripts
wouldnt want it any other way
ah, yes, cool
Hello I can't reduce my iframe I would like some help because on the top.gg site you need 300 characters
add markdown characters
Hey, I created a tempban command, how to add "when his ban is finished, the bot unban him"?
https://hatebin.com/becjzjsqkf
my code (JavaScript)
türküm yardım lazım
(it usually triggers any JS dev within a 10 mi radius)
(mission success)
#general-int please
I had a question, how do you guys manage monetization for your bots?
like
premium tiers
I want to add that to my pretty successful bot but I don't really know how
I am trying something with patreon
but it's going a bit...
yeah
yeah
i'm doing the same too
Hey, I created a tempban command, how to add "when his ban is finished, the bot unban him"?
https://hatebin.com/becjzjsqkf
my code (JavaScript)
bruh you did not just copy paste that
I am making a system where when you join the patreon, it gives you a role in the support server which allows you to run a command y!claim which adds you to the premium user database
well
you should try this
you join the patreon, it has a "gives discord benefits" option where you join support
yeah
then when you join support it writes the user ID as an entry to a DB
you can set up a listener event for it instead of a command
yeah
for if he gets the role?
when*
yup
hmmm
is this a good extention for my db so i can connect it to my bot or?
if you have it already handing out the role
how do I add a listener for a role?
what lang you using
javascript
yes
sweet ty
in d.py it's something like this:
@bot.event
async def on_member_join(guild, user):
role = discord.utils.get(ctx.guild.roles, name = "Patron")
for _role in user.roles:
if _role.id == role.id:
print("we got it")
you'd have to write it in whatever fancy way d.js does it all
but you just need to fetch the role object, then check the ID of it in the users roles
it's pseudocode
i didn't bother trying it
i'm writing it out mentally the step process
because the patreon bot has a similar thing
but then when your bot runs the code before the patreon bot...
it doesn't work
you'll have to put at least a timer on it of 10 seconds or something
you don't really need a timer
nono
you can just set a loop
the patreon bot in your server sets it
why would you do the API if you have a patreon integration in your server
I'm talking about the patreon bot, the role integration
the patreon bot adds the role to the user
and then you want your bot to check it
but you'll need a timer, otherwise it will run at the same time resulting in your bot not seeing the role yet
It would probably be best to just use the patreon api at that point
yeah
how would i check if a user is a bot? so a user doesnt ban/kick a bot by accident?
yeah it's the best thing but how tf am I able to know who(on discord) bought patreon tier
isnt there an error handler for that
user.bot
ahh ok ty @viral mortar
yup im using py
oh good

does anyone know what this is? i havent gotten it before and i didnt get a direct dm from discord or an email
100% token leak
it always is
Hey, I made a tempmute commande but i have a problem.
normally, when his mute is finished, the bot unmute him auto with a text to say the member is unmuted but the problem:
the bot mute him but says the unmute text and don't unmute after the time
my code ⏫
did you restarted the process while the timer where running?
i think no :/
try it again to go sure
how to do this?
mute again and check if its unmute
i tested but he's not unmute
for such stuff i would suggest using redis. this will make the "timer" persistent over restarts also got one or two other benefits. with redis you set a ttl for each data entry and if the ttl reaches 0 redis will fire a event you can listen to.
here a suggestion for a workflow
-> Mute command gives user the Mute role -> Store the Member id and the mute time into redis (mute time = ttl) -> listen for the Redis event for run out lifetimes, if a lifetime runs out you should get the member id that you can then use to remove the role
its a npm redis?
setTimeout(() => {
member.roles.add(mutedRole);
message.channel.send(`Le mute temporaire de ${member} est écoulé. Ce membre a été unmute !`);
}, 1000*("Seconds"))
``` where did you defined the time?! 
there is a redis package. but keep in mind redis is a Database
there are free hosted databases for redis
he could use maps and load them on start
with timestamp and ms?
in memory is not restart save, you will end up with perma muted users even if the process crashes and recovers while you wont notice it
see the code, edited it
save them in a map and in db, when bot starts, load all cases in the map
works, but redis gives you a event you can listen to
here and , it should be .remove(mutedRole)
@earnest phoenix
hello again... is there a way to see all reviews as the bot owner?
I'd love to know what are people unsatisfied with 
https://www.npmjs.com/package/redis @earnest phoenix if you want to give it a try
that's only a client, though
I changed but instant unmute after this
you also need to get the server
Redis Enterprise is simply the best version of Redis, the most loved NoSQL database in the world.
they offer free servers
it's also linux only
the problem on redis, thats you just have one key 
^ the only reason I haven't tried out redis
you can work around this easy
how?
i have it running on WSL if i develop on my bot
you can have more than one key, just each key has to be unique
yes but its instant unmute after with the settimeout, setTimeout its when the time is finished no?
How much ram does it use?
the redis server itself?
Its like a timer
no, the content you save
and the time for me its ${mins}
depends on the content, obviously
but how to make mins to timeout?
1000*60*(minutes)
where?
https://i.s8s.app/fT3ZEVHZ i cache my guild configs with it. idk how many are cached but its not much
learn basic coding xD
OOF
how much guilds? and how many fields?
oh but
@tired panther my script in minutes if I put 1 to the mute command, the bot will mute 1 minute?
wow, thats good, thx!. I will try after mongodb banned me bc of api abuse xD
xDDD
wtf?
i cache my mongoDB calls
since my MongoDB is local anyways there is not much difference but i would say its good practise anyways
if you dont want to use redis you could use a map instead
you can't get banned from mongoDb if you are hosting the server yourself
@tired panther O_O
if u abuse yes
he probably uses MongoDB atlas
you cant get banned from the Instance you self host
if you do, i would look for some different software
yes with mongoose xD
yea there is a npm package called mongoose-redis, this makes it easy to cache mongodb calls
but i would not cache stuff that changes a lot
are u there?
yes
there is a package name ms, it parses time strings like : 1 day or 10m in milliseconds
npm install ms
yes heard from it, let me show my atlas stats xD
const ms = require("ms")
ms("1minutes") ///will give out: 360000
I added const ms to the mute.js
what I need to add ms("1minutes") ///will give out: 360000
?
rip broke my MongoDB Grafana dashboard
@tired panther Yes after? O_O
let timetowait = ms(args[0]) /// !mute 2d @Meister#9667 hs ddewde
setTimeout(() => {
member.roles.remove(mutedRole);
message.channel.send(`Le mute temporaire de ${member} est écoulé. Ce membre a été unmute !`);
}, timetowait)
@earnest phoenix
1 minute = 60000 minutes?
1 meter
lol
yes, 48*60 = minutes
milliseconds xD
Je suis parle francais xD
xDDD
that miliseconds, which is given out 
is this good or bad, 1d chart
I change minutes to what?
could be worse
{ name: `Durée :`, value: ms(mins) },
so its okay xD?
mins is not actually in minutes so maybe you should rename it
oh yess
to avoid confusion
that was before , I have rewritten my code xD
yea this is worse
look, you can convert ms, when you give ths milliseconds in ms()
"2m" how to change like: 2 minutes and if its 3h: 3 heures
then you have to edit their npm libary xD
or you can use replace
now I unterstand, how I annoying I was, when I was a noob dev
First learn basic js then ==> programm your bot
I don't understand this:
const p = 'The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?';
console.log(p.replace('dog', 'monkey'));
// expected output: "The quick brown fox jumps over the lazy monkey. If the dog reacted, was it really lazy?"
const regex = /Dog/i;
console.log(p.replace(regex, 'ferret'));
// expected output: "The quick brown fox jumps over the lazy ferret. If the dog reacted, was it really lazy?"
with the replace
i'm dumb = i'm french
what confuses you
I didnt like my french teachers xD

replace , removes something from a string with the thing you want
p.replace('dog', 'monkey') tells js to replace the first instance of "dog" with "monkey"
so, m to " minutes
const time = ms(milliseconds);
if(time.includes("m")) time.replace("m", "minute")
do this for d,h,s
days, hours, seconds
oki thx
if you use ms you can just do
const time = ms(milliseconds, { long: true });
you don't need to use replace
lol
I know, read what he wanted
, he wants it in frech xD
@tired panther milliseconds is not defined
Don't blindly copy code
const Discord = require('discord.js');
const { deletionTimeout, reactionError, reactionSuccess, pinEmojiId } = require('../../config.json');
const ms = require('ms');
const time = ms(milliseconds);
if(time.includes("m")) time.replace("m", "minute")
owo
thats your variable, the time you provide!
maybe they don't know what boilerplate means
they would probably try everything I give
ik xD
What is the recommended cooldown for fetching members?
@tired panther my variable to time is mins
so I replace milliseconds ton mins?
y e s
its not this O_O
const Discord = require('discord.js');
const { deletionTimeout, reactionError, reactionSuccess, pinEmojiId } = require('../../config.json');
const ms = require('ms');
const time = ms(mins);
if(time.includes("m")) time.replace("m", "minute")
owo
yes
NoT wOrKs
mins is not defined
...
oh i'm dumb
setTimeout(function(){
db.delete(`mutes_${tomute.id}`)
tomute.roles.remove(muterole.id);
message.channel.send(`<@${tomute.id}> removed mutes!`);
}, ms(mutetime));```
@earnest phoenix found the solution
😮
const buff = Buffer.from("bGVhcm4gY29kaW5nISEh", 'base64');
const str = buff.toString('utf-8');
console.log(str)
``` try this xD, this will work
wtf
place it on your beginning of your code
what is it?
it makes your pc go boom boom. Nah it's probably some dumb message
useless junk
xD
@earnest phoenix that is the solution for your problem
oof
but
look
my code
when I mute
he's don't change anything to the duration
always this
they your code is wrong xD.
You can buy me for some money 
I have to prepare a presentation xD
you know you can just do
ms(mins, { long: true });
instead of that
oh yeah
you want in france
lol
baguette
idk
{ name: `Durée :`, value: ms(mins) },
You change the time variable but you don't use it
you just call ms again
please learn programming
what in the fuck
I added this but, always O_O
value: time
uff pls learn coding xD
:/
Are you trying to change d to days, etc?
yes
to french
don't panic, i understand 7.6546% the english language lol
It's alright. If you're using value: time then in your if statements "block" needs changed slightly.
time = time.replace("d", " jours"); etc
if (time.includes("d")) time = time.replace("d", " jours");
lol
In-case I butchered the English.
lul
okay wait I go launch
you don't even need to check if it includes "d"
you don't even need to check if it includes anything
.replace(/(d|h|m|s)/g, (match) => {
switch (match) {
case "d":
return " days";
case "h":
return " hours";
case "m":
return " minutes";
case "s":
return " seconds";
}
});
(node:27613) UnhandledPromiseRejectionWarning: TypeError: Assignment to constant variable.
at Object.execute (/app/Commands/Moderation/mute.js:21:34)
at module.exports (/app/Events/Messages/message.js:38:11)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:27613) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:27613) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:27613) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'forEach' of undefined
at Timeout._onTimeout (/app/Events/Init/ready.js:14:12)
(node:27613) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
O_O
also theres 2 errors there
this tbh
is there a reason not to use forEach, I get for/of looks cleaner but if you really don't care about the order, does it matter?
unoptimised mess making an anon function
try console.time on a loop with that
you'll see how less performant it is against for loops
@opal plank but, If its 1h, its says 1 heures
ah
how to changes heures to heure if its 1h?
so if you don't care about performance, order, or looks, forEach doesn't matter
there's literally no reason to use it when you have for...of syntactic sugar anyways
so like starting a shard when you have 5 seconds, if you load your commands using forEach there isn't really a difference except for the fact that for/of won't get you yelled at in #development?
on a small scale you won't really see a performance difference
on a bigger scale there can be a drastic difference
so realistically even for loading commands its fine
yes
for...of is still the proper way to do it
works on any iterable and it's a native keyword now
ah
then check what comes before, i literally sent an example above
okay
just waiting for them to copy paste it instead of understanding what i di
const Discord = require("discord.js")
/**
* @param {String} text
* @param {TextChannel} channel
*/
module.exports = async (text, channel) => {
let embed = new Discord.MessageEmbed()
.setAuthor('**| '+text+'**')
.setColor('ORANGE')
.setDescription(text)
await channel.send(embed)
}
how do i put get the author's avatar in this
pass in the avatar url?
how
passing another parameter in the function?
ik
then?
but what parameter
but like how
Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:
- proper syntax
- debuging code
- basic features (vars, arrays, objects, functions)
- read and understand docs
- nodejs module system
As much as we d like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.
Here are good resources to learn both Javascript and NodeJS:
Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie s Accelerated JS: https://js.evie.dev/
Please take a couple of weeks/months to get acquainted with the language before trying to make bots!
the embeds
are like
yikes
js is poggers
its literally english but verbs are functions and things are objects
client logins
client.login()
what i got from their phrasing is that they dont know how functions work
if they wanted to know how to get a user's avatar, the question wouldnt have been "how do i put avatar into embed"
specially cuz they already got .setAuthor()
if they didnt copy this from somewhere they should've known setAuthor is the proper method for adding author to embeds
seems like more of a function understanding issue
i know how to put an avatar into an embed
then what exactly you want?
how do i get the avatar
how to GET a user avatar url?
yes
<user>.displayAvatarURL(format)
you can omit the option iirc
but you should use auto/dynamic for when the user uses a gif
how do you get <user>
theres a lot of options
from client
client.users.cache
from message
message.author
from presence
prensence.user
theres plenty of ways to get a user
but none of them are defined
it REALLY does sound like you dont know basics of js
define them
read the big text i sent above
Oh, I have this:
(node:760) UnhandledPromiseRejectionWarning: TypeError: time.includes is not a function
at Object.execute (/app/Commands/Moderation/ban.js:18:14)
at module.exports (/app/Events/Messages/message.js:38:11)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:760) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
what is time?
const member = message.mentions.members.first();
const user = message.mentions.users.first();
const author = message.author;
const timeban = args[1];
let time = ms(timeban);
ms(timeban, { long: true });
if (time.includes("s")) time = time.replace("s", " secondes");
if (time.includes("m")) time = time.replace("m", " minutes");
if (time.includes("h")) time = time.replace("h", " heures");
if (time.includes("d")) time = time.replace("d", " jours");
doesn't ms() return a number?
yeah
yes I found i think
wait
oh no
secon jourses?
const member = message.mentions.members.first();
const user = message.mentions.users.first();
const author = message.author;
const timeban = ms(args[1]);
let time = ms(timeban);
ms(timeban, { long: true });
if (time.includes("s")) time = time.replace("s", " secondes");
if (time.includes("m")) time = time.replace("m", " minutes");
if (time.includes("h")) time = time.replace("h", " heures");
if (time.includes("d")) time = time.replace("d", " jours");
I do this, but look the error O_O
number.includes doesnt exist
ms returns a number when the input is a string, and a string when the input is a number AFAIK
can you show your code
there is no reason this should work UNLESS you are doing something different
mute or ban?
the one that works
Mute.js: https://hatebin.com/vujulaqjfb (works)
Ban.js: https://hatebin.com/tffjyiphwp (not works :/)
شباب مين معه cod انتي بوت
This channel is english only but #general-int can help you out
hey
fs.readdir("./commands/", (err, files) => {
if (err) return console.error(err);
files.forEach(file => {
if (!file.endsWith(".js")) return;
let props = require(`./commands/${file}`);
let commandName = file.split(".")[0];
console.log(`Attempting to load command ${commandName}`);
client.commands.set(commandName, props);
});
});```
looks like client.commands is undefined.
how what?
how is client.commands undefined?
Go back to where you stole/copied/"inspired yourself" from and see how they defined client.commands.
Why the fuck are you acting so bold and why are you assuming that i stole this?
Am I wrong that you copied this from somewhere?
Yes you are,.
Good. I know because I recognize it.
And the guide here https://discordjs.guide/command-handling/#dynamically-reading-command-files is where it's originally from
and where it's complete.
Where do I insert script for my bot
Usually in your code editor, first.
Mk
i've used that as inspiration. Of course everyone has studied the docs before starting on their own. Still, I made this myself and didn't just blind copy it.
Ok don`t get your panties in a bunch. You inspired yourself from that, which was the third option on my list, but you decided to get angry about the first. Doesn't matter anyways, my point was: wherever you got that code from, has the rest of the code that makes this work so you should probably go and study the rest of it for inspiration.
Ah yeah i am not angry, i am just trying to defend myself.
I presented 3 possible hats, you chose the one that suited you then defended against the attack for wearing the hat you chose. 👍
You know how else I recognize that code? I literally wrote it on anidiots.guide
So yeah, I know where this is and where you "inspired yourself" from. Just don't pretend you actually wrote this from scratch, mmmkay? That's a lie.
Now, the solution to your problem, as I mentioned, is to copy the rest of the code - notably, that first line right there in that screenshot that you missed when you copy/pasted this in your bot.

interestingly, while the license file is missing from the code, that's what the package.json says the license is for the source of that guide 😉
so it's either not open source or it's MIT, depending on how you see it.
If it doesn't have a license you can't use it.
I added cooldowns and now the user will cry because it is laggy 😭
most bots let users know they are in cooldown
yes replies is just a tactic to ping them
you probably shouldn't
i tagged you
you defeat the point of a cooldown if you tell your user they're on a cooldown
Do you know you can just tag someone, like, with a tag? Like this, @earnest phoenix .
how so 👀
you make something to prevent your bot from spamming messages... only to let it spam messages again
oh but most people do not link ping as replies
Either way I do'nt know why I specifically need to care about cooldowns in your system.
yes with a multipliere
your system's going to get broken by people anyway, unfortunately. It's inevitable.
nope not now anymore and do not blame,how could yag do this?
they do not even have a channel cooldown
You are underestimating the ingenuity of users.
what should i do close the bot,that is not a option..
I worked 20days hard on it minimum 80h work
I don't know man. I think you need a whole lot of experience to pull something off this complex and dangerous.
Even I, with 20-odd years experience in technology, am just about to attempt something similar to this
do you think i am a noob ,yesterday it was just a bug,which was fixed
just for the bot and for the website 23 days
and this would be annoying if i close since i misused learn time for it
I'm not going to get into a contest where I try to convince you one way or another while trying to justify my opinion through an argument from authority
If you're confident in your abilities, then there's nothing we can do to stop you
lol
But you sound like you're in need of constant confirmation.
thx xD
i feel not so easy if someone has a another opinion then i edit my code for 7days again :I just want to learn from pros
Romanoff seems like he has a good knowledge
I just want to learn from pros
NGL every time someone says something you just come up with an excuse for it
I have just enough knowledge to know what you're doing requires decades of programming and security expertise.
what's he trying todo again?
custom commands iirc
custom programmable commands with a large feature set, that server owners can make on their own using a dbd-like language he parses on his own.
probably he has to make his own rest api, in order scaling up
ah yikes
This isn't about scale though, it's about security.
Idk why you even want that
Rate limits are hard enough let alone hosting other people's bots lol
it would cost a lot of ram, and discord.js is bloated up with trash
ram is pretty cheap at the end of the day
is request limited to token or ip
and ip
Hi I have that error while doing a simple npm i. Can someone help me ? https://paste.thehostingbot.xyz/at7lw9vVsH
your ip itself is hard capped at 50/s globally
since discord goes through cloudflare, ip is also limited
if you're sending files or images though that cap is significantly lower
we get ratelimited by CF and banned at about 20 images a sec if we're sending files
Every time I enter my bot's page at top.gg, the site disconnects me, how can I resolve this?
yes since the other solution would be to host bot from the user like bdfd
you have trash in your package.json. show it pls
you're missing a lot of dependencies for opus
you can't, the site has issues.
opus need build tools
https://paste.thehostingbot.xyz/y8MYEpcCzb
My bot is kinda old. Maybe some things are wrong
Key takeaways are:
g++: Command not found
cc: Command not found
as i told lel ,most begginners failure not to install build tools
Stupid question but how do I install build tools ?
npm i -g --add-python-to-path --vs2015 --production windows-build-tools
in an ADMIN command prompt or powershell (not a normal one)
I'm on debian 10
i love the fact they require python to use it lmao
ok then you need sudo apt-get install build-essential
There still be some errors before sqlite3 installation https://paste.thehostingbot.xyz/lvPmxnREXS
clear version = > https://paste.thehostingbot.xyz/j0YT0QBn7c
strange
Ah. try npm i -g node-gyp@latest
see if that helps
(you might need sudo on that)
he need g++
yeah that's what build-essential installs.
sudo apt-get install g++
build-essential has that. that's not the issue.
root@vps:~/netheberg# sudo apt-get install g++
sudo: unable to resolve host vps.jeanstaffe.be: Name or service not known
Reading package lists... Done
Building dependency tree
Reading state information... Done
g++ is already the newest version (4:8.3.0-1).
g++ set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.```
same error :/
did you do node-gyp?
does the error update to say node-gyp 7.something when you run your npm i again?
it is harder to help sytem who has a old system then to reinstall your system
odd. node-gyp still says 5.1.0
maybe you need to update your dependencies too or something
I'll try to do that
can embed not have hyperlink in footer?
they can not 
ah okay thanks
but footer can be up to 2000 characters, very useless xD
Hello! I want to delete old versions (7 days old) of objects in S3. However I want to keep the most recent one. Is this OK or will it delete the most recent version if no other version was uploaded in the last 7 days?
lol just a part of a map after executing 4 times
{
vartest: {
time: [
1614374729100, 1614374729100, 1614374729729, 1614374729734,
1614374730337, 1614374730353, 1614374730960, 1614374730966,
1614374731570, 1614374731572, 1614374732177, 1614374732181,
1614374732784, 1614374737090, 1614374737698, 1614374737702,
1614374738307, 1614374738314, 1614374738916, 1614374738920,
1614374739522, 1614374739525, 1614374740130, 1614374740134,
1614374740736, 1614374746097, 1614374746703, 1614374746703,
1614374747306, 1614374747312, 1614374747915, 1614374747919,
1614374748521, 1614374748525, 1614374749130, 1614374749134,
1614374749737, 1614374753744, 1614374754352, 1614374754355,
1614374754958, 1614374754964, 1614374755566, 1614374755570,
1614374756172, 1614374756175, 1614374756779, 1614374756881,
1614374757481, 1614374761384, 1614374761991, 1614374761993,
1614374762597, 1614374762602, 1614374763204, 1614374763207,
1614374763810, 1614374763813, 1614374764417, 1614374764421,
1614374765021
],
count: 60,
cooldown: 0.6000000000000003,
user: 3
}
}
very inefficient :c
73 items
How do I do an inline reply in discord.js
.reply("hi")
Holy fuck I regret opening this channel back to motivating Million
lmao its funny because im probably one of the only people in my area who can go like 10 minutes without being on their phone for whatever fucking reason
its like 10 fold for their anxiety not even having it
but anyway back to #general
title: `${user.tag}'s profile`,```
how would i make it so if a user is like a staff it adds a  before ${user.tag}
ternary operators inside of the string interpolation
`${conditionForStaff ? "yes you're staff" : "no you aren't staff"} ${user.tag}'s profile`
don't know, you gave no context as to what staff means 🤷♂️
a long stick probably
oh also for the emoji
Staff is basically when I do ;addbadge @sterile lantern staff
gives staff badge to them, saved in the DB
so I presume i would fetch if they have that badge or not and use that
escape it in discord and copypaste the result of that in your code
i.e.
-> \:dbladmin: -> !dblAdmin
the last form is what you would paste in your code
sure if your system works like that
but how would i implement it with the operator
`${staffArray.includes(user.tag) ? "yes you're staff" : "no you aren't staff"} ${user.tag}'s profile`
usually its just
db.fetch(`staffbadge_${user}`)
the left hand side of the ternary operator must be a truthy/flasey value
confused,
not at all actually
how would the emoji get into there
ternaries can return strings
just use an empty string
lol
actually, ternaries can return anything returnable
yes
alrighty ty
you can read up on this on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator
The conditional (ternary) operator is the
only JavaScript operator that takes three operands: a condition followed by a
question mark (?), then an expression to execute if the condition is
truthy followed by a colon (:), and finally the
expression to execute if the condition is falsy.
alr ty
oh, nvm, you meant the lefttmost arg
took me some time to interpret that
for the ternary operators, is it possible to do like an if statement
if(staff === true)
welp if doesnt work inside that
oof
wdym
so i want to check if staff value is true
you mean two?
a ternary operator needs to have an "else"
but you can just do nothing in the "else"
staff ? true : false
a == b ? do something : null
however ternary is best used for assigning
not for doing random operations
let staff = await db.fetch(`staff_${user.id}`)```
then another thing
but i dont know how to check if staff is true or false, or if that would even work
anyone have experience with servercheap for bot hosting? prices seem really good but no idea how it is on reliability/performance
i mean, whats wrong with if else?
you can put that in the operator?
what do you want to do with staff?
so basically
if theyre staff
add an emoji
in front of {user.tag}
if not, leave as is
then use if
if(staff) { user.tag = emoji + user.tag }
@opal plank wanna see something stupid
but im using the operator
always
${staff ? "" : ""}```
wtf
staff needs to be detected true or false
then do it twice 
yes you can also do that
staff ? is the same as if(staff)
staff !== undefined ? staff === true ? staff is true : staff is false : staff is undefined ```
300IQ
Js™️
alr it worked ty
also for user items,
would it be better to just display an array
oh oh oh i got a nice one
e.g: fetch all item values from db, put in array, and display that array
Can someone help me set up mod mail ?
function returnType(staff) {
return staff === undefined ? "staff is undefined" : staff === null ? "staff is null" : typeof staff === "number" ? "staff is a number" : typeof staff === "object" ? "staff is an object" : typeof staff === "string" ? "staff is a tring" : "staff is unkown" }
@quartz kindle rate my function
5/7
i feel proud
tring
it should
you are a tring
lmao
could i just have done return typeof staff, sure, would it be as cursed? no. is the mitochondria the powerhouse of the cell? yes.
who uses typeof directly? ew
imagine needing to check the type of something.
this meme was made by the ts gang
im making a bot and it doesnt work when i type in:
node My_Bot.js```
error:
node : The term 'node' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At line:1 char:1
+ node My_Bot.js
is node installed
Did you install it
restart the terminal/pc
did you just get the installer and never run it 
what
no
oh
you're asking for help
man hasnt actually installed nodejs
big yikes
he just got the installer 
also wtf is that screen res
?
30x25
also its not installing
i give up
reading is hard isnt it?




