#development
1 messages Β· Page 1470 of 1
these music bot discord.js tutorials are not working
can someone recommend me a video
npm i enmap?
what happens when you try it
bap conditions will not always be the same for everyone
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
that's the part that matters
wait what did i do?
i need help making a music bot
these music bot discord.js tutorials are not working
can someone recommend me a video
see the link in the error
@robust blade if you dont know how to make one dont
literally follow the instructions you are given on the console
Instead of hopping channels since you can't seem to get an answer I suggest learning more JS instead of relying on youtube videos
And FYI, I run one and can confirm it gets expensive
I think so
You need the latest version of Visual Studio.
ok :D
my choice not yours
Music bot overated
Well good luck with the ipv6 blocks
ipv6?
Inb4 youtube blocks your ip
they dont like random people streaming their data to discord
oh
Which is why IP rotators exsist.
IPV6 technically stands for Internet Protocol Version 6
eek
if i do an music bot
i get an error saying i need an youtube identity token
Yes
Which depending on the size of the bot and how shitty the balancing is, it can get quite expensive
Yeah good luck with quota too
i have an youtube identity token
if you're expecting to go big they will rate limit you

Or just scrape it
u talking to me?
Theres no point to them
saw someone spending over $2,000 for an ipv4 block for a music bot
are you sure it finished
Why not
Hey folks, fairly new to making bots for Discord and have been a frequenter of top gg for a while. thought I'd join in the conversation from time to time.
tl;dr Hello π
Did it say all done / done / something similar at the end
where you ran the install for build tools
yo
quickdb has a troubleshooting page, did you follow it?
Update to Windows 10 but thats not the issue
thats probably not it
Or just scrap the whole os itself, who even needs one?
probably shouldnt upgrade on a whim, you should take time to properly backup your stuff
^
Add --loglevel silly to the end of the command and check if the LIB environment variable has any missing or incorrect paths. That could result in node-gyp failing.
i have a problem with quickdb not better-sqlite3
quick.db is built upon better-sqlite3
setInterval(() => {
client.on('guildMemberAdd', member => {
if(guild.id === guildid){
const embed = new Discord.MessageEmbed()
.setTitle(`Welcome ${member.tag}!`)
.setDescription(`Hey there! Welcome to ${guild.name}!`)
.setColor('YELLOW')
message.channel.send(embed)
}
else{
}
})
})```
how come when a user joins, nothing happens? not a error or a message
why do you have a client event inside a set interval
thanks xiuh
im not the best dev but im pretty sure that would be an issue
Erm, i guess i thought of it 
take it out the setinterval and see if it works lol
ok
it does
Try using just two equal operators (==)
if it doesnt, discord sent garbage data, which it sometimes likes to do.
lol
oka
=== is a strict operator comparison so if you change the data in a very subtle way, they will no long have parity
Okay
I have a quick question: So I have a bot which has a singular backend which only drives one instance of the bot on one sever. What are peoples suggestions for expanding to allow multiple instances of the bot to run (currently in JS)?
I'm not adverse to moving to python.
Does anyone know how I can get the latency of a MongoDB database to show up in my ping command
i have done all steps in the github website u gave me @oak cliff
xiuh has a good point as well. If you have this event running at an interval then the chances of a member being added at that interval are extremely low
sorry for ping
i dont know any more than the github thing
ok
you could try asking in the quick.db support server, if someone else here doesnt know
client.on should report back when this event has triggered and then run the associated code
actually i think it would just be setting a new function to be fired on that event
what is the support server for quick.db xiuh?
message.delete()
thank you!!
client.on('guildMemberAdd', member => {
if(guild.id == guildid){
const embed = new Discord.MessageEmbed()
.setTitle(`Welcome ${member.tag}!`)
.setDescription(`Hey there! Welcome to ${guild.name}!`)
.setThumbnail(guild.iconURL())
.setColor('YELLOW')
message.channel.send(embed)
}
else{
}
})```
where do i put that. sorry im new to D.py
look at the docs
anyone gonna help? XD
im sorry, i dont know what the issue is
erm
it helps to put your question and code in the same message
this happened. it says undefined
client.on('guildMemberAdd', member => {
if(guild.id == guildid){
const embed = new Discord.MessageEmbed()
.setTitle(`Welcome ${member.tag}!`)
.setDescription(`Hey there! Welcome to ${guild.name}!`)
.setThumbnail(guild.iconURL())
.setColor('YELLOW')
message.channel.send(embed)
}
else{
}
})```
Discord returns a promise for requests like this, so you may have to await the response of the member name
okay
Or that βοΈ
wait why do you want to say Welcome ${member.tag}
does anyone else ever get this? ```
node:4376) UnhandledPromiseRejectionWarning: Error: 404 Not Found
at IncomingMessage.<anonymous> (root\src\node_modules\dblapi.js\src\index.js:118:25)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
i need some assistance
idk
?
that doesnt mean anything
yeah lol
bru not coding but like kinda of
so i know how to code html
but when i try adding style and stuff the website doesnβt read it
i knwo im doing it right
Yes, you're attempting to consume a promise object without it resolving. When using promises, you should have resolve and reject paths
know
yes iβm literally just testing what i can do
and it wonβt work
here hold up leme send it
its in the node_modules, its not my code its the api
In this case, the end point you're trying to contact doesn't exist?
the link i sent, is all the things you can do . on for the member object.
the member object doesnt have anything called .tag
Ah right
nice
hm, okay
how about member.toString()?
why would you tostring it?
Idk
Lol
erm
how do i fix that? LOl
well i got @distant cobalt
not the string version
member in this instance is data structure which contains properties that you need to access to get the information you need. https://discord.js.org/#/docs/main/stable/class/GuildMember
dont just try random things expecting something to work
This is the user ID btw (698582976769818674)
i think we are going to need some context
make his bot dance
step one turn on music
That can be resolved to a user ping like this I believe:
"<@" + id + ">
But you would need to extract the number
about?
are you looking for support for a bot you want to use? becuase this is a dev channel for making bots.
ok
How do I make da bot
go to makebot.com
I would suggest using member.user.username
If you want a ping "<@" + member.user.id + ">"
i got this :/
const userName = await member.id;
const embed = new Discord.MessageEmbed()
.setTitle(`Welcome <@${userName}>!`)
.setDescription(`Hey there! Welcome to ${guild.name}!`)
.setThumbnail(guild.iconURL())
.setColor('YELLOW')
message.channel.send(embed)```
Change const userName = await member.id;
to
const userName = await member.user.username;
And remove the <@..>
That should give you the base username
okay
its probably a good idea to learn how objects, properties, and methods work.
I just noticed, the reason it's not resolving to a ping is because you're doing it in the Title field. You can't ping in an embed title
Sorry, just going to bump my previous question. I think it might have gotten lost in the flurry of questions
doensn't work, it still says undefined
You dont need to await ids or usernames, they are not promises
do you mean sharding?
do you mean load balancing
Hi
still doesn't work
I mean, currently with my current implementation, it only targets one server. If another were to invite the bot, then they would end up sharing the same back end resources. I'm wondering how people deal with multiple requests and DB's going at once. So load balancing is probably closer.
yes i know, that wasnt to fix it, just to avoid doing useless stuff
Whats your current code?
I think the issue here is the initial retrieval of the GuildMember has been omitted from the code snippet and that's where the promise was initially an issue.
What are you doing that requires so many resources? Regular bots can easily handle thousands of servers
Currently, my implementation requires filtering through a lot of messages and I'm trying to plan ahead if I were to attempt to release it further. Currently, I'm not sure how much load there is via the Discord API and I'm just trying to anticipate pitfalls by asking some veterans in the game.
Would need some more details to have a concrete answer
The fact you came back saying bots can normally handle thousands of servers fills me with more determination confidence.
well, discord starts forcing you to do some type of sharding at 2500 servers
Just reading up on it now
My bot is currently handling ~6500 servers on a single process
On a single core vps
I hope the new commands system gets polished and reduced the need for sharding
I'm currently just hosting on glitch.com for a jumping off point. It has been fairly robust so far. Their online IDE is a bit clunky, but you can access your projects through VsCode so it's not too bad
how many guilds does it handle?
i would think its more about the users than the guilds
My bot? As I said, it's just a single guild at the moment. That's why I seem a bit green in the whole affair. π
Hi @quartz kindle
It's about 350 active users
Yea def would be able to handle 1 guild
problem with glitch is pretty expensive, and bots are against tos on their free tier
expensive for the hardware*
you could go to repl
Users is no longer a problem now that you dont have members intent by default
its not against their tos
keeping something online 24/7 is against glitch tos for the free teir.
Youtube clone bots real scared
so you make a new one or smth
and you know, kinda a crappy thing to do
Hi, can someone help me ?
i mean if you abuse their free service it affects others
imo yes but not much you can do to stop it
because they might increase the price or something
sure, but its still a crappy thing to do, and we shouldnt encourage it
no we shouldnt
I initially had the bot pinging itself to stop it from falling asleep, but I'm paying currently.
If youre paying fot glitch, you might as well pay for a vps
^
You get way more value
Ill always glorify gcp
I'd be happy to move over to a suggestion. I just wanted an easy way to deploy and have module management handled easily for me to get started.
Ye

Their cpus are good
ovh always worked well for me
wait a sec...
But everything else sucks
bad thing is i gotta go to the shell every time i make a change
is there some way to automate that thing
you could run some server?
shhh
hmm
worst case, you just make a program that does what your looking for.
Well you could run pm2 in watch mode, which makes it auto restart on file changes
Then you just upload new files via ftp/sftp and it will auto restart
Everhthing is possible
hmm
But i never tried doing that
I just do it manually via ssh
Yoi want auto deploy on commit?
Yoi can probably do that with github actions or something
yeah
but like it should probably have to enter the ssh or something
ill take a look
Thanks for the suggestions folks. The first thing I'll do is migrate to another platform from the consensus here.
hmm the link works for cloud run i think
is cloud run a good option for bots?
Password
U forgot password ig
Dont really know tbh
Mongodb is a pain to me, i only got it eork oncr
But it have something to do with password ig
Just use sqlite Jason dB 
^^
mentions sqlite and jason.db in the same message
huh
https://million.is-a.computer/files/E39FxTiwFzXiE70.png poggers error
almost as good as /login?r=/logout
yea
can someone help me with hosting my bot to heroku because I'm getting a push failed log when deploying it
when i open the html file, things are clickable and works fine, but when i load it on my web server, it doesnt work
and stuff just isnt clickable
and some pages work on the webserver
and some dont
code?
MongoDB working fine for me, thankfully
I use mysql
`- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
`
@hollow sedge
specify the node version in package.json
how do I do that? lol
now thats a good question
google it
like what doesnt work?
lmao 
what game was that
its an indie game called enemy on board
@hollow sedge like the code of what wont work?
flask
@requires_authorization is that flask-login?
nah its flask discord
oh..
<span class="alert-text"><b>Vanity URL Updated!</b></span>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>```
this is one of the thing that dont work
which one
?
oh ok
I get this thing now
`- node_modules checked into source control
https://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits
- Dangerous semver range (>) in engines.node
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version`
mine is shit
i think thats imported though
uhh u have any ideas?
wait imma just try to run the page
with no wierd stuff
just render template
nothing else
@hollow sedge
go to the links in the error message
I don't really understand what its telling me
neither do i
yeah node_modules shouldn't be in your repo lmao
thats what lockfiles and package.json are for
client.once('ready', () => {
client.api.applications("716985864512864328").commands.post({
data: {
name: "hello",
description: "Replies with Hello World!"
}
});
client.api.applications("716985864512864328").commands.post({
data: {
name: "echo",
description: "Echos your text as an embed!",
options: [
{
name: "content",
description: "Content of the embed",
type: 3,
required: true
}
]
}
});
})
It doesn't work
No error
command doesn't get registered
so how do I delete it?
add it to .gitignore
if its commited already i think you can use git rm -r --cached .
ok so this
ok lol
so thats all?
The slash should be forward btw
development going very very good
okie
light :0
this is what I get when I run the command fatal: not a git repository (or any of the parent directories): .git
bruh you don't have a git repository in that folder
make sure you run the command on the repo
sorry, how do I do that, I'm a noob at this
yeah I'm using github
i mean git
idk, i don't think so
Hello evryone,
Im trying by a command to get all the discord members tag , thanks to helpers π
what lib
cache all users in the discord server and filter them out by discriminator
then define the discriminator to add into a embed or message
I know the theory of what I should do but I can't do it I tried for a good hour , the .filter doesn't work etc.
thank you for the help
hm
i tried :
message.guild.roles.get('roleid').members.map(m=>m.user.tag);
let list = message.guild;
list.members.forEach(member => console.log(member.user.discriminator));
or something like that
will try
TypeError: list.members.forEach is not a function
Anything i want to do , fail
members.cache
o yea
@undone solar srry ho on
let list = message.guild;
list.members.cache.forEach(member => console.log(member.user.discriminator));
djs v12
Np mate , i just tried to help me π
you gotta cache it first lol
How does the tts in a server works?
text to speach?
Ya
well it does what it says
Ik but it doesn't work
anyone in that channel will hear your message via ai speaking it out
Wtf it return only my name
Code
It returns the actual member
wot
You.
do you have guild_members intent enabled
i said discriminator for a reason lol
tag is name+#discrim
username is your name
disciminator is just the discriminator
Im french man don't understand what was a discriminator
tag displays the # followed by the discriminator
That why it return only myself ?
uhh im using flask, and my buttons dont work
smhhhh
but on normal html, and on a page with no flask code it works too
its discriminator
but with the flask code, it dienst
not tag
but i need to return pseudo#discriminator
then add
that why i used tag
Pr
Still return only myself
Or
uH
If she uses `
She can write ${member.username}#${member.discriminator} (if she uses ``)
i think
It's more easyly
Im trying to get all the guild users π
guild.members.cache
All ik is you must have guild_members intent
yea that too
I found the solution thanks all
let list = message.guild.members.cache.filter(member => console.log(member.user.tag));
Oh rigth
but it return only online members
it only returns cached members
But i suggest you to use an specific channel, it's better for logging things
And keep clean the console for important cases
probably better to use a logger, and put it under info, as sending each user in their own message(the same method here, but sending messages) will quickly get you ratelimited
or just dont log every single member in cache, because why would you want that?
does anyone have an idea on how to keep your bot online forever
other server told me to host my bot
then what to do @mellow kelp
K will research thanks
kk
how can i get the number of members in all the guilds my bot is in
i was able to do
client.guild.cache.size
to get the number of guild
but i cant get the number of users in all the guilds
Use Array.prototype.reduce() and add all the member count of all guilds one by one
oh ok lemme try it
dang what would it be of js without array methods
oop
discord switched channels
How do I get a bot host 24/7 for free without paying?
I know heroku is free, but you need to pay to keep it going
doesn't exist
want resources? pay for them
welcome to capitalism
It's not actually capitalism
Someone is paying money for this servers
It is super cheap to hire a server for discord bot
oh
I think I found out a way to make it 24/7 for free without paying
ill tell ya if it works
Okey, I need a problem
I want to return message.channel.send if player isn't voted to my bot
But I can't return because it is promise
How to solve this problem
thats textbook definition of capitalism lol
use async/await
how?
and .then()?
It is in client.on('message', async message => {})
so just return
and Promise is now await but it doesn't work
what is your code
you're not awaiting it
should I await voteCheck()
take a guess
im trying to make a giveawaybot, but i have one problem
how to randomly take a user from the reactions?
reaction.users.random()
I am trying all the combinations
and none of these worked π¦
You need to await voteCheck before you log the value.
They're not returning the value properly in their function
Sounds like you should do some research on async await. Here's an article: https://tutorialzine.com/2017/07/javascript-async-await-explained
I agree with you, thanks
You need to get the reaction first
I'm not sure
reactions.cache.get()
const embed = new Discord.MessageEmbed()
.setTitle('Giveaway!')
.setDescription(`${giveawayPrize} \n Duration: ${giveawayDuration}`)
.setFooter(`Winners: ${giveawayNumberWinners}`)
.setColor('BLUE')
.setTimestamp()
giveawayChannel.send(embed).then(e => {
e.react('π')
setTimeout(function () {
let winner = message.reactions.users.random()
const winembed = new Discord.MessageEmbed()
.setTitle(`Giveaway Ended!`)
.setDescription(`Giveaway Winner: ${winner}\nHosted By: ${message.author}`)
.setColor('BLUE')
.setTimestamp()
e.edit(winembed)
message.author.send(`Your Giveaway Has Ended!\nhttps://discord.com/channels/${message.guild.id}/${message.channel.id}/${message.id}`)
}, ms(giveawayDuration));
})```
so this is my code
instead if just e.react(), you can use const reaction = await e.react() and use resction.users.random()
oh
your e function needs to be async though
reaction.users.random()
or
reactions.users.cache.random()
That grabs a random reaction that's not a property
reaction.users.cache.random()
Can you show me the code
const reaction = await e.react('π')
setTimeout(function () {
let winner = reaction.users.random()
const winembed = new Discord.MessageEmbed()
.setTitle(`Giveaway Ended!`)
.setDescription(`Giveaway Winner: ${winner}\nHosted By: ${message.author}`)
.setColor('BLUE')
.setTimestamp()
e.edit(winembed)
message.author.send(`Your Giveaway Has Ended!\nhttps://discord.com/channels/${message.guild.id}/${message.channel.id}/${message.id}`)
}, ms(giveawayDuration));```
Can you please try this?
ok
Reaction
oh
message.reactions.users.cache
me dum dum
There is no users property for reactions
The users property is for a MessageReaction
msg.reactions.cache.find(r => {
r.users.cache.random()
})
It is a way to do this
I don't know how to implement a code to discord
There is no users property in msg.reactions because It can be too many reactions in a message, you need to iterate all the reactions before
what are you doing
??
I can run normal node js code in heroku worker buildpack but i ant run discord js codes in it why? @here
why tf would you try to ping here
fixed
:)
wht is the best method to empty the same array?
array.length = 0
Ummm, other than setting arr.length = 0
array = []
than it would not remain same
array.splice(0, array.length)
thats inefficient tho
don't assign it to a variable because that will return an array of deleted element
idk man, he just asked a way to do it
so I told him
I read somewhere that it creates memory leaks. Is it true?
function clearArray() {
arr.forEach(e => {
const index = arr.indexOf(e);
delete index[e];
return;
});
return arr;
}```
poggers
you can't delete an index
you can't?
it will be empty item
you're right
@crimson vapor you meant delete arr[index]?
remove first return ig
index is a number why the fuck are there [] around it
function clearArray(arr) {
arr.forEach(e => {
const index = arr.indexOf(e);
delete arr[index];
return;
});
return arr;
}``` improved
returns an empty array
br
y r u returning back the same arr?
forEach vs for...of loop
because it's a function
which is better
depends probably
for of
o

I always use forof, when I dont need index
css for admin page? yes or no
yeah, too many callbacks
Its horrid in timed
it evaluates the function on every element
Times*
it fucking sucks balls
because I have to write css
Though i doubt theres any need to be squeezing that performance
For what though
um.... mr flaze?
forEach is also a bit dirty
for loops are cleaner imo
no one see
for God's sake stop using heroku
i use repl cuz no money
why would you ping the whole half of the server to help you
just wait for a few minutes till somebody sees
i not observer in priceing that in free you get 550-1,000 dyno hours per month and Sleeps after 30 mins of inactivity, otherwise always on depending on your remaining monthly free dyno hours.
so i made a plane deleting and again creating account
i use github
If some one use heroku they can try these if the use free
The google translate making it quite hard to understand ngl
@atomic vault heroku is not meant for bots
I dont know how do I get interaction ID, any idea?
I have tested my method of 24/7 bot hosting(without paying), anddddd it seems like it is online. I have used my own economy command bot.
I will be making my own website so you people can host yo bots 24/7 for free
- there isnt good free hosting
- the ones that are "free" require credit card, dont stay up all days of the month, lack infrastructure, or are too small and shady and will likely get your token stolen.
Dont go on this "hey guys, host ur bot with me for free" type of thing. Its too shady. Use some respected site or pay for a private one
who tf would want to giveaway free computers
async function remove(message, queue) {
const valuesToRemove = [playerone, playertwo]
const removeplayers = queue.filter(queue => !valuesToRemove.includes(queue))
}
remove(message, queue)``` isnt removing player one and two?
what
should remove the players but dosent?
it shouldn't...?
why shouldnt it?
nah I coded my own hosting service and have created my own website for it
you're not removing anything anywhere in that snippet
removing two ids from an array
ah okay
@earnest phoenix what i use to remove?
you probably want to use https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice
The splice() method changes the contents of an array by removing or replacing existing elements and/or adding new elements in place.
that function didn't return anything
they don't seem to be using any return value anyways so
can't they return removeplayers
sure
and then replace the original array with that
however you're creating two arrays with that
best is to use splice
fastest and most memory performant option
@earnest phoenix that is precisely why its fishy. A random guy out of nowhere propheticizing about a free vps with not drawbacks? Not buying it, sorry
well i will make a video on it soon! check my yt on my profile, i will be giving out the codes for glitch.com!
Thats just blatently advertising at this point dude
it is basically just a loopback for glitch.com every 4 minutes
Soooo, why not just use glitch 
yeah im using the glitch "ping back script"
So u dont have a free host
or don't abuse services because you can get in actual legal trouble
U have a pingbot
i do it is scripting
This
^
Pingbots are against their TOS
hmm okay then...
it's not something to be messed around with
"haha exploiting XDDD"
they can sue you
if you're under 18, your parents are responsible
even if you did it
Also false advertising with Free Host, breaking tos, and advertising personal platforms
smells like an MLM
which is also illegal
so auto-ping bots are not allowed on glitch.com?
The proper term is uptimer bots, and no, they arent allowed
hmm
They can use incoming traffic, which is like gpu mining except you are investing into a website that gains you 2x the amount for a domain. Or they could sell your data for targeted advertising.
kk baii
Look dude, i dont give two f's about u doing sketchy shit. But you arent doing it urself, youre dragging people into it as well, and if they dont know this is against their TOS, thats when you get into problems
cryptojacking is not legal by any means ποΈ π ποΈ
at least not where i live
If you doing illegal stuff at least dont bring people down with you in ur shady bizz
i mean you are using the internet(which is free), google chrome could sell your data or what you search for target advertising by advertisers paying google
Not like i encourage anyone to do illegal studf regardless
they could just have that
ik but tik tok makes money
Googlr tracking can be disabled
mhm
Which is why a lot of peopke, guess what, use linux, vpns, proxies, and a lot of shit
many free apps can steal your data no matter what
Wrong
Still doesnt make any right for you to come herer advertising illegal stuff
okay then
I mean, I don't care about my data, idc if they know I've been thinking of buying ahegao hentai keycaps Β―\_(γ)_/Β―
lol
We are just a number dude. You and me are both a single digit in a panel rn
If you wanna be a privacy freak, have fun
If im going to have ads, i prefer google knowing i like games rather than trying to sell me bra's and golfing equipment
use other browsers or you can set up a pihole
very specific items lol
i've been thinking of using my old laptop which is just collecting dust as a pihole
I heard some vpns have ad blockers on ios
i haven't tried it yet
function skip(message, serverQueue) {
if (!message.member.voice.channel)
const bruhembed = new Discord.MessageEmbed()
.setTitle('Error!')
.setTitle('You need to be in a voice channel!')
.setColor('#bb1414')
.setTimestamp()
return message.channel.send(bruhembed);
if (!serverQueue)
const someembed = new Discord.MessageEmbed()
.setTitle('Error!')
.setTitle('No songs found in the queue!')
.setColor('#bb1414')
.setTimestamp()
return message.channel.send(someembed);
serverQueue.connection.dispatcher.end();
}```
what the hell am i doing wrong
Uh
wtf
Can you show a bit of the context
nvm i fixed it
can i pass :white_check_mark: to message.react and it'll work or do i have to pass the unicode version only?
I can't escape emotes on mobile cuz curse discord's fucking soul
Is this good practice to use this in class methods again and again?
or I should rather declare a const variable equal to this.
const _this = this;
can discord.js move categories? (new created ones are always on the top)
\β escaped!
idk, but i think the if method works with {}: if () {}
k
can anyone help?
first it was giving this error but now it comes online but dont respond to commands
even my other bot responds but this one dont
can discord.js move categories? (new created ones are always on the top)
You can specify the position while creating it
If you want to move it, use channel.edit()
thx
follow the installation guide
quickdb?
Its like install quick.db right
oh are you using quick.db?
if so
follow the same troubleshooting guide
but install quick.db instead of better-sqlite3
quickdb used sqlite internally
ehh?
I'm pretty sure await can only be used in an async function
bruh
the bot ignores the space between await and require words for some reason
fixed
but now i have a new problem
await msg.react("β
");
await msg.react("β");
let filter = (reaction) => (reaction.emoji.name == "β
" || reaction.emoji.name == "β") && !reaction.me;
let collector = msg.createReactionCollector(filter, { time: 12000, max: 1 });
collector.on("collect", reaction => {
console.log(reaction);
if (reaction.emoji.name == "β
") {
message.guild.emojis.create(emoteData.image, emoteData.title).then(emote => message.channel.send(`Created new emote with name ${emote.name}`));
} else {
this.execute(bot, message, args, errorHandler);
}
});
the collector never logs anything in the console or throws any errors
i clicked the reactions and it doesn't do anything
do you have the guild message reactions intent?
I didn't pass anything to the Discord.Client constructor
well idk, try defining intents
yo is that a sauce
Now i just need to pass the number to Discord.Client({ ws: { intents: ... }}); right?
tias
Hey! VSauce, Michael here
k
How do I get the Id when I create role.
I know I have to resolve the promise . Can someone check the code below
let crole = await message.guild.roles.create({ data: { name: 'Remind ME', permissions: ['VIEW_CHANNEL'], mentionable: true } });
SO how will I resolve the promise?
where can we advertised here?
nowhere
conn = sqlite3.connect('voice.db')
c = conn.cursor()
guildID = ctx.guild.id
id = ctx.author.id
if ctx.author.id == ctx.guild.owner.id or ctx.author.id == 151028268856770560:
def check(m):
return m.author.id == ctx.author.id
await ctx.channel.send("**κ° μ§λ¬Έμ 60μ΄ λμ λ΅ ν μ μμ΅λλ€.**")
await ctx.channel.send(f"**μ±λμ λ§λλ €λ μΉ΄ν
κ³ λ¦¬ μ΄λ¦μ μ
λ ₯νμΈμ!:(e.g Voice Channels)**")
try:
category = await self.bot.wait_for('message', check=check, timeout = 60.0)
except asyncio.TimeoutError:
await ctx.channel.send('λ΅λ³νλλ° λ무 μ€λ κ±Έλ Έμ΅λλ€!')
else:
new_cat = await ctx.guild.create_category_channel(category.content)
await ctx.channel.send('**μμ±μ±λ μ΄λ¦ μ
λ ₯: (e.g Join To Create)**')
try:
channel = await self.bot.wait_for('message', check=check, timeout = 60.0)
except asyncio.TimeoutError:
await ctx.channel.send('λ΅λ³νλλ° λ무 μ€λ κ±Έλ Έμ΅λλ€!')
else:
try:
channel = await ctx.guild.create_voice_channel(channel.content, category=new_cat)
c.execute("SELECT * FROM guild WHERE guildID = ? AND ownerID=?", (guildID, id))
voice=c.fetchone()
if voice is None:
new_cat = await ctx.guild.create_category_channel("VOICE CHANNEL")
channel = await ctx.guild.create_voice_channel("Join to Create", category=new_cat)
c.execute("SELECT * FROM guild WHERE guildID = ? AND ownerID=?", (guildID, id))
voice=c.fetchone()
c.execute ("UPDATE guild SET guildID = ?, ownerID = ?, voiceChannelID = ?, voiceCategoryID = ? WHERE guildID = ?",(guildID,id,channel.id,new_cat.id, guildID))
```
await ctx.channel.send("**λͺ¨λ μ€μ μλ£! μ¬μ©ν μ€λΉκ° λμμ΅λλ€!**")
else:
c.execute ("UPDATE guild SET guildID = ?, ownerID = ?, voiceChannelID = ?, voiceCategoryID = ? WHERE guildID = ?",(guildID,id,channel.id,new_cat.id, guildID))
await ctx.channel.send("**λͺ¨λ μ€μ μλ£! μ¬μ©ν μ€λΉκ° λμμ΅λλ€!**")
except:
await ```

please stop spamming blocks of code
nvm hastebin is down again
Humm...
c.execute ("UPDATE guild SET guildID = ?, ownerID = ?, voiceChannelID = ?, voiceCategoryID = ? WHERE guildID = ?",(guildID,id,channel.id,new_cat.id, guildID)) ^ IndentationError: unexpected indent
what do you need the client secret and public key for?
i just can't find the info on the net..
message.channel.fetchMessage().forEach(m => {})
Why i have a error in forEach
Discord.js v11
Ok i'll try
Now i get this error i use
message.channel.fetchMessage().then(me=>{
me..forEach(m => {})
});
Now what i need to do?
have you thought about the fact that maybe you're the problem
nvm they're gone
awh
Is that possible never end session on node express and never logout after restart or anything ?
whats the most efficient way to make an automessage which is configurable via a web dashboard?
ive done all the web dashboard, just need to setup the auto message it self
OAuth stuff but most bots dont need it
Webhooks and setInterval and clearInterval
why would you need to clear int
because people might want to delete the automessage or edit it
both of which require you to delete the old one and make a new one
use react for the dashboard
π
can u show an example of how you would do it?
can you explain a bit more
oh ok
// lets say youre using the express server framework to make the server for the dashboard
// in your express app
app.put("/create_automessage", (req, res) => {
// create the interval
});
app.delete("/delete_automessage", (req, res) => {
// delete the interval
});
app.put("/edit_automessage", (req, res) => {
// delete the interval
// create a new one with the edited data
});
And also you'll need OAuth to identify users in your dashboard
yh the dashboard is fully done with the oauth etc
Ok
what would i put in /edit_automessage etc
That part you have to figure out cuz idk oauth
Why my bot goes offline after 5 minute?
I host it in terminal
@earnest phoenix i mean i have a dashboard for my bot and and there is a issue "its logout me automatically after restart my browser"
it mean session is not alive after restart browser
@earnest phoenix what do u use to store the session? i use mongostore and it remembers it for a long time (connect-mongo)
Wait a sec
@earnest phoenix are you using http cookies to store the user oauth token on the user browser
make sure they're not set to expire after some time
@queen crescent im using MemmoryStore
the issue is on the frontend not backend
@earnest phoenix try using connect-mongo
if people are being logged out that means the browser is deleting info about the site so the site cant identify the browser
@earnest phoenix would this just be the url to where the user configures the automessage then?
@queen crescent can you send me code of session part please ?
@queen crescent yep and send the data in the correct format through http PUT and DELETE requests
alright, and delete would delete all intervals, right?
So it mean its browser issue or something ?
@earnest phoenix no he was talking about his own stuff
Sorry wrong reply
Talking about this
Yes
You're probably storing the OAuth token in cookies
Hmm
Those cookies are set to expire after the browser closes
@earnest phoenix would it start an interval every time someone loads the page tho?
Then how can i do it
????????
what is the problem?
maybe you set status to invisible?
@earnest phoenix can i save cookies with auth any other side like db or something ?
nope. i can't use commands
oof
Holy. i know the problem
const Discord = require('discord.js');
const client = new Discord.Client();
const DBL = require("dblapi.js");
const dbl = new DBL('TOKEN', client);
client.once('ready', () => {
console.log('NodeJS Hosting');
console.log('Bot Status: Online!');
console.log(bot_version);
setInterval(() => {
dbl.postStats(client.guilds.size);
}, 1800000);
client.user.setActivity("/help", {type:"WATCHING"});
welcome(client)
onadd(client)
});
dbl.on('posted', () => {
console.log('Server count posted!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
})
where i added that code part my bot does not go anymore online
my bot does not go online anymore
judging from that snippet

