#development
1 messages · Page 1038 of 1
lol
Cheers, all sorted and fixed had @solemn latch
.map(c => c.help.category)
.filter((v, i, a) => a.indexOf(v) === i);```
I still haven’t figured out how to reply with bot
well, whatcha got so far?
I still haven’t figured out how to reply with bot
@bronze bramble Lol I can teach u later
well, whatcha got so far?
@solemn latch I havent do smth lol
Thats why idk even know where to start on a purge command
@solemn latch can u help?
sorry for pings
hello @kind sedge!
Whats up
ello guys
I'm trying to create a loop command for audio
but it's not working,somebody has an idea?
well I already tried this,but failed
so I tried it like this: if stream ends -> add to queue
so it's gonna be replayed again
well I guess it's not a good idea to put this in a while loop
is the call to loop() outside the function definition or am i dumb
yeah i would try what Woo suggested
the way to make this work, would do exactly what a while loop would do
i think your looking for an event, rather than a loop tbh
a while loop to spam it in my queue array?
thats why im saying an event
Wooooooo how do I reload commands if I'm using module.exports
what i think your trying to do is see when dispatcher ends right?
so an event that fires when dispatcher ends makes sense
Shit I don't have eval brb
Tyvm
idk howto create the event lmfao
iirc, dispatcher has a finished event already
dispatcher.on('event', callback)
That's because it doesnt exist in v12, use the 'end' event from nodejs' writablestream
youd have to look at the docs to find it
.on is for events
the log was just an example
🤔
No?
uh what
On is for subscribing to an event.
https://discord.js.org/#/docs/main/stable/class/StreamDispatcher it's right here and there is no finish event, but this class extends WritableStream which has an end event
nope does not work for me
Try using 'end'.
Any idea why when I do console.log(message.mentions.members.size) and tag 2 people it sais the size is 1?
Nvm
Its cuz I tagged a bot
lol
on('finish') does not work for me
wh-
Is tere a way to loop through the message.mentions.members?
console.log(message.mentions.members[0])
This doesn't work
Now I can't
Or you can use .values
I need to loop through it
its .on('finish'
@pure lion
.values[0]?
Yeah
"finished playing" is not on the console
It will return the data of each key
console.log(message.mentions.members.values[0]) undefined
Oh
dispatcher.on('finish', () => {
console.log('audio.mp3 has finished playing!');
});
straight from the guide
In the docs it says use Array.from(<collection>.values())
console.log(message.mentions.members.values()[0]) still undefined
How can I control the permissions of a specific channel for the everyone role? discord.js
So acts as if it were an array.
@solemn latch yea but it does not work
channel.setPermissions?
are you waiting for dispatcher to finish?
yes
🤔
@warm marsh No set permissions, but only check
@balmy knoll permissionOverwrites?
Check the permissions of the everyone role
Yes, but this doesn't work for me, it gives me always undefined
What gives you undefined? @balmy knoll
Idk how you're supposed to check the everyone role but you can try.
let partyArray = Array.from(message.mentions.members.values())[0]
for (let u = 0; u < partyArray.length; u++) {
message.channel.send(partyArray[i].username)
}
Any idea why this isn't sending a message?
No errors either
Oh
The 0 has to go
message.channel.permissionOverwrites.get(message.guild.id).deny;
TypeError: Cannot read property 'deny' of undefined
ChickenDev you should make it send their names in one message so don't get rate limited.
Are you using v12 or v11?
v12
As it's overwritePermissions
But that's used for changing the permissions of a channel.
overwritePermissions, overwrites the permissions... Not checking... Lemme see if i can figure this out
permissionsFor is the method required for checking.
It takes a role or member resolvable.
Using message.channel.permissionsFor(message.guild.roles.everyone)
Might work.
Okay, this works, but now it gives me the bitfield permissions, how can I convert it to see the actual permissions?
@balmy knoll the thing you tried would work if there was an overwrite for the everyone role on that channel, it says undefined because that channel doesn't have overwrites for it
toArray() ?
Using permissionsFor should allow you to do .has('permissions_name')
No, I've set some permissions on deny for everyone on that channel, but it still undefined (Voltrex Master)
@balmy knoll and if you want to see the permissions instead of the bitfield just use .toArray() on it
Hmm that's strange
ok I did it @solemn latch
message.channel.awaitMessages(filter, { max: party.length, time: 30000, errors: ['time'] })
.then(collected => {
console.log(collected)
if(collected.first().content.toLowerCase() === "yes") {
message.channel.send("Check!")
accepted.push(collected.first().author.id)
console.log(accepted)
if(accepted.length === party.length) message.channel.send(`Start`)
}
})
Any idea why this only works when the last second user types "yes"? The accepted array only logs his ID
const filter = response => {
return party.includes(response.author.id) && !accepted.includes(response.author.id);
};
This is the filter
I created a boolean and in my PlayMusic Function i check this boolean and do this:
@tulip ledge what is party.length

So shouldn't it do it twice?
This is weird I just put this in the filter
console.log(party.includes(response.author.id))
console.log(!accepted.includes(response.author.id))
When I type yes it both logs "true" but doesn't fire the awaitMessages and when the 2nd user types yes it's also both true but it DOES fire the code in the awaitMessages
Is it maybe
That it waits for the max to be reached
And then does it?
I got it half working now
const filter = response => {
if(party.includes(response.author.id) && response.content.toLowerCase() === "yes") accepted.push(response.author.id)
console.log(accepted)
return party.includes(response.author.id) && !accepted.includes(response.author.id);
};
message.channel.awaitMessages(filter, { max: party.length, time: 30000, errors: ['time'] })
.then(collected => {
let collectedArray = Array.from(collected.values())
for (let i = 0; i < collectedArray.length; i++) {
if(collectedArray[i].content == "no") return message.channel.send(`**${collectedArray[i].user.tag}** did not accept.`)
}
return message.channel.send(accepted)
}).catch(() => {return message.channel.send("Someone didn't answer in time.")})
It's just not sending the accepted in the channel and runs the catch instead
Please tag me if you know a solution
what are you trying to do? just a simple message collector?
I'm tryna let everyone who's ID is in an array say yes
And then add them to a different array
even if I set max to 2 it doesn't work
is the issue the filter doesn't work, or its saying u ran out of time?
just add an e into the params, and console.error(e) in the catch function
And I know why now
see what it logs
I'm adding the user to the array
And then seeing if the user is not in the array
if(party.includes(response.author.id) && response.content.toLowerCase() === "yes") accepted.push(response.author.id)
console.log(accepted)
return party.includes(response.author.id) && !accepted.includes(response.author.id);
This will obviously return false
Is there a way to still d othis?
wai
t
u want them things to happen if party.inlcudes bit in that if statement is true?
im confused what ur issue is then
I want to add the users to the accepted array
And then run the message filter if they are i nthe party and aren't accepted
But the thing is if they are in the party I'm adding them to the accepted array
I think I have a work around but it might not be so nice
so its doing ['user ID 1', 'user ID 1'] even though user id 1 is in the array?
and it'll keep pushing that same user into that array?
how do i get the user flags as flags and not a number
how can I run lavalink and a nodejs command at the same time
is there some way to idk make the js script execute a shell command to run the lavalink jar
cuz I tried that and it gives me an error
and I tried doing java -jar Lavalink.jar && node index.js
doesn't work either
what error?
Yeh I fix exuwjd
Fuck I'm tired
Btw hi Tim I'm using djs light because I'm recoding my bot and my god it's so fast thank you
Use newline?
well it was an exec script
and when I do the same script in my terminal its all fine
with that I mean console command
I don't understand
so it says command failed when you use child_process.exec() ?
yeah
im not familiar with lavalink, but does it give you back control of the terminal when you run it? or is it like a discord bot that keeps the terminal busy until you ctrl+c?
then you should run it either completely separate, for example in pm2, or use child_process.spawn()
Okay rusnwidw fml
Time to submit back to top.gg
Yaaaaaaaaaaaaaaaay
Shit I forgot how to html
fuck it im using youtube tutorials if I have to
What are you using the tutorial for.
How the fuck do I make stuff change colour when I hover over it
My solution would be using shelljs and make a second script running that with pm2 so that script runs lavalink for me
:hover
I did, it doesn't work
I tried and shelljs works
but it won't work with the bot script
so I need a second script
1 new server //working sql first added server
/root/dc/DHL/events/guildCreate.js:17 //second added server throw error, anyy fixes?
if (err) throw err;
^
Error: Cannot enqueue Handshake after invoking quit.
at Protocol._validateEnqueue (/root/node_modules/mysql/lib/protocol/Protocol.js:215:16)
at Protocol._enqueue (/root/node_modules/mysql/lib/protocol/Protocol.js:138:13)
at Protocol.handshake (/root/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/root/node_modules/mysql/lib/Connection.js:116:18)
at module.exports (/root/dc/DHL/events/guildCreate.js:16:5)
at Client.emit (events.js:327:22)
at Object.module.exports [as GUILD_CREATE] (/root/node_modules/discord.js/src/client/websocket/handlers/GUILD_CREATE.js:33:14)
at WebSocketManager.handlePacket (/root/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)
at WebSocketShard.onPacket (/root/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22)
at WebSocketShard.onMessage (/root/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10) {
code: 'PROTOCOL_ENQUEUE_AFTER_QUIT',
fatal: false
}
does the sql connection die on the second die of running the file guildCreate.js ?
i believe not
or .end()
yes i use .end() @quartz kindle
module.exports = (client, guildCreate) => {
//db for scount
con.connect(function(err) {
if (err) throw err;
var sql = "UPDATE scount SET servercount = servercount + 1";
con.query(sql, function (err, result) {
console.log(result.affectedRows + " new server");
});
con.end();
});
}
im not including the connection details but i do do them above this
and that runs on the guildCreate event?
well the problem is concurrency
events being processed at the same time
one is busy disconnecting while the other wants to connect immediately
you probably want to keep the connection alive and re-use it every time
instead of constantly connecting and disconnecting
for a program that is permanently connected such as a discord bot, its much better to use a connection pool, check out this example
i saw that post, but what is the connectionLimit: 10, part do
is it like 10 minutes, 10 times or what ive never used a connection pool before and i dont know what it is sorry
it defines how many open connections it will manage
for example 10 connections always open
every request you make will use one of those connections
if one of them gets disconnected, another is created to replace it
if multiple queries are done at the same time, each will be done in a different connection to improve performance
How do I make a button link somewhere (also I tried href and it didn't work, laugh at me)
how did u do it?
if each query takes 1 second to complete, with 10 connections you can make 10 queries per second
where with one connection, it would take 10 seconds (1 per second)
href='invite url'
don't tell me you did <button href=
fuck
ohhh thanks for the help @quartz kindle also whats the link to that article just so i can see if theres any more information
its the mysql npm page
How do I do it actually 🐖
thank you 🙏
you can either use <a href= and style a or use <button onclick="javascript">
or use <a href=""><button></button></a>
a {
}
border-radius: ??
¿?
and a unit
You tell me
i cant because i do not know
no memory?
thats why i ask
wolfy, send the full error
i only logged the error.message
well, something is eating your memory
Me
lmao
that's weird because that didnt used to happen
stfu honestly
either remove the last thing u done, or just optimise ur code 
How the golfball do i change the font
how about measuring memory usage?
font-family: font
color: colour
yeah, whatever u wanna change the colour of, do it on that
O ok ty
yo
So if i have a message collector like this
let filter = m => m.content && m.author.id === message.author.id;
let collector = await message.channel.createMessageCollector(filter, { max: 1, time: 15000 });
collector.on("collect", async msgC => {
if(!msgC.content.match(/\d/) || isNaN(msgC.content)){
await csmtd.delete();
return message.channel.send("Provided selection index is not a number, closing selection...");
collector.stop();
} else if(parseInt(msgC.content) > 10 || parseInt(msgC.content) <= 0 || parseInt(msgC.content) > getInfo.videos.slice(0, 10).length){
await csmtd.delete();
return message.channel.send(`Provided selection index must be between 1-${getInfo.videos.slice(0, 10).length}, closing selection...`);
collector.stop();
} else {
await csmtd.delete();
songInfo = getInfo.videos[parseInt(msgC.content) - 1];
collector.stop();
}
});```
As it only collects one message at max, it's useless to have `collector.stop()` right?
Why is it when I use the <a> tag the font colour goes blurple and changes when I hover
A
@pale vessel ideas?
NOP

