#development
1 messages ยท Page 951 of 1
are you editing or sending
how would split work
then a new message is send
edit(content, {split:true})
try this
Wont that split it middle of a message?
no
i mean likle
split just sends a new message
yeah
ow
only if 2000+
so. I found the problem i have. When im using ytdl "url" --print url it throws an error. Status code: 429. That means too many requests and i think my bot got softbanned. How could I fix this ?
but if it's an edit
I am using this option for eval
how is that going to work
Cant do it then
:^)
I just want the error to come to catch nothing else
use .catch
something like throw error can work?
Just await and it will go to catch?
@clever tree is this youtube 
Thanks its working
ah nice
429 is rate limited
yes. So i got a softban for my bot. But how could i fix this ? Restart router or change ip ?
maybe a proxy
thanks a lot Flaze and NMW
all good
https://github.com/ytdl-org/youtube-dl/issues/22839 @clever tree
So I added this to code: if (!message.member.hasPermission(["MANAGE_GUILD"]) || !message.author.id == "518738198982295564") return;Does that mean it must either be someone with the permission or it ignores perms if the message author has this id ( which is me ) and executes command?
it needs to have both
you need &&
it means that if it's the owner or a person that have permissions, it will execute the command
if (!message.member.hasPermission(["MANAGE_GUILD"]) && !message.author.id == "518738198982295564") return;
@fallow steppe

๐
:/

Ah
@summer torrent Yeah. A proxy. But i use the bot on my desktop pc... I have to look around. But why doesnt the groovy bot get into issues? Too many requests or API limit. I could not understand xd
So && means either has perms or is the owner?
Instead of || you say &&
because groovy uses proxies?
&& means that the member does not have permissions AND it's not the owner
&& = and
So how do I make it or instead of and?
&& = or
you want it to bypass owner right? use &&
In this scenario
Ok
I think ||
I'm confused. || or &&?
confusion 100
I think it is ||
|| is or
&& is and
In this circumstance it's &&
It means if this person does not have permissions and they are not the owner then return
use logic next time
Ok, && worked. However I want it to work this way: If user has the permission, they can execute the command. Or if it's the set ID, they can bypass this and execute command. Would I use && for it?
you did that
Alright
that's what the && is for
So || would mean they need both conditions?
nothing
I want to use words instead of numbers
could someone tell me how to do tha
that
wdym by that
there is written var numbers but i don't want to put numbers
i want to but words like hello
just change those to words ๐ค
i did but its not wrking
working

could i give values like 1 = hi, 2= bye
@gleaming glen
well thats how that is
0, 1, 2 for the things you put
they get a number so that you can get them
```if(message.content.toLowerCase() === ${prefix}numbers) {
var numbers = [0, "hi", "hi"];
let cdata = db.get(cdata_${message.author.id})
if(cdata === null) db.set(cdata_${message.author.id}, 0)
var answer = numbers[Math.floor(Math.random()*numbers.length)];
if(answer === 0) {
return message.channel.send(":scream: You didn't catch anything better luck next time")
}
var answer = numbers[Math.floor(Math.random()*numbers.length)];
var embed = new Discord.MessageEmbed().setColor("#FF4500").setTitle("Hmm")
.setDescription(`:star_struck: Hurray! You have **${answer}** h\n\n*Contact ULTRON#4070 or Server Onwer To report issues*`)
db.add(`cdata_${message.author.id}`, answer)
await message.channel.send(embed)
}
}
})
well this is my codes i wanted to do like that if 0 comes then that mssg came and if answer is not 0 then any random word came
you get a random item from numbers
if its 0, you send the message
if its not 0, you get a random item again
the random item again can be 0 again

