#development
1 messages · Page 2020 of 1
If I haven't done that, it wouldn't be possible, right?
since when did js get private methods wut
yeah that # syntax is a bit whacky
How would I reorder an array from greatest to least? Ex.
[myObject 5]
[myObject 4]
[myObject 3]
[myObject 2]
[myObject 1]
To:
[myObject 1]
[myObject 2]
[myObject 3]
[myObject 4]
[myObject 5]
.sort()?
My bot is meant to say who hugged the user with ${message.author} but it's not working i will provide code in a min
const db = require("old-wio.db");
const Discord = require("discord.js");
const { MessageEmbed } = require("discord.js");
module.exports = {
config: {
name: "hug",
group: "fun",
aliases: [""],
category: "fun",
description: "Hug a Member!",
usage: "hug <Mention Member>",
},
run: async (bot, message, args) => {
//Start
let Member =
message.mentions.users.first() ||
message.guild.members.cache.get(args[0]) ||
message.author;
let Result = Math.floor(Math.random() * 101);
let embed = new MessageEmbed()
.setColor("RANDOM")
.setImage("https://media.tenor.com/images/f7379e1268593ee9daa6c027209a9968/tenor.gif?ctx=share")
.setTitle(` ${message.author} hugged ${Member.username}`)
.setDescription(`${Member.username} was hugged by ${message.author}`)
.setFooter(`Requested by ${message.author.username}`)
.setTimestamp();
message.channel.send({ embeds: [ embed ] });
//End
}
};
You're trying to mention the autor in the title which doesnt work
Oh
You need to use tag or displayname
How do I do that?
you need msg.author.username
Thanks
Omg
Thanks it worked
okay so
in my slash cmd i have it so if you do /invlinks set mode:list it should send a list
but whenever i do it it just send the option if you choose /invlinks set mode:off
as shown here
how can i make it so instead of sending the off option it sends the list option ig
idk how to ask it properly
const enable = interaction.options.getString('mode') === 'on';
const list = interaction.options.getString('mode') === 'list';
console.log(list)
if(enable) {
await interaction.reply({ embeds: [ onEmbed] });
await client.db.updateGuild(
interaction.guild.id,
{ id: interaction.guild.id },
{ $set: { modInviteLinks: 'On' } }
);
}else if (!enable) {
await interaction.reply({ embeds: [ offEmbed] });
await client.db.updateGuild(
interaction.guild.id,
{ id: interaction.guild.id },
{ $set: { modInviteLinks: 'Off' } }
);
} else if(list) {
const inviteHosts = [
'discord.gg/',
'discord.com/invite/',
'discord.io/',
'discord.st/'
];
const embed = new MessageEmbed()
.setColor(0xff3636)
.setDescription(inviteHosts)
await interaction.reply({ embeds: [embed] });
}
this is the code btw
if it helps at all
@solemn latch
you have if(enable) else if(!enable)
first of all that is redundant, since if enable is set, it cannot be !enabled anyway, useless to check twice for the same thing
second, that can only ever have 2 different options, either its enabled, or its not enabled
its imposible to ever have a third option the way you did it
Unexpected end of input line 172```
more details pls
const Errorhandler = require("discord-error-handler"); const handle = new Errorhandler(client, { webhook: {id: `962526254446284890`, token: `T1hHU3ASnCHuTAcTFzvVgJSgG5j8yyI18mh_G4OvuMxCkLnLhIghKQxZCI1XWw5KJhzs`}```
The the code a the end
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Given what you've shown, you're missing a })
Oh
One message removed from a suspended account.
thanks for the token, im gonna hack your bot now
One message removed from a suspended account.
One message removed from a suspended account.
I added it and it is still broken
One message removed from a suspended account.
It is
One message removed from a suspended account.
hey tim I'm on life support and need your bot token to save my life can you please give