@earnest phoenix if you're only collecting 1 message, use channel.awaitMessages
Oh yea correct... Wait, does TextChannel.awaitMessages() has collect and end events too?
Oh, will sure look into it... Thanks tim
Lol 13 pings
Also what the fuck, whenever I hover over it it goes blurple even when I have it to not do that
anyone know cheap vps?
perhaps
I'm thinking of moving out to a vps once i hit 75 servers
contabo
are we allowed to have our bots put in a command for another bot? like could my bot put in a command that the Rythm bot would listen too?
duh
@proven lantern rythm won't respond to bots
most other bots ignore commands coming from bots
probably a good idea
contabo
@pale vessel
is cheap
is good (looks like it)
Flaz it's not working uhhhh
in my case it might be a good idea to let other bots call my bot
no
show code
dude at least remove the invalid style code first
i can hear your anger through the keyboard
idontevenknowwhatsvalid
ill learn it tomorrow its fiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiine
i might go for ovh
i avoid ovh
why
Ovharies
Oh no
but its still good, for the amount of resources they offer
I mean it's not like my bot's gonna get popular X)
Server boi
it works
what about when my bot outgrows my measly 50mb/s connection
there is no perfect hosting
just chose whatever you feel like
both contabo and ovh are decent options
ill probs go for contabo
I think I'm dying send help
waaaaaaaat 
english pls
Maybe I should sleeep 😅
Hi, sorry for interrupting but I have a question 😅
so I have this code
const { channel } = message.member.voice;
// Spawns a player and joins the voice channel.
const player = client.music.players.spawn({
guild: message.guild,
voiceChannel: channel,
textChannel: message.channel
});
and thats the same code I used in a second file (which worked) but everytime I try to run the play command it tell me that it can't read the id property from the voice channel even though the id exists and I did log the object and everything is fine and that shit is the exact same code execpt im using a command handler and it worked in the other file but not in this one and I do not understand and no the problem doesn't come from the node module because otherwise that other script I made wouldn't work
so where the fuck is the problem
Hi, sorry for interrupting but I have a question 😅
@gray zealot also don't ask to ask
just ask the question
Hmmm
Hi, sorry for interrupting but I have a question 😅
@gray zealot I'm trying to retrieve a string from a JSON file, but It is retrieving all of the strings. heres the code: ```css
const animalsFromJSON = require("./animals.json");
if (message.content === ${prefix}animal) {
const animals = Object.values(animalsFromJSON)
animals[ Math.floor(Math.random() * animals.length) ]
message.channel.send(animals)
console.log(animals)
}
just ask the question
@marble juniper ok 😄
wouldn't you want to send animals[Math.floor(...)] instead of animals?
Or make a const for that function and send that, either works
ok
if (message.content === `${prefix}animal`) {
const animals = Object.values(animalsFromJSON)
var test = animals[ Math.floor(Math.random() * animals.length) ]
message.channel.send(test)
console.log(animals)
}
``` would this work?
😄
sorry
well if nobody answers me then I gotta find a solution myself
Ill check what I use, and see if I can help. Let me open my src lol
ok so, ```css
if (message.content === ${prefix}animal) {
const animals = Object.values(animalsFromJSON)
animals[ Math.floor(Math.random() * animals.length) ]
message.channel.send([Math.floor(Math.random() * animals.length)])
console.log(animals)
}
``` i don't think I did this correctly bc I have no errors, but, the message.channel.send send 0
It sends a number because that's the random number
no, still sends all the animals...
It sends a number because that's the random number
@strange trout ok 😄
@quartz kindle why when I try to access message.member.voice.channel it returns null
discord.js-light btw
because lower memory consumption
discord.js-light is pretty much anti caching
which disables most intents too
and most stuff has to be fetched
const animals = Object.values(animalsFromJSON);
message.channel.send(animals[Math.floor(Math.random() * animals.length)]);
Mobile so something might be wrong
ok, ty though 😄
hmm, it still doesnt work... something might be wrong with my json 😄
like
What does animals log
the animal that got sent
What does animals log
@strange trout
Animals should be an array
Array of links?
hi
so i want to be able to get the id offa channel tagged
like if you say
poge setup #channel
then it would do stuff in that channel
no, emojis
@gray zealot 😄
@bronze bramble Lol I can teach u later
@HoLdFιZzT#0001
https://i.callumdev.pw/0s758.png
Any way I can get this emojis to be a bit bigger?
nopee
@median star:
const [ [ id, channel ] ] = message.mentions.channels;
Can I still have help :D
(😬)
Hmmm, got a question, how would i send an image when its inside an obj with Image property in it to the channel without saving it locally? any decent way to request the cache path of that object property?
on the json payload to send it on an embed i see it requires attachment://filename.png
though im unsure how to target the obj and its property dynamically without saving, sending, deleting
So you mean the image URL is in an object and you want to send that image in the channel? What library are you using
What exactly is Image? I assume this is JavaScript
indeed
Oh. Gotcha
cool
you can attach an image to an embed from a buffer or a stream
no need to save locally
???
hello
Array of links?
@strange trout idk if you saw this but no, they are emojis
Bombarded by questions!
bombared?
nvm
what does that mean?
edited 🙂
ah oki
Can you show me how it looks when you log it
sure
me?
Kian
hmmm still struggling with it
where are you getting the image from?
please help
how do i get the id of a mentioned channel
message.channel.send({
files: Buffer.from(obj.cover),
content: 'test',
});```
Okay so looks like it's an array inside of an array
rlly? lemme see 😄
is it really worth using typescript for a bot? from my research, compiled javascript from typescript is slower than written nodejs / javascript (which really doesn't matter in context of a discord bot whatsoever, but its still something to note imo) and the errors you'd avoid with typescript would be caught in debuggers according to my research
thats what im attempting, but clearly im doing something wrong
Eloni get it from channel mentions, if you check the discord.py docs you should be able to see a property thats something like message.channel_mentions, or something simimlar
{
"animals" : [
"🦐",
"🦞",
"🦪",
"🦀",
"🐡",
"🐠",
"🐟",
"🐬",
"🐋",
"🦈",
"🐊",
"🐅",
"🐆",
"🦓",
"🦍",
"🐘",
"🦛",
"🦏",
"🐪",
"🐫",
"🦒",
"🦘",
"🐃",
"🐂",
"🐏",
"🦙",
"🦌",
"🦚",
"🦜",
"🦩",
"🦥",
"🦦",
"🦨",
"🦝",
"🦡",
"🐿️",
"🦔",
"🐉",
"🦄"
]
}
``` this is the json
holy code block
any ideas tim?
I don't think you need to use Object.values
@opal plank what is this Image object? is it like the native Image object from browser js?
ok
Just const { animals } = require("path to file")
good question, i'd have to dig into the library to see whats its fetching tbh
Then get a random item from it
Just
const { animals } = require("path to file")
@strange trout k
lemme check their index rq
Because Object.values() creates an array of the key values
how are you creating this Image object?
So it's just giving you an array with another array in it
its already created
checking their docs but i think ill have to go thru the code itself
Nice
where is it coming from? which lib is it?
prob better to dm you
Wym
lets say I want one of the animals to only be sent 1% of the time
Math.floor and ceil
Hmm adding some type of weight to it and doing some other js stuff
🙂
Dunno though. Having the same issue with my slots machine command
ok 🙂 ty though!
1 more... maybe.... I feel like this is simple, but how do I add a cooldown timer
all the help is great! 😄
but if you have MANAGE_MESSAGES perm it doesn't affect you
@pure lion
module.exports = {
name: 'afk',
aliases: ['setafk'],
description: `Users can set an afk message that shows when thay get pinged.`,
usage: "<afk message>",
cooldown: 5,
category: 'general',
async execute(msg, args, bot, Discord, db) {
let afkMessage = args.join(" ") || `${msg.author.tag} is currently afk.`;
await db.set(`users.${msg.author.id}.afk.enabled`, true);
await db.set(`users.${msg.author.id}.afk.message`, afkMessage);
const afkEmbed = new Discord.MessageEmbed()
.setDescription(`Your status has been set to afk with message \`${db.get(`users.${msg.author.id}.afk.message`)}\``)
.setColor('#7289DA')
.setTimestamp()
.setFooter(msg.author.tag, msg.author.displayAvatarURL({
dynamic: true,
format: "png",
size: 4096
}));
msg.channel.send(afkEmbed);
},
};
If (permission has manage messages) return else setTimeout ())))) milliseconds)))
ty
@heavy anchor is db defined and shit?
yes it is
no lol
It's stupid easy
Is there's something wrong with the way I'm doing it?
No idea I can barely see and I'm a tired
oh ok
But why are you writing asynchronously
@pure lion idk lol
the error is db.set is not a function
That's clearly a reference error
lol
kk
Thanks and sorry 
const db = sjwmiwnfisnd
try {
command.execute(msg, args, bot, Discord, dbl, db);
} catch (error) {
console.error(error);
msg.reply('There was an error trying to execute that command!');
};
arguments are passed by order, not by name
your db in your command file is actually dbl
const { MessageEmbed } = require('discord.js')
module.exports = {
name: "b!reactions",
run : async (client, message ) => {
let embed = new MessageEmbed()
.setTitle('Reaction Roles')
.setDescription('React to obtain the role')
.setColor('FCO1FF')
let MsgEmbed = await message.channel.send(embed)
MsgEmbed.react('💍')
}
}
what am i missing outt
coed isnt responding pls help 
@coarse hearth ~~ You need to replace let embed = new MessageEmbed() with let embed = new Discord.MessageEmbed()~~
^ thats not the problem
oh
the code is fine, its likely the problem is elsewhere
show where you call command.run()
your
dbin your command file is actuallydbl
@quartz kindle ohhh i see so I should includemsg, args, bot, Discord, dbl, dbin all my command files?
in your main file, or in your message event file, somehwere you have a line that does .run()
Thanks that makes sense
thats one option yes
yes
can you show the full code from that file?
add a console.log("bla") before the command.run() line
does it log "bla" when you run the reaction command?
yes
you made a new folder?
show where you load your folder
fs.readdir
or just readdir
you're loading files from the commands folder
i can copy paste and edit right
probably yes, the readdirSync block, with everything inside it
make another one, including everything inside it, and replace the folder name
not the module exports part
everything should be inside a single module.exports
const { readdirSync } = require('fs');
module.exports = (client) => {
readdirSync('./commands/').forEach(dir => {
const commands = readdirSync(`./commands/${dir}/`).filter(file => file.endsWith('.js'));
for (let file of commands) {
let pull = require(`../commands/${dir}/${file}`);
if (pull.name) {
client.commands.set(pull.name, pull);
} else {
continue;
}
if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name));
}
});
readdirSync('./commandsprivate/').forEach(dir => {
const commands = readdirSync(`./commandsprivate/${dir}/`).filter(file => file.endsWith('.js'));
for (let file of commands) {
let pull = require(`../commandsprivate/${dir}/${file}`);
if (pull.name) {
client.commands.set(pull.name, pull);
} else {
continue;
}
if (pull.aliases && Array.isArray(pull.aliases)) pull.aliases.forEach(alias => client.aliases.set(alias, pull.name));
}
});
readdirSync('./events/').forEach(file => {
const events = readdirSync('./events/').filter(file => file.endsWith('.js'));
for (let file of events) {
let pull = require(`../events/${file}`);
if (pull.name) {
client.events.set(pull.name, pull);
} else {
continue;
}
}
});
}
er
so
messy
yes, now it should work
but you're reading a folder inside a folder, so your commandsprivate should also have folders inside it, not directly a file
How to make vote only command
Like if user votes then only he can use that command in . Js
anyone
how i get all the messages of a channel?
Ive never actually seen this and I dont see any method in the docs, but is it possible to fetch an embed completely?
like a clone
What library are you using
discord.js
when you get a message i think its just message.embed
ye
(node:41760) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'partials' of undefined
how do i add partials
let me test it
looks like its an array
yea ill just do [0]
ye
im so used to people not knowing how things work
@coarse hearth looks like whatever your using .partials on is undefined
🤔
const client = new Client({
disableEveryone: true || ({ partials: ["MESSAGE", "CHANNEL", "REACTION"]})
});
this ok?
i honestly dont know whats going on in that code snippet
is it possible for a bot to allow two people connected to different voice channels to talk to each other temporarily?
yes, but i think youd have to build that logic yourself. @proven lantern
you want it to be built into the html?
you can host a little api for yourself on your bot and in your express backend query the api to get data you need
is there a function in discord.js that would let me connect two users?
Ben do you plan on logging in with two bot accounts or do something else
you would have to build that yourself @proven lantern
i think he is making a call system lite
cross server and whatnot
if you dont know how, how do you know that's not what they do?
ah
i plan to have two rooms with a team of 4 people and 1 leader. the leaders can talk to the other leaders using a modifier
well, just so you know. this system would likly have a lot of lag
their voice would be sent to discord, then to your bot, then back to discord and to the user again
if the users are far away from the server, you can be looking at seconds of delay
maybe i could just move the player to the room temporarily
can i setup keyboard/mouse event listeners?
for users in discord?
probably isn't allowed
if they type a key 🤔
anyone here know the best place host a discord bot?
Am coding my first ever bot and I can't find solid places to host for cheap
like a PTT button
i like galaxygate @drowsy sequoia
oh maybe @proven lantern
but it would be thier normal ptt
i dont think that event would be useful actually
the "speaking" event i think bots have acess to
this one i think
maybe i could listen for a double click of the PTT button
i could log the PTT click time and if they click within a certain time they get moved
will client.guilds.cache have all the guilds that my bot is invited to?
@proven lantern are u trying to count the number of servers ur bot is in?
yeah
client.guilds.cache.size will return the number of guilds in the cache.
typically, thats all of them(if not sharding)
(node:53544) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'partial' of undefined
at Object.run (C:\Users\LXPC\Documents\GitHub\brutalbotgit\commandsprivate\other\selfroles.js:16:30)
help please
const { MessageEmbed, ReactionCollector } = require('discord.js')
module.exports = {
name: "b!reactions",
run : async (client, message, reaction, user ) => {
let embed = new MessageEmbed()
.setTitle('Reaction Roles')
.setDescription('React to obtain the role')
.setColor('FCO1FF')
let MsgEmbed = await message.channel.send(embed)
MsgEmbed.react(':jack_o_lantern:')
if (reaction.message.partial) await reaction.message.fetch();
if (reaction.message.channel.id === "730593650386151"){
if (reaction.emoji.name === ':jack_o_lantern:'){
await reaction.message.guild.member.cache.get(user.id).roles.add("730596667311226")
}
}
}
}
Has discord some issues now or why my bot don't move me anymore in my channel? https://i.imgur.com/6zVoyGO.gifv
Didn't change anything ._.
It still worked earlier.
Can check, wait
No, i don't get any error messages
it works earlier like 1-2 hours before @lyric mountain
const discord = require('discord.js')
exports.run = async(client, message, args) => {
let money = db.fetch(`money_${message.author.id}`);
let content = "";
for(let i = 0; i < money.length; i++) {
let user = client.users.cache.get(money[i].split("_")[1].data)
content += `${i+1}. ${user} - ${money[i]}$`
}
let embed = new discord.MessageEmbed()
.setTitle(`Leaderboard`)
.setColor("RANDOM")
.setDescription(`${content}`)
.setTimestamp()
message.channel.send(embed);
}
exports.help = {
name: "leaderboard",
description: "",
usage: "",
example: "",
};
exports.conf = {
aliases: ["lb"],
cooldown: 5
};```
that is my code i succesfully return the embed but not showing anything
That formatting is a mess
hey
That or mobile is messing all the code
whats wrng with this code
@bot.command()
async def getid(ctx, channel:discord.TextChannel):
await ctx.send('' % channel.id)
it is outputting nothing but wont output to console
@tired nimbus tis
discord rerwite
const discord = require('discord.js') exports.run = async(client, message, args) => { let money = db.fetch(`money_${message.author.id}`); let content = ""; for(let i = 0; i < money.length; i++) { let user = client.users.cache.get(money[i].split("_")[1].data) content += `${i+1}. ${user} - ${money[i]}$` } let embed = new discord.MessageEmbed() .setTitle(`Leaderboard`) .setColor("RANDOM") .setDescription(`${content}`) .setTimestamp() message.channel.send(embed); } exports.help = { name: "leaderboard", description: "", usage: "", example: "", }; exports.conf = { aliases: ["lb"], cooldown: 5 };```
help me
chill
bruh
yes
@bot.command()
async def getid(ctx, channel:discord.TextChannel):
await ctx.send('' % channel.id)
where
.sett
How would I remove the border for the bot avatar and the border for the vote image (image attached for vote)
const discord = require('discord.js')
exports.run = async(client, message, args) => {
let money = db.fetch(`money_${message.author.id}`);
let content = "";
for(let i = 0; i < money.length; i++) {
let user = client.users.cache.get(money[i].split("_")[1].data)
content += `${i+1}. ${user} - ${money[i]}$`
}
let embed = new discord.MessageEmbed()
.setTitle(`Leaderboard`)
.setColor("RANDOM")
.setDescription(`${content}`)
.setTimestamp()
message.channel.send(embed);
}
exports.help = {
name: "leaderboard",
description: "",
usage: "",
example: "",
};
exports.conf = {
aliases: ["lb"],
cooldown: 5
};```
help me
I made this code so my bot sends a DM to people who votes but I don’t know why it doesn’t works
the embed not showing content
It doesn’t sends anything to logs 
wait, not you :PPPP
@granite nexus i feel betrayed ;-;
@marble geode
ya
Pls read my message
add ; ?
👍
@marble geode had some trouble not awaiting before running code sync btw
might wanna await calls to make sure the code doesnt run before it returns
where?
in your first database call
console log it right after, see if its finishing before the code runs
await db.fetch??
ya
ok
if the query doesnt finish before the next line is ran it'll just log (promise)
same
Help, it doesn’t works and doesn’t sends anything to logs
did u log it?
LOG it
on console
console log it right after, see if its finishing before the code runs
console.log(money) that?
yes, right under it, without await
How does one remove the border around the vote button? I managed to fix the bot icon
same bro
show here
@olive rune use f12 to find out vote button's class
Do I set the border to none?
Any mongodb specialist here?
@opal plank iam trying that for 1 week lol
well im giving you instructions to help you debug it but you keep sending the same screenshot
even though i told you to console log it, you are sending me discord screenshots
you know what console is, right?
this is console
this is chat
now calmly, add console.log(money) after your database call. then show me the console printing whats inside @marble geode
someone with mongodb knowledge here?
im only familiar with postgres
leave that i deleted the code :v
are you have idea for new command in economy?
Are you have lul
I want to make a modbot in 1 week?
do you know any programming languages?
dont ask to ask, just ask
Nope
you need to learn one before trying a bot
JavaScript or Python would be my recommendations
How to learn JS
lemme get some links for you
CodeAcademy
@opal plank check DM
@opal plank I want to make my status count other people online in other server
can you help me
@clever vector which lib you use?
ilb
and i use Node.JS
u need discord.js right?
or eris
What do you mean Library
or deno
Node.js
not a library
😭 good luck mate
im assuming you have discord.js
The app?
How u made the bot? via CMD or Powershell or an APP
thats the term
Where can i find it
U need to install it
you make a bot with coding. Use VSC or Atom(goes by your preference) @earnest phoenix
Atom is good
I would recommend VSC , my personal preference
SHow SS
repl isnt a library mah dude
Bruhhhhh
see YT tutorials
Youtube tutorials are:
shit
likely outdated
just teaches you to copy-paste
doesnt have the examples nor the explanations that the docs have
true or false
K
hi, im having some high memory usage / possible memory leak issues with by bot. i ran a version of my bot without commands or client events, but it still takes gigabytes of my ram, im thinking it's something to do with the guild & user count (~50K guilds). How could i lower the bot's memory usage? or is it just normal for a big bot to take up this much memory?
What language are you coding in?
im using the Discord.js library, javascript
and im just running this code https://srcb.in/145f8f13e0
try using intents @hollow granite
So if you have a large server, and you cache a lot of entities, it can suck up RAM like no other
^
if you still cant get ram to levels you want
and dont wanna swap to eris
try discordjs-light
Thanks woo <3
ok, thank you both
ofc <3
someone please help
I was making overwrites
with discord.py
I got this error
TypeError: __new__() got an unexpected keyword argument 'allow_new'
I have a problem, when people buy a gun he can mine even though if you want mine you must have pickaxe I use if (db.has (`$ {message.author.id}`, 'pickaxe') === true) { here the code }
im pretty sure you shouldnt share joinSecret
it's probably an example off the docs
yes
What is that
learn classes
Bros
or void
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
here
just checked
sending in channel?
but i want to use it to add
\ + emote
to help part
default style
How
emoji id
<:lol:23567:>?
you need id, use \ before it
name:id
example
it s
:kekw:someid
animated emojis should be with a
no, you use the big thing
/ ?
you only use \ to see the name of it