and you will get Hurray! You have 0
but if 0 cames there is another message and if he won something then there is another message
if he get 0 then what is that ... hurray you got 0
because you have 2 answers
and both are random, so they can be different or be the same
how to use resetTimer() in reaction collector? I want to stop the collector after inactivity
edit: I use djs v12
@quartz kindle ah you're right, I didn't see it there all this time lol
thanks Tim!
isnt that just a linting thing
client.on('message', message => {
if(message.content.toLowerCase() === ${prefix}pokemon) {
var numbers = ["Hello", "Bye", "Cya"];
var answer = numbers[Math.floor(Math.random()*numbers.length)];
var embed = new Discord.MessageEmbed().setColor("#FF4500").setTitle("You got a - ").setDescription(answer)
message.channel.send(embed)
}
})
i am not randomizing it twice but it is also not working
@quartz kindle
https://stackoverflow.com/questions/53004291/exported-type-should-have-comment-or-be-unexported-golang-vs-code
@mossy vine o
@surreal notch I think it works
nope
@surreal notch
yes the code should work
can u make private functions in js classes
not that ik of
ree
just do the standard notation for a private class
_class_method_thats_private or in js _classMethodThatsPrivate
thats what i usually do
Most IDEs pick up on it and register it as private
Transferring 8TB of Data onto the VPS be like an oof
@modest maple have you setup notifications for your netdata to send alarms to a discord channel via webhook?
nah
ahh pants, was hoping you had lol
I might at some point but im planning on making my own Panel for when i deploy my API and site
for some reason its not recognizing my custom config for it and never sending the alarms ๐
@knotty steeple you can in node 12+ afaik
so i can manage DBs and see stats and rates on one apge
ahh yea, i've been messing around with custom dashboards too ๐
cuz netdata gives alot of info but not rlly data i always need
i wish they had a kiosk mode or something by default
or a way to order charts by priority or such
so im making a panel that i can view each Table's stats db latency etc...
api rates
oh nice
i keep seeing more reason to -de-docker my netdata
but im being stubborn!
afaik though, i have it completely setup to recognize everything from the host os, except my custom docker network names (it recognizes the networks, just not the names)
i dont docker my netdata
I have noticed it seems to take a chunk of cpu when im viewing the interface tho
yea tbh there is no real need to have it dockerized, I just did cause them my entire system can be easily moved to another host and started witha docker-compose up
i mean you can still do that with netdata lul
like, i literally drag and drop via filezilla and run compoose up and am done
yea ik lol
i do feel it'd be easier to handle custom config if it wasnt in a container
@quartz kindle itโs node 13+ not 12
i'd at least be able to look through the files to make sure my custom config was actually loading properly lol
mozilla docs say its node 12
how do i get a webhook port hostname and path
@white anvil
yeah thatโs a private property not private function
I was wrong about the node version but yeah lol
werent they both introduced together?
apparently private functions havenโt been finalised
yeah
Hi, can someone help me with code that edit message wich bot has sended every 10 minutes?
I'll appreciate your help!
I am working with Java on JDA.
How could i count all members from all server the bot is on ?
-faq 1
-faq 2
I have a quite particular question, I have an image created with canvas-constructor and I want to edit a message with an embed with another embed that contains this canvas. How can I do it?
message edits cannot send attachments
so you have to delete the previous message and send a new one in order to add or update an image
@quartz kindle Okay, others have told me the same thing as you, but I can't understand one thing: why can this bot do it?
is there way to run multiple (more that 2 files) in python
Depends on what you mean by "run"
discord.py project
So in discord.py you can do it, but in discord.js you can't, right?
import if I understand you correctly
Or use process managers if they need to run separately 
@slender thistle Wait, I didn't quite get that. Can you explain me again?
That wasn't directed at you 
Ok 
oh thanks
@balmy knoll the discord api does not have a way to overwrite existing attachments, no lib can do that
that bot is probably doing something else
not updating an image
at least from what i know
I try to ask the creator of the bot
you can change the embed fields
for example change urls
but you cannot upload a new attachment
so if all your images are already uploaded somewhere
you can change the urls and the embed should update
but you cannot attach a new image
Okay, thank you very much, so if I put the image in the url form, can I attach it?
form of a scream? what?
what?

