#development
1 messages Β· Page 1837 of 1
What is discord-js-light
Sarcasm...
nope, never heard of it :^)
I only know discord.js-light
It's a discord.js lib that forces light mode in channels your bot is in
actually i'm just stupid, bot.channels.cxache is indeed getting updated, mb
Oh shit
MessageMentions.USERS_PATTERN = /<@!?(\d{17,19})>/g;
https://discord.js.org/#/docs/main/stable/class/MessageMentions?scrollTo=s-USERS_PATTERN
That sounds painful
@quartz kindle Aren't you using node-fetch, too?
where?
like in general?
not much
looks like it doesn't like LE certs
i had an upper case \D. that matches everything that's not a digit
xD
client.on('interactionCreate'.....
what is interaction in this?
Que
are you trying to fetch an endpoint that runs on LE ssl?
Yeah
it should work, i dont see why it wouldnt work
No issues with any other service fetching my endpoint.
Just nodejs.
Not even using openssl to test contacting the endpoint
wtf
weird
is your server running on node directly or a reverse proxy?
client.on('interactionCreate', async interaction => {
console.log(interaction)
});```
what do interaction triggers ?
all messages or what ?
slash commands and buttons
in that code it didn't log anything when i typed /help
did you register the command?
....
slash commands have to be registered
no
you will have to in the future
nope, there's no reverse proxy
can you show your server's ssl code?
hi, i was reading the discord.js change log to v13, what does ephemeral message mean?
ok no i'm just dumb, i just figured out
only the person who used the command can see it
yea i just realised it lol, thanks anyway
Sure... one moment, will do some more checks before
cmd.run(client, message, args);
this was working
and still working on discord1.12
i get this in discordv1.13 TypeError: cmd.run is not a function
TypeError: cmd.execute is not a function
i used execute as discord.js guide
same error
so what's the problem ?
you should know lol, its your code
how does your command handler work?
how do your command files run?
what is the name of the function that executes the code inside the command?
client.commands = new Collection();
let prefix = ("/");
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
console.log(file + ": Loaded.")
client.commands.set(command.name, command);
}
//---------------------------------------------------
client.on('messageCreate', message => {
if (message.channel.type == 'dm' && message.content.startsWith(".help")) return message.channel.send("Don't use bot commands here, use servers instead")
if (message.channel.type == 'dm') return;
if(!message.content.startsWith(prefix))return;
if (message.author.bot) return;
let messageArray = message.content.split(" ");
let command = messageArray[0];
let args = messageArray.slice(1);
let cmd = client.commands.get(command.slice(prefix.length));
if (cmd) {
cmd.run(client, message, args);
console.log("(" + command + ") command just used in " + message.guild.name + " server")
}
});```
name: "help",
}```
the same code work in my old version bot
not the 100%same one btw
whats the rest of module.exports?
where is execute coming from then
if you have module.exports.run then its cmd.run
Yea
check if all your command files have run
Make sure none of your commands are using execute instead of run though
or missing a run function
Yea
Then im confused where execute is even coming from
add console.log(cmd) right before cmd.run()
Ah wait I se now I didn't read the entire situation 
and show what it logs
i got {name : "help"}
then the function is missing, or you removed it
in what order did you define the module.exports lines?
which one first?
this module.exports.run = async (client, message, args) => {
if that one is the first one, then thats the issue
you are removing it in the next line
module.exports.a = 10; // create an "a" property
module.exports = {}; // redefine the object with a new value. this removes all properties
module.exports.a // undefined
const Discord = require("discord.js");
const fetch = require("node-fetch");
const fs = require("fs");
module.exports.run = async (client, message, args) => {
console.log("....hi")
}
module.exports = {
name: "help"
}```
yes, you are removing it
did you understand the code i posted?
no
you are removing the run function by overwriting module.exports with a new object
so what should i do
edit this for me
no
no -
then you should learn, thats like super basic javascript
actually i know a little
its not hard
is it like when i use
var data = "";
then later edit it using data = "new info"?
it work with this
fs.readdir("./commands/", (err, files) => {
if(err) console.error(err);
let jsfiles = files.filter(f => f.split(".").pop() === "js");
if(jsfiles.length <= 0) {
console.log("No commands to load");
return;
}
console.log("loading " + jsfiles.length + " commands!");
jsfiles.forEach((f, i) => {
let props = require("./commands/" + f);
console.log(i + 1 + " : " + f + " loaded")
client.commands.set(props.help.name, props);
})
});```
π₯
someone know how to make mentioning member optional? (discord.py) for the now source i have:
@bot.command()
async def stat(ctx, member: discord.Member)
it will not work with this code if you dont change the other code
my bot is working with it as i said and it's online working fine now
then your command file is also different
or you didnt restart your bot after you changed it
just a sec
this file: #development message
is not compatible with this file: #development message
if it works, then your files are different from what you posted
or you posted the wrong file
@quartz kindle here https://github.com/ZezoCraft/Formova/
check the full bot files
Why even building it so complicated?
module.exports =
{
name: "command",
async run(...)
{
...
}
};
you see the difference?
i just edited it and guess what...
it's not working with ,
also not working with other commands
Not the , is the issue
I think you don't get what the issue is.
tim do you mean .help
i mean your module.exports lines
module.exports.help is NOT module.exports
let me see if i can explain in a way that you will understand
module.exports is a box
when you do module.exports.something = somethingElse, you are creating an item something, inside the existing box.
when you do module.exports = something, you are creating a new box and giving it to module.exports, and replacing the old box. the old module.exports box is deleted, along with all items inside of it
Why i have error in user.presence.status in discord.js v13
asap cause battery on my pc goes brr
Try member: discord.Member = None
k
Do you have the presence intent enabled on your bot page and in your code
nope. didnt worked. i use a thing which need user. none returns none (possible with author ?)
and what exactly is this error
..
anyways - went to 0% better to shoutdown pc bye
I have a problem. I want to set the valuable default as "not set". But if there is something in the database the valuable changes to the valuable which is stored in the data base. But the result arrives a few ms later so I will always get "not set". How can I fix this (resolve)?
you cannot get a value from a callback outside of the callback
you have to use promises
there are so many wrong things in that snippet
waait which one
opps sorry wrong server
i have the following code
if message.content.lower().startswith("=tag"):
guild = client.get_guild(670368584220016641)
usersList = guild.members
print(usersList)
but the code only returns the bot in the list
[<Member id=709498755136618527 name='The Brickyard Bot' discriminator='0465' bot=True nick=None guild=<Guild id=670368584220016641 name='The Brickyard' shard_id=None chunked=False member_count=922>>]
not sure why I'm getting back only the bot, and I double checked the numbers for client id
only the bot member is cached by default
unless you have the GUILD_MEMBERS and GUILD_PRESENCES intent
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
hmmm
werid
Wth is that
java
Oh
send stack trace
Very ez looking π
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
at com.bumptech.glide.Glide.<init>(Glide.java:409)
at com.bumptech.glide.GlideBuilder.build(GlideBuilder.java:563)
at com.bumptech.glide.Glide.initializeGlide(Glide.java:314)
at com.bumptech.glide.Glide.initializeGlide(Glide.java:266)
at com.bumptech.glide.Glide.checkAndInitializeGlide(Glide.java:210)
at com.bumptech.glide.Glide.get(Glide.java:191)
at com.bumptech.glide.Glide.getRetriever(Glide.java:774)
at com.bumptech.glide.Glide.with(Glide.java:801)
at com.marsbrowser.ashpotter.app.HavadurumActivity.initializeLogic(HavadurumActivity.java:99)
at com.marsbrowser.ashpotter.app.HavadurumActivity.onCreate(HavadurumActivity.java:69)
at android.app.Activity.performCreate(Activity.java:8207)
at android.app.Activity.performCreate(Activity.java:8191)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3782)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3985)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2309)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8577)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by: java.lang.ClassNotFoundException: com.bumptech.glide.gifdecoder.GifDecoder$BitmapProvider
... 25 more
You probably didnt import all libraries
i did

the code:
Glide.with(getApplicationContext()).load(Uri.parse("https://wttr.in/".concat(edittext1.getText().toString().concat("_0tqp_lang=tr.png")))).into(imageview1);
oh thank you
@rare mist glider is alredy builtin acultty
Well i dont wanna be captain obv but there is a missing class that java cannot find, try changing the compiler
its aapt2
So I'm working on adding tts/easy for screen reader commands for each of my regular commands via a "tts" option - is it possible to direct the tts to only the one requesting the command
If not, that's fine, I just couldn't find anything in the api about it
for example I currently have it like so:
I know people can disable tts client side, but it is on by default
Unfortunately with the introduction of slash command only requirements it becomes difficult for any accessibility software to use bots correctly
I mean that's ultimately for discord to really figure out not us
they are working on their screen reader though I think
we don't exactly get much freedom
True, they have stated they halted the accessibility program though
They have 1 solo developer handling it, no team anymore, no input from real users
Kinda stupid
Just Discord things
I know this is not place to get help with this but still,
I got locked out of my heroku account and I can't access my 2FA codes and need heroku team to remove 2FA from my account I mailed them but still no reply from them it's been 5 days
If you know someone from heroku team that can help me with this DM me thank you
Lesson learned: always take a backup
My backup was on my mobile and my mobile bricked now I will use cloud T_T
f
Don't open its scam link
I was using message.author for tag message author but it doesnt work on v13 what they changed?
Then it will say tyone#9999
I donβt think that was your question never mind
Not @earnest phoenix @earnest phoenix
Yeah I thought you meant you were trying to get the tag of the user
I donβt use djs anymore, so nevermind lol
yea doesnt work in v13
just do <@${message.author.id}>
How can I add pictures in java bluej?
why would they change that?? tf
isnt that considered bad practice?
why would it be a bad practice?
no idea, it was easier to do to tag the author than using .id
assuming an object will give a correct response when stringifying it
I was under the impression that was never correctly supported by nodejs.
template literals use an object's .toString method
I am lazy for do it
was less a nodejs issue rather a discordjs issue. rather than fixing it they just make you do it now? π
discord being discord
djs being djs
and shit being shit
What?? π
Discord is shit
so as their changes lmao
fuck... DiscordAPIError: Max number of daily application command creates has been reached (200)
imagine you're trying to test something really hard and boom you're fucked 
creates a new guild, after creating another guild ...
oh no

Hello. π
I have this code.
for (i = start; i < res.length; i++) {
embed.addField(`${3 > i ? `${emojis[i]}` : ""} ${i + 1}. ${bot.users.fetch(res[i].userID)?.username ?? message.guild.members.cache.find(user => user.id === res[i].userID).username}`, `${Math.floor(res[i].workAmount).toLocaleString()}`);
console.log(bot.users.fetch(res[i].userID));
};
You see.. I logged bot.users.fetch(res[i].userID).. and it returned an object but Promise before.. should I await it?
Promise {
User {
id: '528256079101034506',
system: null,
locale: null,
flags: UserFlags { bitfield: 64 },
username: 'HamoodiHajjiri',
bot: false,
discriminator: '9923',
avatar: '28511586b01b7f82beb6688886bd2296',
lastMessageID: '874220319005605898',
lastMessageChannelID: '828625740773589102'
}
}
For some reason... ${bot.users.fetch(res[i].userID)?.username} is returning undefined.
Did I do something wrong?
yes, promises need to be awaited
Moment.
This is returning undefined.
console.log(await bot.users.fetch(res[i].userID).username);
await await await await await await
tp await? First time hearing that.
to*
Oh. I'm sorry.
(await promise).username
Oh.
Let me check.
console.log(bot.users.fetch(await res[i].userID).username);
Like this, correct? It's returning, undefined.
basically, fetch always returns a promise, so await should always go before fetch
.. so I created this.
const z = await bot.users.fetch(res[i].userID);
console.log(z.username);
Sorry for the late reply.
OH WAIT
console.log((await bot.users.fetch(res[i].userID)).username);
I figured it out. π
π
Thank you. π
^
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (D:\Coding stuffs\discord.js\endlessparaDOX1\node_modules\discord.js\src\client\Client.js:544:13)
at new Client (D:\Coding stuffs\discord.js\endlessparaDOX1\node_modules\discord.js\src\client\Client.js:73:10)
at Object.<anonymous> (D:\Coding stuffs\discord.js\endlessparaDOX1\index.js:2:16)
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 Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 {
[Symbol(code)]: 'CLIENT_MISSING_INTENTS'```
I never had this error
so idk how to fix it
someone help AAA
and do ping me
ok I got it I got it
so they changed the code- DUDE ITS SO ANNOYING
rewrite time haha
;-; yea
I wanna die now
no don't
WHY DID THEY CHANGE SO MUCH
It a good start reading the guides
awie but ;-; I am feeling lazy now oof
You arenβt forced to update.
If you wanna update any library, framework etc. you will always need to inform yourself about changes and make sure to adjust your code if needed.
you aren't forced to update yet, but you will be in the future
Some of those changes are neccesary, while some not really, well like xID become xId. lolzer
like xID become xId. lolzer
that took me a while to understand lmao
lol
i thought you said xD xd lolzer
Is it possible to compare Discord emojis
A person reacts with π and i want to compare it with :smile:
discord doesnt send you :smile:
discord sends you a unicode version of the emoji
so you have to compare that
Can i get some hint how to make a command which tracks the amount of time left before you can vote again and send a reminder when the time is right ?
Would I need to store the timestamp in DB when user voted last time, or is there an alternative ?
just when a user votes, use a setTimeout which sends a message in 12 hours (i think thats the vote time)
something like
// listen to user vote
setTimeout(() => {
<SendMessage>
}, 43200000)```
Ohh thanks, that's the way to go, I was going the wrong way 
I was trying to avoid database since I'm not familiar with it and this helps.
i would use a database because if your bot restarts, it wont send
ohh, but won't it take too much memory on large server , can I avoid that ?
i dont think it'd be too bad
Ohh well I got to go with database then 
I will also need it to store amount of votes and reward with votes so was worried about space
it shouldnt be too bad
because its not that large
i just woke up like 5 minutes ago i cant explain anything
lol
Well can't you post it here, why would anyone dm you ?
Because its not an error of top.gg
It's an error on my private bot
And this server is for
you can ask for development related help here
server1.post("/dblwebhook", webhook.listener(vote => {
console.log(vote.user)
client.channels.cache.get('766908428411994134').send({embed: {
title: "<@${vote.user}> voted !!",
fields: [{
name: "Thank You for voting for us!!",
value: "The Description"
}]
}});
}))```
So i'm getting this error ,can anyone please tell where I went wrong ?
read the description of this channel
change the " to `
Btw can u help me
bear in mind top.gg only sends the user's id tho
so youll probably want to fetch the user or turn it into a mention
btw embed titles dont mention
ah
ask then
OK, but we can use '' and "" both for string in js afaik so why does it matter ? (I want to know in order avoid future mistakes)
Ohh this might be the case
` is for templating/inserting variable values within strings (i think that's what it's called)
ye and its not <@$id> its <@!id>
Wait
single or double quotes are just plain text without any variables inserted
Can u helpe with this
I m new in repl.it
So
And I don't know how to install module
although you can do "user:" + user.id + " voted" instead
And which module
but this would give only id, not mention
yeah exactly
really , @digital ibex
you can turn it into a mention by adding <@ > around it
the ! is for nickname iirc
yeah
Bro pls check my error
"user:<@" + user.id + "> voted" like this ?
or
looks like youre trying to run a file that doesnt even exist
yup
But it discord.js version 2
It works
On my other bots
i think most people prefer the backticks (`) tho because it is a lot cleaner
But now it doesn't
like this works too javascript const user = "<@"+vote.user+">";
can you send a screenshot of the files you have on replit?
thats not going to mention in the title still
the server.js file doesn't exist and replit wouldn't try to run it by default
Container right
.replit file skill issue
ohh i forgot I'm handling template literal and they require it
i have no clue how replit works
im assuming a file is a file
Yeah I will try in description,
Well are you coding on phone, really ?
With light mode too