someone better not report me for that
sure, my token is uvuvwevwevwe.onyetenyevwe.ugwemubwem.ossas
Missing )
ty
I did that still broken
go count your brackets
how about you read how to use it ?
That it is what I'm using
i know, but you didnt read any of it to learn how to use it
I got it fixed
Using the user-agents package (https://www.npmjs.com/package/user-agents), how would I utilize it in axios?
var userAgent = require('user-agents');
axios.get(file, { headers: userAgent.toString() }).then(async (response) => {
let pageContent = response.data;
let $ = cheerio.load(pageContent);
let image = $('img').attr('src');
await downloadFile(image, path);
}).catch((err) => {
console.error(err);
});
Tim I am @hidden gorge I'm not stupid
I got logged out of my main
i dont remember you, but anyway, my answer was based on you having difficulty with something as basic as brackets, and the snippet of code you posted looked nothing like how the documentation for discord-error-handler shows
I kinda used my own way
headers: { "User-Agent": userAgent.toString() }
oh
sadge
how can i change it so i can then?
if(mode === "on") else if(mode === "off") else if(mode === "list")
you're trying to send an empty message
Send help
/channels/* and /guilds/* are the most paintful to update
ohhh
ty
is that ts
jesus

i use sad js
I've never seen import used like that
same
i use import for my dependacies and stuff
or if i'm pulling from a file
so many files open
what theme
thx
I have a lot of names that would conflict
np
not importing all the necessary members from my types package
it's a really good theme
i use a cool formatter so my code looks smooth and pretty lol
would recommend cascadia code btw
they have some pog symbols
you should try synthwave
synthwave is what I use
I used to use one called sweet
just not its glow feature though
lol
looks bad
i like the one i'm using currently
makes the colors more vibrant
yooo
wtf
@sudden geyser @lament rock this is lit
omg it goes well with my console too
the colors
my eyes
it's so pleasing
jesus
I have the glow amount set to 1.0, but it doesn't work
or I might just be looking in the wrong place
the number doesn't seem to do anything for me
so bright
wait I can't turn it off now
okay now good
How do I fix it?
by not sending an empty message lol
supply either content, embeds, or files
Another theme I like is anything Xcode-based
I could never get into the neon effect for the synthwave84 theme. it looks awesome without it though! 🙂
I am trying to get the code
Is message.member.hasPermission still a function?
Um
you didn't give us any code to work with
also no, use the docs https://discord.js.org/#/docs/discord.js/stable/class/GuildMember
use message.channel.permissionsFor(message.member).has()
overrides may not be what's desired
for instance, overrides can't have specific guild level permissions
How to recognize closures in js
define closures
curly braces
it was an interview question for react.
what would be perfect answer for this

cheater
I know nothing of react so
discord.js uses guild-wide permissions as base and account channel overwrites on top of it
weird
Well. Not really weird, but if you want guild wide permissions, then getting overrides isn't helpful
idk why I like to argue about everything. I'll shut up
that's true, but i'd expect them to check if they could send messages, view channel, etc. and overwrites would be better to check with, while still being able to check kick members, manage server, and other guild-wide permissions
That's theoretically the only way to check unless the everyone role or roles assigned to everyone have funky perms
fr
im trying to post my server count on my bot's top.gg page but i get this error (python)
code:
`from discord.ext import tasks
from discord.ext.commands import bot, Bot
import topgg
dbl_token = "my token"
bot.topggpy = topgg.DBLClient(bot, dbl_token)
@tasks.loop(minutes=30)
async def update_stats():
try:
await bot.topggpy.post_guild_count()
print(f"Posted server count ({bot.topggpy.guild_count})")
except Exception as e:
print(f"Failed to post server count\n{e.class.name}: {e}")
update_stats.start()`
error:
Traceback (most recent call last): File "C:\Users\---\Desktop\chat checker\server_count.py", line 6, in <module> bot.topggpy = topgg.DBLClient(bot, dbl_token) File "C:\Users\---\AppData\Local\Programs\Python\Python310\lib\site-packages\topgg\client.py", line 94, in __init__ self.loop = bot.loop AttributeError: module 'discord.ext.commands.bot' has no attribute 'loop'
can someone help
module 'discord.ext.commands.bot' has no attribute 'loop'
i got the code off https://docs.top.gg/libraries/python/
and it said "bot" was not defiened
so i added "from discord.ext.commands import bot, Bot"
so how can i fix it?
sorry if i seem dumb i have just started doing this stuff
with discord.py
if you already have a reference of your bot from d.py, replace bot with whatever you named your reference
and make sure that it's defined before the code you posted
and replace import bot, Bot with just import Bot
ok thanks
where do I start if I'm planning to make rpg bot
that one looks more challenging than my previous project
I made one but am not motivated enough to finish it but main tip is to think ahead
Lets say you make something that handles fights
Make it so it can also handle fights in other commands and not just ur fight command
This is what burnt me out
I mean like where to begin with before making those fight/buy/etc function
theme, you mean like dungeon/medieval thingies ?
any basically
monster/scifi/human kinda thing
its a wide topic so u gotta figure the theme first
ahhh
uh, how do I make bot detect mute role, because on my case it require the server owner/admin to make "muted" role for the mute role to work
If there is none, create. If there is use it.
A better approach in my opinion would be to save the muted role ID to database so that it could be renamed and still be used as the default mute role
uh mind make it simple to understand, I'm still kinda new on developing
would this work
That will end up the role having no permissions
If everyone has the permission to talk this will do nothing
Then permission overwrites are your only choice
oh right, the mute role does nothing
how I do that
am I doing it right
for the love of god use timeouts please
impure functions / classes
still new on these, sorry
i didn't mean it in a bad way, but using overwrites is jank
I'm actually surprised how many of my users have adopted slash commands 👀 This is slash commands vs message commands over the last 30 days. I only pushed the slash command update about 30 days ago so this is pretty much the adoption rate after 30 days of them being available.
lol
yeah because discord is forcing people and encouraging to use them via the ui
Hello guys can they help me?
Well they still have the choice of using message commands so I wouldn't say they're being forced
In my case
But I guess maybe people are having to adopt slash commands on other bots
discord said they'll remove them so it is kind of forced, they might as well adapt now
So probably just easier than remembering prefixes
and discord even said they're going to be encouraging the usage of slash commands through ui messages and tips
I have message intent so I'm going to keep offering prefixed commands for now
unless you have that of course
bit inconsistent though
If you have it you can keep message commands but you can't get the intent for the sole purpose of message commands
slash commands really raised the entry requirements for a discord bot
unless you want to be capped at 100 servers
the annoying part is setting them up but after you do that it should be fine
Which also sorts out at least some trash of people being made who shouldn’t even use a PC
how can i make direct vote cmd if user don't want to vist topgg website so he can direct vote bot using cmd
you cant
can i do after 12 hours bot dm user to vote
yes rip
I'm making a dashboard for my bot, how do I make the dashboard automatically update the server count that the bot in ?
while the page is open, or after refreshing the page?
when opening the page
so like first open bot in like 5 server, then after some time and open the same page the count updated to 7
3 options:
- run the server inside your bot file and get the count from the bot
- run an ipc connection between the server and the bot so they can communicate
- store the server count in a database and have the server access the same database
One message removed from a suspended account.
@sage bobcat
alright thanks for the info
anyone
used nextjs?
for some reason when i use axios in getServerSideProps im getting connection refused error
but when i run the same api in useEffect it works fine
does anyone know how to anchor a 2D object to the bottom left using canvas?
just move it to the very bottom left of the screen and make it stay there when I resize
just set its x and y coordinates to the same as the canvas's width and height
this is what I got, but instead of bottom left it spawns at the bottom center
perhaps anchoredPosition is responsible for that
but how do I know what to put there?
Vector2.left?
idk how that canvas implementation works, but the idea is to set the object's position to x = canvas width - object width and y = canvas height - object height
so something like this then:
float xPos = canvas.transform.position.x - StaminaMeterBG.transform.position.x;
float yPos = canvas.transform.position.y - StaminaMeterBG.transform.position.y;
StaminaMeterBG.rectTransform.anchoredPosition = new Vector2(xPos, 15 + yPos);
@quartz kindle
err you can use the Unity UI to anchor it
it's instantiated on startup so can't
How is that stopping u
there is no way to do that using script, it's an option available only in the unity editor as far as I'm aware
Question for native English dudes
This profile name is already been taken or
This profile name is already being taken
this profile name is already taken
no need for been or being
but
you can do
this profile has already been taken
that sounds weird
I'm not even native and it sounds okay for me
The first one isn't grammatically correct, the second one is correct but it sounds like it's being taken right in this moment which isn't the case I assume
just treat me as native since I know pretty much the entire language
that's indeed correct
hmm guess I will end up with This profile name is already taken
sounds like the best option imo
ty anyways
np always
I haven't used Unity in a while but I'm pretty sure nothing's stopping you from anchoring via the Unity editor, it doesn't matter when the object is actually instantiated.
it's instantiated on runtime, how do you think I'm gonna go into unity editor to anchor it once the game is built? lol
there is no code to anchor it on runtime besides doing math to tell it where to anchor
yes
anchoredPosition takes care of that and it needs math input
there isn't something like
anchoredPosition.bottomLeft
I think at least
then anchor it via the editor and just make it hidden, show it when you want to
you don't need to anchor it dynamically
I can't cause it spawns on runtime..
the object is not available in the unity editor unless the person presses play, if that makes sense
it spawns during the Start() method
you can instead create a single instance with the UI, then just hide it. The user won't be able to see it it'll be as if it's not instantiated.
show it when you need to
with code
you want me to create an instanced variable instead of simply doing it on startup
don't get me wrong I already have that system implemented, but why
...because that's the cleanest and most obvious solution? Why create a single instance on startup when you can create it in the editor and just hide it? That's one of the most common ways to spawn things in unity
that's not spawning then
you jsut create the gameobject and referencing it
as someone said before, it's lazy
It's literally one of the most common ways to do this, lmao. It's not lazy.
common doesn't mean good
it's every beginner that does that
should I just anchor the x position to like -100 and get it over with
... there's literally no downsides to doing it like this.
It's not bad
it's good
it's simple
it's readable
You only need one instance
If you needed more then yes
I don't even need an instance
just reference the variable in the script
but still
then it's EVEN better
you can use the UI and just drag and drop it to the scripts that need it
literally the UI is made for this
you're arguing against the UI
I know, but I already draw it during the execution of the script, I've made it compact enough for everything to spawn during runtime
why would I destroy that
why are you drawing it during runtime anyways 🤔 Is the sprite dynamic or not
If it's not then just load in an image
hell even if it's dynamic you can only draw the dynamic parts in
you can still use the UI
you can draw it in it's Start() function
can fs do something like this? ```json
{
"userID": "",
"gold": 0
}
with fsjson
{
"userID": "2020020102",
"gold": 0
}
well you parse the JSON string, edit it, then stringify it again
and write the file contents
going with a regex to find and replace the line is... possible but errr
I know that's the whole point of referencing
it's supposed to be a stamina meter
drawing it on the screen during runtime is simply for making the script compact
just paste the script and you got everything working, no need to do much in order to make it work
reminds me of me doing regex for everything lol
good thing Unity doesn't have regex or I'll be using that there too
bruh @cinder patio looks like putting the anchor to vector3.left * some value made it work
and it automatically scales with the screen too
no clue why you'd want to make a sprite "compact" by drawing it with code instead of just having it on disk as an image... but ok
like you're using it once
uh how do I use safe filter for some search api
check the docs of some search api to see if they have one and how to use it
bro this new project is gonna be so much better
I've done more in this couple hours than I've done in a couple days in the old project now that I 100% know what I want to do
does anyone know where to find very high quality textures?
they who?
Is a crash
Hey
I wish I could enable ray tracing with this, the volumetrics work well with these types of light
Lua
Though I don't find a difference, whatever your comfortable with
Lua file is more straight to the point
so .setFooter('string') is deprecated in v13 and we need to use .setFooter({ text: 'string' })?
Yes
ok
thanks
Yea you can use .setFooter({ text: 'sometext', iconURL: 'someiconurl' })
uh, where do I see tutorial to make a interactable dashboard like the one mee6 have, already made one but it's not interactable.
Interactable dashboard?
Just a web-panel that changes a few settings here and there that then the bot applies to a specific server it's in?
for some reason whenever I use the autocomplete feature of nvim cmp, and try to edit a new file, like 5 empty buffers open along with it
wut
does anyone want to take a look at my code and optimize it? it's c# tho
bruh I can't even figure out how to switch views
take it as a challenge cause it's really really really bad
it's c# tho
it's a good language
and not cringe
and am definitely not asking for someone to improve it cause I can't do it myself
@ancient nova its on git?
Yeh
HTTPError [AbortError]: The user aborted a request. what is this?
the user aborted a request
it IS discord.js
is it happening in some section of your code / some area you know about
and if so does that task run for a while
djs aborts if it takes longer than 15s
because aborts usually happen when a request from the library to discord is taking a while (15 seconds), which could be influenced by rate limits
or your network just sucks
true...
const discord = require("discord.js")
const { MessageButton, MessageActionRow, MessageMenuOption, MessageMenu } = require("discord-buttons")
module.exports = {
name: "Pheonixia",
aliases: ['pheonixia', 'Pheonixia'],
usage: "pheonixia",
description: "shows country stats",
run: async (client, message, args) => {
const Factory1 = new MessageMenuOption()
.setLabel("Factories")
.setDescription("Manage your Factories")
.setEmoji(":factory:")
.setValue('factory')
const Menu = new MessageMenu()
.setID('menu1')
.setPlaceholder('Manage Information')
.addOption(Factory1)
.setMaxValues(1)
const TedoaMesajGönder = new MessageActionRow()
.addComponent(Menu)
await message.channel.send("Democratic Republic of Pheonixia", { components: [TedoaMesajGönder] })
}
}```
Basically I have been trying to create menu option and I am VERY new to the idea of these drop down menus as well as buttons but this is what I have at the moment, it is causing me issues for some odd reason as cmd prompt keeps telling me that MessageMenuOption is not a constructor? 💀
Who a bot dev that code discord.js? I need help with afk command lol
if u need select menu
const { MessageActionRow, MessageSelectMenu } = require('discord.js');
const Menu = new MessageSelectMenu()
.addOptions()
just ask your question here
iirc there are no discord.js devs here 👀
yea, only discord.py exists here
wdym?
that's because MessageMenuOption is not a class
ask your question
No he's joking
There are plenty of djs users here
Just ask your question instead of asking to ask
the opposite actually
Ohhh okay just when I got my hopes back up it kind of umm...did this. I hate programming sooo muchhh i really do. it keeps persisting with these 'x is not a constructor' errors any ideas how i fix this one
oh and my code is like this now
Does anyone know how to code a afk command? I try looking for one or try coding myself but It not working
-discord.js v12
-new to coding lol
what is an afk command lol
Bruh
Nobody here is going to write your command for you. You need to ask a more specific question than that
some pointless thing that tells others that you apparently arent active atm
Not pointless but okay
ig u construct MessageActionRow inside of which u create MessageSelectMenu
let menu = new MessageActionRow()
.addComponents(
new MessageSelectMenu()
)
whats your discord.js version?
12.5.3
thats the problem
u need 13
oh lordy lord when does it stop lmao okay hold on i will give it a go
kindly explain what this "afk command" is supposed to do, and maybe we can help
ig u want people to set there afk message
anddd here we go again, I actually had this issue earlier but managed to fix it with
const client = new Client({ intents: ["GUILDS", "GUILD_MESSAGES"] })
still no idea what it means since i suck at reading errors
when someone run the command he/she saves them message
Say if a person like to leave there pc on and afk aka ( away from keyboard ) and do >afk <reason> | and if a person ping you it will tell them u are afk and the reason why
imo its easier to use integers for intents, ex: 32767
and when someone ping him/her they tells that message
just set your status to dnd and give the reason why in your status message instead
When reading an error stacktrace, you only need to read the first and the first relevant access (as in, a line that references your own code instead of a library or internal calls)
you will need a database to store the statuses
Yes
So in that error, you read the first and the third lines
Valid intents weren't provided to the client
well the issue is that i am so inexperienced with this version its crazy
hmmm okay i see
uh question regarding sharding / clustering what is those and when to use it ?
v13 is a somewhat big jump yeah, but its better to go along with the versions instead of waiting until the last second
"afk" command developers when they discover the "idle" Discord user status
sharding is separating your bot into multiple connections
each connection can only handle 2500 guilds
I feel like afk commands are just people trying to pack more features into their bot
so you need to shard when you get close to that
If only idle allowed u to set on-ping messages
isnt clustering using multiple devices or whatever to share the load across them
so for example 1 shard is like 2,5k guild or ?
people use the word "clustering" to mean multiple different things so yeah i guess lol
it doesnt tell me which intents are missing and which ones aren't, by intents is this possibly within privileged intents where you have to apply to get the right to use them or am I just beyond confused?
And then there's the users who are always on idle or DND status...
for example, if your bot has 5000 guilds total, you will usually have 5 shards with 1k guilds each
you could also have 2 shards with 2,5k each, but its recommended to have 1000-1500 per shard
That's where debug comes in
what if one of my shards went off will it effect others? 👀 😂
depends
Read the documentation to see if you didn't forget anything
ah ok, thanks for the explanation
sharding gives you the ability to load balance your bot, which can be done in many different ways
if you run each shard in a separate process for example, they will be completely isolated and independent of each other, and cannot affect each other
if one dies, the others will not be affected
I dont seem to be missing anything
also how you set shard
btw, i remember the time when people run there code 2 times in terminal and ask why its responding 2 times, will sharding solve this?
but you can also run multiple shards within the same process, or use worker threads for example
no, that has nothing to do with sharding
are you using discord.js?
yes
If it's erroring then it's missing something
At least show the part where the error happens
if i run the same error will it throw some kind of error? 👀
discord.js supports 2 different sharding methods, "internal sharding" and the "sharding manager"
what's the common used
which is the react's latest version?
18.0.0-rc.3 or 18.0.0
internal sharding means your bot will create multiple shards all inside the same process, there is no difference in code, everything works exactly the same. you enable it by setting shards: "auto" in your Client options
Rc means "release candidate"
"TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client."
i think its in my main file which would be bot.js
const discord = require('discord.js');
const fs = require('fs');
const client = new discord.Client();
const { Client, Intents } = require('discord.js');
const { token } = require('./config.json');
require("discord-buttons")(client);
client.commands = new discord.Collection();
client.aliases = new discord.Collection();
client.queue = new Map();
console.log(`Loaded Nonay Database`)
console.log(`Loaded Nonay Music`)
console.log(`v1.2.1 - Nonay Bot`)
const Categories = ["misc"]; //Commands => Category => Command
Categories.forEach(async function(Category) { //
fs.readdir(`../jbot/commands/${Category}`, async function(error, files) {
if (error) throw new Error(`Error In Command - Command Handler\n${error}`);
files.forEach(async function(file) {
if (!file.endsWith(".js")) throw new Error(`A File Does Not End With .js - Command Handler!`);
let command = require(__dirname + `/../commands/${Category}/${file}`);
if (!command.name || !command.aliases) throw new Error(`No Command Name & Command Aliases In A File - Command Handler!`);
if (command.name) client.commands.set(command.name, command);
if (command.aliases) command.aliases.forEach(aliase => client.aliases.set(aliase, command.name));
if (command.aliases.length === 0) command.aliases = null;
});
});
});```
So it's kinda a "pre-release" version
One message removed from a suspended account.
the sharding manager needs additional configuration, you need to create a new ShardingManager instance in a separate file, that will manage multiple instances of your main bot file, each in a separate process
so 18.0.0 is latest, right?
18.0.0 is the latest stable version, they're mapped by tags
https://www.npmjs.com/package/react in the versions section
Latest stable, yes
I have the same issues before
I just use this
const client = new Discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] })
you didnt define intents there
One message removed from a suspended account.
Timotei
@sage bobcatfthie
their code is a mess and it is very confusing as to why they are doing some of the things they are doing
idm stable version. I just want to know, if 18.0.0-rc.3 comes after 18.0.0.
One message removed from a suspended account.
indeed
ask them not me
lmao
comes before iirc
ok
my real name doesnt
One message removed from a suspended account.
One message removed from a suspended account.
its not fake
It goes like rc1, rc2, rc3, stable
just not the english variant
tim faking?
it doesnt have "th"
So yes, misty is right
you two are great ty so much but now its back again and with a new error, this time i legit do not have a donkeys clue what it is saying
I also changed the code accordingly:
const fs = require('fs');
const client = new discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] })
const { Client, Intents } = require('discord.js');
const { token } = require('./config.json');
require("discord-buttons")(client);
One message removed from a suspended account.
One message removed from a suspended account.
Oh god... Not discord-buttons
Seems like it is an issue with the discord buttons package
Also what version of djs are you using?
One message removed from a suspended account.
discord-buttons is only for discord.js v12. v13 doesnt not need it
You can do buttons without the discord buttons package if you are on v13
i mean, my full name is in all my github projects packages,jsons
lmao
One message removed from a suspended account.
One message removed from a suspended account.
ah alright let me just uninstall it real quick
Timotei tim motei timothy
also, just fyi: ```js
const discord = require('discord.js');
const client = new discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] })
is exactly the same as
const { Client } = require('discord.js');
const client = new Client({ intents: ["GUILDS", "GUILD_MESSAGES"] })
you dont need both, just pick one style
Gotta love how discord.js users flood the support server with "where X feature???" As soon as it comes out, as if it's gonna be implemented in a minute
One message removed from a suspended account.
yesh
One message removed from a suspended account.
One message removed from a suspended account.
i grew up in portugal, but im slovenian
Found it
Timotei
is that meant to be spoken like demote
ty for this, the errors havent given up yet tho lmao. I have never had this issue before though, going to guess i touched something i shouldnt of touched or maybe its the new discord.js version?
let Prefix = config.prefix
if (message.author.bot || !message.guild || message.webhookID) return;
if (!message.content.startsWith(Prefix)) return;
let args = message.content.slice(Prefix.length).trim().split(/ +/g);
let cmd = args.shift().toLowerCase();
let command = client.commands.get(cmd) || client.commands.get(client.aliases.get(cmd));
if (!command) return console.log(`No Command Found!`);
if (command) {
command.run(client, message, args);
};
});```
no. i. am disappointed
Oh god Tim turned into a shampoo
likewise with const { token } = require('./config.json');
remember both styles?
yeah i just realised lmao thanks
Ye, that's actually the joke on that scene
you can either do const config = require('./config.json'); and then use config.prefix
or
you can do const { token, prefix } = require('./config.json'); and then use prefix directly
I love Microsoft's C# documentation
Konata acts like the ad lady cleaning her hair
Especially their ASP docs
for some reason my code was taking 20ms instead of 1ms, turns out the problem was ```js
if(date.toString() === "Invalid Date")
if you want me to be brutally honest i have no idea what you just said but i think i did it correctly but even before i did that i still got another error and i am getting unbelievably tired
look
const { somethingElse } = require("something");
is the same as:
const something = require("something");
const somethingElse = something.somethingElse;
One assigns everything to a variable the other grabs that prop directly from the file
this is my understanding at least there could be more technical stuff happening but 🤷
Just change that line to
let Prefix = "&"
that isn't useful
lmao
yes, you may actually be able to see my desk launch into the upper atmosphere
they already have a prefix defined in a json file
seems like you're new and don't understand the value of having a file with all your config stuff separate from the actual code base
also it doesn't make things easier or harder
the way he is doing it is perfectly fine he just seems to not understand how to grab the prop from the file without mixing two styles of doing so (from my understanding of the conversation this is what he is doing I might be wrong tho sorry if I am)
You are right
you are left
👀
:^)
rick roll
the one meme that wont die out even when it reaches 2050
that and your mom jokes
You've forgotten about amogus memes
Also I got 2 new games
They're coming back with a strong hit again, they'll never really die out
and my pc handles them poorly
What games
Horizon Zero Dawn is awesome
ikr
Tho my pc handles the animation and audio poorly
Neither are linked up right
The audio is like 5s ahead
so I kind of know what is happening before it actually happens
i want to scream but its 4:00 AM, I have given it a shot but there is just a new error everytime one error is fixed, i will just have to leave the bot in the state its in collecting dust im ngl. Thanks for your help I am just too inexperienced for this I think and I will have to find a work around.
benefit? 
what you guys think about interaction localizations?
if my pc was a bit better the game experience would be 10x better as well
have you tried sleeping and tackling the problem later
Welp, I guess that sucks, hope you get a better PC soon
Yes
just because another error comes up, doesnt mean you did something wrong, you cannot see all errors at once, you need to fix one to be able to see the next one, so if you see a different error, its likely progress being made
unless you screwed up and created a new error instead
🤨
I just need to get a project that can make me some money going
Then i'd be set
ezpz
in the api or the actual interface for the user
thats true, im willing to bet its option B. I still dont understand what anyone is saying or what anyone is doing
||maybe thats just me being very tired||
in interface for users
This means discord is no longer defined
if you removed discord = require and started using { Client } = require then you also have to use Client directly, instead of discord.Client
you probably swapped it to const { Client } = require('discord.js') so you can just do new Client()
You should at least try out https://store.steampowered.com/bundle/20773/The_Room_Collection/ for now, best puzzle games to ever exist
I already did remember
I just didn't pay for em
:^)
too expensive for a puzzle game
Eh, considering how clever and satisfying the puzzles are, I would say otherwise
I am not a big puzzle guy
well the issue is mr misty and tim is that client was already defined
const { Intents, discord } = require('discord.js');
const fs = require('fs');
const client = new discord.Client({ intents: ["GUILDS", "GUILD_MESSAGES"] })
const { TOKEN, config, prefix } = require('./config.json');
i feel so bad rn 💀
you didnt understand what we are saying
one you are doing something you shouldn't
look
when destructuring you dont need to do it multiple times
no i really dont i am so tired it is really late
you can group of Intents and Client together in one destructure
and just do const client = new Client(...)
Coke, I'm gonna be honest, instead of wasting time; take a break and resolve it later, by this you'll just make it worse
const { Intents, discord } = require('discord.js');
is the same as
const discord = require('discord.js');
const Intents = discord.Intents;
const discord = discord.discord;
``` you see whats wrong there?
there is no discord.discord
Is it possible to define a variable and use the destructuring assignment on the same require method?
do you know what an object is and how objects work?
ik but i am dedicated honestly the next day i will only be spammed asking why a certain command isnt working its just stressful bro i cant be dealing with complaints the next day so i get it all done in one day
no clue lol
bruh
then you need to learn some basic javascript lol
const { Client } = require('discord.js')
const { Intents, discord } = require('discord.js');
can be changed to
const { Client, Intents } = require('discord.js')
When destructuring you don't need to do it multiple times if it is coming from the same place. You can just do it all at once
also yes this
this is an object:
const myObject = {
a: 10,
b: 20
};
you can access the values like this:
myObject.a // 10
myObject.b // 20
Explaining it like that is mostly a waste of time, just link it to the MDN docs :^)
Is there any performance or any other difference between destructuring an object to just assigning it as a variable and doing it that way?
nop
So it is just a preference
ye
AHAHAHAHA IM DEFO DONE HERE IM SORRY GUYS
we are back at the same error i was trying to fix in the first place and my sleep schedule is shattered please don't feel like u have to help because u don't but i am going to bed now because coding is officially my worst nightmare
consider this my super villain backstory against code.
thats just because you're trying to code blindly, its the same as trying to write an essay in a foreign language that you didnt study
try to learn some javascript basics and you'll have a much easier time
yes i am reading in numbers and speaking in gibberish, i am so tired i will just have to find a tutorial or something ty anyways
LEARN? oh god
You can start here. https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/comment-your-javascript-code
There are many other resources, but if you want to learn slowly and not about something specifically, you can use FreeCodeCamp.
OH GOD its a disaster, has it really come to this. I guess i will have to learn. thank you once again.
You can't code without learning.
If you don't like freeCodeCamp, here are alternatives
If you want to learn about something specifically (supposedly more information about commenting), it's at any of the link above or at https://developer.mozilla.org/en-US/.
i feel teased and dead i feel like my about me needs to be changed
ty i am gone now goodbye friends
wrong
How is that wrong?
Tim is never wrong 
yes
Help
Right
As long as you're willing to listen and improve, you're good
Your account needs 2fa in order for your bot to perform moderation actions in community/large discords
I tried to put my new bot token into old code and it ended up like this
but when I put old bot token, it could
Thank you
You provided a intent that isnt enanled in developer portal
can anyone help me on this?
its an electron app built with html, css and js, when i click on the togglebox the opacity and mix-blend-mode of other stuff seem to do what they want, idk how to solve
if it matters, the togglebox when checked does a translateX(26px)
My work so far anyway, basically wrote a highly stable framework just gotta finish two things up and tags I think
Then need to write the api protocols but shouldn't be crazy hard, anyone here full stack?
Dude that’s no platform to find developers working for you
You should also consider to learn how to do screenshots without weird angels to let it at least look professional

Nah bro don't wanna expose too much infront of 300k
Hmm that’s why cutting, markers and filters exist even in the simplest tools
R u full stack
But anyways you might wanna use an online platform to find developers
Yeah
True yeah lol what do u work on
Not driving into trees hopefully
tru
anyone?
driving into trees while texting*
truer
Huh where did everyone come from
Out of my cave due to boredom
And I’m going to leave the highway.. see ya later
Bet
Yap
What's that
Nothing commercial
I've been working on a pretty low level abstraction layer for Discord rest and supporting X-Audit-Log-Reason and multipart/form-data in every edge case is hard.
Like for reason, I could assign a reason property to JSON params for payloads, but that doesn't work for where the API only accepts Arrays since Array.reason doesn't exist and I can't just arbitrarily assign object properties since Discord can and will change often.
The lib manages multipart files for the user and having cases where they have to manage it would be super inconvenient
copium I guess. Low level Discord dev work sucks
If anyone has an elegant solution for my issues, I'd love to hear
they're getting rid of the audit log header soon iirc
they'll be inside the payload itself
bit of a stupid decision in the first place to put it there but whatever it doesn't really have an effect
so I'm on hosting test trial for my project and hosting it on heroku before I deploy it to vps, I got canvas.node: invalid ELF header, I tried to use gitignore but it doesn't work
gitignore is just for ignoring files during commit
as it seems, you pushed your node_modules folder to git
which broke heroku
yeh I can see that, which make some of my command doesn't work either
how do I fix it
I'm more amazed by HOW you managed to push node_modules
I don't know I just connect my repo on github
still, the modules folder is huge, it should've taken a long time to commit it
nonetheless, you need to delete it somehow
you mean delete it from the repo ?
yes
so heroku will install it ?
but do it locally, since u cant delete a folder on github without deleting all files within it
yeh, then push it to github
alright then, I'll try it, thanks for the help
bad idea
for the history you mean?
ye
well, rebase it then
do I need to do the same if I using vps or no
alright, it's working, thanks for the help.
yw
i create this command and if i use this command bot send this message
song.name is undefined
according to the distube docs, name is not guaranteed to always exist (notice the question mark)
Damn Tim going out of his way to check third party library documentation for this man
😋
oh yeah 100% I did learn something
is it more complicated if I built dashboard inside my bot project, or it's more simple to separately making it, I want the dashboard can be use to configure the bot.
Personally I would build them separately and use either IPC or websockets to communicate between the two
its easier to put it inside the bot, but if the bot is offline, the website is also offline
uh how do I make space between each section on html
gotcha
As for your previous question, like Tim said, it's easier, but you couple your bot to your website. While they are connected, they aren't strictly connected, so keeping the website and bot in separate projects is a better design imo.
i would do it the database way, keep both separate, and both access the same database
but how do I make the website interact with the bot, for example I have a function to enable/disable xp system on the website, and want the bot to do the same.
Now what if the database goes out
the website accesses the database and changes the setting in the database
the next time the bot checks the database, it will already be updated
Modify the database and have your bot read from it to know if the xp system is enabled
what if they use any music package and they get to the bot check and make the request.
Will the bot be accepted or rejected or removed?
what color that could match the header background and the body
the blue is horrible, the white looks good
trying both white and grey
One message removed from a suspended account.
i have no idea what that even means
does anyone here know about gnu screen? cuz on my old server i had a shell script that ran on boot. it started my node apps and mc server and it all worked fine. everything ran in its own screen session using a command like screen -dmS <session name> node index.js and it all worked but in ubuntu it will not work
-i have varified the script runs but making it beep the bios buzzer
-screen its self works
-the script runs perfectly if i run it manually
what elce is there?
i knwo this is probably wayyyy out of the scope of this server but just asking out of curiosity since its a verry obscure problem and i have no idea how to google it lol
i hate updating shit always makes more problems than its worth
ive never used screen
I use it
ubuntu 20.x
never had issues with it at all
I'm a bit confused with what -dmS does, I always created a screen and ran whatever I needed from inside it
-d means start detached
-m idk tbh
-S is the flag that makes the screen nameable
so together its -dmS
I always used permanent screens
you only need it really if you want to automate stuff which is my intentions
it only happens when the script is run on boot and its run as root
if i run it manually it works fine no errors
and when it runs on boot it doesnt log anything
worked perfectly on centos 7, read some where it might be becuase it have to be run as a service but i cant find ant info to back that up
also what do you mean "perminant screens?"
screen
it creates a new screen that u can access with screen -r name
then inside it I do whatever I want to do
u can rename permanent screen with :sessionname name
thats just a normal screen isnt it?
ye
how do I make new page on html
wdym a new page
why not just run the node itself instead
the
make the network required for boot
a bit slower boot but youll get network
mmmm
sound like reinventing the wheel
i just want to know why screen inst running
its all setup exactly the same as on my old server but its just not working
i also wnt to know why docker networking is so confusing
lol
sam elol
I tried use fas-server icon it work for a while on my html, then after 5 minute the icon is gone but the code still there, tried to refresh and still the same results.
I hate CSS. Any suggestions on how to make this look half decent lmao (making a “website” for a friend)
I think you're making the mistake where you feel like a page has to have content all over it. Don't make the screen busier than it has to be
Thanks for your input! I'll keep that in mind 👍
I like looking at https://dribbble.com for inspiration and do a basic design on figma before starting the css when I feel super stuck with design
Find Top Designers & Creative Professionals on Dribbble. We are where designers gain inspiration, feedback, community, and jobs. Your best resource to discover and connect with designers worldwide.
in djs v13's slash commands message is replaced with interaction?
No
The interaction object comes with its own properties and not all properties you know from message objects are available for interactions
maybe
That’s the base where different types of interactions have some more or less properties available
Messages will continue to exist
just most bots will not be able to access their content
Or attachments, embeds etc.
How do I make .gitignore to ignore a specific folder.
Read that again: I don't want to ignore a folder by git
I want to have a folder that is not affected by .gitignore
It’s glob pattern if I remember correctly
Pretty sure you can exclude a file from being ignored by adding a “!” In front of it
So:
*.exe #Exclude all exe
!foo.exe #Except for foo.exe
Hello, do you guys know a bot that can make tasks for members such as following a twitter account?
you could integrate Twitter authorization within the bot and it could follow users for a Twitter user if received proper scopes
i'm not sure if there's already existing bots that could do that
and is it a folder inside an ignored folder?
please, use https://hatebin.com/
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
please
RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.
uhh
{
name: `> Roles [ ${ roles?.length ?? "0" } ]`,
value: `${ roles ? roles?.join(", ") : "No roles." }`,
inline: false
},``` Error is probably here
or
let roles: any = user?.roles.cache
.sort((a: Role, b: Role) => b.position - a.position)
.map((role: Role) => role.toString())
.slice(0, - 1);```
if you're using ?. it means it's a possibly-null value
check for user existence before entering that block
that should still give "undefined" as a string tho
that's the only field where there isn't any sort of fallback value or md character tho
the user exists
don't use ?. then
want me to use !. then?
no
that doesn't even exist
it's because of this that the linter is warning you
you declared it might be null or undefined
does adding a guard make the linter stop warning?
add a guard then
if u know it exists just put !.
Yeah
is that a valid thing tf
yeah
in typescript yes
yes it is
depends on the scope sometimes ts doesn't realize you already added a guard
yeah was going to mention that lmao
btw his actuall issue was probably coming from here
value: `${ roles ? roles?.join(", ") : "No roles." }`,
ah
roles.length then?
ohhh
ye u right
except if roles can be anything other than array, then it will throw join is not a function lmao
join?.() Brainnnn
xD
what the fuck
just add ?. to everything, surely that fixes everything
that's valid
because "" fails with || but not with ??
btw why is there no null coalescing negation in js
i want to be able to do if(?value) {}
instead of if(!value) {}
my brain is hitting 100% cpu usage just looking at that code
why
seems really confusing

find einstein's brain
is that just supposed to be
if (value == null) {}
as in it's only either null or undefined
everybody's running on ryzens these days, you cant keep up with a core2duo for brains much longer
rip the new generations tho, all running on arm
I run on leg tf
xD
I run on any kind of floor
Sometimes when I cache for a channel I get this error, there is a way to avoid it?TypeError: canale.send is not a function at Client.<anonymous> (/root/novabotStable/events/guildMemberAdd.js:75:30)
add a question mark before .send, like: canale?.send
or use try function
canale should always exist, bcs I have the data stored inside a database
that's why I said should lmao
If it’s a channel you’re grabbing from cache, then there’s always a chance that it’s not cached
Fetch it instead
If the channel is already in cache, djs will grab it from the cache for you
function cercaCanale(client, id) {
const canale = client.channels.fetch(id)
if (!canale) {
return null
} else {
return canale
}
}```
like this?
That is not how you use fetch
loool
Also you should probably consider returning null instead of false
Fetch is a function
client.channels.fetch(id)
Actually just return the channel itself, no need to check for null or false in the function unless you want to throw an error or something
Just check for null whenever you call that function
function cercaCanale(client, id) {
const canale = await client.channels.fetch(id)
if (canale) {
return canale
}
}
And your function has to be asynchronous