thats against discord's rules
@quartz kindle Nope I want something which send messages in intervals like in this channel send a message in every 2 mins
How do I send an emoji in that form \โ and not in that โ
do \โ
I tried to do that in an embed but it still sends the normal onw
onw*
onw*
omg
one*
how can i check if a command exists?
like
i have ```js
{ name: 'hi', response: 'ee' },
{ name: 'ee', response: 'hi' }
if it isn't hi or ee how can i send a message saying something
using js
nvm
i found out how yeet
I tried to do that in an embed but it still sends the normal onw
@opaque seal
you're probably escaping it in code instead of actually sending the frontslash to discord. use double frontslashes
@surreal notch thats still technically against the rules
but 2 mins should be fine, as long as its your own server, or if a server turns this option on. it should not be on by default
Methode in which one finds out the Invite Code with which the user has joined?
How do I get a list of all the guilds the bot is in?
I've tried console.log(bot.guilds) but got nothing
Alright thanks
@zenith terrace I meant like, a list of the guild ID's, not the amount of guilds
O
map the guilds by their ID
Could someone help me in pure javascript for my website I wanted to make search box
Anyone please come in DM
Eli, a cache is a Collection (https://discord.js.org/#/docs/collection/master/class/Collection), you can get an entry by id with get or you can find an entry that satisfies a specific condition with find
Thanks, that's all the info I need (very new to coding, barely know JavaScript)
a!ping
Huh
Legit, I took my bot down for ten seconds in two weeks and in that ten seconds they declined my bot because it was not responsive
:(.
@cinder patio do I need to do a forEach loop?
Can you describe what you're trying to get exactly?
The guild ID
I've tried (Guild => Guild.ID) but it returned the first guild that appeared in the list and not the ID
So you want to get a guild id
ah, then you'd use the map function on the bot.guilds.cache Collection
Already have that
In the map function, provide a function which returns the guild's id, like: guild => guild.id
oh you already told me you tried that
Yeah sure
const botFind = new Map();
botFind.set(bot.guilds.cache.find(guild => guild.id))
console.log(botFind)
You should use the map function, not find. find returns a single element which satisfies the function, and since every guild has an id, the function is always satisfied so the first elements always gets returned
also, no need to create a new map and do all that, map returns an array of IDs: [id1, id2, id3...]
alright
It's a little confusing, cause there is a data structure called Map and a function called map
lmaoo
-_- Can someone tell me a better way?
async def queue(ctx):
ctx.message.guild.name = []
await ctx.message.channel.send('**-start of queue-**')
await ctx.message.channel.send('**-type end when done-**')
def ch(m):
return m.author == ctx.message.author and m.channel == ctx.message.channel
while True:
song = await client.wait_for('message', check=ch, timeout=30)
song_str = str(song.content)
song_f = song_str.translate({ord(c): None for c in string.whitespace})
if song_f == 'end':
print(ctx.message.guild.name)
break
ctx.message.guild.name.append(song_str)
for song in ctx.message.guild.name:
vc = ctx.message.guild.voice_client
if vc.is_playing():
continue
else:
player = await YTDLSource.from_url(song, loop=client.loop)
print(song)
vc.play(player)```
wait you are still using 0.16.4?
I thought YTDLSource is gone from the current version
Sorry, brb, just mention me when helping.
Why are you overwriting guild.name
Also I don't think a while True: is helpful in async code
The bit with while True: worked
It appends the input in the dict and breaks when the input is 'end'
Output
['NCS Jarico Island', 'NCS Jarico Landscape']
NCS Jarico Island```
It plays the first, but stops at that.
https://prnt.sc/sr6hpb im really confused, to get the code I use req.query.code
and apperently it says no code provided
Hi i am developer too
It doesn't work there either
My bot is on the server but does not execute the commands
All I need to do is play songs based on the input provided in a dict.
Smh but mistyped
Shake my head
Can i add my bot here?
Your bot will be added to this server if it is approved
How to approved it
Anyway someone help me
Code :
async def queue(ctx):
ctx.message.guild.name = []
await ctx.message.channel.send('**-start of queue-**')
await ctx.message.channel.send('**-type end when done-**')
def ch(m):
return m.author == ctx.message.author and m.channel == ctx.message.channel
while True:
song = await client.wait_for('message', check=ch, timeout=30)
song_str = str(song.content)
song_f = song_str.translate({ord(c): None for c in string.whitespace})
if song_f == 'end':
print(ctx.message.guild.name)
break
ctx.message.guild.name.append(song_str)
for song in ctx.message.guild.name:
vc = ctx.message.guild.voice_client
if vc.is_playing():
continue
else:
player = await YTDLSource.from_url(song, loop=client.loop)
print(song)
vc.play(player)```
Output:
['NCS Jarico Island', 'NCS Jarico Landscape']
NCS Jarico Island```
Alright I Need Help
What with?
I Need A DiscordGo Master
It plays the first song in the dict, but stops at that.
Ok
How do I make my bot not try to add a role/send a message when it doesn't have the permissions to?
@has_permissions([PERMISSION]=True)
@pure lion what libary
let collector = msg.createReactionCollector((reaction, user) => user.id === message.author.id, {time: 1 * 60 * 1000});
How do I send a message when the time runs out?
Discord.js
let collector = msg.createReactionCollector((reaction, user) => user.id === message.author.id, {time: 1 * 60 * 1000});How do I send a message when the time runs out?
@tulip ledge setTimeout.function
B r u j idk
I need to send a message
y not use awaitReactions ?
( discord.py ) I need to play songs present in a dict ( queue )
how would I make a url(text)
With the code up there it only plays the first song in the dict then stops.
if (!message.bot.hasPermission(["premissions here"]))
return message.channel.send(
"message here"
);
@pure lion
why message.bot?
Thx, I'll try
message.bot?

Prob everyone here
why message.bot?
@tulip ledge
CoNsT bOt = nEw DiScoRd.CLiEnt();
I regret asking help for raid bots in discord.py support server and getting banned.
Just after a HTTP call, i get an object with properties. One of the properties is called 3v3Victories. I would like to access it with object.3v3Victories but i got An identifier or keyword cannot immediately follow a numeric literal. What can i do ?
message.member and message.bot should work the same
...
Whats the logic?
MMmh
Try
let item = 3v3Victories
object[item]
prob not the best solution
But in theory it should work
I need to play songs from a dict
Dont know discord py
Sad
Already did
@molten coral stop asking to ask
let item = 3v3Victories
object[item]
@tulip ledge
@molten coral what lang
Just after a HTTP call, i get an object with properties. One of the properties is called 3v3Victories. I would like to access it with object.3v3Victories but i got An identifier or keyword cannot immediately follow a numeric literal. What can i do ?
Javascript
no
programming language
object['3v3Victories']
Try that
Or that
Ow thx i didn't see
I will need to figure it out and it will take years, sad.
variables cant start with a number
but...
it's i get the object i can't change it
I know lol
@molten coral i gave you the solution
I noticed
ยฐ-ยฐ' i try wait a sec sry
Oh i haven't read like that
Yea sure thx
(I'm a bit stupid sorry)
#announcements message how do u gen graphs like that?
That one was probably made with a spreadsheet software
I Need Help Which Bot Library I Should Choose Because I Want To See The Most Recommended
( discord.py ) How can I play songs from a dict? Like I have a dict ['song1', 'song2'] How can I play songs from the dict?
Using a for loop attempts to play the next song and does not wait for the first song to complete.
Ok
A temporary solution would be to get duration of the song in seconds and do asyncio.sleep(sec) then attempt to play the next song, but it isn't really a solution
fetch message > delete message
(node:9008) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'channel' of undefined
msg.channel.messages.fetch(args[1]).then(msg.delete)
(args1 is msg id)
How do I use ffmpeg .pipe() (tryna make filters for music in discord.js)
@earnest phoenix type enable-pnpm in your console and wait.
No you don't need to do that
catch { is only on newer node versions iirc
hey have they done something my bots not able to kick members
or ban members
+_+
having an error argument in the catch block is required
well does it have permissions
Are you sure those commands are actually loaded
@mossy vine Im not using any code / command in my project , and my project just includes "ejs" , and some "js" files. and i can't access terminal...
wym?
bot รงevrimdฤฑลฤฑydฤฑ kontrol etmek iรงin Glitche girdim ลu hata var en son bir gรผncelleme edit veya hiรง bir ลey yapmadฤฑm saฤlam รงalฤฑลฤฑyordu durduk yere bu hatayฤฑ verdi birden bire
internal/modules/cjs/loader.js:670 throw err; ^ Error: Cannot find module '../build/better_sqlite3.node' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:668:15) at Function.Module._load (internal/modules/cjs/loader.js:591:27) at Module.require (internal/modules/cjs/loader.js:723:19) at require (internal/modules/cjs/helpers.js:14:16) at Object.<anonymous> (/rbd/pnpm-volume/524ccb5d-22b9-48d9-8b23-e738be5eee1a/node_modules/.registry.npmjs.org/better-sqlite3/5.4.3/node_modules/better-sqlite3/lib/database.js:5:21) at Module._compile (internal/modules/cjs/loader.js:816:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10) at Module.load (internal/modules/cjs/loader.js:685:32) at Function.Module._load (internal/modules/cjs/loader.js:620:12) at Module.require (internal/modules/cjs/loader.js:723:19)
bot was offline I entered Glitche to check it is the last error there was a recent update edit or did nothing I was working hard suddenly gave this error to the ground -- Google Translate
how can i access the vars that i set in res.render in ejs in style tag
does anyone understand what i mean?
Recommended db for 32bit system? Mongodb is out since they cap @ 2gb
@rain jacinth send ur code
it's fixed
@pliant needle SQLite maybe?
So I have this colelction with 2 entries, how do I take the 2nd one?
I dont think there is actually a way to do that
var something=collection.first(2)
something[1]
this can work idk
Already tried that
whats problem?
Since I have the reactions.users.cache
And I'm tryna get the one that's no the bot
convert it to array
how?
message.channel is undefined @rigid maple
what should I do ?
filter is for an array not for a collection
There is
Or does filter wortk on a collection aswell?
console.log(message) and check
I want him to message that channel @summer torrent
console.log(message) and check
@rigid maple Can u console.log(message) and send me ss
console.log(reaction.users.cache.filter(x => x !== client.user.id))
This should log the other entry?
Nope
remember to cache that message tho
Wdym?
whats it logging?
if you restart the bot the cache is deleted
Both entries
shall i do that ?
Weird
Ah
how can i access the vars that i set in res.render in ejs in style tag
does anyone understand what i mean?
res.render("delete", {
pageTitle: "Dashboard",
user: req.session.user
})
if i do this
I did as you say, but it doesn't throw away the help menu
<% code here %> @small prairie here is an example of how to use it that is used on My website/dashboard to fetch the users perms
<div class="card-columns">
<% user.guilds.forEach(guild => {
const permsOnGuild = new perms(guild.permissions);
if(!permsOnGuild.has("MANAGE_GUILD")) return;
%>
const Discord = require('discord.js')
module.exports = {
name: "yardฤฑm",
description: "Komutlarฤฑ ve aรงฤฑklamalarฤฑnฤฑ gรถsterir",
execute (client, message, args) {
const embed = new Discord.MessageEmbed()
.setTitle("Prowdy Yardฤฑm Menรผsรผ")
.setURL("https://discord.com/oauth2/authorize?client_id=683667575565320439&scope=bot&permissions=8")
.setColor("RANDOM")
.addField("p!รงal","YouTube'dan ลarkฤฑ รงalar")
.addField("p!atla","รalmakta olan ลarkฤฑyฤฑ atlar")
.addField("p!dur","รalmakta olan mรผziฤi durdurur")
.addField("p!devam","ลu anda รงalan mรผziฤe devam eder")
.addField("p!ses","Geรงerli olarak รงalan sesin sesini deฤiลtirir")
.addField("p!playlist","Youtube'dan bir oynatma listesi oynatฤฑr")
.addField("p!liste","ลarkฤฑ sฤฑrasฤฑnฤฑ gรถsterir ve ลimdi รงalan ลarkฤฑyฤฑ gรถsterir")
console.log(message)
}
}
I did as you say, but it doesn't throw away the help menu
i literally wasted 2 hours figguring it out
@rigid maple did u actually code this bot?
i literally wasted 2 hours figguring it out
@small prairie lol it happens, my bots website is 100% ejs so hopefully that helped
Thanks
Not really
Yeah im just trying out a dashboard of a bot i thought would become a big one and now i feel depressed and down ;-;
I did as you say, but it doesn't throw away the help menu
const Discord = require('discord.js')
module.exports = {
name: "yardฤฑm",
description: "Komutlarฤฑ ve aรงฤฑklamalarฤฑnฤฑ gรถsterir",
execute (client, message, args) {
const embed = new Discord.MessageEmbed()
.setTitle("Prowdy Yardฤฑm Menรผsรผ")
.setURL("https://discord.com/oauth2/authorize?client_id=683667575565320439&scope=bot&permissions=8")
.setColor("RANDOM")
.addField("p!รงal","YouTube'dan ลarkฤฑ รงalar")
.addField("p!atla","รalmakta olan ลarkฤฑyฤฑ atlar")
.addField("p!dur","รalmakta olan mรผziฤi durdurur")
.addField("p!devam","ลu anda รงalan mรผziฤe devam eder")
.addField("p!ses","Geรงerli olarak รงalan sesin sesini deฤiลtirir")
.addField("p!playlist","Youtube'dan bir oynatma listesi oynatฤฑr")
.addField("p!liste","ลarkฤฑ sฤฑrasฤฑnฤฑ gรถsterir ve ลimdi รงalan ลarkฤฑyฤฑ gรถsterir")
console.log(message)
}
}
@rigid maple I cant help if you havent codeed the bot
are you Tรผrk ?
sadly no sorry
What should I write in console.log(message)
I did not write message.channel.send(embed)
@rigid maple messge.channel.send(embed)?
??
รalฤฑลmฤฑyor mu@rigid maple
english only.
รyle birลey yazmฤฑyor@summer torrent
no
?
off-topic and support
here is also considered support
Ooo I forgot about the support channel
but no problem
@rigid maple yes but this is a English only based channel
change msg to message
it wasn't working
tried?
lol
but i can't speak english much ๐ซ
i can't see your "moderators" role
@rigid maple message.channel.send(embed) try this
it is useless because it is help command
Sana diyorum ki message รงฤฑktฤฑsฤฑnฤฑ attฤฑr diyorum
ingilizcem yok .d
sen diyorsun ki Kullanฤฑลsฤฑz bu bir yardฤฑm komutu
is shard reconnection and resuming taken as shard being disconnected?
i copy paste the kick command and change it to dm people as a warn command and it just say it cant find users every time
discord.py big brain
#memes-and-media for memes.
Go to where you call the execute method and make sure the second argument is a message object.
How would I get a role's ID from a mention like (prefix)setrole @role
discord.js
check Message#mentions
message.guild.channels.cache.find(c => c.type === "category" && c.name === "name");
@nocturne dagger ^
Thanks ๐
np!
No, i mean how can I do something if it does and then something different
if(message.guild.channels.cache.find(c => c.type === "category" && c.name === "name").exists())
?
@steel drum
@nocturne dagger no, because if the find method returns undefined you'll have an error thrown at you along the lines of ```js
TypeError: Cannot read property 'exists' of undefined
so
plus exists is not a method of the channel class (to my knowledge)
i could do if(!guild.findthing == null)
you can just do ```js
let category = message.guild.channels.cache.find(c => c.type === "category" && c.name === "name");
if (!category) {
// ENTER CODE / ERROR HANDLING FOR WHEN THE CATEGORY WAS NOT FOUND
return; // to exit the function
}
// DO SOMETHING WITH CATEGORY
return;
np
Can someone help me. I made a ticket command and for some reason the embeds want to duplicate sometimes. Does any know why it does this?
@neat gazelle a snippet of the code related to this functionality would be nice
how many nodes is the bot working on
Just one node
can you show us the code
of the commands that has duplicated embeds
can you show us the code
it must say the line of where is it
V12?
members.cache.get
and message.guild.roles.cache.find
Im trying to check if args[0] is a string and if it is to return something. I tried to do the javascript way but the value is invalid cause i typed in (args[0]) is there any other way for me to check if args[0] is a string?
Im trying to check if
args[0]is a string and if it is to return something. I tried to do the javascript way but the value is invalid cause i typed in(args[0])is there any other way for me to check ifargs[0]is a string?
Anyone help?
typeof args[0]?
what would you consider a string though
theoretically all incoming arguments from discord are strings
"203" is a string
you want a non-number argument check?
yes
i tried isNaN now
but it wont work
you want a non-number argument check?
@potent ivy yes
Im making economy
and when i type in $deposit a
it says it deposited a$
and then in userData it changes the bank balance to "0a"
i fixed it
i accidentaly typed if isNaN(args[0]) === true then the number instead of false
well now when I try to deposit or withdraw a specific number from the bank it turns into a string if for example type in $deposit 15 it will say that my bank account now has 015$ I think its because I did this userData[sender.id + msg.guild.id].bankBal += args[0]
userData[sender.id + msg.guild.id].money -= args[0]
okay
hm
@wet iron you need to convert it to a number first
let number = Number(args[0]);
if(isNaN(number)) return
doesnt isNaN convert to number beforehand? So theoretically, you can save microseconds of processing time by switching the order 
it does
but he would need to convert to number twice
once to check isNaN and again to use it
So I have this collection:
Collection [Map] {
'259776081316282368' => User {
id: '259776081316282368',
bot: false,
username: 'ChickenDev',
discriminator: '6181',
avatar: 'da6a01a4e3c8e84ce7c7f295b11c2210',
flags: UserFlags { bitfield: 131584 },
lastMessageID: null,
lastMessageChannelID: null
}
}
I tried Collection.id but that doesn't work any idea how I get the ID?
collection.first().id
alr
define cmd

I wanna send a message to a user and catch the error if the user ha DMs disabled without doing anything else, how do I do that?
newState.member.user.send(noPermissionEmbed)
.catch();```
does that work?
for some reason when I took an array to a string there was no closing }
that's the correct way @opaque seal
thank you
want to see it just maybe figure out?
.catch(err => { do something });
Is that referred to me?
you know what Im just gonna send my object wait
why is it an object
im just goiing to do some thonks
Who recommends a cheap and good host for a bot of suggestions that is in 101 servers?
@ember lodge Digital ocean
@ember lodge its free ^^
its good, just check it out first before saying free hosts r shit and stuff lmao
-servercount
To have your bot's server count displayed on DBL, please read the documentation on server/shard posting. Click here to see the docs.. You may also find #312614469819826177 useful; however it is strongly discouraged as most of the examples are extremely outdated.
Is there a way to get the user who invited the bot?
[text here](url here)
It only works in embeds or messages sent by webhooks (even when in plain text).
As in webhooks can use them too. Bots can use them as well but limited to embeds only.
Hey! How do I get my discord bot status to change each time it joins a server? It only updates once I restart the VPS
how i can get channel object, i tryed the same way i do for users but it's not working (py)
Hey! How do I get my discord bot status to change each time it joins a server? It only updates once I restart the VPS
@leaden flame make a loop
How
How do I make the bot check user roles? I use this: member.message.hasRole(["RoleID"])but does not work.
the usual way you would add them in normal messages
<:name:id>
?
If they are gif emojis it's
<a:name:id>
From the computer, you can achieve this by typing: /:emoji:
Or \:emoji


