#development
1 messages · Page 546 of 1
Wdym
That wouldnt work either way, it uses properties not methods
Thats what makes it api abuse
Ok then, guess not
Hold on
@sick cloud
@amber fractal
What if I only send it to #general channels
Ok then
mass announcing
Is there something wrong with this code since when i run the cmd the cooldown date is undefined
if(command == "economy") {
const randomnumber = Math.floor(Math.random() * 100) + 1
if(args[0] == "bal") {
let balance = await economy.fetch(`uBal_${message.author.id}`)
if (balance === null) balance = 0;
message.channel.send(`You have $${balance}`)
}
if(args[0] == "work") {
let cooldown = 8.64e+7
let lastWork = await economy.fetch(`lastWork_${message.author.id}`)
try {
economy.fetch(`uBal_${message.author.id}`).then(bucks => {
if(bucks = null) {
economy.set(`uBal_${message.author.id}`, 0)}
else if (lastWork !== null && cooldown - (Date.now() - lastWork) > 0) {
let timeObj = ms(cooldown - (Date.now() - lastWork))
message.channel.send(`You have to wait ${timeObj.hours} hours and ${timeObj.minutes} minutes before you can use this command again!`)
} else {
economy.set(`lastWork_${message.author.id}`, Date.now());
economy.add(`uBal_${message.author.id}`, randomnumber).then(i => {
message.channel.send(`You worked hard and got $${randomnumber}!`)
})}
})} catch(err) {
console.log(err)}
}
}
try new Date()
[js] Hello everyone, I have a question, how to make a bot see a picture that you delete, my bot sees that the message is deleted, but that it does not see the deleted.
u gotta like save the picture then send it
I want that when deleting a picture, the bot sent to the logs a picture that was deleted or its name was deleted.
you log the delete msg event and save the buffer and send it as an attachment in a channel
yes javascript
try using message.attachments
you should be able to see the files that were attached to that message
@quartz kindle but deleted msgs u gotta use like node-fetch to fetch the buffer before the link gets deleted
i was about to ask, how long do you think urls stay there before they are removed?
i wonder
.attachments has both an .url and a .proxyURL
are ratelimits even documented in the discord docs?
How i can detect if an user s into a guild with an id?
in my experience attachment urls are invalidated instantly
Tim does discord documents their ratelimits?
well they don't rlly
https://discordapp.com/developers/docs/topics/rate-limits it asks u go to the endpoints
Step up your game with a modern voice & text chat app. Crystal clear voice, multiple server and channel support, mobile apps, and more. Get your free server now!
there's this, although its old and outdated
but current rate limits are still similar
the only way to get actual rate limits is to use the api and enable rate limit headers
Does anyone know how to get google's youtube data v3 api to fucking work
I keep getting
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. YouTube Data API has not been used in project [redacted] before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=[redacted] then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"extendedHelp": "https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=[redacted]"
}
],
"code": 403,
"message": "Access Not Configured. YouTube Data API has not been used in project [redacted] before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=[redacted] then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
}
}
if message.content in serverMembers:
print("success")
else:
print("fail")```
where serverMembers is the usernames of all online members
i added l!give to all items in the list to see if that worked but it always prints fail, idk if this is meant to be an easy fix or not (discord.py)
cheers
is it enabled on that specific app
read the docs through then
I have
they should mention how to set it up
then try google support or something
Google support is trash
try removing the restriction and leave the key unrestricted
So, disable the restriction to only use the api I'm trying to use? that sounds broken as fuck
then again, we're talking about google
of course it'll be broken as fuck
just don't lock the api to a specific url
Now to wait for like 5 minuets
my api keys are all unrestricted lul
still erroring at 3, not a good sign
still erroring at 5
Key has no restrictions
im making a community plugins system where people can create their own commands for the bot, and then anyone can add that command to their server via the web control panel. What would the best method of doing this be?
yeah github would work best
how would github help?
i want the stuff to be hosted on my server
@loud salmon the plugins are essentially packages that listen for discord.js events that will be hosted on my server. my issue is, what would the best way of firing the events and alerting a certain package that that event has been fired
keep in mind that the bot is for multiple discord servers and not all servers will use all packages
wait lemme give you a code example
ok
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. YouTube Data API has not been used in project 880573742558 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=880573742558 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"extendedHelp": "https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=880573742558"
}
],
"code": 403,
"message": "Access Not Configured. YouTube Data API has not been used in project 880573742558 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=880573742558 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
}
}
Key has no restrictions, left for at least 6 mins before testing after changes, still not working
try deleting everything and starting from the beginning
Done that
new project, new api key
several times
people are probably still asleep from all the partying they did last night
then idk
How do you use mongodb atlas? Not asking to be spoon-fed, just asking for someone to point me in the right direction.
Alright, so I know some ways to make cooldowns on commands, but does anyone know the best way to go about doing it for discord.js?
create a set
On a timeout yea
Add person to set at the end of message handler
Get a timeout to remove them
Return if in set
But I want people to be able to check the time left on it
there’s a work around for that
use timestamps
save timestamp for last time command was used. on new command compare timestamp to saved one
Are timestamps in miliseconds
Well whatever was passed is undefined
at new User (/rbd/pnpm-volume/ffe971fb-0896-423e-a2be-c3899038c99b/node_modules/.registry.npmjs.org/fortnite/4.1.1/node_modules/fortnite/src/User.js:13:73)
it cant make something lowercase that doesnt exist
idk how the fix would work, but its trying to make something lowercase that isnt defined
idk tbh
this is like the third time people post about this problem
from what i remember it seemed to be a problem with the package, which was not updated since, by the way
oh srry ;/
the package is really simple though, you can easily do whatever you need without using it
does anyone have any idea how I would make the progress bar scrollable on client side
Anyone know bot that shows last user, how many users online, how many users on server, how many banned users etc.
Bot that create channels with this info, not on the website.
okay im not looking to be spoonfed, i want some resources but google isnt helping
i want to make a website that can use javascript code that isnt displayed to the user, but constantly runs on the server
i know this can be done with php, but i want to use javascript
and also use node.js modules and es6 syntax 
so yeah if anyone can direct me to a good starting point i would be very thankful
node.js and express
Webpack for using ES6 syntax and there are many template engines for Express. Like EJS
soooo i just use express in my file and do everything with it?
idk I use python for my website
I am pretty sure you can pass in parameters
but express is good I've heard
And use them in the file
why is the express website so bad tho

It doesn't look like that for me. https://images.danktronics.org/images/sDV6hwgn2ijcyqFjblfzs4WH8nAPUfVtiUrn1ySc.png
ik im using dark reader
anyways, thanks for the tips
ill check it out
if anyone is reading this in the future and has better ideas tag me kthx
I guess nobody has answer to my problem
Eris has REST mode.
var embed = new Discord.RichEmbed()
.setAuthor(message.author.tag, message.author.avatarURL)
.setDescription(`\`${feedback}\``)
.setThumbnail(message.author.avatarURL)
.setColor("00FFFF")
.setFooter(new Date())
client.shard.broadcastEval(`const channel = this.channels.get('529692006608273428'); if(channel) {channel.send(\`${embed}\`); true} else false;`)
This returns [object Object] in the specified channel... JavaScript, can someone help me figure this out please?
it would be easier to use webhooks™
Nu. I want to do it like this aha
because you're sending the toString() of the embed
I was told, this would work. But it is giving me another error:
client.shard.broadcastEval(`const channel = this.channels.get('529692006608273428'); if(channel) {channel.send(\`${JSON.stringify(embed)}\`); true } else { false; }`)
Returns:
{ SyntaxError: missing ) after argument list }
Read the error. It tells you everything you need to know
I do not see the syntax error though...
Um no offense or tryna sound like an asshole but like how did you make your bot if you didn't know where and when to add an )
const channel = this.channels.get('529692006608273428');
if (channel) {
channel.send(\`${JSON.stringify(embed)}\`); true } else { false; }``` Does this look right to you?
@gilded blaze breh
client.shard.broadcastEval(`this.channels.get('529692006608273428').send(\`${JSON.stringify(embed)}\`)`)
There shouldn't need to be a ) anywhere else...
Still same error
@quartz kindle
var embed = new Discord.RichEmbed()
.setAuthor(message.author.tag, message.author.avatarURL)
.setDescription(`\`${feedback}\``)
.setThumbnail(message.author.avatarURL)
.setColor("00FFFF")
.setFooter(new Date())
client.shard.broadcastEval(`this.channels.get("529692006608273428").send(${JSON.stringify(embed)})`)
Cannot send an empty message...
try send({embed:JSON.stringify(embed)})
finally! Thank you so much 😂
👍
Good luck
jk, its in there
its a property
lul
there are
so
many
options
i dont even know what I'm supposed to look for
Does anyone know of a bot for discord that can prune members with roles?
Or generate a report on last login time etc..
last login 
does anyone know how sharding works for discord.py .16.14 ?
if anyone has an example of how it works
it'd be much appreciated
im pretty lost and my bot is giving me an error that sharding is now required
it's not, .16.14
I'm pretty sure it's not possible with it
you need to migrate to rewrite
I might be wrong but I'm 99% sure
Hi
How to fix this problem?
at item.request.gen.end (/root/X/node_modules/discord.js/src/client/rest/RequestHandlers/Sequential.js:79:15)
at then (/root/X/node_modules/snekfetch/src/index.js:215:21)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:26047) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
my bot is in 87 servers
(node:26047) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
@crisp turtle it looks like it's possible you just need to do it manually
@earnest phoenix have you tried reading the error
it's self explanatory
yes i read it
Missing Permissions
what perm missing?
¯_(ツ)_/¯
ok
go check your code and check all actions you have
@pastel gazelle
@pastel gazelle and me have a bot hosted on https::/glitch.com
Made in d.js
How can we homehost?
yes
How can we do that?
wdym homehost
Run from computer
do you want to host your bot on your machine?
Yes
your machine or a server?
install node.js and other dependencies, download your bots code, and run it
yes, and install other dependencies as well
i have node.js
Oh ok
what else is needed
@earnest phoenix My bot commands starts with - const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
let bicon = bot.user.displayAvatarURL;
let dembed = new Discord.RichEmbed()
T o a s t go to glitch and go to the code
i have no clue what other stuff your bots code uses
my invite link is broken
if you use sql you need to install sql as well (duh)
@pastel gazelle go to https://glitch.com
And find the project
or you could just create an invite link 
Its at this link:
oh its most likely privated
(not an access link, he is already on the code)
it says not found
you don't host bots on free hosting, period
He is on the code already
then whats the problem 
what the
oh its working
any free hosting either:
a) is not free
b) has limited time of usage
c) restricts features which are 100% features your bot needs (to connect to the gateway for example)
Only used glitch while we were making the bot
There are 7 devs
Now it's made, were homehosting
^
money
you can find ones for literally $3
im guessing you arent paying for the electricity then
No
otherwise a vps would be waaaaaaay cheaper than homehosting
if you don't have the money to buy a $3 vps you probably shouldn't be hosting a bot at all, change my mind
I'm not hosting it, @pastel gazelle is
then why are you asking for instructions 
But i dont want to give out credit card info```
you... don't have to? you can use a middleman service like paypal
wait what
and you have a credit card
Can you not host @pastel gazelle?
ok
umm
you have to be 11 for that
we might need wlarus
.
m8 u have to be like 18
or wait
ur in a different country
England
this channel is for develpoment not for sorting out your personal problems tbh
dms exist for a reason
Can you host it please tost
You're mistaking a credit card for a debit card
get your parent/guardian to make you a debit card lol, i have a debit card on my name and i got it when i was like 14?
sorry
ask your parents for a credit card for a "school project"
and get an amazon/google vps
its free for 12 months
tell them its a school project to learn how to work with vps and remote linux
that only needs a credit card to sign up, it wont be charged before 12 months pass
if you have an edu email you should probably check out github's student pack too
quick question, important to add this shard or wtv to my bot? didn't really understand whats that
Best vps for discord bot hosting? no heroku
ik it isnt bad, i use it but my bot needs to be online 24/7 @earnest phoenix
Having trouble adding bots
@quartz kindle google give you a potato vm for life
no idea how thats sustainable but they do...
you can get a 1gb ram vm which is heavily overpriced
they give you $300 to use on their service though
vms are still heavily overpriced
Can somebody help, with the discord api how do I hide the token after the redirect?
@shy rose yeah im using it. but its not 100% free because they give you 1gb bandwidth/mo
discord alone uses like 8gb/mo
yeah but the vm it self is free with no inbound data cap so liek your only paying outbound
which compaired to any other service is free...
and the vm it self is still free
yeah it adds up to like 1-2 $/mo
given on aws its $5 per month for the vps + every other cost
and if your not doing outbound data youve still got a free machine
ik, i've been recommending it all the time here
nothing else afik offers that
but if you need something slightly better, then other companies are much better
if you want something better then pay for it...
why n0t glitch
if can find another service that give you a free vm thats better...
@keen drift cause google gives a whole vm for free
so does glitch 
im just saying, if you need to upgrade your vm for a price, other companies do it better
google's next tier is like 7usd/mo
like can you run a mysql or mail server at same time as your bot on glitch?
while others do it for 3
each glitch project run in its own vm
you know what a container is right?
containerised code
not sure, never heard of it
can you run a mysql server + nodejs at the same time off one glitch container?
I believe so
is memory persistent?
when the container stop/starts is a file you made before reboot still there
Yes it has a persistent volume
Bru this is scary
Hey guys, if I wanted to make a bot in Python which library would you recommend I use?
Is there like an idiots guide alternative for Discord.PY
Like an idiots guide for NodeJS?
Not sure, theres always the docs tho 
lmfao same Kie
ayo quick question
does lavalink establish a connection with discord or does it relay the stream to the client
it establishes a connection to a discord voice server
Why isn't message.react('✅'); working? I am using discord.js
@lethal sun Are you getting an error?
It says DiscordAPIError: Invalid Emoji
The emoji isn't correct and isn't recognized by Discord
idk then, sorry
is react looking for an object, and not a char?
try any of the other unicode checkmarks
U+237B ⍻ NOT CHECK MARK
U+2611 ☑ BALLOT BOX WITH CHECK
U+2705 ✅ WHITE HEAVY CHECK MARK
U+2713 ✓ CHECK MARK
U+2714 ✔ HEAVY CHECK MARK
U+1F5F8 🗸 LIGHT CHECK MARK
U+1F5F9 🗹 BALLOT BOX WITH BOLD CHECK
A check mark, checkmark or tick is a mark (✓, ✔, etc.) used (primarily in the English speaking world) to indicate the concept "yes" (e.g. "yes; this has been verified", "yes; that is the correct answer", "yes; this has been completed", or "yes; this [item or option] appli...
or try to use the text
tried everything
hm
maybe the lib isn't up to date?
anyone here good with Rust?
why?
Rust will give you tetanus that's bad
can't figure how to unpack a vector within a format
google solves most of your problems
how is it not relevant
i couldnt find anything on google which is why i asked here but i presume it isnt possible anyways due to how rust is
Channel about (bot) development
yea what
vec.iter().map(|e| format!("u32({})", e)).collect::<Vec<_>>().join(", ")?
@brave wedge
afaik that should work
fn main() {
let vec = (1..10).collect::<Vec<u32>>();
println!("{}", vec.iter().map(|e| format!("u32({})", e)).collect::<Vec<_>>().join(", "));
}```
@lavish forge it's not just for bot development but it's the preferred subject, if people ask other questions its not up to you to tell them to stop, for all you know the guy is trying to get a vector for use with a bot, who knows
eval works just fine. @earnest phoenix
🤔
is the file encoded properly?
I don't know
open it in notepad and save it as utf-8
rule 7
ok sorry
My first time setting the amount of servers that are displayed on the site, and I forgot to remove the 2,133 number from the example, so when I ran my code it set the server count to 2,133. I changed it so it should now set it to the actual number of guilds connected but it isn't updating
who are you and why are you pretending to be me
does it update if you hardcode a different number?
then double check how you get the real server count
when i run the command on discord i get errors back in the terminal
ah shit ofc lmao thanks
wew
has anyone tested discord's ping to many different vpses?
all i can say is i get better on galaxygate then i got on digitalocean
but they're both US right?
ye
i wanna know if an EU vps makes a big difference
im trying to decide between hetzner, ovh and galaxygate
well yeah but how much higher? if its like from 30 to 150, thats bad, but if its from 60 to 80, thats not bad
also, discord's gateway is cloudflare right? i pinged their IP from here and i got 50ms, while my normal ping to the US is 200
is the gateway really US only?
idk
i have a bot hosted on a friend's eu vps
its 2x ping compared to my other bot
but idk
the discord api is hosted 100% in the US
is it noticeable when you run commands?
no
most people won't even notice 100ms -> 200ms response times in normal usage
i only have experience with 2 vpses, one was from a russian friend, and it was really laggy compared to google's when i switched
changing the encoding to utf-8 didn't work @quartz kindle
is it possible to, at least locally, create an image of a pie chart in python?
python is turing complete so yes
I can't find a way to do it, is there a lib that I've missed?
Hi, How To Host Bot With Glitch
you dont
;-;
You use a real host
do you know a good package for fetch a overwatch player ? i was search since 5 hours and i didn't find
I'm trying to do 'client.guilds.size' with my eval cmd.
But it says 'client is not defined'. How to fix?
Check if they are HTTPS or not
thats an album link
oh
good god
just change the a to an i right?
no
oh
open the url
and copy image url from the album
got it
thanks
i have a question...
?
Why does a bot not work in the test channels? Do I have to do anything or something??
Maybe your bot is muted, check #265156361791209475
ok @frozen kettle and what exactly do i have to do?
solve the problem your bot has
Sam lmao
@hushed zodiac your bot may be muted because it responds to other bots, or something else.
Check #mod-logs
ok
You may have to use this thing https://totallynotavir.us/i/9d36.png
search for your bot
-bots @hushed zodiac
@jade garnet
The reason will be in modlogs
If you believe that it shouldn't have happened, ping a moderator
refrain from using luca in here btw
So I have to rub a moderatior aschprescription?
AxelBOT23.12.2018
Mute | Case 5179
User
@jade garnet (Progen#5454)
Moderator
Unknown. Moderator, use ::reason 5179
Reason
Unknown. Moderator, use ::reason 5179 <reason>
ID: 495293590503817237
Perhaps a <@&304313580025544704> knows more?
didnt work because edits dont ping
and dont ping all mods btw
ping 1 mod
and this was why your bot was muted https://skullbite.is-for.me/i/9mb7keyw.png
oh okey
@client.command(pass_context=True) async def coinflip(ctx): pog = ctx.message.author.mention cfa = ['Heads','Tails'] cfr = random.choice(cfa) await client.say(f'{pog} {cfa}')
How would I fix that so it picks randomly Heads or tails
I feel really dumb for having to ask that
you sent the array not the random choice which was defined as cfr
no prob
I would've kept staring at that forever
https://github.com/CuteWolf16/BroBot/blob/master/config.js
I need help because my bot is saying that the yt key is invalid which is not and i dont know why it is doing it for
generate a new key
Well thats either on glitch or heroku...
@mighty moat it takes up to 2 hours for your key to work
when you generate a new one
same size devices?
is it something in your css? with media size
It just centers the image
do you have media sizes though?
might want to make sure you're not missing the tablet screen size
Hmm
It doesn't specify the size at all
I don't specify the size it just centers it automatically
Hi?
it could be something like @media-screen (max-size 400px) then another with a min screen size
but nothing between
no.. depending on how it looks with no screen size restrictions. u may not need anything, just body { background blah blah
I'd need to see the code and everything tbh
I can hop on PC and check out your site
try removing the stuff after the picture path and reload on tablet
https://cdn.glitch.com/2b7e7bbd-231a-4e05-93ab-d9700aa0ec46%2Ffortnite-hd-wallpapers-33139-8742143%20(1).jpg
no like the ?3454374 after the actual picture link
might be cached, so might try clearing that
idk if resolution would affect your tablet
It's quite a high resolution
7192x3912 is pretty massive
The tablet is a Nexus 9 on slimroms
try resizing it 50%, change the link to resized image and try again
i dont
Mk
might be some emulator stuff online ill check
If it loads on others it might not be a issue
window.onerror = function(msg, url, linenumber) {
alert('Error message: '+msg+'\nURL: '+url+'\nLine Number: '+linenumber);
return true;
}
put that in your <head> between <script> tags and reload
see if youre getting an error
So I need to add a header
oh sorry inside <head>
yeah probably because the links
and actually.. something else
move <style> with all your custom css into your <head> section
I'm probably going to move it to a case file
<meta> all those tags need to be in <head>
Css
<link rel=...> all those need to go into <head> aswell
they are all inside your <body>
Umm that's weird
If you have glitch I can invite you
But all the links are in the head
i dont have glitch
so something isnt loading right then
can u teamview?
Sign up for glitch you can see the code though it
I'm on phone ATM so I can't teamview
oh.. apparently i have glitch
try moving audio into your body
Okay
or can i do it?
those 3 dots on line 94 need to go
@earnest phoenix if you dont want a subdomain set name to @
but i would recommend you use cloudflare
@mental solstice mk
i deleted them, all scripts and stuff are in the head now
something still funky with <body style>
oh @earnest phoenix looks like if youre using freenom's dns just leave the name blank
Am I the only one that despises embeds?
yes
Okay
Embeds are amazing and so clean @celest arch
Idk I just don’t like the look of them
Is there something wrong with this code
if(command == "transfer") {
let user = message.mentions.users.first()
if(!message.mentions.users.first()) return message.channel.send("Please mention a user.")
let amount = parseInt(args.join(' ').replace(user, ''))
if(isNaN(amount)) return message.channel.send("That is not a number.")
let targetBalance = await db.fetch(`userBalance_${user.id}`)
let selfBalance = await db.fetch(`userBalance_${message.author.id}`)
if(targetBalance == null) targetBalance = 0;
if(selfBalance = null) selfBalance = 0;
if(amount > selfBalance) {
return message.channel.send("Sorry, you don't have enough money to transfer!")
} else {
db.add(`userBalance_${user.id}`, amount)
db.subtract(`userBalance_${message.author.id}`, amount)
message.channel.send(`Sucsessfully gave ${user.username} $${amount}.`)
}
}
Oh nvm i figured it out
Am I allowed to ask about html here?
you can since this is for development, but html isnt really a language
I know
I just need help with something
How can I move a button to the top right using Html?
All I need is the method, no one needs to give me code
you use css
I Created Bot Again xd
does dbl have a way to have a post request be done to edit edit things, like the secret for the vote receiving
i want to make it more secure by having it be updated every few hours or so
is this possible?
how do i send an api post to update my bot stats?
what is the endpoint / url / format?
/api/bots/stats
its on the api docs lol
iirc
scroll down ^
someone know a command for unbanall ?
I want to unban all member ban in my server so..
i cant unban all manually
delete your server and create a new one :^)
i dont think there is a way to bulk unban, other than looping through all members and unban them one by one. but that could also be considered API abuse since you have over 10k bans, so you could put a delay on it and unban everyone over a longer period of time
I think i go unban all manually
Spam unban button
I dont unban deleted user
Because 3/4 of ban are deleted
Ouch
or you can open it in browser and make a script in the console xd
So like, how do i check if a user voted?
i saw the thingy in the API but i dont really know how to implement it
you send a request with a query, and you need to set an Authorization header with your bots api key
what’s your code?
what’s the error again?
wtf
i didnt have this error on other bots
I don’t see anything wrong tho
and its coded pretty much the same

is the file saved as .js?
of course lol
inb4 .ts
i pasted code in package.json by accident
Somebody can help me with the JDA DBL API ?
hey im having problems again with client.channels.get().send()
discord.js
if anyone can help plz tell
TypeError: Cannot read property 'send' of undefined
@mossy vine your code? 👀
just said 
anyways
client.channels.get() returns all properties properly
but .send() is just borken
did you put in a valid channel id
..
hold on a sec
if you dont define the channel you can't send the message. so do something like
client.channels.get('channel_id').send(`your message here`)
thats what i did but.. hold on a sec
yeah ok
i didnt say anything
found a solution but im gonna be like the average stackoverflow user an not post the solution
jk i didnt actually add the bot to the server 
js deving is 10% writing your code and 90% angrily browsing stackoverflow
90% angrily asking in dev serers*
i don't actually ask, when i dont find someone who has already an answer of the same question i trial and error until i get it
because there was an error
@loud salmon can @cobalt pine get unmuted, It will now not send Unknown command message if the message's server's ID is this server's
👍
does anyone know how to get the bot key from discordbots
I don't know if this matters, but my bot uses discord.py
Oh wait does this go in #topgg-api
in the folder where your bot is
its got the json file
if you have package.json then run npm install
Hey tim, can you help with my question right above pineapple's after you're done with pineapplefan's
in the folder
alright can someone tell me how to convert my joinedAt and createdAt in discord.js to convert to normal time
@compact mauve you mean getting the dbl api key programatically? or just getting it from the website?
website
the time is hell lmao
should be in your bot's edit page
@smoky mica use javascript's Date() function
where do i type the npm install
cmd or powershell
make sure youre in your bots directory
npm install
npm is not recognised as an internal or external command
ive intalled it and shut down before
installed*
a i meant to be on the bot or node-v10.15.0-win-x64
am*
if your node is installed correctly, everything should be done in the bot directory
but your node is not being found, that means the environment variables are not set or wrong
this might help
Thanks Tim :)
@inner jewel thenAccept or whenComplete, it's null
The real question is why you put your bot in your downloads
iirc he downloaded his files from glitch
@mossy vine im trying to run the bots code
That is a JavaScript file, but how do I open it?
...
What do I type
open up a cmd
navigate to the download directory
node file.js
my head hurts reading this
^^
same Telk, being sick af doesnt help at all
ikr
Ok, I'm on node
tbh we need an auto mod here when people ask about ReferenceError: <random thing> is not defined
Whatever I type after node says SyntaxError
show cmd
how does this person hv bot role @mossy vine
Laptop turned off one second
did you solve the environment variables problem you had? can you access node from anywhere? even outside node's folder?
I don't think so
then you have to solve that problem first
What do I type for that
you need to be able to access node from anywhere, so you can access it from your bot's folder
do people think every problem can be solved with 2 lines of code
var issue = "something isnt working"
fix(issue)
Is there an easy way to change the name of my bot on the discord bot website without reuploading it
it will change automatically
last time i checked you couldnt change your bot's username on the website, only the project name
you can change it with code tho
@quartz kindle how would I do that? Like I tried to use the section where u can write HTML to Change the bots title but it didn't work
somebody can help me with json ?
oh you're talking about dbl? i though it was about discordapp
dbl should update it automatically
as long as its your bot username, not just a nickname
Uhhh dbl?
discordbotlist
So ur saying I should change it in the developer portal?
I want the page on the discord bot website to be updated
Should have cleared that up first
so you already changed your bot's username?
No
So that's what I'll try now
Alright so I updated it on the developer portal but it didn't change on the website
Or in any of the servers I have it in
I believe theres both a project name and a bot name in Developer portal, make sure you renamed the right one?
Ah yes it worked thank you!
Wait how come on the site it only shows the new name if I'm logged in?
And if I'm not it still shows the old
Does it just take time to update?
http://prntscr.com/m2p41n "error":"No query userId, add ?userId= to your request
if somebody can help me
Java, Apache httpconnection
if(command === `${prefix}servers` || command === mentionprefix +"servers") {
bot.guilds.map(r=> r.name + " " + r.members.size)
}
Why does that not work for me.
js btw
why doesnt what work
my command
Would you mind fixing it so that it returns a message?
You are very helpful.
basic enough
what does .map do?
oh
in a kind of way
@earnest phoenix basic rule of the server. We don’t spoonfeed you stuff. Figure it out yourself
its literally just a send function
if(command === ${prefix}servers || command === mentionprefix +"servers") {
message.channel.send(bot.guilds.map(r=> r.name + " " + r.members.size))
}
yeah im stupid.
thanks
i knew that
@mental solstice Map is an iteration that returns an array. example:
the result is always an array
Hi
can someone help me with sql/jquery
Probably, ask your question
@mental solstice unless you make the array = arrayname.join("")
then log it
ok :) thanks guys
np
Tony did u get helped with your SQL jquery?
nope
know clue how to do sql + jquery + html @mental solstice
oh its jony
a mod chnaged my name and got it wrong
😒
are you using jquery ajax to call an outside php file that returns an SQL query
wtf
...
You would have to set up mysql for ajax requests iirc
is that what you're doing tony?
How long will a bot take to put all the server members id in a SQL database ?
couple seconds in good internet and no errors
depending on how many users.. at .001 second per query you could do 1000 users a second..
;eval 9*9
Thank you because to display the local leaderboard, I need to compare all id(s) with those in the database. But I never thought that a server could contain so many people ... So I'm afraid that my bot takes a lot of time to analyze everything.
(I tried to do my best to make my English understandable)
databases are made for holding large volumes of data
@clever remnant depends if you sort them
just select * from <table> where <filter> order by <key of the leaderboard> desc limit <amount>
do not forcefully add users to your database
when they do a command which interacts with your database, add them only then
you're wasting giant amount of space and resources on forcefully adding users to your database
That's what I did. What I'm concerned about is when I want to display a local leaderboard. The only way I've found is to compare all the server's id to the database to find out who's inside or not.
Because in my database I have the id and "points" of the user.
any proper database will deal with that easily
Thank you, it reassures me
So I'm making a bot for friends, and i ran into this error;
[ERROR] launcher: Error starting bot
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/aiohttp/connector.py", line 822, in _wrap_create_connection
return await self._loop.create_connection(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 804, in create_connection
sock, protocol_factory, ssl, server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/base_events.py", line 830, in _create_connection_transport
yield from waiter
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/sslproto.py", line 505, in data_received
ssldata, appdata = self._sslpipe.feed_ssldata(data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/asyncio/sslproto.py", line 201, in feed_ssldata
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)
The above exception was the direct cause of the following exception:```
issue fixed! Just had to click the python command file
quick question
is guildMembersChunk for loading in a chunk of members in the cache
or a chunk of members joining a guild
read your libraries documentation
oka
Is there something wrong with this code
db.startsWith(guildMessages_${message.guild.id}, { sort: '.data'} ).then(resp => {
resp.length = 10;
let finalOutput = '**Leaderboard:**\n\n';
for (var i in resp) {
finalOutput += `${client.users.get(resp[i].ID.split('_')[2]).username} -- ${resp[i].data} messages`;
}
message.channel.send(finalOutput)
});
It doesn’t give me an array of users it just gives out this Leaderboard:
@topaz fjord
now let's see
where are you getting message from
the function doesn't return the parameter message
if you want to use message turn that function async
what did you do?
what did you check?
bot.on('ready',function(){
console.log("Ready")
bot.user.setStatus('Online')
bot.user.setActivity('game')
})
I checked if i turned on the async function
why it dosent works
....
bot.on('ready', () => { not function()
tha's not what I mean
How do I do it dan that offered my play a game
Nono i was talking to the other guy
this is what I mean https://medium.com/@tkssharma/writing-neat-asynchronous-node-js-code-with-promises-async-await-fa8d8b0bcd7c
read the thing
How do I do it dan that offered my play a game?
Kk
Guys
I need assistance
still doesn’t work for some reason
I'm probably a 2/10 with d.js
if(command === `${prefix}servers` || command === mentionprefix +"servers") { message.channel.send(bot.guilds.map(r=> "**" + r.name + " (" + r.ownerID + ")" + "**" + " \n `" + r.members.size+ "`")) }
So that command works.
But I would like it so that it numbers the servers, and then I say a number and the bot will give me the link to the given server.
no
client.on('ready', () => {
console.log(Gestartet ohne Fehler als ${client.user.tag}!);
client.user.setActivity('Wird Programmiert')
});
This works
- yes that's possible
- you'll run into errors if you don't have the proper perms @earnest phoenix