Ok
Which file should it run
And how to change it
??? You tell me
server1.post("/dblwebhook", webhook.listener(vote => {
console.log(vote.user)
const user = '<@'+vote.user+'>';
client.channels.cache.get('766908428411994134').send({embed: {
description: 'user voted !!',
fields: [{
name: 'Thank You for voting for us!!',
value: 'The Description'
}]
}});
}))``` good to go now, right ?
I dk
Lmfao
It's a moderation bot
It's your bot
Yep
You should know which file to run
well are you copying a yt tutorial ?
They said they already made two bots with similar file structure and they work
sus
if youre trying to include the user mention in the description, you need to make sure youre properly including the variable
But then shouldn't they know that server.js is missing 
`${user} voted` instead
Ohh sorry noob mistake 
The essence of programming is "we don't know why and don't ask why just gimme the fucking solution"
lol, for a moment I thought wtf before you editedπ

Anyway you forgot to add server.js @hard vortex , add it and it should run fine hopefully
anyways by looking at their file structure it seems the entry point to their bot is index.js
they don't need server.js
they were trying to copy a tutorial for expressjs
which has absolutely nothing to do with discordjs
Well he is using replit so might be trying to keep it online with server.js file, it's in replit tutorial, I use it too
You dont need a server to keep repls online
I think you misunderstood me
also doesnt need to be named server.js
yeah
ig they renamed it index.js
Ok
but general practice 
show your package.json file
@hard vortex edit replit file to run="node index.js"
https://replit.com/talk/learn/Hosting-discordjs-bots-on-replit-Works-for-both-discordjs-and-Eris/11027
You are trying this right ?
Hosting discord.js bots on repl.it ! This tutorial shows how you can host your discord bots on repl.it if they are built in node.js irrespective of whatever library you used. This tutorial is applicable for all discord.js and Eris bots. Just to ease things we'll be using the end product of this tutorial . What we'll be doing? Creat...
Yay, the mention is working, thanks starman and pro discord mod!!
mod*
sorry π
:)
Why the fuck is javascripts event system so fucking complicated when it moves into multiprocessing 
idek what to believe anymore the MDN docs or my linter having it marked as depreciated
Once I'm done testing and early development, I'm gonna shift to vps for sure
Btw can we host multiple bots on single vps ?
yes
ok cool
what is deprecated? lmao
idek
apprently browser.runtime.onMessage.addListener(foo); is depreciated
but addEventListener doesnt work

im just torn
im so torn
Its my code: js client.on('message', async message => { const bang = client.channels.cache.get("843098329293783070") if(message.author.id === client.user.id) return if(message.channel.id === "874213843356774430") { if(message.content === 'Un **joueur** vient de voter pour le serveur.') { return bang.send(`Un membre vient de voter sans noter son pseudo.`) } const no = message.content const pseudo = no.replace(' vient de voter pour le serveur.', '').replace('Le joueur ', '').replace(/\s/g, ''); db.add(pseudo, 1) const votes = db.get(pseudo) const msg = `Merci ` + pseudo + ` pour ton vote, tu as actuellement ${votes} votes !` bang.send(msg) } })
and I want to make a leaderboard with the name (pseudo) and the number of votes
how I do this?
no idea, never used that, but considering its something kinda shady, i doubt linters would know much about it
do be my life
would probably help if i actually bothered to install something to register the web api properly
butttttt
any npm package for making markdown?
as in rendering the markdown in html... or..?
markdown parser for user input
https://www.npmjs.com/package/marked seems decent
aight
first of all why r u adding a + to a string when its a template literal 
sucks to be a linter
How can I make a leaderboard with the user with the most level listed on the top.
json:
{
"808771611070038046318101553233788930": {
"xp": 0,
"level": 9,
"xpto": 1
},
"808771611070038046747426344568225904": {
"xp": 0,
"level": 1,
"xpto": 1
}
}
I want to get out of the json file the user with the heighest XP:
808771611070038046747426344568225904
= serverid: 808771611070038046 userid: 747426344568225904
And before you get mad: I just use the bot for a small server so I dont need a database
.sort((a,b) => a > b)[0]
Sort takes -1 and 1 not true and false
Also itβs an object
Not an array
So itβll be .sort((a, b) => b.level - a.level)[0]
Actually
No
That wont work
You just said it's an object lmao
I thought you meant the whole object not the sort params
Object.entries()/Object.values()
Object.keys(file).sort((a, b) => file[b].level - file[a].level)[0]
Object.entries(obj).sort(([, a], [, b]) => b.level - a.level)[0][0]
Ye
Interesting I didnt think of doing that
Anyone know of any JS packages that can do a local mysql dump and run on node v16? I use mysqldump right now but it looks like it doesn't work with node 16. I downgraded back to node 14 and it works. Problem is I need node 16 for local development.
What error does that package throw in Node.js v16 causing it to not work?
It manages to connect to the db, start the dump, but when the dump is finished and it goes to finish off the save, I get an error saying it can't find the file.
That's kinda strange
[Error: ENOENT: no such file or directory, open './backups/backup-2021_08_09.sql.gz.temp'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: './backups/backup-2021_08_09.sql.gz.temp'
}
fs problem?
That's the error it gives at the end of the dump. I can see it dumping the file in the directory though. It makes the file and I can see the size growing. It's just when it hits the end of the process in node 16 it errors out. No issues in node 14
I tried updating the packages, no difference.
May you show us your code and how you're using it at least?
Maybe the package dependencies broke on v16
Just the basic setup based off the example on the npm page. It doesn't really matter. I was just wondering if anyone had an alternative that would work with node 16.
maybe node 16 fucked up the old packages 
Our Node.js v16 release didn't really have anything to do with that behavior, it seems like that error happens because the package renaming the file but not using the new name of the file at the attempt to compress the file
I'm not sure how it works on Node.js v14 tho, which is kinda strange rather
When updating new nodejs I always delete the whole node_modules
Did u use the full path? (__dirnameβ¦path)
Fucking auto correct
Yes probably
why wont my code work ```py
@client.command(name="Pick", description="Pick your starter pokemon!")
async def pick(ctx, starter_pokemon):
with open('starters.json', 'r') as s:
starters = json.load(s)
if starter_pokemon.lower() not in starters:
await ctx.send("This is not a valid starter pokemon!")
return
with open('caught_pokemon.json','r') as f:
caught_data = json.load(f)
if ctx.author.id not in caught_data:
with open("caught_pokemon.json", "w") as e:
userid = f"{ctx.author.id}"
x = {userid:[]}
x[userid].append(starter_pokemon.lower())
starter_pokemon = starter_pokemon.capitalize()
await ctx.send(f"Congratulations! You have picked {starter_pokemon} as your starter pokemon!")
else:
await ctx.send("You have already started your journey!")
I had it as
dumpToFile: './backups/backup-' + date + '.sql.gz',
Also yea you should always rebuild the packages you've installed after installing another Node.js version, but it wouldn't matter if you installed the package with Node.js v16
Yeah I did rebuild the packages
Try to use the __dirname global
it wont enter any data into the caught_pokemon.json file and instead clears everything in it
What is the stacktrace of the error you get?
Sure 
someone help?
Ok it's running the dump on node v16 now. Gonna have to wait about 3 minutes for it to finish.
π
can somebody help meπ©
No luck. Same error.
lol
are you using compressfile?
In the options?
yes
Yeah
try without it
That seems to work. I tested on a smaller db. Just running the test on my production db now.
Accept Tim as your saviour and win a FREE PS5

