#development
1 messages · Page 1155 of 1
@earnest phoenix javascript discord.js sumthing, im new to coding
so
uh
you need to get guild data
which can be done by doing
uh
#Client.guilds.cache
it will return an array of all guild that is cached
but every guild is cached on startup so
just get the array length
that's all
do i just put Client.guilds.cache in the code wym
@tight plinth explain please
client = your bot client
client.guilds = servers your bot is in
client.guilds.cache= the actual list of servers (this is a map)
client.guilds.cache.size = the size of the map containing all servers your bot is in
try now to guess which one is the number of servers your bot is in
thank you friend
oh i got it, thanks guys it just tells me a straight number
17
is there a way to see members
read docs
How do i covert a collection to json again? btw json.stringify returns a empty json thing
use collection#array()
i forgot, but how i could make async function without needing to call it, like something (async () => console.log("ran this thing"))?
(async => something())();
is there a server somwhere with emojis with the names of the public flags?
ive tried looking on docs but cant find it
is there anyone who knows how to see my bots user count
@strange raven what library
javascript

discord.js yea sorry
Ok
There are two ways you could do it.
The first one is simpler, which is to check the <Client>.users manager for a collection of cached users (.cache.size). However, this is only for cached users. It does not include every user.
The second alternative is to iterate over the <Client>.guilds manager (still has a .cache property). For every Guild in it, add up the .memberCount property, which is the total member count for a guild (including offline members). Using the .reduce function on the guilds manager is also helpful.
For example (the second one), reduce's structure looks like this (the first argument is a function you pass, the second argument is the initial value): js <Client>.guilds.cache.reduce(...)
@sudden geyser sorry im a bit new to this
reduce is a function
Version 12.3.0 has been released!
Much bug fixes, such features.
The full changelog is available on GitHub: https://github.com/discordjs/discord.js/releases/tag/12.3.0
ok
A
me and woo were talking about it couple hours ago
been checking out whats up with it for a couple hours now
Oh
nothing major imo
Ok
this would just say "undefined"
because cache is a map
you need to iterate thru the map to get its values/properties
@strange raven
im so lost
you know what map is?
no
then read this
actually
nonon
thats array
this is map
why isnt this working
@astral yoke,
- What version of Discord.js are you using?
.getis a function. You can't call.random(...)on it. But if you remove the.getpart, you can use the random method given to the collection instance.
12
why not just use size instead of complicating it?
I'm using this code rn, https://hastebin.com/ogomaxufax.js for a voting poll thing
and when I set a, say, 30 secs poll and the first 10 sec I just react and take it back and then react again and so on, as a result, it doesn't count my vote..
can you help me find where should I make changes and with what?
OfficiallyLost because it's not accurate
howcome?
well yeah
so would doing that?
idk if random() will do anything different
so what do i have to do to get it to work
havent checked that method
if thats ur issue then
@sudden geyser
cache all users
@strange raven you need to access a value in a map first
do console.log(client.guilds.cache) and see what it returns, that'll give you a good visual idea
scltxn there's no .members property on <Client>.guilds. what are you trying to do
im trying to get a random member from a random guild my bot is in
do math.random with the size of the guild.cache
then fetch that guild members, and do another math random
¯_(ツ)_/¯
I'm using this code rn, https://hastebin.com/ogomaxufax.js for a voting poll thing
and when I set a, say, 30 secs poll and the first 10 sec I just react and take it back and then react again and so on, as a result, it doesn't count my vote..
can you help me find where should I make changes and with what?
cache => math.random(cache.size)
random cache => get members
member => math random.(members.size)
@astral yoke
Not Erwin why do that when there's a dedicated method for it
cuz i usually avoid a lot of bad code in d.js
im sorry im being stupid
How is it bad?
@strange raven what did your console return?
not that specifically, i just avoid using d.js whenever its possible
the method likely does something similar either way
a bunch of stuff
did any of those 'stuffs' have memberCount in it?
does anyone knows how to make something like a clickable text that opens link?
for example:
[Click Here]
and it opens link?
embeds
anyone know what a team user is and if they have a badge
i know tried it but it doesnt work
it does
member count is 3 but that doesnt make sense because my bots in 17 servers
iirc only description and fields can have it
there mutiple member counts
^ what erwin said
there another one that says 103
did you bother looking at the link i sent you?
yes i did
then you didnt properly read it
map doesnt have .memberCount property in it
im currently using d.jda
@strange raven
so i just need to make an embed and do like u did?
you should read the whole thing btw
embeds yeah
you need embeds to display links like that
i stickied an error message and spent 45 mins wondering why i was getting errors
this is to advanced for me, sorry for wasting your time, atleast i got server count
https://img.rovi.me/PDWNMRlvDd.png i added them all to my support server. should i make a public server to house them all so others can join and use it?
@opal plank Thanks it's working!
@pale vessel yeah i did it quickly and downloaded svgs locked to 20px for some reason lmamo
mmlul
pog
lol