use settings.developers.includes(devID)
currently you are returning from the forEach callback which makes no sense
is it only me or sometimes the ytdl-core just goes crazy on playback? (discordjs)
message.member.roles.cache.find(r => r.name === 'Moderator') .then(role.setMentionable(true)) .then(updated => console.log(`Role updated ${updated.name}`)) .catch(console.error);Is this correct?
how can i get voice channel name by id discord.js v11.6.4
@fallow steppe .then takes a function. then(role.setMentionable(true)) is wack. Did you try it out for yourself?
Not yet, trying to know how to make the bot find a role and make it mentionable
doing .then on something that is not a promise is wrong either way
So, replace first .then with ;?
To use emotes that Ive upload on my private server on my public bot on an embed can I just do :emote_name: in an embed
In the embed*?
You use the entire emote id, doing it this way just prints it like that
For examples like this:

๐
so ugh i just made a command handler and when i do a cmd it shows the cmd 3 times
instead of once
maybe you have 3 instances
What is that ?
I just don't know why you put this here
yeah but why ? this return nothing at all
so i also remove the return?
In your code the {return} doesn't do anything, you can remove it
that just trigger me lol
you can remove {} too
it did 3 again..
I think you have multiple instance of your bot
wym
like 3 terminal with your bot launch
i'm only using one wym...
I don't know but I didn't see other issue
All of your script seems like to be good
time to use atom
try to use console.log() if you need to know if it is your command or an other problem
does anyone know how to check if the given playlist has more than x number of songs
im using lavalink btw
If the playlist is an array/set/map/etc. you should be able to check it's .length or .size.
it does
try {
message.member.createDM()
} catch (error) {
if (error) {
return message.reply(`I was not able to access your DMs! Please open your DMs or ask another Admin to run the command.`);
}
}
I was trying to check if the user allows DMs from servers but this only crashes the bot and doesn't send the message.
can someone point out whats wrong?
nvm i was able to fix it
@earnest phoenix that try/catch is useless because you dont await the error
wait oops nvm
im blind
does anyone know why this happens when i start my bot after 2 mins it shuts off these are the logs
0|npm | 2020-06-01 02:31:29.435 INFO 204478 --- [ XNIO-1 task-1] lavalink.server.io.SocketServer : Connection successfully established from /127.0.0.1:33624
0|npm | 2020-06-01 02:31:29.438 INFO 204478 --- [ XNIO-1 task-2] lavalink.server.io.SocketServer : Connection successfully established from /127.0.0.1:33626
0|npm | 2020-06-01 02:31:44.006 INFO 204478 --- [ XNIO-1 I/O-1] lavalink.server.io.SocketServer : Connection closed from /127.0.0.1:33626 -- CloseStatus[code=1006, reason=]
0|npm | 2020-06-01 02:31:44.009 INFO 204478 --- [ XNIO-1 I/O-1] lavalink.server.io.SocketContext : Shutting down 0 playing players.
0|npm | 2020-06-01 02:31:44.034 INFO 204478 --- [ XNIO-1 I/O-1] lavalink.server.io.SocketServer : Connection closed from /127.0.0.1:33624 -- CloseStatus[code=1006, reason=]
0|npm | 2020-06-01 02:31:44.041 INFO 204478 --- [ XNIO-1 I/O-1] lavalink.server.io.SocketContext : Shutting down 0 playing players.
0|npm | 2020-06-01 02:32:25.141 WARN 204478 --- [ager-3-thread-1] c.s.d.l.tools.GarbageCollectionMonitor : Suspicious GC results for the last 2 minutes: [Bucket 0 = 9] [Bucket 20 = 2] [Bucket 50 = 2] [Bucket 200 = 0] [Bucket 500 = 0] [Bucket 2000 = 0]```
TheNoob wdym by? It doesn't look correct by what you're saying.
the dude above clearly has multiple instances of his bot running
Anyone work with rewrite .py?
@hardy vector hey did you know why my lavalink server every 30 mins when i wanna play music,say
UnhandledPromiseRejectionWarning: Error: No available websocket connection for selected node.
I need to restart the node again
Also the log
Ayy! I made it!
Had to do asyncio.sleep for the length of the song + 15 to avoid that already playing error
Hello @astral remnant did u know how to fix my problem?
I really need help making a simple pagination embed.
Are we allowed to do code for hire type stuff?
Cause I'll pay lol.
@astral remnant
Oh Sorry, going afk-
Oh. Aight.
-needdev @merry quartz
@merry quartz
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.
There's a built-in paginator you might want to use ๐
For rewrite .py?
print(ctx)
ctx._ = functools.partial(ctx, cog="ErrorHandler")
error = getattr(error, 'original', error)
etype = type(error)``` thats my code and it generates this error```C:\Users\Jassm\Desktop\Alpha>python main.py
Successfully logged in as Elusive ID: 709877224353955931
<discord.ext.commands.context.Context object at 0x0000024B4609A2E0>
Ignoring exception in on_command_error
Traceback (most recent call last):
File "C:\Python38\lib\site-packages\discord\client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "C:\Users\Jassm\Desktop\Alpha\modules\core\error.py",
line 19, in on_command_error
ctx._ = functools.partial(ctx, cog="ErrorHandler")
TypeError: the first argument must be callable
And if it's not what you want, module paginator on pypi suggests a convenient paginator with pages and stuff
Are you able to link me to it, please?
It's uhh... somewhere in the docs, can't really search for it on phone 
Ah.
Go to discordpy.readthedocs.io/en/latest and search paginator in the search box
Ok, there's 13 pages for it.
I'll see if I'm able to work with that.
Much appreciated.
so anybody tryna help me
w/ what?
print(ctx)
ctx._ = functools.partial(ctx, cog="ErrorHandler")
error = getattr(error, 'original', error)
etype = type(error)``` thats my code and it generates this error```C:\Users\Jassm\Desktop\Alpha>python main.py
Successfully logged in as Elusive ID: 709877224353955931
<discord.ext.commands.context.Context object at 0x0000024B4609A2E0>
Ignoring exception in on_command_error
Traceback (most recent call last):
File "C:\Python38\lib\site-packages\discord\client.py", line 312, in _run_event
await coro(*args, **kwargs)
File "C:\Users\Jassm\Desktop\Alpha\modules\core\error.py",
line 19, in on_command_error
ctx._ = functools.partial(ctx, cog="ErrorHandler")
TypeError: the first argument must be callable
Try this:
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandNotFound):
await ctx.send('Command does not exist.')```
Hopefully that'll work for you.
if isinstance(error, commands.CommandNotFound):
# Ignore Command Not Found
return```
Then idk how to help with that. Sorry.
What I showed is everything I need for a on_command_error type scenario.
It just returns an error message.
Huh
Do you have a special way you want to do it? Or do you just want a basic response from your bot when someone sends the wrong command?
its kinda special yeah
Oh.
yeah
I am really not good at understanding how to read the docs.
It gives you some definitions and such but no examples.
I learn better with examples and seeing the code be executed and the results.
Then I can see what exactly I'm changing.
oh nice
How do I delete a role from the server :/
(Discord.js)
Do you need your bot to delete a role?
Perhaps
Cause you can do it manually.
HHhHhHH
Takes a few seconds to delete a role.
Go into your Server Settings > Roles > Select the role name > Scroll to the bottom of permissions area > Delete Role.
Unless you actually want to code a command that deletes a role for you?
Oh. Sorry, I wouldn't be useful for that then. I don't use js.
Oh that's alright
Does anybody know how to convert months and years and all into just days and only show the amount of days from
<moment>(...).fromNow()?.....
use moment.duration(time).asDays()
there's also asMonths(), etc.
time can be in milliseconds
if you have other than milliseconds, you need to specify the unit (e.g. duration("1", "seconds"))
Does it work with timestamps?
you need to calculate it first
Oh ok
Yea
Iโm Excited To Start Working On DiscordGo!
Never Mind Iโm Using Discord.Js
How Do I Start?
Itโs Useless My Chromebook Is Useless
how old are you?
- Why?
ah okay, no worries
Which One Do You Recommend?
which what?
Which File/Page Code
Why didnโt u use go
Js Looks Better
bruh
Which File/Page Code
@forest pond thats.. not how it works. also please please please learn actual programming before doing bot development
HoW
Dude I Donโt Want To Do It
Read the discord.js guide if you wanna skip that. But you will encounter multiple errors.
Dude I Canโt Do Discord.Js Learning
are you sure you're 13? sorry to say that
Yes
if you can't / don't want to learn then just don't do it
are you sure you're 13? sorry to say that
@pale vessel wdym
Dude Iโve Been Applying For Too Many Things Now I Have To Wait For 1 Year
Applying for what
I don't have any backgrounds and knowledge on programming yet I programmed my own bot just by following the guide.
I Was 12 When I Made My Account My Bday Was May 8th Now I Am 13
Hi!
Ye just follow some tutorial online till you get a decent grasp on the topic
Iโll Do It At 11 PM CST Ugh
so i have this code here (nuxt/vue)
<template v-if="userData !== null">
<h1>Hey {{ userData.username }}</h1>
</template>
yet it throws this error:
_vm.userData is undefined
any help?
Try with !=
how does that fix anything
that's genuinely a lol
userData is undefined in this case, and you are checking if it's strictly not null, or is that not how vue works?
u can't do v-if's in template tags afaik
put it in that h1 or use a div
template is where Vue compiler reads data while it's building, it doesn't fetch anything on build just compiles the code
@sick cloud bb
How do I remove the last index of an array? I rtried splice(-1,1) but that gives me the last index
let craftrole = collection.split(" ").splice(-1,1).join(" ");
why not just pop()?
it also modifies the array
oh
const arr = [1, 2];
arr.pop();
arr; // [1]```
why i am getting this error https://ta.is-inside.me/eETGCCtJ.png it sometimes work sometimes dont
Problems with aiohttp ร_ร
I actually came here to ask the same thing...
:/
How do I get the a role object based on the name in v12?
idk
maybe because it's discord.com now and the ssl certificate on discordapp.com is no longer valid
Does anyone have suggestions on how to send a big package of data from DiscordJS / node to a PHP api?
maybe because it's discord.com now and the ssl certificate on discordapp.com is no longer valid
@pale vessel I figured it might be something like that...
Possible fixes?
// on message
/**
* Collect profiles
*/
if (Object.keys(members_cache).length <= 200 && members_cache[msg.author.id] === undefined) {
members_cache[msg.author.id] = {
'discord_id': msg.author.id,
'username': msg.author.username + '#' + msg.author.discriminator,
'avatar': msg.author.displayAvatarURL,
'bot': msg.author.bot,
'guilds': bot.getMutualServers(msg.author.id)
};
}
// sending the data
setInterval(function() {
if (Object.keys(members_cache).length > 0) {
form_settings.qs['request'] = 'insert_members';
form_settings.form['cache'] = members_cache;
bot.request(form_settings).then(function(result) {
var result = JSON.parse(result);
bot.log(result['response'], form_settings.qs['request']);
}).catch(function(err) { console.log('API request failed: ' + request_settings.qs['request'] + ' -> ' + err) });
members_cache = {};
}
}, 60 * 1000); // 60 * 1000 milsec
For some reason my bot reaches 90% CPU after a few hours, even though it should clear the cache after each request sent
And it should never go over 200 profiles