the issue is fixed in several PRs but they were rejected because the lib is no longer maintained
Now I have a 1.4GB file lol
you can gzip it yourself
Yeah
or use one of the prs
It's ok. I delete the old backups anyway
I'll check the PRs if I have time
Thanks!
Yeah actually the PR was quick enough to fix. Thanks Tim!
what lib
Remember to provide all details possible, refer to channel topic
um i code on replit
the language i use is node.js
what library are you using
What is your status role command supposed to do? What's the exact issue you're having?
Like if someone has the status , JOIN THIS SERVER FOR NITRO GIVEAWAY
Then they get a role called Has Status
And basically if u dont have that role you cant join the giveaway
That's presence data and you'll also need intents for that
OS error 33 let's go
the fucking v13 intents got me fucked up
Isnt presence like dnd,idle
i was like "wtf bro why u no work"
It also has the activites
Alrighty
LETS GOOOOOOOOOOOO BOYOS
const {Client, Intents} = require('discord.js');
const client = new Client({
intents: [
Intents.FLAGS.GUILDS
]
});
phone is a pain in the ass
Okie
Rip
imma just do guilds in there because why not
What
Er how do i do that-
by whatever intent looks like it makes the most sense in your situation
One message removed from a suspended account.
Use the API #topgg-api
Damn at least you tried...
Got it working in the end though
Tim suggested a PR that was denied because the package wasn't maintained anymore
no one answering there bro
That fixed it
can u help me
Aha, alright
@rose warren bro will u help me to do it
"Fixed" is what matters
Take a look at the docs to do API requests every 12 hours to get the list of all voter user IDs or simply use webhooks.
Save the results (user IDs) in a database.
Check if the user ID exists in the database if somebody runs your "voted users only" command.
ohk
grill
can someone help?
Not if you just ask for help like that
whats your issue dont just say "can someone help?"
Yep
Helo
helo
Any recommendable hosting services?
i used to use galaxygate
Okay
are you talking free or paid?
Either one
Okay thanks
ew I wouldn't even suggest repl
Also I know a good hosting service that is fairly cheap
I did say cheap
Nothing free is every worth it

