#development
1 messages · Page 1933 of 1
I made it be before a while ago that let you have more than two channels in a call and I'm thinking of remaking it
Anyone know about my API list question?
Sometimes I've considered adding support for voice chats and direct calling
And also using it as a phone a friend life line for a quiz show server I was making and I would link it up to smart people servers
Anyway where could I find a list of discord APIs implemented since early 2018?
is there a way i can dockerize discord bot?? djs especially.. how do i shard in that case
any docs?
thanks
probably is one online
dockerizing a bot should still work the same way with shards since those shards will be separate processes in the same container
i see, thanks!. any useful links?
Hello, can someone fix a bug on my discord bot? the bot is responding to any prefix
show the code where you define a prefix
can i invite you to my replit?
just send a screenshot
give me a sec
inviting random people to a replit is risky
turn || into &&
yeah, but i have the bot codes
okay i'll try
the bot is dying
if (!message.content.toLowerCase().startsWith(prefix) || message.author.bot) return
that
mybad
https://i.capy.host/tmgzXc2W why won't the input field go underneath the text?
<br> didn't work
\n ?
alr gimme a sec
thank you sooo much ❤️
<form class="mt-2 flex" action="/changeuser" method="post">
<input type="hidden" id="userid" name="userid" value="<%= user.id %>">
<h1 class="mt-5">Embed line 1</h1>
<div class="flex flex-col"></div><input class="p-4 border-t mr-0 border-b border-l text-gray-800 border-gray-200 bg-white" name="username" id="username" placeholder="<%= username %>"/>
<button class="ml-5 bg-gray-700 hover:bg-gray-800 text-white font-bold py-2 px-4 rounded">Change</button>
</form> ```
I got rid of <br> because it didn't work
do you use bootstrap ?
Tailwind
ok
<form class="mt-2 flex" action="/changeuser" method="post">
<input type="hidden" id="userid" name="userid" value="<%= user.id %>">
<div class="flex flex-col">
<h1 class="mt-5">Embed line 1</h1>
<div>
<input class="p-4 border-t mr-0 border-b border-l text-gray-800 border-gray-200 bg-white" name="username" id="username" placeholder="<%= username %>"/>
<button class="ml-5 bg-gray-700 hover:bg-gray-800 text-white font-bold py-2 px-4 rounded">Change</button>
</div>
</div>
</form>
should work
@spark flint
i am going to

You can use regular expressions when you convert the timestamps to UTC format
SyntaxError: Missing catch or finally after try in /root/site/views/image.ejs while compiling ejs
Hello, does anyone know where I can fine a list of discord APIs implemented since early 2018?
doubt its public
I'm talking about the APIs like slash commands and stuff
I want to know whats been added to discord apis since early 2018
How many changelogs are there between 2018 and now?
I don't want every single little change, I just want to find a list of new things
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
bump
are you using try{} anywhere?
yeah
is there a catch{} after the closing bracket of the try?
it needs to be right after
nothing can be between it other than spacing
it tries to
I would put that code in vsc and just double check that closing bracket is the one for the try{}.
ok
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '../../util/Collection'
Require stack:```
When I do `node .` this error appears.
You omitted the require stack so that error is incomprehensible to us
Wdym.
here's my code ```js
const { Client, Intents } = require('discord.js');
const Discord = require("discord.js")
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
const prefix = '.';
const fs = require('fs');
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const command = require(./commands/${file});
client.commands.set(command.name, command);
}
client.once('ready', () => {
console.log('Mmm, good soup.');
client.user.setActivity('customers eat.', { type: "WATCHING" });
});
client.on('message', message =>{
if(!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
// if(command === 'test'){
// client.commands.get('test').execute(message, args);
// }
});
client.login('token');```
Require stack:
... there's nothing here
oh the whole error
but it seems like you're using an older version of Discord.js?
or someone did a fucky wucky
i think i have v13
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '../../util/Collection'
Require stack:
- /Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/actions/MessageDeleteBulk 2.js
- /Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/util/ModuleImporter.js
- /Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/actions/ActionsManager.js
- /Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/Client.js
- /Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/index.js
- /Users/user/Documents/Dino_and_Soup/index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:94:18)
at Object.<anonymous> (/Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/actions/MessageDeleteBulk 2.js:4:20)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/actions/MessageDeleteBulk 2.js',
'/Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/util/ModuleImporter.js',
'/Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/actions/ActionsManager.js',
'/Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/client/Client.js',
'/Users/user/Documents/Dino_and_Soup/node_modules/discord.js/src/index.js',
'/Users/user/Documents/Dino_and_Soup/index.js'
]
}```
uninstall it and install it again
ey!
I have a problem with my HeadlessUI Modal. https://headlessui.dev/react/dialog
So, I map through an array and on every element I render an info table + a button to open the modal. Sometimes everything's working fine and suddenly I can't do anything anymore and I get spammed with Uncaught RangeError: Maximum call stack size exceeded
maximum call stack size exceeded means you have an infinite or near-infinite recursive function
meaning a function that calls itself, or mulltiple functions that call each other either infinitely or for too long of a time
hmm but I don't know where...
well neither do i, especially without the full error and the code lol
@zinc fable is a mum
bro... that's just random af...
whats the full error?
tbh... I don't know but I don't get an error anymore.. I also don't have it anymore. But it could be that it just appears random again.. can I text you if I get it again?? I don't know why... 🤔
MmMmMm inconsistent code execution, my favorite
Say I was making an rpg bot, and people could mine stuff
{
"candies": [
{
"item": "Cookie",
"value": "25"
},
{
"item": "Gingerbread",
"value": "40"
},
{
"item": "Peppermint",
"value": "65"
},
{
"item": "Truffles",
"value": "90"
},
{
"item": "Candycane",
"value": "150"
}
]
}
this is the list of items they can mine and how much they can sell em for.
The thing is, I wanna make it so the higher the value of the item the less likely they will mine it from their mine. Though I don't wanna make it impossible to get any I just wanna make it so they don't mine more of a higher valued item than a lower value since its supposed to be rarer.
Any idea how to calculate this or a way of going about doing this?
you could make it so the chances are equal?
so you take all of them into account
the higher has a higher percentage the lower has a lower
and the percentages add up to 100%
this is called a softmax function its often used in machine learning
Wait what?
If the chances are equal then how do you make a higher valued item harder to get a lot of?
if you only have those, you can use a simple if else chain with math random
if you have many items tho, it gets too much
I plan on adding more if my bot does well
one sec i'll show a demo
So I wanna do something now that would be easier to scale
but for a simplistic approach use tims 😂
it is indeed simple but if I go to add more items like tim said it will get to be too much
so I wanna do something now that will work no matter if I add more items or not
another way to expand on it would be to add tiers
and then use math random on the selected tier
for example, lets say you have 3 tiers, common, rare epic
if math.random() retruns a value bigger than 0.4 for example, chose common, then get a random item from the common array
bigger than 0.4 would be 60% chance
I see so assign values from 0.1-1 for different tiers?
if math random results a number between 0.1 and 0.4, which would be 30% chance, chose a random item from the rare array
yes
that way you cant control individual item's chances of obtaining it, but its easy to add/remove items from the list
does math.random() on its own only go up to 1?
yes
For a basic implementation I like this method
just multiply by any value u want
if I ever wanna control individual drop chances I can try and do that at a later point
0...1 is enough to achieve any value u want
looks a bit complicated but yeah probably not suited for your problem
in this case the higher value gets the higher percentage but there are ways to reverse that
and it works best if you have numerous items
tf
just make a normalized array and roll a Math.random()
return the last item below rolled value
or an inefficient way of doing it is to fill an array with the items, amount of a specific item depending on price and then choose a random item from the array
its actually not as inefficient as it seems
unless you end up with thousands and thousands of items
But I am wondering, doesn't math.random generally generate the a lower number over a higher number
the definition of Math.random() is that it returns a pseudo-random number between 0 (inclusive) and 1 (exclusive)
so no, there is no bias or weighting
though as far as javascript community goes you're right
wonder if theres a way to make something like this without having to push tons of duplicate items
I am still confused of how math.random would be useful here maybe my thinking is wrong
What I am thinking is that if it hardly ever generates a number bigger than 0.4 wouldn't that make it so the rarer items should be gotten then?
it doesnt
🤔
the number is random between 0 and 1
there is no such thing as lower numbers showing up more often
I see
you are taking the probability and dividing it in sections
you know that its 100% chance of being 0-1, so you also know that there is a 50% chance of being > 0.5 and < 0.5
likewise the chances of being lower than 0.4 are 40%, and the chances of being bigger than 0.4 are 60%
you can divide that into sections anyway you wish
if you want a 10% chance you can do either < 0.1 or > 0.9, doesnt matter
or between 0.4 and 0.5
w<
-b +- sqrt(b^2 - 4ac) / 2a
this is more about ranges (0 < x < 1), so it isn't big brain math stuff
the trauma
very nice equation
you are in a long corridor, it is 10m long
you throw a rock, what are the odds of it landing before 2m?
it's easy, you just need to visualize it
also math will be fundamental in devving
Are the votes reset???
probably
yes I know but ugh I hate it
:((
the more you fight math the harder it'll bite u back
yea ik
-KuuHaKu
then you're lucky, as we don't touch algebra here
what numbers sit between 0 and 1
0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8 and 0.9 I would assume is the correct answer to that
They do fit
but the answer is an infinite amount
as there's no limit to how many numbers past the decimal point there are
true
- infinite might be smaller due to double precision
But we don't like infinite numbers. so if we say 0 < x < 0.5, that's 50% of our numbers
still infinite, but now we have a smaller range
infinite is more of a concept its value doesnt matter:)
hold on i have nitro i can send 4k messages
i have the same question
even using css frameworks like bootstrap the interactions are still random at times
gotta be honest, I hate bootstrap
same
I've only used Tailwind so far, but I like and don't like it
I prefer tailwindcss
so I'm back for the search
same thing with tailwind
like, making a site responsive isn't that hard to justify having to deal with shitty bootstrap classnames
i only find it quicker to use than css not exactly easier
because the underlying css interactions still stand
sinonym for buttfart
lmao
well, most of it is fully functional, so you can use it as is
but i will work more on it as april aproaches
since im gonna transition my bot to it
i dont
lmfao
i procrastinate 24/7
hi tim

how do
every programmer out there
i thought you were doing the maximum but you're doing the bare minimum
procrastination as a service
paas
You pay me to procrastinate a project and I'll take all the blame!
https://stackoverflow.com/a/70230587/10697213
a lot of people said that the answer to the OP's question is something that can't be done
is hijacking that rarely known?
Damn capitalists everywhere 
woah woah woah
not true
Pretty much!
its not often used in browser contexts, because a lot of stuff in browsers is protected for security reasons
but yes you can override the prototypes if they are not native code
I get what you mean but native code or not.. once you can access a property, you can mess with it however you want(as in script loaded is also held from the same "arms length")
also gn ;-;
don't think native code can be messed with
With button interactions, what’s the best practice with the collector? How long should I keep the collector going on for and is there a way to disable the button once the collector ends?
They can run indefinitely
You'll get an interaction create event when a user clicks it
Just don’t use a collector at all since you receive an event if an interaction happens
You can disable them as well

hot
like fake said, best practice is to avoid using collectors in the first place, unless your use case really warrants it
Ah ok yea I was tryna change the button after 15s with collector.on(“end”, () => {}); but yea I’ll just try with client.on
Thanks for the help
im asking a serious question tim cause im kinda curious why you say to avoid using em.
collectors exist to fill a very niche use case, which is "waiting for multiple responses"
The better question is why I would you use them if you receive an event anyways?
most times using awaitXXX will be a much easier and better option
true you receive an event
but it gets messy doing it in an event
if you use it for multiple purposes
and the times where you need to process multiple inputs from the user, most times using the event directly will be better
so collectors sit in a very weird place
Err no? That just depends on how you handle your commands/buttons/interactions code
🤷♂️
just please dont use collectors for single response use cases, like question-answer
I love asking one question and collecting it with a message collector
ugly
rude
This channel is weird
Including the persons in it
you're in it

what does that say about you
That I should leave and sleep
yes
let msg = await message.channel.send("question");
let answer = await msg.awaitMessages(options);
await message.channel.send(answer);
``` vs ```js
let msg = await message.channel.send("question");
let collector = msg.createMessageCollector(options);
collector.on("collect", async answer => {
collector.end();
await message.channel.send(answer);
});
i rest my case
yea awaitMessages is just better
but
who would use the message collector
if they do ew
let msg = await message.channel.send("question");let collector = msg.createMessageCollector(options);collector.on("collect", async answer => {collector.end();await message.channel.send(answer);});
beautiful
i mean, if you want a one liner...
(await message.channel.send("question")).channel.createMessageCollector(options).on("collect", message.channel.send)
not short enough
await message.channel.send(await message.channel.send("question").then(m => m.channel.awaitMessages(options)));
s=message.channel.send;s(await s("question").then(m=>m.channel.awaitMessages(options)))
xD
()()())(
pain.
a fish
I like fish
hey so im having a major issue with the description, can someone explain to me why its displaying like this despite me setting the border to 1px.
tasty tasty
is that a christmas tree
completely unintended
I think it looks good
its not good, the text overflows and it looks like crap
keep it that way it looks festive 
<!DOCTYPE html>
<html>
<style>
.css-1332yn0{
background-color: white !important;
}
.css-z4g4qj{
background-color: white !important;
}
.css-1xyu927{
color: black !important;
}
ul {
list-style: inside;
}
*{
text-align: center;
}
ul{
list-style-type: none;
padding: 0;
margin: 0;
}
li{
margin-top: 1px;
}
li:first-child {
margin-top:0;
}
</style>
<body>
<h1>Meet Mewdeko, the bot that is so customizable, and is so powerful, the only thing you'll say is damn.</h6>
<br>
<br>
<h2>Feature List</h2>
<h3>AFK</h3>
<ul id="afklist">
<strong><em>
<li>Set your afk!</li>
<li>See which users are afk!</li>
<li>Limit the length of afk messages in your server!</li>
<li>Remove afk for one or more users that may be abusing it!</li>
<li>Set a completely custom embed to use when a user is mentioned!</li>
<li>Set after how long an afk message deletes itself to reduce clutter in chat!</li>
<li>Disable the showing of afk messages in certain channels to avoid annoying embeds when you don't need them!</li>
<li>Set wether afk is disabled when a user types, sends a message, or if its not removed until they or a mod disables it!</li>
<li>Set after how long a user is considered afk after they set their afk! This affects how the feature above works directly.</li>
</em></strong>
</ul>
</body>
</html>
that says 10 but i set it to 1
there
Ye, the margin is there
yea
now the issue is
Where is that?
thats my own html file
What abt the other?
the other is topgg preview
Ur structure is messed
you are using global element selectors
You need to put styles inside head
almost forgot about that part
or create new classes/ids
I should probably be doing my own website stuff but im like tim
im procrastinating
nice
xD
im reading manga
which one
berserk
fuck yeah
berserk?
I recommend claymore after that
already read it
Wish they did follow the manga for the anime version
I read manhuas
It was perfect until pieta
I am reading this one manhua that is kinda weird
ah, more of those
but thats not what is weird about it
its like a different style entirely
ever read martial arts isekais or just anything that has a lot of fighting and death
sure
well this one is different cause it is like a game
it has a "system" that is sort of like a game system
<!DOCTYPE html>
<html>
<style>
.css-1332yn0{
background-color: white !important;
}
.css-z4g4qj{
background-color: white !important;
}
.css-1xyu927{
color: black !important;
}
.ulist {
list-style: inside;
text-align: center;
}
.ulist{
list-style-type: none;
padding: 0;
margin: 0;
}
.dekolist{
margin-top: 1px !important;
}
.dekoheader{
text-align: center;
}
.dekolist:first-child {
margin-top:0;
}
</style>
<body>
<h1 class="dekoheader">Meet Mewdeko, the bot that is so customizable, and is so powerful, the only thing you'll say is damn.</h6>
<br>
<br>
<h2 class="dekoheader">Feature List</h2>
<h3 class="dekoheader">AFK</h3>
<ul class="ulist">
<strong><em>
<li class="dekolist">Set your afk!</li>
<li class="dekolist">See which users are afk!</li>
<li class="dekolist">Limit the length of afk messages in your server!</li>
<li class="dekolist">Remove afk for one or more users that may be abusing it!</li>
<li class="dekolist">Set a completely custom embed to use when a user is mentioned!</li>
<li class="dekolist">Set after how long an afk message deletes itself to reduce clutter in chat!</li>
<li class="dekolist">Disable the showing of afk messages in certain channels to avoid annoying embeds when you don't need them!</li>
<li class="dekolist">Set wether afk is disabled when a user types, sends a message, or if its not removed until they or a mod disables it!</li>
<li class="dekolist">Set after how long a user is considered afk after they set their afk! This affects how the feature above works directly.</li>
</em></strong>
</ul>
</body>
</html>
nice cod
prolly should name it dekolisitem
you didnt need all that lol
inb4 you can just use dekolist on ul
you are wrapping them in a strong and em, its possible they are overwriting it
but the li's should work
btw tim what does em even do?
this
oh its itallics?
<b> does the same thing
rip
also one thing that bothered me was topgg only sees <center> for centering images for some reason when not using css
which one in particular
which manhua?
ye
so yeah making my own classes dont work
how can you not know the name of what you're reading
do I look like i can speak korean
same exact issue
dont you read english translations?
the title is in korean
wtf
but the actual manhua is in english
guess im on my own then.
I am using an android apk called mangazone
ah
they use the raws and redraw em and translate
Ahaha yes let's just translate the whole work except the title
but they could care less about a title
👍
who needs to know the title
whats your top.gg url?
idc about the title I care about the story
rn its not updated but sec
its using my old description atm
https://top.gg/bot/752236274261426212
ima just not do work and read cya bois
lemme just save my old stuff rq
if you want to read something good how about song of the long march
@quartz kindle saved it
I think it looks fine tbh
yeah no it does the same thing without it
then again thats just me being lazy
Ok. This has been legit pissing me off for a while. Why the fuck is it off centered
its mobile
excessive margins and/or padding
everything on mobile sucks
i dont even pad lol
well, only on the list
but everything else is still off center
if you want to center stuff, using ul-li is not really ideal
then?
just do regular text?
if you check dev tools, you'll see they have this css overriding yours:
.css-18r9pyf li {
-webkit-margin-start: 1em;
margin-inline-start: 1em;
}
i'm pretty sure it's not centered because the actual div where your long description lives is not centered on mobile
i have noticed this even with my basic ass markdown description
should i just use regular text then
if i remove those 1em above, then it becomes centered for me
but its better to just use regular <p>s
so if i remove this it wont be terrible on mobile?
try it
alight
regardless, you can still fix it yourself
ok i have no idea how to fic it
lol
why in the world are there two different class names for the buttons on mobile and desktop
const user = interaction.options.getMember('approveduser')
const accepted = new MessageEmbed()
//.setAuthor(interaction.guild.name, interaction.guild.iconURL())
.setDescription(`Your break was accepted!`)
.setFooter(`Enjoy your time off!`)
user.send({ emebds: [accepted] })
const logging = new MessageEmmbed()
//.setAuthor(interaction.member.tag, interaction.member.displayAvatarURL({ dynamic:true }))
.setDescription(`<@${user.id}>'s Break was Accepted by; <@${interaction.member.id}> | \`${interaction.member.id}\` for ${time} with reason: **${reason}** `)
} else {
const staff = new MessageEmbed()
.setAuthor(interaction.guild.name, interaction.guild.iconURL())
.setDescription(`You need to have the <@&916913372291801128> role. `)
interaction.reply({ ephemeral: true, embeds: [staff] })
}
}```
That gives me a : `Error; Can not send a empty message` `o-o`
You misspelled embeds
can someone tell me whats wrong here before i lose my god damn mind, preview shows literally nothing and the site doesnt show the box
<!DOCTYPE html>
<html>
<style>
.css-1332yn0{
background-color: white !important;
}
.css-1aro6ms{
background-color: white !important;
}
.css-z4g4qj{
background-color: white !important;
}
.css-1xyu927{
color: black !important;
}
@media (max-width: 1000px) {
}
.dekolist{
text-align: center;
}
.dekotitle{
text-align: center;
}
.mewdekodescription{
width: 700px;
background: #f5f5f5;
padding: 10px;
border: 5px solid #a7a409;
border-radius: 15px;
-moz-border-radius: 15px;
text-align: center;
margin: auto;
}
</style>
<body>
<h2 class="dekotitle">Meet Mewdeko, the bot that is so customizable, and is so powerful, the only thing you'll say is damn.</h2>
<br>
<br>
</head><body><br>
<center><img alt="mewdekobanner" src="https://media.discordapp.net/attachments/915770282579484693/916912959169634334/monogatari-series-background-hd-1600x900-108924.jpg"></center>
<br>
<div class="mewdekodescription">
<h1>Mewdeko</h1>
<p><br><i>A bot that combines customization, moderation and others for nothing out of your wallet!</i>
<br>
<br> - Extremely customizable suggestions and afk system -
<br> - Absolute control over how afk works and is used -
<br> - Has a 99.9% uptime so you can rest assure your server is safe -
<br> - Powerful moderation commands, in fact there are two separate warn systems! -
<br> - Powerful tools to help against raids, and cleanup after raids -
<br> - All features are completely free to use, no limitations! -
<br><br></p></div><p></p>
</body>
</html>
wait i tyink i know
ok this is actually pissing me off can someone tell me whats wrong here
preview shows nothing and the regular site skips over my css for mewdekodescription
my head is actually hurting from this because this fucking works as a normal html file
anyone
patience is key young Padawan
hello iam trying to get a embed description content in discord py can someone send a simple code how to do it ,I searched it in Google i found i had to use message.embeds but couldn't find out how to get the description
so message.embeds returns a list of embeds
yes
and I would assume you'd wanna get the first embed in the list which then returns an Embed
how to get the embed's description
which you can then grab the description
idk python so idk how you get something from a list
that is something you gotta google
it sends a embed object
if you can get the embed from the list then you can also get the description somehow.
message.embeds[/* 0 if the first embed */].description
https://discordpy.readthedocs.io/en/stable/api.html?highlight=message#discord.Embed
I assume you're asking how to add this to your long description on top.gg? Remove the <!DOCTYPE html>, <html>, <head> and <body> tags. They're already declared by the page itself and can't be declared twice.
ty
anybody here know how to make a spotify bot in python? im trying to make it so i can play, skip, pause, change volume, and show currently playing song on my spotify account through discord
there are tutorials online you can find
@rose warren can you say me please ?
No one's replying me
It's ok patience is the key to nothing
Lol
I told you you could check the pinned messages here for resources, or just Google it. Nobody here will walk you through it step by step if that's what you're looking for.
Hmm no I don't think so if you have told this before also
patience is the key to nothing
With your attitude it is, that's what I can definitely say
Oh sorry I didn't say it
Bro I was just joking for timepass ? Don't take that seriously please
Sure thing
But I didn't found anything better in Google so I thought to ask here because here alot of verified developer are there so I thought they can help me and tell me something
?
Anyhoo, a bot is a program running constantly and in case of Discord, listening to events and responding them with HTTP requests
Nope. 99% of developers here started with Google too so I'm sure you can manage it.
That implies that in order to create one, you need to be able to program it
Hmm
There are links to useful resources in the pins here.
because here alot of verified developer are there
Sorry to disappoint you, but half of this community is immature kids
Hmm but I didn't finding anything great except telling that you can make your bot from Discord developer portal which I did
👌
Only 15% of it is actually mature developer who can assist you
Oh actually I am also a kid of age 14 or 15 I guess
My English is struggling
My implication is more about their mental age, not physical
Community lead t-iara
But I digress. You'll need to learn a programming language and download necessary tools for it
Hmm 🧐
Oh ok which language is better ?
... which also means learning it and following its syntax
Sorry to disappoint you, but half of this community is immature kids
That's part of the chime of this server. Most developers here are inexperienced and gradually becoming better developers.
What is this syntax you are talking about ?
True
Hmm
You need to learn to code first. Check the pins for more resources.
There's no better or worse in languages. Every language has its use somewhere and is complicated in its own way. You'll need to refer to multiple resources for some and make up your mind yourself
In computer science, the syntax of a computer language is the set of rules that defines the combinations of symbols that are considered to be correctly structured statements or expressions in that language.
If you really want some language to start at, consider JavaScript or Python
If you're starting out I'd recommend javascript just because it's the most documented lib you can find the most help for.
Those are considered the simplest out of all of them usually
Hmm ok
Ok
Ok
I guess I need to search in yt to learn
hi
why hello there
Yeah now its not even parsing the html.
What's the bot ID?
Are you closing it aswell?
Seems to be rendering for me
The preview shows the codeblock
the preview renders html
like it did for my old one
on top of that, the body html and doctype tags are there on my old html description
and it renders proper
so either im blind and missing something or theres something else wrong
Well that's bad practice and the stray closing </head> tag you had in your code was probably the reason for it breaking.
now it doesnt render at all, preview shows nothing and it doesnt render my css on the site itself
on top of the fact that it works absolutely fine as a separate html document
preview renders nothing
what the regular site shows
what its supposed to look like
so everything at the moment points to the site being at fault
this is the third time ive said this
if (!userOrRole) throw new TypeError('INVALID_TYPE', 'parameter', 'User nor a Role');
^
TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.```
What does this mean?
not a User nor a Role.
Yeah, but I double and tripple checked my work, it always gives me this.
it means that whatever you put is not a user or a role
It doesn't tell me where I put something wrong at tho
giving just part of the code does nothing for us either
might wanna refresh your token.
Alr done lol
where exactly does this throw
Wym?
"guild": "916911511157481513",
"log": "917048604131221585",
"prefix": "!",
"roles": {
"bot": "917046932596219956",
"mod": ["916913101528522823"]
},
"ticketCategory": "917048587836338247",
"dmUsers": true,
"deleteTicketOnLeave": true
}```
That's the settings.
All those are right, I checked em over 4 times.
hmm
can you add a breakpoint around where it gets the role and tell me where exactly it fails
A "breakpoint"?
oh god what are you using to code
also, isn't it supposed to be the id
How to switch a specific user from a voice chat to another?
this^
What's it supposed to be?
why not test locally using vscode 💀
hello i need a host for wesite that support discord bot
Any vps provider
Library?
seriously tho can someone help me with my html issue
like
this is your code?
Same erorr
You dont need html or body tags on topgg, also note your css cannot be the same between standalone and topgg
^
As topgg has its own css
yes it will work, but its not correct
this returns Promise
this renders fine
also that's not the ID too
its not semantically correct to have multiple heads and bodies in the same page
even if it doesnt actually break anything
Wym? Should I just put in id: 'ID_HERE'?
true, however why would it not render at all in the preview and break in the site itself
the preview is broken, i've had the same experience with it, so dont rely on it
but the page itself should work
i've never had anything not work there
its just a matter of finding the right way to do it
yea the style is being removed for some reason
did you remove the html body and doctype?
especially since removing the html tag and bidy tag etc causes it to render as plaintext
how about removing <!DOCTYPE html> <html> </html>
yes preview is unreliable
ah
however preview showed it as plaintext
that code works here
this one
i buy my domain in go daddy
for whatever <center> works, and doing style:text-align center doesnt work for images
why is that?
seems like something is outdated
yeah
yeah, if used in a parent element
text-align:center works on inline elements
ah
so you have to declare the image as inline-block
and have it contained in a div with 100% width
css skills op, i have a ton i swear! /s
ah
also, why in the world does it render weird as hell on mobile
its off center and its ticking me off lol
Uh oh.
horizontal padding and fixed widths can make it overflow
ok i just had to change the width of the description to auto
however its still off center and its messing me up
this happens with text too
you can do display flex and both align-items + justify-content to center on a parent div if you want
that's literally how i center things lmao
use rem for font size instead of px
so it changes based on screen size
also don't use h1-6 for font size
headings
Night
React.JS or Bootstrap.
but you can use react with bootstrap
Yes I was about to say
those 2 are different things
its like saying windows vs firefox
I think I'll go with Bootstrap since web hosting these days don't support Node.JS unless you host it on a Virtual Private Server.
look at me, im highlighting cool words, im so smart
my brain is trying and failing to comprehend what you just said
:^)

Never intended that?
Great.
just talk like a normal person xD
That's how I talk.
bootstrap is a css framework
I'm aware.
I am worried about you
Be, so. 😂
What's wrong with using bold text?
I never think using it makes me smarter.
the text itself is wrong
I use it to highlight words, only.
That's according to what others said, from hosting companies, unless they are idiots themselves.
- bootstrap and react are different things
- almost every web host supports nodejs
- a vps is just a web host?????
he means shared hosting
like cpanel php etc
many of them now have built in support for nodejs, but not all
Yes, in regards to what I meant by Web Host.
Mine doesn't. :/
Dude, WEB HOST.
Okay, I should've been more specific.
😂
THE WEB IS MADE OF CAPYBARAS
Although, isn't what cPanel powers most.
YESSSS
Interesting, that's an animal. 
theres lots of them here in brazil
tim went to brazil
We have no idea what they are, I'm scared to tell my biology teacher and she goes null/undefined.
Pce.
not me
Error:
const hash = this.hashes.get(`${request.method}:${routeID.bucketRoute}`) ?? `Global(${request.method}:${routeID.bucketRoute})`;
^
SyntaxError: Unexpected token '?'
client.once('ready', () => {
console.log('Ready!');
const CLIENT_ID = client.user.id;
const rest = new REST({
version: '9'
}).setToken(token);
(async () => {
try {
if (!715157246480482324) {
await rest.put(
Routes.applicationGuildCommands(CLIENT_ID, '916911511157481513'), {
body: commands
},
);
console.log('Successfully registered application commands for development guild');
}
} catch (error) {
if (error) console.error(error);
}
})})```
Heya,
I have a little Issue with my Slash Commands in Discord.js. When i add new Slash Commands and restart the bot it doesnt add the slash commands to the existing guilds unless reauthorized. Is there a way to sort of "fix" that?
Global commands take up to a hour.
Makes sense
Is there a way to sort of "fix" that?
@marble zephyr you can create the command as a guild command rather than global
So it appears immediately.
thx
anyone have a santa api? i remember seeing one last year but i forgot it (just an api that places a santa hat over an avatar)
your node.js version doesnt support ??
Wtf rip Tim
You don't need node.js in order to use react
Also what do you need react for? Because bootstrap and react do not have the same purpose
if you're making a static site then I wouldn't really recommend react
Don't u?
Like, iirc to install react u use npm
on the server you don't need node.js
during development yes
Actually you don't need it during development either, you can get react via a CDN
who said a static site can't be interactive
<client>.ws.ping
v12 😔
And you should use v13 discord.js or eris.js idk
What do you mean?
Like an activity status?
And what library are you using? JDA? Kord?
feel free to reply to this with a roast for my bot's roast command, you will receive credit as a contributor
kord
Hello
How to I get my bot to work?
idk
bang on it a few times, always works for me
const auditlog = async function({
guild,
type
}) {
const fetchedLogs = await guild.fetchAuditLogs({
limit: 1,
type: type,
});
const log = fetchedLogs.entries.first();
if (!log) throw new TypeError(`Something went wrong!`);
return log;
}
//----------------------------------------------\\
client.on("guildBanAdd", async(guild, user) => {
const log = await auditlog({
guild: guild,
type: "GUILD_BAN_ADD"
})
guild.fetchAuditLogs is not a function
The first parameter of guildBanAdd is a GuildBan instance.
Not a guild
You could use guild.guild.fetchAuditLogs(...)
There's no second parameter by the way, so specifying user is redundant.
.
hi what site do you use
maybe it grew too much
that should be a 413 error
or something like that
i'm getting a 400 error
Does anyone have the Disocrd.js Docs link for creating slash commands in your main index.js file?
Instead of Command Handling.
why is my request being so bad?
Try telling it to be good
client.on('interactionCreate', async interaction => {
if (!interaction.isCommand()) return;
const { commandName } = interaction;
if (commandName === 'ping') {
await interaction.reply('Pong!');
} else if (commandName === 'beep') {
await interaction.reply('Boop!');
}
});
Ah alr
it was actually one description that was 101 characters long
that was fun to find
Yee had that issue in the beginning, too
Couldn’t figure it out until I read the fucking error message

Yeah 
Who does that
Greetings, do you help with bot command issues?
airspeed of a binladen swallow
Lol
C:\Users\Administrator\Desktop\Kral-Botlar\Kral-VampirK1-BOT\node_modules\discord.js\src\rest\RequestHandler.js:154
throw new DiscordAPIError(request.path, data, request.method, res.status);
^
DiscordAPIError: Missing Permissions
at RequestHandler.execute (C:\Users\Administrator\Desktop\Kral-Botlar\Kral-VampirK1-BOT\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async RequestHandler.push (C:\Users\Administrator\Desktop\Kral-Botlar\Kral-VampirK1-BOT\node_modules\discord.js\src\rest\RequestHandler.js:39:14) {
method: 'post',
path: '/channels/907998176131297301/messages',
code: 50013,
httpStatus: 403
}
missing perm
aka you don't have permission to do something
posting a message to a channel channels/907998176131297301/messages
Error getting the bot from the server roles, so is there a command like message.channel.send(error?
Sorry my English is bad.
you don't have SEND_MESSAGES perm
the channel might be locked down
you need to check if you can send before sending
or many of the potential reasons listed https://discord.com/developers/docs/resources/channel#create-message
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
or some not listed
"handle" as in silently bash the error in the head and put a flextape in its mouth
Thanks, the bot is giving an error because its role is not taken over.
So, is it possible for the bot to log an error accordingly?
errors go into the void
The bot is constantly rebooting. But what I want is for it not to reset.
If it logs the error to a specific channel and there is no reset. If I set the command accordingly, will the problem be solved?
handle the error
.catch(() => {})
since u can't send "Not enough perms" message
Just use if () for perms
are you even reading what we are saying?
¯\_(ツ)_/¯
Reading.,
and for god's sake, indent your code
the complete lack of any formatting is disturbing
How would I make these for only 1 Server?
Guild commands?!
Yeah, Slash Commands for 1 server in your index.js file.
It’s an event so associated to servers

I hated that character
Whatever you wanna do sounds weird
Thanks for the help guys, have a nice day.
I want to create slash commands in a index.js file, but only for 1 server.
use guild slashes
Got any good docs links?
what lib are you using
uh no shush
that is disgusting
Discord.js?
Yeah^
if else sucks tho if you are doing multiple things
It's with a messageCreate thing tho.
just use switch/case ez
It's a ModMail bot with Slash Commands.
switch/case > if/else
Why not just use if else?
else if
Idek how to use that.
switch/case ignores everything and goes straight to the correct result based on the expression
whereas if/else will go through every single if statement until it finds the right one
so switch/case is generally faster
unless it's been changed
just a note, its like microseconds faster unless you have thousands of if statements
so whatever works for you is generally better
I mean yea woo, but on a larger scale I would prefer to use the faster method
but maybe my thinking is wrong

Imma stick to else if
optimizing anything else is a better use of time
plus switch/case just looks better
dont come at me
;c
From the explanation I got switch/case will ignore everything that is false to the expression given and just go for the correct one.
I might be phrasing what I am trying to say wrong tho
so :p
don't optimize what the compiler should be optimizing
again don't come at me ;c
I like using switch/case
not you specifically
just optimization in general
I like switch case too, but imo its preference in these types of cases
honestly when it comes down to it
I smell a yanderedev comment incoming
Can we get back to my question please? o-o
if/else vs switch case is a matter of preference in some cases
but it comes to a point where switch/case is just obv better cause it looks better
kthxbai
Enough with this else if, switch/case, case closed.
you aren't the one who can determine that
o-o
someone really likes their switch/case's
its a dev conversation
which is what this channel is for
yanderedev made a good game
it just sucks it was made poorly
it's so good we haven't been able to play it yet
lmao
I mean like
the concept behind the game is good
it just sucks it was made by that dood
someone who took one unity class and was like ye game time
didn't he basically do everything in unity's Update method
which updates stuff every 1s
He made a game that no matter how good your pc was
instant 5fps
No idea I didn't see the full code
I just noticed a lot of stuff was being done in the update method that makes no sense to update every 1s
there is a video on the code breakdown on yt
Still don’t get why.
You either have a global or guild command - both will trigger the event you receive
Not responding to an interaction will also cause an interaction failed warning
Can these also have Strings? (Dw I turned the ping off)
I want a guild command.
I have my bot already in prefix commands but I want to replace it all with Slash Commands, with that being said, it has args such as ; const args = interaction.content.slice(prefix.length).trim().split(/ +/g); //splitting args in which I need to convert to a slash command.
You will have to register it as guild command then
Yep, which is what I want.
Not sure how to do that.
else {
await rest.put(
Routes.applicationGuildCommands(CLIENT_ID, TEST_GUILD_ID), {
body: commands
},
);
console.log('Successfully registered application commands for development guild');
}```
I could do something like that.
using @discordjs/rest
What I am confused about is using a optionSring within a intial file.
There are no arguments parsed by the content of slash commands
The event doesn’t include a message content
You have to define each parameter you want - they are called options or components
Also don’t copy that guide trash
client.application.commands is the base to work with
There are the associated methods to register/update or remove commands
Idk why they have that in the guide when they literally made helper methods for working with the rest client
Well, my bot is a ModMail. So they need to message the bot too.
Yeah I won’t get that, too also why they didn’t update it yet
You can’t simply transfer common commands to slash commands
You have to add an option to the slash commands (being your parameter) an user is required to enter and register it
Well, can I send my code as is with just normal commands, and can you not do it for me ofc, but give me a rough guess on what I need to add?
If an event is fired you can check it’s options to get what the user entered as paramters
What am I supposed to say here?!
You have to build a completely new commands handler, dealing with registering/updating the slash commands and with your command files
So none of my code will work as is?
That's the entire thing rn.
Works with commands.
So confused if I need to add a ``interactionCreateinsidemessageCreate` orrr?
You have to build a completely new commands handler, dealing with registering/updating the slash commands and with your command files
For someone who knows djs v13 very easy, for someone who is just learning, sounds like a far strech.
At least the basic structure of your command files doesn’t change.
Slash commands also have a name and a description.
Anything’s else is optional like options the user needs to use etc
I can’t download or open txt files on mobile, just to say
Well, on my other bot, I use @discordjs/rest, so couldn't I use this:
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction, message) {```
and then add options there accordingly in a index.js file?
`} else if(slashCommand === blah blah blaj)`{
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
async execute(interaction, message) {
or something as such?
Okay that's 2 commands in 1 command, I am confusing myself o-o
you are confusing us as well
Yeah that might be true but there’s no way around if you wanna work slash commands
if you are too lazy to make your own slash command handler you can always look at frameworks or smth
Yeah well there is no good guide to explain what goes where, how can interaction receive a message from a user?
it doesn't
I've used one from @discordjs/rest which works 👌
It's not that I can't make one, given the correct resources and guides I could, but there is no basis or grounds that show me how.
Documentation
There are the djs docs


