#development
1 messages · Page 1248 of 1
I get it from github
yeah buddy
Is invite manager down for y’all too?
But they provided me
thats stealing code
@wind kayak hope this is a joke
thats stealing code
No
-needdev
DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.
No
@wind kayak it is
yeah shivaco coming in to help :p
@wind kayak stealing code from github will get your bot deleted here
He doesnt even has a bot
If you want to make a bot actually learn how to
-bots @wind kayak
Wait what
he does
Awaiting review
Oh
their bot is not approved..
-bots lists bots even if they're not approved yet
ok
This user has no bots
if you add this in your head
script
<script>
if (location.protocol != 'https:') {
location.href = 'https:' + window.location.href.substring(window.location.protocol.length);
}
</script>```
then even if u don't have ssl
it will say your website as Secure
ok
"Channel for chatting about (bot) development. If you have questions, ask the questions and wait for someone who can answer to help you. "
bot
this channel is for chatting about bot development i belive
ye
Not restricted to bot development
message.channel.send("Enter the channel");
let filter = m => m.author.id === message.author.id;
let collector = new Discord.MessageCollector(message.channel, filter);
let destination = message.channel;
collector.on('collect', (message, col) => {
console.log("collected message:" + message.content);
destination.send(message.content);
});
collector.on('end', collected => {
console.log("messages collected:" + collected.size)
})
``` ive got this code for a collector which works. how do i make it end after a certain time, like 10 seconds?
where do i add that
in your code duh
where in it? ive returned from coding after a 2 year break, im a bit rusty
when you want to end it..
ok
setTimeout(function() {
collector.on('end', collected => {
console.log("messages collected:" + collected.size)
})
}, 10000);
which
whihc??
i did myself
discord.ext.commands.errors.CommandNotFound: Command "kick" is not found
What's bad with this thing?
i personally never use setTimeout but i think function needs to be changed
thats ur command handler
I am sending the code tho
and you don't know what that means because you prob copied the code......
how are you sending your code
eval?>
eval*
eval?**
¯_(ツ)_/¯
@client.event async def kick(ctx, member : discord.member, *,reason=None): await member.kick(reason=reason)
and you don't know what that means because you prob copied the code......
@sharp thicket nah
seems like it
so you stole the code?
Nah.
copied*
I learned it through yt videos
same thing
So what's wrong in it ?
How the actual fuck am i supposed to know how your command handler is setup
also add a premissions checker
make sure you don't give everyone kick perms
Kk
Kicked from this server or off the list?
from server
message.channel.send("Enter the channel");
let filter = m => m.author.id === message.author.id;
const collector = message.channel.createMessageCollector(filter, { time: 10000 });
collector.on('collect', m => {
console.log(`colected ${m.content}`);
message.channel.send("collected:" + m.content)
});
collector.on('end', collected => {
console.log(`collected ${collected.size} items`);
//message.channel.send("collect)
});
i did this and it works. how to make it send a message when time is up? do i have to do a try and catch?
i dont know @silver lintel
Oh okay so your bot can be on the list if it has welcome messages
@primal wraith i could have a patch for that
wait im stupid, i can just send in collector end
@primal wraith i could have a patch for that
@sharp thicket a patch for what?
client.on("guildMemberadd", (member) => {
if(member.guild.id === '264445053596991498') return;
\ ..
})
Oh you mean that
check if the guilds id is dbls id
Ig so
@primal wraith They shouldn't be on by default and the bot will stay here
If they aren't disabled for this server it will be kicked only from here
Also #support
Idk I added it like 2 weeks ago but I never got a response
I think it's because it has admin perms enabled which is a mistake
I forgot to change it to just send and react perms
@primal wraith They shouldn't be on by default and the bot will stay here
If they aren't disabled for this server it will be kicked only from here
Also #support
@earnest phoenix thanks
@sharp thicket u too xd
Xd
what database would you recommend to use if youre making an economy bot?
@forest drift mongodb
quick.db as a starter but after a few months switch to mongodb
ive tried mongodb but im just not good enough yet, ive been looking at sequelize but cant find an external host version
console.log(newMember.member.voice.channel.id)
console.log(oldMember.member.voice.channel.id)
})```
cannot read property id of null
newMember.member.voice.channel is null
why tho
because the member left the vc?
you sure the oldMember is undefined?
if (newMember.member.voice.channel)console.log(newMember.member.voice.channel.id)
if (oldMember.member.voice.channel)console.log(oldMember.member.voice.channel.id)
})```
no
bruh
Remove those absolutely fucking useless unnecessary and probably stuff breaking if statements
that is only what i got
log the entire object
no you won’t
yes i will
do you really not understand how console.log works or do I not
cuz I’m fairly sure it’d just log null
yes it logged null when there is no .id
therefore i cannot get which VC the guy left
you can get the old VC's ID and check the member size:
if (!oldMember.guild.channels.cache.get(oldMember.member.voice.channel.id).members.size) // empty vc```
But wouldn’t the bot count as one member
oldMember.member.voice.channel.id gives an error when someone left the channel
Is oldMember not a <Member>?
voiceStateUpdate event
or .filter() if the bot can be outside the vc
@pale vessel how do i use this doohickey
use it on what
what are you trying to achieve?
oldMember.member.voice.channel.id gives an error when someone left the channel
hmm?
you can't access a property of null or undefined
so only console.log if member.voice.channel exists before checking member.voice.channel.id
how do i make it not null?
how do I make it that if someone leaves the VC, the VC's id will get logged?
It can’t be?
?
use oldMember
its impossible
not newMember
if oldMember doesn’t work then 
oldmember gives null if someone leaves VC
you sure?
i think so
It shouldn’t
make sure that they actually left by making sure newMember.voice.channel is null
by they you mean me...
both newMember and oldMember will go null if I left the VC
could it be caching funniness
i would expect newMember would be null while oldMember be the last VC I am on
and when i join i would expect the opposite
I think you can create a JavaScript on Android
To make a bot work properly on multiple servers, you have to make it use separate global variables for every server, right?
-bots
Otherwise, depending on the bot, data can mix if its being used at the same time in multiple places, right?
If I use the ".flip" command on one server to change a global variable to true, and use the ".check" command on another server to check that variable's value, it'd be true, right?
I came here to double check with devs that the above is true and that I have to put in a lot of work to make scenarios like above not happen unless I want them to.
https://discordapp.com/channels/264445053596991498/714045415707770900/756065313895743498
If anyone can help me, I can't seem to remove this border. 🙂
I wanna do message filters
like someone said Shit
I have done message.content.includes.......
and added shit
but if S is capital then it does not work
Try .toLowerCase() or your language's equivalent for the message content.
@rocky edge
@pliant gorge
@tacit grail
@gilded plank
@smoky prairie
@opaque adder
@finite olive
@exotic kite
How to make Pokécord Spwan Feature
const swearWords = ['words here']
if(swearWords.some(word => message.content.includes(word.toLocaleLowerCase)) ) {
if(message.guild.id !== "690557545965813770") return
if(msg.channel.id === "736428278969270342") return
message.delete()
message.author.send('Cursing is not allowed in this server So better watch out')
msg.channel.send(` No Cursing or you'll be muted`)
}``` @viral plover this is how i do it but it does not work
don't pay attention to msg and message
they both are same
I have done const msg = message
You mentioned the wrong person. 
oh
sorry
Try
.toLowerCase()or your language's equivalent for the message content.
@viral plover no you only said this tho
Yeah, but I typed that to help--
Oh, sorry.
I uh, misunderstood.
ok
I use JS so Python's a bit weird to me but...
This is in the "on message" event, right?
Though if it is I'd expect the swear list to be declared elsewhere.
I'm probably just nitpicking. >.>
Might want a fast database for swear words
@faint prism ok but why doesn't the bot respond
As long as there's no issue with msg vs message like you mentioned, I don't see why it wouldn't work.
Have you checked if any of the code is triggering?
is there a way ping another bots ip:port with my other bot to see if that bot is online or not? it uses discord.js
@faint prism I got an error
finally
it says cannot read property some
of undefined
I don't know about pinging another bot's ip:port, but you can check its status just like a regular user, right?
ye there is, I use js on my bot and have a way to check statuses. you could filter that by bots or just check a certain Id to make that work
ive tried i found nothing on it
idk code tbh I look everything up
ok uh there should be a tutorial on a server info command which has that and a ton other stuff
I cant remember the exact one though
I'll see if I can find it
ok it's the one by menudocs
if you search up discord.js serverinfo then go to around 11 minutes that should help you
@soft eagle
@faint prism ok but why doesn't the bot respond
@delicate shore no idea. Use break points
@cobalt scaffold im not looking for serverinfo im looking for a ststus of an ip:port
to see if my bot is up ort down so if the bots status is offline i can tell its online
bots don't do inbound traffic
does anyone know if there is a limit to how many channels the bot can send message to at the same time?
Or it depends on the server it's hosted on cuz of the processes
they don't have a ip:port, bots are just connecting to discord
i did ```const http = require(http);
const app = http.createServer((request, response) => {
response.writeHead(200, {"Content-Type": "text/html"});
response.write('works');
response.end();
});
app.listen(2028);``` on the bot i want to check bc uptimerobot required that
@fast loom 5/5 is the known limit however your lib should handle it for you
i just want a way to see if the port is running or not
so a bot can only send a message to 5 channels at the same time? if that's so it'd suck big time 
i dont get what you mean by at the same time
like... to send a message in all channels in this server
at the same time, as an example
requests will never happen at the same time regardless, it's impossible
how do you check if a variable/args is a channel in the server and not just random letters?
depending on what its for i might be able to help
For it to be a channel either check it's name or use it's id
or better yet check for a mention of a channel
yes, how do i see if its that
A mention?
is mention of a channnel #development?
yes
okay, i want to check if it is a mention of a channel
Depending on library used the way of checking that is done slightly different
and see if its in the collection?
oh the way i always did it was just message.mentions.channels.first
Either works
if you do .first then make sure to filter out #deleted-channel
Just using .first returns undefined if not found
how would it be done in if statement form?
if (collection.size > 0)
{
// do code here
let first = collection.first();
}```
nvm figured it out i just check if the port is reachable using isPortReachable
const isPortReachable = require("is-port-reachable");
(async() => {
//console.log();
if ((await isPortReachable(2028, { host: botip })) === true) {
console.log("Up");
} else {
console.log("down");
}
//=> true
})();```
@gilded plank
so if i need to send like 9 msgs how would i split it to send within the limit
so i dont get api banned
like how many seconds should i make each timeout be to be within limit
like how many seconds should i make each timeout be to be within limit
you would probably only need like 1 second in between each message
maybe 1.5 to be safe
because im pretty sure its 5 messages in 5 seconds max
i think i saw that earlier
so each msg should be sent 2 seconds apart from each other then
do you want to make that feature yourself or add the bot thats doing it in the screenshot
Yes, I want to do this in my server
with your own bot or the one in the screenshot
Why is my member.username undefined ? 😥
Yes
@arctic cape what language are you using
Discord. Js v12
im pretty sure member.username isnt a thing
Wait wth
what are you trying to do
Can you do to me with the picture?
Brb wait
Can you do to me with the picture?
@zenith patio i dont know how you want to actually do it
are you using someone elses bot or your own one
to show those
dont just say yes
Member is first mentioned user or author.
You do it
And .nickname is resolving but username doesnt work am i stupid ? 🤔
wdym first mentioned user or author
You do it
@zenith patio so you want to get someone elses bot to do it?
Someone else
ok
let member = message.mentions.members.first() || message.member
Yes
find out what bot it is thats doing it in the screenshot you sent then add that bot to your server
let member = message.mentions.members.first() || message.member
@arctic cape ok so what are you using this for
Fetchr bot and id do server
In case of no nick is there
ok i havent really done anything with nicks but you can probably just make it so if they have a nick, show it and if there isnt any then just leave it out
Hello
How does this work?
How can I make something like [2020-1-1, 00:00]: ???
The date and time?
Do I use Date.Now()?
!help
Seriously.
Guys
Is this a command?
if(!money[user.id] || !bank[user.id]) return message.channel.send(noMoneyEmbed)
Try and see
Like can I use 2 !s at the same time?
And what tf you are trying?
if the user does not have a money or bank account it returns
like that
so I made this
Just try it and see
if(!money[user.id] || !bank[user.id]) return message.channel.send(noMoneyEmbed)
Thx @arctic cape
That current code is saying if a user doesn't have money, or that user doesn't have money in the bank
If you to send the nomoney embed if the net worth is 0
Then you need &&
Yes
Is there a way to get mentioned user's username except length substring of user.tag ?
If he has no nickname
Discord. Js v12
what
See i made a userinfo command which has field nickname
So if a person doesn't have a username which i check using !nickname i. E variable i want to set this var to the username and it doesn't work 😥
hello, i coded this yesterday but its not working, is the syntax correct?
if(client.channels.cache.get(VoiceTemp.users[newState.id].ChannelID).members.size > 1){
client.channels.cache.get(VoiceTemp.users[newState.id].ChannelID).members.map(async(user) => {
user.voice.setChannel("534847940959666196")
})
}
VoiceTemp.users[newState.id].ChannelID = ID VoiceChannel```
the fact that the movement in the channel afk poses no problem?
Get more logging or set breakpoints
mongo_url = "url"
cluster = MongoClient("peepee")
db = cluster["poopoo"]
collection = db["u nerd"]
guild_id = int(ctx.guild.id)
guild_id2 = {"_id": guild_id}
prf = collection.find(guild_id2)
for pre in prf:
prefix = pre["prefix"]
client = commands.Bot(command_prefix = getprefix)```
this is d.py and mongo
and i want to make like custom prefixes
plez help
giving this error TypeError: on_message() missing 1 required positional argument: 'message'
I don't like your database naming convention
its not that
It should be descriptive of it's contents
its just like i changed it
Unless?
Is there a way to check if args[1] is a link to a discord server?
use regex
if (args[1].match(pattern)) <valid invite>
https://www.regextester.com/99527 looks good
kk, thanks
message.channel.send("blah blah blah");
setTimeout(function() {
message.delete;
}, 3000);
How do you delete a message after 3 seconds in discord.js?
How do i do this? Sidneybpt is also d.js
32k pings!
Dont question it lmao
do what, the attachment or the screenshot
the screenshot
probably a tool like puppeteer.
@silver lintel setTimeout
Or selenium
probably a tool like puppeteer.
@umbral zealot kk, thanks!
Why dont you test it @silver lintel
How do you delete a message after 3 seconds in discord.js?
@silver lintel you can usechannel.send(data).then(sent => sent.delete({ timeout: 3000 }));. you send a message and get the sent message. after that, you delete it after 3 seconds (3000 in milliseconds)
Selenium isn't headless, so it'll actually have a window to screenshot
What permissions does my bot need to give roles?
I tried Manage_Roles but it doesnt work, but when I give admin, it works
Thank you fazepe
MANAGE_ROLES works as long as the role you're trying to give is lower than the bots highest role
every time I create a channel I would like it to be above afk
newState.guild.channels.create(`Vocal de : ` + client.users.cache.get(newState.id).username, {type: 'voice'}).then(tempchannel => {
tempchannel.setParent("567883665435131904")
tempchannel.setUserLimit(2)
})```
Ok, it works. I was just being dumb
Is there a way to get a users badge?
Yes <User>.flags if your using discord.js
is it possible to pass a sqlite table into parameters?
Yes
<User>.flagsif your using discord.js
@heavy anchor thank you
@tired nimbus nope
ok
what's SQLite
what's mongodb
what's the universe
what's life
what's life's true purpose
42
Nice
oops #general we're going general (not off-topic GENERAL cuz the channel name changed)
try to remove the www. in front of twitch's domain
maybe discord gets confused and doesnt allow that as a valid twitch url @earnest phoenix
hm
@earnest phoenix found the problem
you're passing a string as the first parameter instead of the string being INSIDE the object as the first parameter
it's supposed to be setActivty({ name: "fuck"}); NOT setActivity("fuck",{});
discord.js docs say otherwise
@earnest phoenix get the syntax correct boi
("name",options)
wut
@earnest phoenix gib link
client.user.setActivity('discord.js', { type: 'WATCHING' })
~ djs docs example
what
@earnest phoenix mine is VERY different:
bot.user.setPresence({
activity: {
type: "STREAMING",
url: "https://twitch.tv/nauticaljeans84",
name: `c.help | ${bot.guilds.cache.size} servers| Support server discord . gg/Usv92Db | s t o p r e a d i n g m e`
}
});
TypeError: 'module' object is not callable```
does anybody know about it?
it's not js
Client is not the same as client
Clientis not the same asclient
@umbral zealot elaborate
languages are usually case-sensitive
oh
i got it
it's capital c
languages are usually case-sensitive
@umbral zealot thanks! u will live 10 years...
I really hope we live a whole lot longer than that, but thanks 😄
ur non-edited sentence was good
there, now it's even better 😄
ok
i got a big error
i need some python programers
who use pycharm
and know about
anybody?
wtf is everyone here are javascript programers
yeah. discord.py
i think
when i am running my code
that is of 25 lines
i got some actually very much
send the code and/or the error
learn 👏 the 👏 language 👏 ✨ first ✨
:d
i got some actually very much
@silk chasm that r of connecter.py that is part of discord.py
learn 👏 the 👏 language 👏 ✨ first ✨
@restive furnace ik python...any prob?
I like object oriented/based languages' syntax more than function oriented
@restive furnace ik python...any prob?
@silk chasm then why do you ask beginner questions 🤔? but okay.
like.. screenshot it
@fast loom it has many errors can screenshot it
@silk chasm then why do you ask beginner questions 🤔? but okay.
@restive furnace what questions?
Does anyone know I how to make channels
isn't this question: i got big error, i need some python programmers etc.
uninstall dicord.py and install it again
or was it the python version itself
One of the two
certificate verify failed: certificate has expired
@fast loom this means he's using windows and need to get the latest certificates
i got the same error when they update his stuff
certificate verify failed: certificate has expired
@fast loom i got that error before also ... that's y uninstall and reinstall it... but still the same
@gentle zenith What language and library?
idk then... for me it worked after I reinstalled a couple libraries
@long cipher dm me!
or was it the python version itself
@fast loom oh wait my python is showing "available updates"
OFC after I spent 2 days trying to find how to do it all xD
pycharm
oh LEL
pls someone du -checkdms
well, still, I think it's the libraries
let me update my pycharm and then i'll see it...
here https://discord.js.org/#/docs/main/stable/class/ClientUser?scrollTo=setPresence @earnest phoenix
paste that exact code and see
so yesterday we talked about translation, and how to handle it in a bot. I've settled on an external json file thats loaded when the bot starts: https://github.com/brainboxdotcc/triviabot/blob/master/lang.json
then this simple bit of code to find and translate a language string:
std::string _(const std::string &k, const guild_settings_t& settings)
{
auto o = lang.find(k);
if (o != lang.end()) {
return o->find(settings.language)->get<std::string>();
} else {
bot->core.log->debug("Missing language string '{}'", k);
}
return k;
}
thoughts? seems to work and scale quite well.
Is it possible to pass a sqlite table's gotten key to parameters?
client.on("ready", () => {
function randomStatus() {
let status = [
`exompel -help`,
`Your Website link here`,
`${client.users.size} Users|${client.guilds.size} Servers ${client.channels.size} Channels`
]; // You can change it whatever you want.
let rstatus = Math.floor(Math.random() * status.length);
client.user.setActivity(status[rstatus], { type: "PLAYING" });
}
setInterval(randomStatus, 2000);
console.log(
`${client.guilds.size} servers have ${client.users.size} members ${client.channels.size} Channels `
);
});
so yesterday we talked about translation, and how to handle it in a bot. I've settled on an external json file thats loaded when the bot starts: https://github.com/brainboxdotcc/triviabot/blob/master/lang.json
then this simple bit of code to find and translate a language string:std::string _(const std::string &k, const guild_settings_t& settings) { auto o = lang.find(k); if (o != lang.end()) { return o->find(settings.language)->get<std::string>(); } else { bot->core.log->debug("Missing language string '{}'", k); } return k; }thoughts? seems to work and scale quite well.
is thatstd::formatin the logging? or custom one?
no its fmt::format
ah
bundled with spdlog
cool
Hello, I had a problem playing some YouTube songs and it tells me when playing some of it, look at the picture
how can i fix it
make sure the config file exists and is in the right place and properly formed
the error says cant find config file.
You did not understand what I meant. I worked on this file and it works fine, but there is some music that is not playing and this talk appears to me, but the file is present
how i fix it
PING
is botghost good host
To use for a personal Discord server: yes
To use as a public bot for everyone to use: no
public bot ghost bot bad
for many reasons
who tf knows where they store your token
will they eventually cut service if your bot grows too big? YES
It's also free so 🤷
how I do this?
@slow otter What library are you using?
discord.js
I work in discord.py, but try looking at this: https://stackoverflow.com/questions/58568377/how-can-i-set-custom-status-in-discord-bot-according-to-new-update#:~:text=3 Answers&text=You can get custom status,cs by using the ClientUser.
and check your time uing !time.
Queues for what
how do i actually just display the queue time next to a name
tnx
how i can fix this
define a player config
if you join
@eternal osprey looks like mafia bot
mafia bot?
@eternal osprey Well, you need to calculate the queue time first
i already have that
Ok,
i actually have a comman for that
i just want to display the time next to someones name
unction timeInQueue (userId, timeFormat = 'm') {
const userIsInQueue = isUserInQueue(userId);
const queuedUserObj = getUserFromQueueByUserId(userId);
if (userIsInQueue && queuedUserObj) {
let timeValueReturned = 0;
const now = new Date();
const queueJoined = queuedUserObj.timestamp;
const diffMs = (now - queueJoined);
const diffDays = Math.floor(diffMs / 86400000);
const diffHrs = Math.floor((diffMs % 86400000) / 3600000);
const diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000);
switch (timeFormat) {
case 'm':
timeValueReturned = diffMins + ' minute(s)';
break;
case 'h':
timeValueReturned = diffHrs + ' hour(s)';
break;
case 'd':
timeValueReturned = diffDays + ' day(s)';
break;
default:
timeValueReturned = diffMins + ' minute(s)';
}
return timeValueReturned;
}
return false;```
the snippet
for the time
mafia bot?
@eternal osprey it's a popular bot... just ur bot looks like that
I have set a config, but some music is not working@eternal osprey
it's okay dark42ed
What is the "Team User" Badge?
How do I make a ticket system?
What is the "Team User" Badge?
@earnest phoenix application's owner that is from a team (only available through oauth iirc)
this is my coe
i actually want to create a command that admins can remove people from the queue, how do i do that?
@earnest phoenix application's owner that is from a team (only available through oauth iirc)
@pale vessel ah okay thanks
hey i know that bot ;eyes;
ok so I'm working in discord.js and I have a map for every user and a value of "money". Every time I take the bot off and bring it back online to update the code, the map resets. Is there any way around this?
Use a database. Maps clear when the bot comes offline.
Questions will not be answered in the comments. Please join my Discord server. 😀
MongoDB Windows: https://www.mongodb.com/download-center/community
MongoDB for Linux: https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04
MongoDB for Mac: ht...
im saying im pretty new to programming and not that great
thanks cam i like your status btw
It's all good, just watch some tutorials.
I assume you're using discord.js?
@upper elm
yea
Okay, that video should work just fine for you. Good luck!
thank you!
Of course!
Can I not use the author property of a message object?
message.reportedMessage.author.send('...');
discord.js
Ok how do I handle HTTP exceptions to stop being ratelimited by discord?
https://hastebin.com/udilamutel.js this is my code. How do i show the time someone has been in the queue next to the name of the person, in the embed, I already have a !time command.
how do i make a bot that nukes a channel?
discordpy pls
if i were to constantly get invites what interval should i use?
uhhhhhh
define "nukes"
^
as in, deletes a channel?
lowkey sounds like a raid term to me
so... how would you add sharding with keyv?
uhm keyv is a key/value database it has nothing to do with sharding?
i also need to connect the variable client with a website dash
like
currently, i use
each shard will need its own connection
const db = new Keyv('sqlite://database.sqlite');
client.database = db;
but i dont know how i would add it with discordjs sharding
Is there an event fired when say for example someone changes the discord server name?
guildUpdate no?
i meant directly from the WS
im not sure if i can connect to the same database at the same time (not sure)
Since im not using a Lib
Should be
that's a question the keyv docs probably can answer.
oh
ok cool
looks like my shit isn't entirely fucked
I just missed the event entirely when I looked last
there's nothing about sharding + keyv in docs
sqlite supports concurrent read access, but not concurrent writing
idk which sqlite lib keyv uses behind the scenes, but better-sqlite3 is pretty smart about it and correctly queues reads when needed, so it should work out of the box
@eternal osprey I assume by "nuke" you mean "delete all of the messages". This is impossible, as the API limits the bot to mass-deleting messages to 2 weeks old or less.
just delete the channel and create a new one
@quartz kindle Interesting approach, but you would need to copy over all of the channel settings as well.
you can clone the channel
That is a very good point.
most libs have a method to clone a channel
IDK if discord.py does, I'm a discord.js user
so if i add sharding, i cant define client on the website dashboard i was working on anymore to check if the bot exists on a server
it seems like im stuck in an error loop
hey boys and girls
@shy turret you'll need to perhaps put that code in Shard 0 only, and communicate with other shards in order to get data from all of them.
@shy turret why cant you? are you running the dashboard inside the bot process?
@shy turret it'll get to a point where you wom't have a join, although I recommend setting up a rest api to contact the process of your bot or something
i have made a !join queue command but i want to have something different. I want to use the !join queue (THIS WILL BE FREE TEXT TO WRITE). Then it would add you to the embed with the free text you wrote behind your name
i cant start a mongod process bc it will error it cant make a file in lib/mongodb, after that it will say something about a socket file
then it will whine about tmp/mongodb
like this, but with the free text behind the names.
then it will say the connection is already in use
so everyone has another text behind their names.
how about uninstalling mongo completely, then following the installation instructions from the mongodb website?
@umbral zealot smart idea, i can do that (except i never used sharding before)
@quartz kindle no, i just didnt know how
how about uninstalling mongo completely, then following the installation instructions from the mongodb postgresql website?
i gave 777 on every folder it wants to have access to
@shy turret How are you running your dashboard?
how is it communicating with your bot's DB, I mean?
nothing works
there should definitely be a way to determine what shard you're in, check the library docs perhaps, @shy turret
@mystic ice Don't do that. Only give folders the permissions they need.
Hello, I encountered not only playing adult songs
This message appears to me and I don't know how to fix it Can you please help me the problem with ytdl-core-discord
i made a index.js that communicates with botcode.js and webdashboard.js @umbral zealot
something like if(client.currentShard == 0) or whatever. depends on the lib
i know @buoyant aspen just got fkn triggered nothing worked
@shy turret Not exactly a best practice... Your dashboard should be external and should interface via an API or by reading from the same DB.
well i use client.database = <db var>
But it's still in the same instance, correct?
same process
Yeah, that is probably your issue.
Your code might be trying to shard the webserver as well.
yeah that's why it should only be added to a single shard, which Shard 0 would be a likely candidate.
so one shard has the dashboard, the others don't.
can someone walk me through the mongodb process?
I would just host it in a separate process if I were you.
some parts where i get an error i dont get info from the guide uno
could anybody help me please
yeah but then you have the added complication of communicating between that process and the shards, and that's nontrivial
client.shard.broadcastEval('this.guilds.cache.get(SERVERIDHERE)')
.then(results => {
// what here
})
.catch(console.error);
?
@eternal osprey what u want?
@buoyant aspen same process different files, it doesnt try to shard the websit
Right, it would still be sharding your dashboard in that case @shy turret
yeah that's a way to get data - however you can't actually send an entire guild object, so you'll need to figure out specifically what you want to transfer.
u want the text to be diff for everyone
but how do i do something like: !joun queue (free text to write)
well
so
Hello, I encountered not only playing adult songs
This message appears to me and I don't know how to fix it Can you please help me the problem with ytdl-core-discord
@buoyant aspen well... i dont think u know what i mean, it doesnt
help me
!join queue fishing
u can take the args and put them together
the embed shows: Awsome Fishing
botcode.js is separated from webdashboard.js
uhh
and start from like 2
@shy turret Maybe I am misunderstanding, are you only sharding botcode.js?
Hello, I encountered not only playing adult songs
This message appears to me and I don't know how to fix it Can you please help me the problem with ytdl-core-discord
@buoyant aspen yah
https://discord.js.org/#/docs/main/stable/class/ShardingManager actually useful
@buoyant aspen confusion
why would a bot, whom has all the required permissions, be "missing access" to send a message to a channel?
export const welcome = async (member: GuildMember) => {
try {
console.log(await member.guild.systemChannel.send('test'))
} catch (err) {
console.error(err)
}
....
DiscordAPIError: Missing Access
at RequestHandler.execute (G:\WINDOWS\DESKTOP\PROJECTS\gitlab\mumbot\mumbot\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
name: 'DiscordAPIError',
message: 'Missing Access',
method: 'post',
path: '/channels/755151104878182452/messages',
code: 50001,
httpStatus: 403
}
Because someone invited it with permissions: 0
also
channel overrides exist
meaning someone can easily remove permissions
Yeah I checked all that ...
all the perms are there
its based of the client's permissions, not the "added" member's perms right?
eh crap, nvm, the role was wrong
(need more coffee)
Could someone please explain whats wrong here? Discord.Js v12.
if (response.first().content.toUpperCase() === code) {
await member.send(`:online: That was the correct code! Your access to \`${member.guild.name}\` has been granted.`)
let role = member.guild.cache.roles.find(r => r.id === `${id}`);
member.roles.add(role)
} else {
await member.send(":dnd: Sorry, but that code is invalid. You have been kicked from the server. If you wish to try again, rejoin the guild.").then(async () => {
await member.kick(`${member.user.tag} failed verification.`)
})```
Been working on this for around two to three hours now with no solution.
We can't get it to add the role when a code is inputted correctly.
entire file; https://github.com/UndefinedDevelopers/Authenticator/blob/dev/events/guildMemberAdd.js
(node:223107) UnhandledPromiseRejectionWarning: TypeError [INVALID_TYPE]: Supplied roles is not an Array or Collection of Roles or Snowflakes.
@final stone please use paste bin its really hard to read
ok
Been working on it with some friends for hours, we are entirely stumped.
ignore the guild.cache, that was fixed to guild.roles.cache
okay i found the problem
member.guild.cache.find
what are you searching in the guild
use member.guild.roles.cache.find
oh sorry
The roleID is valid, and I have also checked here;
The bottom number is the role id its pulling
so it has complete access to it
are u on v12?
its a collection get
Is there a way to check if the bot has lost and re-established connection to Internet?
try doing let role = await member.guild.roles.cache.find(r => r.id === id);
*.on error
add the roles thingi
lemme try that
cache.find() does not return a promise so await is unnecessary
you can also use cache.get(id) if you only need to find via id
I did not try it cached
Lemme do that
The roleID is valid, and I have also checked here;
client mods 😠
bot-tag is normally blue
client mods 😠
@restive furnace bruh this is not even part of this convo, and its called CSS. I can revert my damn css if you care so much
one color aint harming you
well ok
is it possible to make a 12h channel cooldown ?
I mean.. I have seen It I think, some bots do cooldown commands
My brain might just be messing with me
not bot commands cooldown
channel cooldown
Thats what I was talking about
I believe I have seen bots have timeout commands to set custom timeouts
👍
not 100% on that
for d.js https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=setRateLimitPerUser @cerulean salmon
ah so im not insane
@restive furnace i saw that ,the problem is in channel settings we see max cooldown is 6h ,they didn't mention max time
60 * 60 * 6 = max time in seconds
hey guys
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
i have made a command that you can join a queue using !join queue and you can assign your own message behind your name
its for bots
Awsome test test test
for example: !join queue test test test
would show this
but if someone else joins the queue
the message just disappears
and only the new message of the new member in the queue shows
// If queueMessageId is still 0, no queue has been created
if (queueMessageId === 0) {
message.channel.send('A queue does not currently exist sailor '+ "<@" + message.author.id + ">");
// Otherwise, the queue already exists, so users can join
} else {
message.channel.messages.fetch(queueMessageId).then(queueMessage => {
if (addUserToQueue(message.member.displayName, message.member.id, args)) {
assembleQueueMessage();
queueMessageText += ' ' + message.content.slice(Config.prefix.length).replace(/^queue *join/, '').trim()
if (Config.useEmbeds) {
queueMessage.edit(embedQueue.setDescription(queueMessageText));
} else {
queueMessage.edit(queueMessageText);
}
} else {
message.channel.send(`${message.author} already entered the ship queue!`);
}
})
.catch(console.error);
}```
could someone help please 🙂
Don't know if anyone will be able to help but this has been annoying me for some time now, all help is appreciated, ill add a few images below of the error:
around line 128 it seems like that is the only place youre specifying servantmaxhp
but it's undefined so results[0] might be undefined
anyone that can help me with my problem above>
if that is of any importance there
Hello
I am doing an addrole command and this is the code for role setted as args 1
let role = message.guild.roles.cache.find(r => r.name == args[1]) || message.guild.roles.cache.find(r => r.id == args[1]) || message.mentions.roles.first()
Whenever I do like !addrole @HamoodiHajjiri#0001 @TestingRole, it doesnt work..
yeah
it means that results[0] doesnt have anything in it
what is the result of logging results
Wdym
its that [] at the top
which i dont understand as there is data for the userid (mine)
then its probably an issue with the query
or something because if theres nothing it means the database returned nothing that matched
hmm, its odd. I've used the exact same code part for other things ive coded and it worked fine...
I just cant tell if it's bad scripting or if I'm missing something obvious...
out of interest, would the result be different if i did let ServantMaxHp = rows[0].servantmaxhp or would it just break? I haven't tried it yet.
Error setting up listener","attr":{"error":{"code":9001,"codeName":"SocketException","errmsg":"Address already in use"}}}
Failed to unlink socket file","attr":{"path":"/tmp/mongodb-27017.sock","error":"Operation not permitted"}}
DBException in initAndListen, terminating","attr":{"error":"IllegalOperation: Attempted to create a lock file on a read-only directory: /var/lib/mongodb"}}
Failed to unlink socket file","attr":{"path":"/tmp/mongodb-27017.sock","error":"Operation not permitted"}}
these errors keep repeating anyone know how to fix this?
trying to install mongo and run a process
Hey i want to make a lyric video command and i have 2 questions, 1 is a good idea and 2 how can i upload that sice videos are too heavy and gifs are hard to work with big musics
i created alarm/remind me command it is working but i want to do it to exact time because at the moment it is doing it hour bu hour like it can do 0-60mins but i want to do it like 1hour 23 mins etc
i dont know ms very much
i want to convert something like 80 mins to 1 hour 20 mins 0 sec
@prime glacier Can you please speak english?
hey
hey
// If queueMessageId is still 0, no queue has been created
if (queueMessageId === 0) {
message.channel.send('A queue does not currently exist sailor '+ "<@" + message.author.id + ">");
// Otherwise, the queue already exists, so users can join
} else {
message.channel.messages.fetch(queueMessageId).then(queueMessage => {
if (addUserToQueue(message.member.displayName, message.member.id, args)) {
assembleQueueMessage();
queueMessageText += ' ' + message.content.slice(Config.prefix.length).replace(/^queue *join/, '').trim()
if (Config.useEmbeds) {
queueMessage.edit(embedQueue.setDescription(queueMessageText));
} else {
queueMessage.edit(queueMessageText);
}
} else {
message.channel.send(`${message.author} already entered the ship queue!`);
}
})
.catch(console.error);
}
}```
oh my
this is a command taht when you use !queue join something
you will join an embed with something after your name
however when someone else join
@prime glacier Can you please speak english?
@charred kindle its english bro
my older text behind my name deletes
I mean
how would i fix that
Please correct your grammer since I cant really understand it
Please correct your grammer since I cant really understand it
@charred kindle oh wait
@eternal osprey Do you have different messages or 1 message?
I mean
look:
@prime glacier So you want to convert hours into minutes?
and add their own twist
like extra text
but once someone else joins
my text deletes
so wait
and his shows
you want to add the text onto the existing text?
i had created a command name alarm like carl bot has a command remind me
but i am facing an issue in my command that it one do alarm for hour's like if i do 0-60 mins it will work correctly but if i do it 1h30m it will do 1h only and if i do it 90m it will do it 2hours
i had created a command name alarm like carl bot has a command remind me
but i am facing an issue in my command that it one do alarm for hour's like if i do 0-60 mins it will work correctly but if i do it 1h30m it will do 1h only and if i do it 90m it will do it 2hours
@charred kindle
uh
I kinda need the code to see whats happening
look
I kinda need the code to see whats happening
@charred kindle ok wait
Do you want to add your message onto his?
no i want the messages to be saved
for fucks sakes
wait
if i write !queue join text message
i join with this message behind my name
@charred kindle please watch your dm
@eternal osprey Then shouldnt you have multiple messages then, instead of editing one message?
do you wanna see my source code?
cuz that isn't the problem
it is an args.
everyone can use it
oooh
so wait
you need seperate variables for each message, or put them in an array/dictionary
What's the problem?
const dict = new Map();```
It doesn't seem like your awaiting messages.
how can i make a music system?
That's kind of a vague question. It differs on what library you are using.
i am using discord.js
go use lavalink or ytdl and opus and ffmpeg
^^^^^
Hello
I am making an addrole command
And I am trying to check that if the specific role that I am going to add for the member or user is higher than the bot or the message.author, it returns
Is this code correct?
if(rMember.roles.highest.position >= message.member.roles.highest.position) return message.channel.send(noPermissions);```
like **!addrole @HamoodiHajjiri#0001 @role **, we check if the role is higher than the bot or the author, it returns
Have you tested it yet?
Yes
@feral aspen https://tryitands.ee
It is wrong
What did it do?
The guy:
Is this code correct?
The same guy:
It is wrong
idk how to make it check for the role
Have you check docs yet?
Idk how to use docs! 😦
I just want to know how can I make the bot check for what I said above
toxicity101 ova here
What type is rMember?
rMember is like the user I am adding the role to
how can I check that if the role is higher than the bot or the author, it returns
I know, but I am asking what type is it. Is it a User type or GuildMember type
let rMember = message.mentions.members.first() || message.guild.members.cache.find(m => m.user.tag === args[0]) || message.guild.members.cache.get(args[0])
🙂
So it's a GuildMember Type
let rMember = message.mentions.members.first() || message.guild.members.cache.find(m => m.user.tag === args[0]) || message.guild.members.cache.get(args[0])
@feral aspen i vomited
that's a FREAKING TERRRIBLE WAY to fetch users
😦
It's better than casting it into a User type
?
no ?
you won't get it
he's just finding the member with user tag
User type is not associated with the guild

hes not mixing it anywhere
how can I check that if the role is higher than the bot or the author, it returns
didn't i already help you with that?
get position of role and bot
but seriously that is a 75% cool way of fetching users from the message
especially ===
Can you show the declaration of the role variable please