most of them are 74x74 (actual size being 64x64 but with 10px padding
the thing is that you need another server to handle every emote lol
look good in embeds
looks good
looks nice
looks (insert smth here)
what is that
Let's keep the topic development related please
Does anyone know the tags to give a webpage a icon (Like this)
I tried using <icon> tags but that didnt work :/
You know you can just inspect the page and see what it is
@still merlin it's the link tag
Cool, Thanks!
icon is for rel, <link rel="icon" href="image">
Very epic, Thanks again
putting favicon.ico in the root directory also works but i never tried it
ye all good
await the messages
make a blacklist system
if the user id is in the database, don't respond or do something
how can you check if a message has a link in it?
use regex if you really need it to be accurate
or otherwise look for http or something
if you're using node, you can probably use the build in url module
oh will that blacklist them? can i set the the while to blacklist them
.setDescription('${args[1]} is already your prefix dude.')
I have a problem with this not converting the first argument you put in your command, it instead does this output:
@stable eagle you're using ' to define your string
you need to use template literals
`
@earnest phoenix can you dm me i need to ask something
you can ask your question here
is not related to server
#memes-and-media then
ok
How i can play a playlist in discord.js and ytdl-core?
how much time it takes to approve the bot
3-4 Weeks i mean
how to get random user if message.content === "@random " ?
reeperk i think there is a tutorial about ytdl
You mean getting a user from a mentuon?
yes
Djs?
I'm french i don't understand sorry
Like "/ban @granite pagoda" ?
<Message>.mentions.users.first()
Or
Use regex
Sry I pong someone
Lmao
i think he meant get a random user if the content is "@hollow fossil"
@pale vessel yes
Its their fault for having terrible usernames
?
Excuse can someone help me ?
when i do member.roles.add(the role name);
that say (node:9640) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'add' of undefined
Djs 12?
Yes
Is member properly defined as a member not a user?
Thats a user
Oh
Also, I dont think role names are role resolveable.
https://discord.js.org/#/docs/main/12.3.0/typedef/RoleResolvable
Which add expects role resolveable.
https://discord.js.org/#/docs/main/12.3.0/class/GuildMemberRoleManager?scrollTo=add
There is a api that generates fake bot tokens. What is it named?
That seems simple to do by hand
How then 👀
Does anyone know how to use AWS Lightsnail, i dont know how to get my bot file onto it 😐
What are the other activites for status
e(activity=discord.Game('Watching Servers'), status=discord.Status.online)
discord.Game is playing(watching servers)
What else can i use for like watching, listening
tokens are simple in structure
I could not for the life of me find that
r. danny best
What are the other activites for status
e(activity=discord.Game('Watching Servers'), status=discord.Status.online)discord.Game is playing(watching servers)
What else can i use for like watching, listening
@proven dragon ?
Docs
I'm trying to make a tag command for my bot but idk how, How do i pick up something just in like 2 double quotations, Can someone help me with that like what kind of stuff I'd need to do?- So like the title would only pick things up if it was in the first quotation marks it would only show that stuff ("tag title" "tag message" "tag footer" "tag colour" like that)
So you want to capture all the text in quotes
yes
Regex sounds appropriate for your case, imo
Thanks
Another way I like separating fields for input is by spacing them out with a bar (|) so the user can do my title | my description | my footer | etc. Quotes are also a good way
Allowing the user to use quotes in the command, though 🤔
Eh, there's the option of (!\\")
-stuff -other stuff
--group of stuff -stuffingroup -other stuff in group
Lots of ways to handle multiple things, all of them terrible
You know what would be cool?
Forms.
Like embeds, but where you can enter info
And it gets sent to the bot that made it
Okay cool, thankyou
And it gets sent to the bot that made it
@solemn latch something like https://eb.nadeko.bot/ I assume?
Yeah, like that. But in discord
That would be quite interesting
Hello there, I have a bot which create a temp voice channel and delete it when no one's in it anymore, the problem is that when setting up overwrites, the bot don't have enough perms to delete the channel
in the overwrite the bot have manage channel perm
Ay, I need help
I am new at scripting, I saw YT tutorial but I can’t do anything.. in Command Console I choose folder, and mpn init
And a different thing shows up
It’s npm
Tried it too
Is node installed?
Ye
try node -v
Maybe it’s my device.. I have Windows 8.1
what does node -v say
F
how to make the bot status update every 5 minutes or something
status code:
client.user.setActivity(`<help | In ${client.guilds.cache.size} Servers | With ${client.users.cache.size} Member(s)`);```
setInterval
what should i put it the ()
The function
The doc shiv linked also explained it
5000 is 5 seconds
also set interval looks like this
setInterval(() => {
// insert code here
}, 5000); // time```
how can I use time stamps to check if something is valid with json and d.js
Idc that it’s json it’s for caching literally i don’t need it to be reliable
It just needs to work
ty, seems to be working
Yes like have something last for 3 days then update
hmm
It would make sense if you knew what it was for
If your just doing expire timestamps.
Just if the timestamp is older than now fetch the updated version
If(jsontimestamp < now)
hi, i have a command in which when a msg is deleted, it will send an embed. How can i get the time the msg was deleted
So how do I get what the time stamp would be in 3 days
@ivory seal in what language?
just Date.now() isn’t it
Then convert it into days seconds and whatever
Yeah.
Idk 3 days in ms off the top of my head. Google can do that for ya
ok I’ll try what you said
My bot has a module that can do it
3 days is 259200000ms
If you ever wanted to know
A bit of an easy formula if you ever worked with those
>>> 3*24*60*60*1000
259200000

Most time math is really simple anyway
hell yeah, noob incomming
Why does regex101.com think ! is for matching literally the ! character with gm flags 🤔
Unless I'm missing something, shouldn't it be the negate operator?
2 questions:
1- about bot submission, how do i make my bot public instead of private?
2- also, how do i make my bot stay online 24/7 so that it will be online when someone tries to test it?
Yo, can someone recommend me some good free translation apis if possible, or cheap ones 
ffs yes it is
@earnest phoenix get a decent host is the answer to your 2nd question
can you get it free?
2 questions:
1- about bot submission, how do i make my bot public instead of private?
2- also, how do i make my bot stay online 24/7 so that it will be online when someone tries to test it?
@earnest phoenix 1 It should be public if you didn't change anything and 2. get a vps
Not really
Nope
Also, your bots developer page has public/private option
There are places that do free trials
ah ok thank you
Anyone ever worked with MongoDB user authentication?
Particularly in the mongo shell, when self hosting a cluster
Is there a reason you need it in json and not in memory?
Is your bot restarting often enough that it matters?
My bot restarts a lot
Ah
I do a lot of updates
It will be mostly reads anyway so it should be fine
And even if it does break, eh
You could just load the cache into memory at startup and update the json hourly.
Yes but it won’t be a set list of domains
Would lower the chance of corruption to almost nothing and speed it up.
It’s going to be user generated
So if a user requests it
It gets added to the database
Then if someone wants it again and it’s a valid time stamp
It uses the database
Instead of the 30 second actual scan
Well the database works so that’s good
Do you discordjs
I do discordjs
is discord.js or discord.py official?
Both are officially listed on the dev site
i mean, are they made by discord itself?
Not made by discord staff if thats what you're asking
No its community made
Discord can't even make a working client
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
They are vetted, they are not made by discord
Im trying to await reactions on a msg and a whole server should be able to react but i think a filter needs to have a user specified to it (Discord.js v11)
const filter = (reaction) => reaction.emoji.name === "✅"
reactionMsg.awaitReactions(filter).then(collected => {
console.log(collected.first())
})```
I dont give support on deprecated lib versions someone else will have to help
(the .then doesnt run when someone reacts rn)
i didnt ask you to help
i asked everyone that can help
Oh I just say that because I think its important to inform users they are using something which is no longer actively supported
ok?
Using depreicated software is bad mky
Using any deprecated software is bad.
It was deprecated for a reason.
because discord changed the endpoint
no
because they changed domains
It was because intents
not just that, it's old and outdated in many other ways
Iirc
You wont find a lot of help for deprecated stuff, most people use stable or master
^ most people here moved off 11 a few months back and learned the new methods.
Ay
how to make the bot say a number between [number] and [number]
Google is a great source for that type of stuff
Is it worth it to compress and decompress a string to save 12 bytes?
f yes, 12 bytes is everything
is that sarcastic or no?
i dont think theres really any point unless your working with a 40 year old cpu with 256 bytes of ram.
are you storing inventory items as strings?
yes
you could store them as ID's instead
item id 1 is coins
in the users inventory they have item id 1: 300
would save a lot more space, without any need for compression
but to display it I would need to convert it then right
I mean I can try but I'd have to rewrite a big portion of code
yeah, but thats practially no cpu time
well it really would depend on your specific structure and database.
I'm using MySQL
I already use ID's for weapons and armors but thats cuz they have specific properties depending on the user
I'm using yourSQL too
They are like: UE73-EI7-EI23
Is that UUID?
yes
Assuming v3
i actually would reccomend doing it in database.
the djs guide actually covers the concept.
https://discordjs.guide/sequelize/currency.html#create-models
Where it's saved
284 -> Original
111 -> Using ID's
272 -> Original Compressed
I'd use like a JS or JSON file and use it like this:
module.exports = {
1: "Item",
2: "Item 2"
}
i use my database for it, but you could use json
How To invite probot
Cuz they are unique ID's
item id's i would think are already compressed no?
@earnest phoenix not the right place
!invite probot
@earnest phoenix https://top.gg/
if your counting in order, you cant really compress that any further.
44
45
How is the compressed one more?
Lmao
Item ID's are the weapons theyre like: EUR4-EIEZ-OT94
that would be the items modifier no?
?
.setImage(`https://api.alexflipnote.dev/floor?image=${member.user.avatarURL()}&text=${text}`)
``` Image won't load
@ me if you know why.
for example
1: coins
2: iron sword
3: arrow
users inventory would have
1: 300
2: 1 with a modifer of EUR4-EIEZ-OT94
3: 20 with a modifer of XXXX-XXXX-XXXX
No as I store the inventory and weapons seperatly
youd have a list of all standard items
a db of all users items with each item having its own modifier
that probably is a waste of space then too
I don't see a different way to do it
As I want to seperate the materials and the equipment
typically youd just flag that in your item database
1: coins, inv
2: iron sword, weapon
3: arrow, ammo
4: healing potion, inv
otherwise your storing users multiple times in multiple locations for no real reason.
I can try that
I was also thinking, my friend stores a JSON object like this:
User: JSON Object wich contains all the things
And he compresses that object would that be better?
honestly, when your storing inventories based off an id system, i dont think you can compress it much anyway.
maybe 10% at most
i dont see why not, but id ask that in #support
I think I'm just gonna keep it like it is rn and just use ID's for the materials
@solemn latch Sorry for tag but would I use an object then look for object[id] or would I make an array and use the ID to locate the index of the array?
you can use a map
let items = new Map()
items.set(id,{item object, or string})
items.get(id)
iirc, this is also a pretty common thing to do in mysql, if both your item list and user inventories are in mysql you can actually fetch all relevant data at the same time
And I have no clue how to do that so I'll just stick with this
how to make bot website
That requires a lot of knowledge
About front end and backend development
And how they work together.
frontend is tedious imo
Not saying you can't do it.
Just its kind of out of scope for this community and channel
Definition of development is broad too 

😂

🤷♂️ broad questions are hard to answer.
If you have more specifics I can help. Theres also a million resources online for making websites.
I have only done a few websites, and only know a few methods which may or may not be useful for what you want to do.
@ everyone
yes
how do i go about getting it?
Lé Spam
Hey, does music commands require a database?
@earnest phoenix no
but, probably not
why would they
@earnest phoenix no
@honest perch okay, thanks
why would they
@honest perch but what about queue?
no
that doesnt need a db
that would be a very bad and slow way of doing it
Yea
Ye
an ipv6 block
imagine requesting data from a db every time you change a song
@ionic dawn you gave me the idea
huh?
does anyone knows how to check the if the author has perm blabla to use a command in jda?
does anyone know how to host a bot on AWS Lightsnail? Please ping me
@balmy anchor jda ?
or lightsail?
@solemn latch is that 2 different thing?
doesnt matter anymore its ok
on lightsail, you can just use ssh to connect.
i recommend bitvise for ssh and sftp
@solemn latch its lightsail i got it wrong lol
tnx
its just a vps, so you can treat it like any other system.
lightsail has terrible reviews on vpsbenchmark lmao
lmao
f
its only 12 month
upcloud :0
never heard of them ngl
what is voh?
@quartz kindle lmao i thought contabo was bad
- OVH: https://www.ovh.com/us/vps/
Starting at $3.35/mo for 1 core, 2GB RAM, 20GB SSD
oh OVH
lol
OVH is the best
although their performance is also on the lower end
iirc, most providers restrict disk speeds for smaller vps's anyway
all hosts have ssd these days, but they dont tell you how good these vps's are
you need to test them once you're in
for example galaxygate's SSDs reach 400MB/S, contabos SSDs hover around 100MB/S
:0
google compute engine's disks are attrocious, at 35MB/S lmao
Wut
lightsail is also like google
so google and lightsail are both bad?
where?
why lol
i have 300$ free
ah good
you're using a multi-core one?
i only used the f1-micro, even with the free credit
well guys so how youre rl pro can say me, if i make a github proyect private, the page will be deleted?
i am using f1-micro 2
what page?
yes
but with 1gb ram
ah
u can't make github pages for a private repo
1gb ram
oh thanks
the code for the page will not be deleted, but the page will probably no longer be online
oh
google also charges for excess bandwidth
they only give you 1gb/month free
my bot was using 400gb/month before intents lmao
what
anyways this is the page
just
i hate myself
i coant do anything better
ok how r u guys?
my bot was using 400gb/month before intents lmao
@quartz kindle LMAO
sarabscribe
that's not bad, just change the url color and make it more interesting
uuu
uwu
@earnest phoenix suushshhshscdibe
slap some bulma and ur done
highlight.js
there are many others
discord uses highlight.js
i also made a highlight.js previewer
nice
epic
i also made a highlight.js previewer
@quartz kindle you're ducking awesome
don't wanna swear and ducking sounds weirder than fucking
there a way to host multiple websites through my nginx server (under different names ofc)
Also which image format should I use for my bot profile cards?
png
you have only two options:
SVG SVG
How can I do this?
When they speak their character avatar apears, unlike stramkit it's low res
https://www.twitch.tv/rcurseofstrahd
yes you can host multiple websites on nginx
if you want to display them on discord, discord doesnt support svg
yes
yes
is it hard to use png
everything supports png and jpg
not really
these two formats are pretty much universal
i dont support jpg
then you suck
png just allows transparency and isn't compressed (or at least not as hard as jpg)
lol
i am connected (via filezilla) to a bitnami vps hosting system, where do i put the (node.js) bot files? in the bitnami folder? in the home folder?
you can put it in whichever folder you want
in whatever you want your project folder
you can create a folder for it as well
ok thanks!
hey, someone know why it doesn't work (vote with dbl api using shards)
const DBL = require("dblapi.js");
const dbl = new DBL('token dbl', { webhookPort: 5000, webhookAuth: 'pass' });
dbl.webhook.on('ready', hook => {
console.log(`Connected to DBL Webhook at http://${hook.hostname}:${hook.port}${hook.path}.`)
});
dbl.webhook.on("vote", async (vote) => {
console.log(`User with ID ${vote.user} just voted!`);
});```
are you doing this on every shard?
I believe they are.
ah, yeah. only run one webhook.
how ?
you can make a separate process that you only run once that communicates with the bot.
or you can check if your on the first shard and only run it if you are.
or you can run it in your sharding manager
oo
i do that
const { ShardingManager } = require('discord.js');
const config = require("./config");
const manager = new ShardingManager('./index.js', { token: config.token, totalShards: 2});
const database = require('./database/database.js');
manager.spawn();
manager.on('shardCreate', shard => console.log(`Shard ${shard.id} ready !`));
const DBL = require("dblapi.js");
const dbl = new DBL('token dbl', { webhookPort: 5000, webhookAuth: 'pass' });
dbl.webhook.on('ready', hook => {
console.log(`Connected to DBL Webhook at http://${hook.hostname}:${hook.port}${hook.path}.`)
});
dbl.webhook.on("vote", async (vote) => {
console.log(`User with ID ${vote.user} just voted!`);
});```
like that ? @quartz kindle
when i try to vote
nothing apear in the console
and i don't know why
and no error @quartz kindle
oh no
your bot page, edit, bottom of page
ohh sorry i don't see that
i heard nginx can load balance.
do you think i can load balance between different reverse proxies?
sure
:o
wtf
i need to redo my stuff, thats way more efficient than what i was doing
oh weights too
oo
is that nginx config?
ye
no wonder I dont understand it 
dynamic, meaning if one of them fail, itll go to other ones?
and backup as in if all other fail use those?
yes you can prioritize which backups should be tried first, how many retries until the next one is called, etc..
plus delays and rate limits
sorry but i need to put what here 😄 @quartz kindle ? i don't understand
@earnest phoenix where is your bot hosted?
now i test so on my computer 😄
where?
thx
np
you say that http://SERVER.IP.ADDRESS.HERE:WEBHOOK_PORTHERE/WEBHOOK_PATHHERE @quartz kindle so it's http://0.0.0.0:5000/dblwebhook ?
0.0.0.0 means any ipv4 address.
If its on a vps, its just the public vps ip.
if its hosted at home/glitch/heroku/some other non traditional server location. there might be a bit more to it
you'd need to port forward
your homes public ip.
youll need to port forward
and if on windows youll need to let it past your firewall
you can get public ip by googling whats my ip
@earnest phoenix if its on your pc, you will need to port forward in your router
fucking hell you got me
that ?
that also works iirc
ok so here’s a mystery for you
When any user runs vt!scan 1.1.1.1 it does it then sends [object Object]
When I run the command it doesn’t not say [object Object] and there is nothing in the code that lets the bot even know who I am it just things I’m a normal person
why
the fuck
yes
port forward
'-'
and if on windows, firewall
http://ip.here:5000/dblwebhook
i do what's my ip
@obtuse jolt i just did it again and didnt get object objected
is it possible its doing something else for non cached users?
or something
people whove never done a command before
it's my ip here @misty sigil ? https://mon-ip.io/
Afficher instantanément votre adresse IP publique ainsi que des informations concernant votre géolocalisation et fournisseur d'accès
yes
for example if your ip is 999.999.999.999
the url will be
http://999.999.999.999:5000/dblwebhook
yes i do that...
but you will need to port forward your router, as i said before
because your router will block it
that is why if you have a server, test it in the server, not in your pc
its much easier because servers dont block ports
Good night to everyone. Could someone tell me how do I get my bot to obtain and update information on a website when someone sends a command?
Optimally, you would use an API. If the website doesn't have one, you could try webscraping it, which most likely won't be appreciated by the people who own that website
what is the webscraping?
making your bot download the page from the website and read it as text
ok
But how do I get the bot to update the command information using the website's source?
Check if they have an api
for the information they're providing
out of curiosity what site is this for?
my bot
out of curiosity what site is this for?
@delicate zephyr my bot is mostly football
how do i make that if someone react with the \🗑️ it will delete the message
reaction collectors
idk how to set one
look at the docs, lemme get it rq
ook
thx
const filter = m => m.content.includes('discord');
i put where i they say discord the emoji?
looks like your looking at the wrong part
“m.reaction == whatever” maybe
you want reaction collectors not message collectors
found it
reaction collectors are near the bottom
yeah found it
how do I know that the site I want my bot to collect information from, has the webhooks API?
typically you look on the site, if not there you google it
so i put the \🗑️ where the like is?
typically you look on the site, if not there you google it
@solemn latch what do you mean?
for example
top.gg
if you look around, youll find they have an api on this page.
https://top.gg/api/docs
whatever site your on, look around in the info pages/header/footer
const filter = (reaction, user) => {
return reaction.emoji.name === '🗑️' || user.id === message.author.id;
};
const collector = message.createReactionCollector(filter, { time: 15000 });
collector.on('collect', (reaction, user) => {
console.log(`Collected ${reaction.emoji.name} from ${user.tag}`);
});
collector.on('end', collected => {
console.log(`Collected ${collected.size} items`);
});
how do i make that code to delete it?
@solemn latch thanks for your support!
@tardy hornet well
reaction collector gives you a messageReaction
messageReaction has the property message
https://www.flashscore.pt/ the website that I want to get the information for the bot is this
FlashScore.pt oferece resultados de futebol em direto e jogos ao vivo de mais 1.000 ligas diferentes. Livescore, resultados, classificações, equipas iniciais e detalhes do jogos.
is anyone else’s API Widgets not working?
wtym?
Yeah
Mfw botum.top
buy it
my code is https://i.imgur.com/B9KVvf1.png
it works fine https://i.imgur.com/vbVCqDl.png
but i get this error https://i.imgur.com/DHBmJyJ.png
can someone teach me how to module export function with parameters
or provide a useful link
buy it
Can we go half and half
message.react("🗑️")
})
const filter = (reaction, user) => {
return reaction.emoji.name === '🗑️' || user.id === message.author.id;
};
const collector = message.createReactionCollector(filter, { time: 5000 });
collector.on('collect', (reaction, user) => {
console.log(`Collected ${reaction.emoji.name} from ${user.tag}`);
});
collector.on('end', collected => {
message.delete({ timeout: 0 })
.then(msg => console.log(`Deleted message from ${msg.author.username} after 5 seconds`))
.catch(console.error);})
break;
what is the problem there?
any error
no
What should be happening, and isn't?
its should do when i react with \🗑️ it will delete the message @delicate zephyr
do that in collect event
how?
message.react("🗑️")
})
const filter = (reaction, user) => {
return reaction.emoji.name === '🗑️' || user.id === message.author.id;
};
const collector = message.createReactionCollector(filter, { time: 5000 });
collector.on('collect', (reaction, user) => {
console.log(`Collected ${reaction.emoji.name} from ${user.tag}`);
message.delete({ timeout: 0 })
.then(msg => console.log(`Deleted message from ${msg.author.username} after 5 seconds`))
.catch(console.error)
});
@summer torrent like that?
yes
@tardy hornet likely cuz you doing a function on message, and the new message author ID is your bot's id
im assuming you did something like
client on (message) => {
message.channel.send(embed).then((message) => {
message.react()
collector
})
}
that message.react("🗑️") in the first line of your snippet leads me to believe you blocked your original message since the reaction is on the bot message
collector.on('collect', (reaction, user) => {
sentMessage.delete(mhelpEmbed)
});
``` Why he's not deleting the embed? :0
can someone teach me how to module export function with parameters
@stark abyss module.exports can be set to any value. For example,module.exports = 5means requiring the file will return the value of5as that's the export.
So, to export a function with X parameters, you define a normal function and export it.
require the file with require(...). ... should be a string that's the relative path to your file
ok
@sudden geyser If I do
module.exports = function getUserFromMention(mention){
if (!mention) return;
if (mention.startsWith('<@') && mention.endsWith('>')) {
mention = mention.slice(2, -1);
if (mention.startsWith('!')) {
mention = mention.slice(1);
}
return client.users.cache.get(mention);
}
``` it gives me error SyntaxError: Unexpected end of input
You're missing a } at the end.
oh yes sorry

@sudden geyser can you please explain little more on how to use it?
const exportFunction = require(./../../exportFunction.js); ?
Hi
oh wait i put getUserFromMention instead of const exportfunction it's const getUserFromMention
right?
and then i can use it?
Can You Giveme Bot ping
?
Example: ```js
// ----------------- firstFile.js -----------------
module.exports = function getFive() {
return 5;
}
// ----------------- secondFile.js -----------------
const five = require("./firstFile.js") // We're assuming it's in the same directory.
console.log(five()) // The name you give the function does not matter.```
though you should prob use es6 sytax for thos kind of things
its a bit better
export named functions, multiples, default, import as, export as
they are all quite handy @stark abyss
Does anyone know how you'd use the text-align: thing in css for something inside a div, I want my main text on the right, But with button onclick it reveals some text, but i need that text in the middle of the page.-.
i get such an error when i search the discord user with id.
- TypeError: Cannot read property 'toArray' of undefined
There's the option of abusing flexbox...
@earnest phoenix show code
Or just margin: 0 0 0 auto kind of thing
.addField('Rozetler', kisi.flags.toArray().join(', ') ? kisi.flags.toArray().join(', ')
this region
kisi.flags is undefined
kisi is a supposed to be a user object, right?
it's possible for the flags property to be null
I dont like
0
0
yeah but it works when I use it by mention the user.
There is a problem when use id
the plan is to get the same background color as the numbers
and make a custom emoji with that color
thats blank
just something for later
When the flag is blank it says "Rozet bulunmuyor..".
.replace("VERIFIED_BOT", ":onaylibot01:") : Rozet bulunmuyor..)
now to add fire animations to every single emoji
for when ships are dead
4 hours later 
try adding a check somewhere to see if kisi.flags is undefined or not, and if it is, set it to an empty collection
Question what skill would be needed to make a bump bot
depends what your bumping
Servers
theres several ways to bump servers
external bot?
so
or making your own
You'd need a server list 
not really. hmm, all you need is a channel, in your server that fetches messages, that starts with the bump command in other servers
actually quite easy
Well if you're bumping servers you need a list to bump on
@solemn latch it seems we both got 2 major things achieved
you'd need a database for that?
ay whatcha get done?
i made FREE NITRO bot
oo
database to store the guild ids and the channels in the guild
gib nitro plz
the forbidden rule that must never be broken, i did it
The easiest way would be to just put it at the start of an array so you dont have to keep sorting it at run time
They mean a scam bot
NoEE
#lawsuitfromdiscord
actually free nitro
remember when you made 99 countdown emojis erwin?
I ahve now achieved the ultimate level of advertisement, being able to say that without being clickbait or scam
i still have that actually
people told me im a retard for not using canvas for that
or imagewizard or some other shit
oh yeah it woulda taken half an hour just making the code
gifencoder makes it dumb easy
if i actually asked what you where doing i so woulda done it
fff
i did not add 0 or something in the end and its triggering me that it ends on 1
Watch it log ur info n shit 😂
@midnight blaze Open dms
no
Yes
no
Yes`nt
Anyone here up for commissions 🤣
no
im pretty sure its against the rules here
How
you can get access to #434058442764714002
idk i recall seing shivaco and some other mods do a command saying use fivver or something
Fivver is a hiring site/app I think lol
a commission is literally just hiring a freelancer
bottom line, you paying someone to do something