well repl is for a temp thing
I've never used galaxy so I can't say
thats my issue, there is somethin wrong with it
But I know hosting bot in the past has been reliable and in most cases i've seen them price check
i hosted a bot from 120 to 260 servers on repl no issyes
Umm, I have user id and want to fetch tag from it, I tried .setAuthor(${user.tag}, user.avatarURL) in an embed but it ain't working. I believe it is due too that user need to be User object of discord.js while mine is userid. How can I get user tag and user avatar from user id ? (Searched stackoverflow but there wasn't any convincing answer).
Is there any other required fields for slash commands? I'm getting a BASE_TYPE_REQUIRED error with a message of This field is required, when in all of my commands I've included a name and description
You could get the user by ID if its in a guild and access the user prop that way
Client.users.fetch(id) iirc
or you could fetch from the api like that yea
Well I thought of that too but I don't have client in my command file, how can I pass it there ?
Or if its cached client.users.cache.get(userid)
You should of been able to pass client to the commands
U just answered your own question, by passing it
Well sorry I'm new, I know that passing client here would work but I'm unsure what to write to pass the client π
also passing client is a safe practice or should we avoid that ?
Well, in your message event I assume you do something like cmd.execute(params) or something along those lines
Just pass in client to there
Just make sure that your params are in order when using them in your commands
else what you name em might not be what they are
You can access your client through a message object in djs iirc
message.client
Without having to pass it in as a parameter
Well I'm confused due to my own mistakes. I am using a command handler even when I don't understand good enough 
So i wrote client.on('message', commandHandler); in my index.js , ```javascript
const test = require('./commands/test.js');
const commands = {test};
module.exports = async function (msg) {
let tokens = msg.content.split(' ');
let command =tokens.shift();
if(command.charAt(0) == '&') {
command = command.substring(1);
commands[command](msg, tokens);
}
}``` in my commands.js, I think I need to pass it in last line as commands[command](msg, tokens, client); , am I right ? But even then how I bring client in command file ?
But I have another command where I track votes using webhook on top.gg, I can't use the message object there, so wanted to know how to pass client 
if you have the message, you dont need to pass the client
you can do message.client
as for the webhook you need to have the client accessible somewhere
either pass the client to the webhook file at initialization, or put the webhook code in a file where the client exists
const client = message.client, right ?
I would of figured this out
yes
can u help
use hex code
thanks a lot!!
woah, that''s news to me
if you wanted a custom color though that is when hex codes are needed
css has default colors
Wait so I've been passing my client to my message files all this time for nothing?... π
css doesnt use quotes
Fucking facts bro
color: black
Dayum
not color: "black"
All the guides online show it too 
That is why I don't believe its always been like that
Looks like me and misty aren't alone 
context? where are you using this css?
did you change your name ?
I remember something else with that pfp
more description
with the rest of my code
ya
do any of u mind if i dm u code
post here
long description
thats not how it works
the animation works with dark mode
i just pasted normal html
You can't do that
its a block of html inside an existing website
can u send me docs
embed
If your page is already hosted somewhere else use an iframe
no im using it directly
ya
there is no header, no body, no doctype
can u send me docs for existing tags
You can't use head, script, html etc
i can use html
head has only title tag which idc if its ignored
script has nothing just basic codepen
I mean the <html> tag
scripts dont work anyway, they are blocked
That's already declared
yes
.setAuthor( ${client.users.fetch(userId)}) , is it wrong ?
yes
then
how do i use css and html
i can only use html then
if i dont define body
Your page should be basically
<style>
*/ CSS HERE /*
</style>
<div>... etc.
https://top.gg/bot/869934349120856095 this on dark mode works
The rest of the page around it is already declared
so ill add css to the div
anything you put in your top.gg long description, will be added there
inside a P
inside the class content
so as you see, header, doctype, body, etc all already exist
dont add them yourself
just add the actual content
so it is just like a box
yes
BUT I MANAGED TO CHANGE THe EXIStiNg CODE
you can put style tags in your content, and interact with the existing css
style doesnt need to be inside head
it can be inside your content
whats the existing tag
of the whole website
you can find them all with the dev tools / element inspector
also, on many tags, you will need to add !important
pagecontentwrapper
?
Just remember using it to hide certain elements like ads is against the rules and may result in a ban.
pfft
yea
I love using ad blockers for youtube
put it to black yet its white
@quartz kindle
now it works
so in the css i put this?
That's what Tim told you
yes
yes
Umm, in this .setAuthor( msg.member.user.tag +'test', msg.author.displayAvatarURL) I'm unable to get avatar, can someone tell where did I go wrong ?
ohh 
thanks
i put body css as body {
background:#000000 !important;
} yet it wont work still
the bg is still white
Clear your cache
opened it in incognito
Reload
yes
There's Cloudflare caching too
did ctrl f5
CTRL + Shift + F5
Then inspect to check for conflicts
Known site issue. Some people can't save.
Using root in your css
You copy and paste what you want to change from the inspector and add !important on the end. That's a quick fix.
ohhhk
someone pls help i want to remove buttons after use
it wont save
like it wont update
it saved
shouldn't it be components: []
@rose warren how much time to update needed?
f o r e v e r
grrr
If it's not saving it's a known site issue. I told you.
well i did this
why so many site issues?
it saved the last edit
it took time to update
Then it's probably caching
never heard of disbut
||we go raw api||
ahh ok
yes use components: [] not buttons, use a real ide please
because it'll tell you what it's called
ok sure
How can I make afk command
process.kill()
It has 2 errors, first Owner nickname problem, second bot not responding while afk
Dyno also can't change owner nickname but afks's us
Use this code to make the bot afk
process.kill(process.pid, 'SIGINT');
Oki


We legit have told you how
Why do you bully people
lmfao
its ain't working
components: []
cause buttons doesn't exist
components is the prop
he asked for it
@solemn latch
Umm, one more thing pleasse javascript server1.post("/dblwebhook", webhook.listener(vote => { console.log(vote.user) const user = "<@"+vote.user+">"; client.channels.cache.get('766908428411994134').send({embed: { author: { name: `${user} voted !!`, icon_url: '', }, fields: [{ name: "Thank You for voting for us!!", value: "The Description" }] }}); })) Here How can I get user avatar with user id in icon_url of author ? (Will client.userId.displayAvatarURL() work ? , would need to add const userId = vote.user)
you need to retrieve the user first
btw, what you're doing will send ALL voting messages to a single channel
which isn't even guaranteed to be cached
Yeah I was trying that
Umm I'm new, what will it mean to the process ?
an ELI5 answer would be that cache is basically a map containing recently-used stuff
or frequently used stuff
since the library deals with a hell lot of stuff, saving them all would kill your process during startup
I use node-fetch to post to the channel through the API directly for doing this. Runs as a separate process to the bot.
that's why it only keeps a minimum usable amount of entities at a time
if you NEED to get a channel regardless of caching, use fetch
Umm, but isn't fetch used to retrieve information, how can one send using fetch ?
well, to send you first need to retrieve it
you need the user object, so retrieve it by using the provided ID
const newUser = async id => client.users.fetch(vote.user) , like this ?
ohh await here, srry i messed up there
Not discord.js's fetch method. The node-fetch npm package. I don't use discord.js on my voting manager process. I do it all directly through the API.
Ohh I am yet to try api's fully so didn't know that, I'm still a novice so don't about api much 
Btw what's the benefit of using that ?
well...you get the user object
otherwise you'd chance getting "Cannot retrieve property avatarUrl of undefined"
Means no relying on cache, no extra libs etc.
Also if your bot is down the votes still get counted.
Because it's a separate process.
Wait a min, this is intresting, but https://www.npmjs.com/package/node-fetch these docs aren't helping me to understand how it works, do you know somewhere where else can I find a guide for that ?
Discord's API docs
Not discord.js
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
To get user data using node-fetch for example ^
Only cool kids ditch fetch entirely and create raw http requests
hey does anyone know how i can actually automatically send posts from facebook to discord?
Is there an easy way for guild owners to grant an existing bot slash.commands scope without reinventing it?
ye
ye you can
just use the slash scope alone
without the bot scope I mean
I did it to allow my testing bot to add slashes to my guild
Just reauthorize it with the application.command scope, no need to kick/reinvite
this
does anyone have a arduino? If so does the arduino print messages to the ide?
if connected of course
I think I read somewhere Discord will be granting the applications.commands scope by default at some point. Is that right?
It still rumors for now, but highly likely with the message.content becoming privillage
you can still use slashes without that perm tho
don't think discord will allow it by default
Not quite - unless the bot has the scope enabled it's not possible.
If u invite a bot without that scope it wonβt work
you can
you just can't add guild slashes
globals still apply
Really? I didn't know that damn
ye, I didn't request my users to allow slash scope yet the commands appeared everywhere basically
Interesting, I didn't know that.
Makes sense. I have some bots in a server I manage and I never had to invite them again to grant the scope. They were invited long before slash commands were ever a thing.
I think it works for bots that were in servers before slash commands were released. Not sure if you add a bot now without the scope if it will work or not.
I did try to add guild slashes tho, it failed if I didn't add the scope
ig they did it to prevent abuse
like, undetectable and "fuck this server in particular" abuse
I kicked Probot yesterday because I wanted to disable slash commands and re-invited it with just the bot scope and that removed the slash commands. So you must still need the scope for new invites.
the slashes get removed as soon as you remove the bot
they come back some time later if you readd
interesting then
You must need the applications.commands scope for invites post-slash command release. Seems like all servers which invited bots before the release got the scope granted by default.
if the inviter doesnt include the application command during invite, the slash command will not appear on the guild
Yep. For new invites this is true. If your bot was invited to a guild before the applications.commands scope was a thing then it was retroactively granted access to the scope. If your bot is only just being invited today, you need to include the scope upon inviting.
update node to v16
How
Abort Controller only exist on v15 onward, no idea it your host
In your command line: node latest
Can you put this to my package and send it back?
That's not where you do it
I need to use it in the host?
Whatβs different 12v and v13?
one is chill
No in command line
You'll find and article there
For nude i use this
worker: node alex.js
the other is a rabid ferocious totally bloodthirsty monster
Where π
V13 is ok. I just still don't like the way the send method is with embeds π
In your terminal?
Ok π
client.on('interactionCreate') whatβs do ππ
its new ππ old one was client.on('message')
Type node -v in terminal to check your version. Then node latest to upgrade to v16
Ok 1 sec
It's messageCreate in v13. That's different to interactions.
Don't work
You misspelt latest
Ok
Same






