#development
1 messages · Page 626 of 1
you cant, and wrong channel for that anyways
javascript is just a mess
stop bulli
@real helm your name was changed because your username contains special characters that would put you on top of the user list
if you change your username into a normal name without special characters, then you can ask a mod to change your name back
Remove the !
^
hello
how can I do to put in the bot log of my bot the amount of channels in which they are
depends on your lib
js
Just loop through the channels and log what you need
the ammount of discord servers
with discord.js its client.guilds.size and client.channels.size

wtf
anyone know an easy image editor for node js? (ping)
canvas probably
client.guilds.map(g => g.name)
learning js will help you write a bot in js lol
https://discordjs.guide you should also check this out
Great, someone finally recommending discordjs.guide to ppl... I’m fed up with ppl sharing anidiots.guide shit with others
That belongs in the garbage can of discord.js history, not in a help channel
Does anyone know what static website generator/theme discordjs.guide uses if it uses any. I'd love to use it for my bot it looks very nice
em
Looks like it, thanks 😄
It just gives large codeblocks of code and than tiny bits of explanations at the bottom
And most ppl just copy-paste that code
cant really fault the writers for the inability of their readers
I mean I don’t blame them... if I were that dumb and I saw someone giving “free codes” for cool shit like star boards and tracking used invites, I’d copy-paste it too
when i was getting started i never even knew there was an official guide so i learned from aig and shudder tsc/plexi
But the writers should be held responsible for the consequences of their site
Plus the stuff that aig makes pages for r just basic logic that any real dev should be able to write
Look at that junk... JSON and Enmap shouldn’t even be taught cuz of how shitty they are, and the rest are just bait for those suffering from imposter syndrome
Forgot this was #development, sorry
Also last bit of criticism, GitBook, really? That shit is slow af
man what have evie and york done to you
Also last last last bit I swear, it has guides on how to host on fucking Heroku and Glitch
i agree that json should only be written about to tell people that its NOT a database but enmap is fine and all the other topics are popular
why wouldnt they write about what people find popular
heroku is also fine, i dont know why everyone hates it so much
Enmap is popular? Enmap is pretty much keyv but worse
Loading an entire dB into memory is a dumb idea
I mean Enmap was flawed from the start
It’s another piece of bait for beginners to get caught on... poor fellas can’t manage to escape it
its a decent starter database
it would be nice if they taught people how to use something like mongo though
Not a database... again if you want simple key/value storage why not use keyv
and then also had a tut on hosting a remote db
there are countless video's
it works tho
gets the job done
like i mean, if something works for some people, then great! they must use that
Users having trouble with keyv can get support from a much larger and well-maintained library and a well-built community than just a small bunch of weirdos
just cause it doesnt work for you then meh
calm down my guy. we get it, you really hate york and evie
me .. lol i dont xD
That’s not the case with Enmap, you have to rely on Evie’s good graces cuz virtually no one of trustworthiness uses it
i dont hate
not you spiky
I don’t hate them... I just wish they did better
oof
Look, when discordjs.guide got out, York should’ve archived anidiots.guide...
honestly my biggest problem with them is that evie is very selective with her help
couldnt agree more
but if youre not mega stupid she can be helpful
with eslint statement
best part of the djs guide is the page on eslint no cap
Exactly... with keyv, it’s not like that
i didnt even bother trying enmap and that stuff
Discordjs.guide is reviewed and maintained by multiple valued members of the djs community... aig on the other hand is run by evie and York and is ultimately subject to their opinion and their opinion only
but i am learning mysql atm
@opaque eagle what database do you use?
i tried using firebase the other day, and it just didnt work xD
i have to learn it for school
ive been putting off learning mongo for the longest time oof
so i might aswell learn it
MySQL is fine
@idle basalt there some great video's online
Fire base imo I don’t see myself using it but if u have to learn it for school you’ve got no option
firebase seems cool
It’s pretty restrictive and it’s noSQL, and ur data is subject to Google’s privacy policy
I use MYSQL, I don't see much point in using anything else (also I don't much choice on my server)
firebase didnt work for me xD i was messing around, trying to get it to work, but i was having issues
Fire base is really only meant for front end sites
yea
i was experimenting xD
You really should avoid using it
im gonna try it for auth on my website
gave up xD
Lol
but i try to go with free as much as i can, cause in my country, everything is really expensive
the good thing, we getting AWS in 2020
If you’ve got a VPS you can do whatever u want in it
Heck you could even use Redis or pg, which is cool
hmm
the price for a decent VPS per month is $25 to $50, that is for 3gb ram and 2 vCPU xD
oof
that is south africa
everything is shit expensive
but ive given up. i ordered some server stuff, gonna run a server closet at home xD
Daaaaamn
Lmao gl
lol
Also you can check out some of the options in the pins, they’re pretty cheap @ivory hazel
Much cheaper than $25
the problem is, nothing is in south africa
Wait just to be clear $ refers to USD here right?
Yeah then why bother... with DO is roughly $5/mo
In USD
And price won’t vary by country
If it’s a physical product being shipped to u, sure, rates might differ
its R14.58 per 1$, so $5 is R72... that wont even get me a McD's burger xD
maybe a small one xD
Oh
you can get a vps from any country, doesnt need to be yours
well then rip
server region only applies to voice
and voice for music at least doesn't really matter the latency
latency only really affects you for real time chatting
@shy rose it doesnt
it also affects text
and the latency does matter
instable latency can cause distortion and weird artifacts
especially with opus
@fading wigeon text servers are all US based (central discord) afik
voice servers are the only applicable part
not so sure about that
their status display shows voice servers yes
but ive seen messages react differently when selecting different regions
hence when you connect a to vc you get given a vc IP in the region you connect to
how ever the websocket you chat over all runs to the same place
its also insupport reffered to as voice region https://support.discordapp.com/hc/en-us/articles/216661717-How-do-I-change-my-Voice-Server-Region-
@fading wigeon if you know/find anything about text region would be good to know so can load balance it out nicly but so far only seen for voice
also when US dies all servers normaly die
yeah since us servers handle load balancing
ill see if i find something
might message discord idk
*meant load balancing out bot hosting sry
cause currently the strategy for low latency is jam all the hosting in to the most centeral discord area possible
lol
i think it connects to the nearest endpoint anyway
and thru it to the central servers
aka make it the biggest central point of failure possible
they use cloudflare for a reason
ws all resolves to same place with i believe cf just fowards it
cf will make it way nicer for them 😛
yeah ik i love it
lol
yeah tbh they should do something about their server structure
found a fun one the animated server icons if they are big enough always result in a miss
so on a mega server i was on they avg 250GB per hour sending the always miss icon which is
i mean when ever discord has a db failure the entire thing topples
except vc lol
you can still talk to people and ask if they can talk in chat
you cant connect or leave though which is odd you cant leave
they enforce sharding for bot creators but dont do it themselves
kind of ironic
its not that hard too
it is kind of hard for real time chat tbh
might result in a bit more traffic between data centers because of data references but still
nah its really hard
its not as hard as u think
they already run clusters and shards
there are solutions for it
i mention specifically for real time chat
having an internal bit-torrent like system for example
like in normal semi realtime systems you can do rolling aggregation clusters which works amazing but the moment you bring realtime in it really starts to hit the fan
cause thats still really hard
if both pairs reviece an event at same time aka 2 people in diff part of world
then its question of who gets presence
if they use p2p for the whole network seen that somewhere cant remember its name but you end up with no chat history
and also tons of script kiddies trying to dos one another
you could
and yes that might also happen
but still
the history thing wont be a problem if they use custom cachers to support the network
the only problem i see is privacy
if you bring cachers in then your back to same issue
if 2 people send message at same time each to a different cluster then who has presidence
so new users have a bit of context
also member lists wont exist lol
none
the tasker will handle it
no it wont exist
it cant exist
it will come down to the client then
to decide which message will be first
also interesting thing discord has tried and does have a form of rolling aggregation
decision will probably be made according to current cluster connection
did you know the recaptcha for new temp accounts is just a local form dummy?
but also why you cant bulk delete past 2 weeks as they are no longer on hot
what do you mean sry?
and the client glitches
do u know u can create temporary unregistered discord accounts?
bulk delete past 2 weeks
is the idea of fetch then send single delete evens
by going to discord.gg
its a 300 now
wha?
it just redirects
Hi
yeah
301 or 302 i didnt have tools open
but everything else is a cname
hello
if you dont have a request for it it redirects to main
cname is very diff from 300 lol
Who can help me ?
@lofty hamlet does it give you line number?
It's all 😉
When i use includes
Wtf
const switcher = message.content.slice(prefix.length).trim().split(/ +/g); switch (switcher[0].toLowerCase()) {
My switch if you want
For the case
ah ik this
mainly cause just hainvg this issue 5min ago on another project lol
if you do a double split then you get a null entry
alright
you get empties
?
@fading wigeon interesting read btw https://blog.discordapp.com/how-discord-stores-billions-of-messages-7fa6ec7ee4c7
So ?
@lofty hamlet the codes thats throwing the error isnt in the sent file?
Of course, lmao

For some reason, my webhook isn't even running at all...
module.exports.startUp = async (client) => {
const dbl = new DBL(dblToken, { webhookPort: 5000, webhookAuth: dblAuth });
dbl.webhook.on("ready", async (hook) => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});```
What are you hosting ur bot on?
ubuntu
Any error messages?
nope
Was the webhook running before or was it just never running?
Have you made any changes?
Nope
Yes
Here is the full script: https://github.com/Memexplorer/Memexplorer/blob/master/dbl.js
Normally it prints out: Webhook running at http://${hook.hostname}:${hook.port}${hook.path}
But for some reason it just stopped running the script
I tried
Yeah, sorry I couldnt solve the issue 😬
Ports pls
never forget to open ports
a webhook will never work if your ports are closed
Can you elaborate a bit more?
Dont you know what port is?
I have it set to 5000
It's where ships go to dock and make sweet love @sinful lotus
Error: Could not connect to server
Status: Disconnected from server```
It can't connect to port 5000
And how does one do that? :>
I just searched it up before I asked that question
And I got like 1000+ different results
Really weird
start from figuring out what is your firewall
This webhook used to work last week
I'm so confused
port 22 works
I mean, port 22 is open
port 22 is your ssh port. try avoid using ports 1-1024, most are reserved for common services
lmao why cant you just learn to open port
we are pointing you to the right direction
we all started from I dont know how to
we just have the drive to learn and explore
why dont you try that
I cant spoonfeed you how because every system is not same
reading without comprehending is useless too
Is there a way to do have webhooks without using ports?
@ivory pebble open your router settings and look for a tab called Port Forwarding
webhooks need to be accessible to the public which is why your port that the webservice (apache im assuming) is listening on needs to be open
Sorry, I really don't have that much knowledge about VPSs
ayy i get this as response from api `action: 'getWeather',
parameters: { 'geo-city': 'Los Angeles' },
allRequiredParamsPresent: true,`
'city' is not defined error
help me
Do not @mention people randomly.
ayy i get this as response from api action: 'getWeather',
parameters: { 'geo-city': 'Los Angeles' },
allRequiredParamsPresent: true,
'city' is not defined error
help me
that what i get from api at the top
reposting doesnt help
we dont even know what api that is
its dialogflow
what is ur code
var url = `http://api.apixu.com/v1/current.json?key=4b17315c17394d40ac6232419191001&q=${req.body.queryResult.parameters.geo-city}`; request(url, function(err, response, body) { body = JSON.parse(body); if (body.error) { //console.log(body.error); return res.json({"fulfillmentText": `**Data not found:** ${body.error}`}); } res.json({ "fulfillmentText": `` })
it gives error at the end of url
parameters.geo-city
it says geo-city is not defined because of -
thats not how js works
so how it owkrs
iirc you have to do parameters["geo-city"]
thats what i needed thx you
hello
hi
How to add 2 prefix ?
e.x:
- @turbid dune help
- !help
Lib: Discordjs
I don't mean setprefix
Because i saw people doing "@botname help"
!play s
@idle basalt
hi
why cant you invite a bot yourself? but also, no
and this isnt the right place to ask
Hello, does anyone know how to make a command in discord.js that indicates how long the bot has been active?
ping me
what do you mean active? you mean uptime? how long it has been running since last restart?
yes
process.uptime()
@peak glade why crossposting
chaos, hello
no
thesourcecode 
😐
hi
it won't correctly connect can you help me ?
Its good @earnest phoenix
Whats your host?
make sure your ports is open
omgserv
if you set it to 9000 then make sure port 9000 is open
dont use port 22
or any port below 1k
Take the time and learn how to open the port
ok
I have a problem my code :
And my error : includes of null
When i use includes
Wtf
const switcher = message.content.slice(prefix.length).trim().split(/ +/g); switch (switcher[0].toLowerCase()) {
My switch if you want
For the case
theres no includes there
An empty hastebin, half of an error message, and the wrong piece of code?
lmfao
@lofty hamlet show the error in console
client.on('message', message => {
if (message.content === 's!fight') {
if (!message.mentions.users.size) {
return message.reply('You have to mention a member to fight them!');
}
var opponent = message.mentions.users.first();
return message.reply(opponent.username)
}
});
I'm trying to make my own fight command. It does say You have to mention a member to fight them! if there is no mention, but there isn't any message if a user is messaged.
No console error message.
because message.mentions.users.size is 0
I'm going to try something first
how do I fix it?
it also seems like it isn't allowing to pass any args
wait I think I what I messed up and how to fix it
I used message.content so any args wouldn't work
if (message.content.startsWith('s!fight')) {
fixed it
my code was right
it was just the message.content
@shy turret what ?
nvm
@lofty hamlet
- That HasteBin is empty.
- That's not the full error... some of the error message gets cut off, so show us the full error + stack trace.
- That's not the actual file that the error comes from.
And you were already told all of those things beforehand:
https://discordapp.com/channels/264445053596991498/272764566411149314/584352791296737295
Hello
So could someone point me toward a guide that explains how to open ports and such? I’ve tried doing the research myself and I can’t find anything
@opaque eagle my bad wtf hastebin empty ok so : new hastebin : https://pastebin.com/u7Qh1hva
This a few party of my code
and the error is ?
thats still irrelevant code
welcommer?
You mean the bot Welcomer?
Idk how to welcommer either
or whatever it is
teach me when u learn how to do whatever that is
const dbl = new DBL(token, {
webhookPort: 8780,
webhookAuth: "password"
}, Client)
dbl.webhook.on('ready', hook => {
console.log(`Webhook running at http://${hook.hostname}:${hook.port}${hook.path}`);
});
dbl.webhook.on('vote', vote => {
con.connect(function (err) {
if (err) throw err;
con.query("UPDATE players SET megabox=megabox+1, hasvoted=" + Date.now() + " WHERE id=" + vote.user); () => {}
Client.users.get(vote.user).send("Thanks for voting you receive a Vote Box, do ``&open votebox`` to open it. *Don't forget to vote again in 12 hours !*")
Client.channels.get('566730124066684949').send("**" + message.author.tag + "** have upvoted the bot, thanks !")
})
});```
with this code
i have the error
what's wrong ?
you already have something listening on that port
are you starting the webhook in an event handler
welcommer is a welcome message that a bot send when somebody join
client.on(..., ... => {
const dbl = ....
})```
ok thx
That is the bots name
how to see my port that are already used ?
The bot is private
mmm
in cmd
ipconfig @earnest phoenix
i think
@unique nimbus and how I do a welcome message
@real helm on guildMemberAdd events
what is easy mongodb or mysql?
mysql
i know mysql but i dont understand on javascript 🖕
Woah
Been using mongo cuz it's convenient in a way
so what is easy?
Nothing
lol
Does anyone here have any experience with createjs or webpack? I'm trying to make the two work together. To use createjs I need to make a Stage which takes in an ID of a canvas as a parameter. Well I did all of that, but I'm getting an error because I think it can't access the html or something? The error itself is not of any use this.Container_constructor is not a function. Does webpack prevent that? how can I fix that?
@digital sparrow I'm pretty sure both are easy once you understand how to use them.
I'm very new to both so I have no idea what I'm doing
@copper cradle tf?
so what is good mongo or mysql?
just use a json database /s
do you know what /s means
oof
@digital sparrow preference
forgot about it
i like mysql
@digital sparrow s3 is gud
Easy to learn ngl
Just have to upload a few more files than others
@earnest phoenix error is includes of null
i think json gud
oof
I have a problem my code :
And my error : includes of null
When i use includes
Wtf
const switcher = message.content.slice(prefix.length).trim().split(/ +/g); switch (switcher[0].toLowerCase()) {
My switch if you want
For the case
Do you have a list of posts like that
so how to use mongodb?
Mind sharing it? 
Are you banned from Google
Who me ?
Oh ok
I would try to search this up / look it up on the docs but I've no clue how to word this question for google nor what it'd be under in the docs;
whaaaat
Is it possible to fetch a message in discord.py without getting the discord.TextChannel first?
Idk anything about java
@jolly sentinel no channel - nowhere to get message from
sweet
Now I just need to decide whether or not I want my quote command to require the channel the message is from or the channel you want to send it to.
try {
message.member.send({ embed1 })
} catch (e) {
{const embed= new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(color.rojo)
.setDescription(":x_: ERROR:\n No te he podido enviar los comandos, revisa que tengas activados los mensajes directos de este servidor.")
.setFooter("Programado por @real helm")
message.react("581159019633180756")
message.channel.send({ embed })
}}
what is wrong
message.member.send(embed)
you dont need the {}
just because of how richembed constructors work
what?
if the code is okay
aa okay, and what
Also you have an extra scope for no reason I believe
Like you have a pair of {} inside your catch that don't seem to do anything
that won't cause an error but yknow
Right, which makes sense, it's a scope
most languages will accept it
i just wouldn't want him double-scoping every try catch block for some reason because this code works

yeah
aaa
@digital sparrow ?
?
Can lava link take voice in
you mean receiving audio?
If that’s what you mean, then no.
thats what i meant
so i want it to receive audio then send it to api then get back response
just like okaygoogle
i have a music command but it only works with links, how can i make it so i can just put in some keywords and its plays the first thing it finds?
find a library that searches youtube
from discord.ext import commands
client = commands.Bot(command_prefix='>')
@client.event
async def on_ready():
print("Bot is ready.")
@client.event
async def on_member_join(member):
print(f'{member} has joined a server')
@client.event
async def on_member_remove(member):
print(f'{member} has left a server')
@client.command()
async def ping(ctx):
await ctx.send(f'Pong! {round(client.latency * 1000)}ms')
client.run('')
``` get error when i use ping comd
What's the full error?
if you don't know python... why are you making a bot in python
Traceback (most recent call last):
File "C:\Users\Jassm\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\bot.py", line 846, in process_commands
yield from command.invoke(ctx)
File "C:\Users\Jassm\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 367, in invoke
yield from self.prepare(ctx)
File "C:\Users\Jassm\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 345, in prepare
yield from self._parse_arguments(ctx)
File "C:\Users\Jassm\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 304, in _parse_arguments
transformed = yield from self.transform(ctx, param)
File "C:\Users\Jassm\AppData\Local\Programs\Python\Python36\lib\site-packages\discord\ext\commands\core.py", line 212, in transform
raise MissingRequiredArgument('{0.name} is a required argument that is missing.'.format(param))
discord.ext.commands.errors.MissingRequiredArgument: ctx is a required argument that is missing.```
cuz thats how i learned js
and i believe i can learn py with it too
"lets learn spanish by just reading spanish books and not understanding the context whatsoever!!"
i didnt know js at all when i started making a bot but now i can make a lot of stuff with it
its just a way people learn stuff some learn from vids some from experimenting and some from self learning
see rezno is wit me
Are you using rewrite or async?
its the latest one
i didnt know js at all when i started making a bot but now i can make a lot of stuff with it```
a result of that is shitty unoptimized code
actually everything works fine
thats kinda rude to him
im still not very good at js but still better than before
I think you're using async because that should work on rewrite.
It's saying you're missing the ctx argument
lol im learning from lucas new tut videos
and i believe he is using the latest one rn
thats what he said
here we have it boys, the golden combo, youtube tutorials and not knowing the language whatsoever
lmao
cry just help if u want to or dont reply to my stuff
just me telling you to not use youtube tutorials and to learn the language you're working in is helpful
Lucas tutorials...
to your sanity
That tutorial is probably using async
Sounds about as shit as it can get
oh uh
so should i not watch him
Yeah for async search "discord.py bot devdungeon"
You should probably get a basic understanding on the language first
That's what I did
Learn the language, read the docs
^
Two things
which is a heaping load of irony seeing as how my first bot was how i learned the language but whatever
A!eval message.author.send("getlife")
--upgrade
pip install discord==0.16.12
(async)
pip install discord
(Latest)
so which one should i do
I remember having a horrible time trying to install discord.py-rewrite
-U for update
discord-rewrite is shit
Successfully installed aiohttp-3.5.4 attrs-19.1.0 discord.py-1.1.1 idna-ssl-1.1.0 typing-extensions-3.7.2 websockets-6.0 yarl-1.3.0```
cuz it wasn't even official
isn't every tutorial on yt under async
is that what i need
Yes
i mean
And yes
they might not be good
so there we go i made progress
but whatever
finally it replied thx
enemyhpstring = fs.readFileSync('data\\battles\\' + opponentid + '-hp.txt').toString().split('\n');
enemyhp1 = parseFloat(enemyhpstring, 10)
enemyhp = enemphp1 - move1damage
what's wrong with this?
[ '20' ] // This is enemyhpstring
20 // This is enmyhp1
C:\Users\Username\Desktop\Discord Game\bot.js:229
enemyhp = enemphp1 - move1damage
^
ReferenceError: enemphp1 is not defined
Is a txt file really your best option
For simple games yea
well json is more organized atleast
@idle basalt I'm in handler and it dont work
um...
i already tried:
if(!message.content.startsWith(prefix)||message.content.startsWith("<@" + bot.user.id + ">")) return;
client.on('message', async message => {
let messageArray = message.content.split(" ")
let cmd = messageArray[0].toLowerCase();
let args = messageArray.slice(1);
if(!message.content.startsWith(prefix)||message.content.startsWith("<@" + bot.user.id + "> ")) return;
let commandfile = bot.commands.get(cmd.slice(prefix.length)) || bot.commands.get(bot.aliases.get(cmd.slice(prefix.length)))
if(commandfile) commandfile.run(bot,message,args)
});
only &&help work
The mention doesn't work, right?
you need another !
^
! message.content.startsWith(prefix) || message.content.startsWith("<@" + bot.user.id + "> ")
will be false when your prefix is not present or when the mention is present
You need another ! after || @lapis meteor
^ (actually you need to use && ! instead of ||)
or you need to group the conditions and keep one !
I do an overkill thing lol
or use arr.includes
["!", `<@${client.user.id}>`].every(e => !msg.content.startsWith(e))```
lol
Why not encrypt a bitmap with the matching bytes and run it through a block chain?
i think you mean .some btw
No, I mean every()
doesnt every check if everything passes 🤔
If I used some() it'll return true and then it will stop running the code
every is correct, because of the negated startsWith
ayy so this is the client that i connect to lavalink with right https://www.npmjs.com/package/discord.js-lavalink#discordjs-lavalink
How do i make the background on discord bots list to black
There's a dark-mode switch in the footer, if that's what you're looking for
where at the bottom?
on your bots page or the entire website?
bots page
use style tags in long description
how do i do that i am not smart with html
<div style="background-color:black"> .... </div>
in long description, just do
<style>
css code here or something
</style>```
or that but it will only be inside that one div
which is meh at best when using light mode on the website
i cant install better sqlite 3
i hardly installed enmap and quick.db
but it cant find the module even i installed for 5 times
I mean Geotims worked right but i want the stuff that i have already the bottoms and shit but it wont work
nvm i have it how i want it know thanks tho!
ps in the code before you could've done this
if(!(message.content.startsWith(prefix) || message.content.startsWith("<@" + bot.user.id + "> "))) return;```
Is anyone here familiar with webpack?
wait I'll try something I'll get back if it doesn't work
Ofc all JavaScript devs know what webpack is, it's just that not everyone has enough practice using it
I'm having trouble using it with createjs
holy shit I am an idiot
I forgot to add new and I was wondering why it said it wasn't a function. It was a constructor I've spent so much time trying to fix it
aaa
What is the HEX code for the invis color on embeds?
You just use the color of the embed
@warm sail No because prefix = message guild's prefix
@opaque eagle your first proposition didn't work
Are you still having issues?
if (!message.content.startsWith(prefix) || message.content.startsWith("<@" + bot.user.id + "> ")) return;
@lapis meteor what exactly do you expect this part of the code to do?
As it is, it will call return if message.content.startsWith(prefix) is false. It will also call return if message.content.startsWith("<@" + bot.user.id + "> ") is true.
kk. g'night
thx but i'm not going to sleep
🤦 time zones
How do i make my web page for the bot say how many servers it in?
Use the API
Or you can check out some of the official client libraries
It’s on the website
oh okay
Click the “API” option in the navigation bar up top
Help my #topgg-api
Hmm
why uploading a bot is sucking like that x358634643643374 times?
Detailed description too short. Minimum 300 characters. Add your commands. Spaces or empty spaces are not counted.
I must write something to detailed description?
write what the commands are and how to use them
thats why it says its required
also pls dont
it shouldnt be hard to describe a bot that you made
just say some of its features and shit
not even help?
@restive light what does it do then lol
300 words is pretty ez
Uhh hi, i was just working on voting system and i couldnt make my bot to dm the person whoever voted
the codeline is this: ```
dbl.webhook.on('vote', vote => {
bot.users.get(vote).send('Thanks for voting! You can vote again in 12 hours.');
console.log(User with id ${vote.user} just voted.);
});
it isnt working somehow
In #topgg-api
if (message.content.startsWith(`${prefix}baga`)) {
if (message.member.voiceChannel) {
if(!servers[message.guild.id]){
servers[message.guild.id] = {queue: []}
}
search(args.join(' '), function(err, res) {
if(err){
message.channel.send('ceva namers bn sefu')
}
let videos = res.videos.slice(0, 10);
let resp = ''
for(var i in videos) {
resp += `**[${parseInt(i)+1}]:** \`${videos[i].title}\`\n`;
}
resp +=`\n\`alege un nr de la 1 la ${videos.length}\``;
message.channel.send(resp)
const filter = m => !isNaN(m.content) && m.content < videos.length+1 && m.content > 0
const collector = message.channel.createMessageCollector(filter);
collector.videos = videos
collector.once('collect', function(m) {
message.member.voiceChannel.join()
.then(connection => {
var server = servers[message.guild.id];
message.channel.send('casa ma scoti zi ``/iesi``');
server.queue.push(args);
Play(connection, message);
})
});
})
} else {
message.channel.send("intra pe un canal retardatule")
}
console.log("████████████ "+"-"+message.guild.name+"- " + message.author.tag+": |baga| "+ args2[0] +" ████████████")
}
if (message.content.startsWith(`${prefix}iesi`)) {
if (message.member.voiceChannel) {
message.member.voiceChannel.leave()
.then(connection => {
message.reply('gata pa');
})
} else message.channel.send("foaie verde stam la mal intran pula mea peun canal")
}```
can someone help me with this?
it works when i search for a video
it sends all the options
but when i select one
i get this error
help me
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received type object
const streamOptions = { seek: 0, volume: 1 };
youre passing an object where you should be passing a string
How can I take my bot online after close repl?
actually use keep_alive
and no that's not possible for a vps that's free
But It doesn't work very good
I'v just find this
diff --git a/discord/gateway.py b/discord/gateway.py index 7ba78b0..36b01f3 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -65,7 +65,12 @@ class KeepAliveHandler(threading.Thread): self.msg = 'Keeping websocket alive with sequence {0[d]}' self._stop_ev = threading.Event() + count = 0 def run(self): + try: + count = KeepAliveHandler.count + KeepAliveHandler.count += 1 + print("Keep alive", count, "started") while not self._stop_ev.wait(self.interval): data = self.get_payload() log.debug(self.msg.format(data)) @@ -76,6 +81,8 @@ class KeepAliveHandler(threading.Thread): f.result() except Exception: self.stop() + finally: + print("Keep alive", count, "stopped") def get_payload(self): return {
In gateway.py
@idle basalt how to fix it?
Now I found this site
Long knew about him
LOL
fun fact; people work to get money. you should get a job if you want to buy stuff you can't afford
Anyone able to assist me I’m having some difficulties with discord.py
you cant post links to other bot lists
I’m getting an error when I try to install
send console + code if possible
One sec just got home after taking a break to go eat
I don’t know if it’s a discord.py error pip error or just a user error
Reinstalling discord sorry just a min
??
what reason do you need to install discord
it shouldnt be that hard just to post a screenshot
Right but I sent first message on my phone and the issue is on rpi
Command "/usr/local/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-install-mbo7z90c/multidict/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-ev0krf1d/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-mbo7z90c/multidict/
You are using pip version 19.0.3, however version 19.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The error
when i try to install discord.py
@indigo geyser Both GCP and AWS provide Free VPS options with certain limitations. AWS' Free Option is only for a year though. Both aren't anything great, but they're fine for small-scale projects. Give them a try
If you're planning on doing anything big though, you may want to look elsewhere
Ok thanks
np
adding to that both aws and gcp have free inbound data which is great as around 98% of all data you use on a bot is inbound
const user = message.mentions.users.first();
// Parse Amount
const amount = !!parseInt(message.content.split(' ')[1]) ? parseInt(message.content.split(' ')[1]) : parseInt(message.content.split(' ')[2])
if (!amount) return message.reply('Must specify an amount to delete!');
if (!amount && !user) return message.reply('Must specify a user and amount, or just an amount, of messages to purge!');
// Fetch 100 messages (will be filtered and lowered up to max amount requested)
message.channel.fetchMessages({
limit: 100,
}).then((messages) => {
if (user) {
const filterBy = user ? user.id : client.user.id;
messages = messages.filter(m => m.author.id === filterBy).array().slice(0, amount);
}
message.channel.bulkDelete(messages).catch(error => console.log(error.stack));
});
it says it cant delete messages under 14 days
but im nort
over 14 days
ye
A!eval message.author.send(client.guilds.size)
??
is there a way to get a message's content using its ID
dont think so
i think so
how
you would read the channel messages then get the message with that id then get its content
?
you cant get a list
well maybe not in your language
im using the stable version of discord.js
.-.
nearly 100% coverage of the Discord API
yes you can in discord.js
how
Ayy im looking for devs for something big proj to do
Should know jquery and js html and css
please dm me if u interested?
Not the right place for asking that
Hello
fs.writeFile("./blacklist.json", JSON.stringify(bc)).catch(err){
if(err) {
console.log(err)
}
}```
Unexpected { at `fs.writeFile("./blacklist.json", JSON.stringify(bc)).catch(err){`
lol
I think you put , instead of .catch in that idk
the code snippet seems right, you most likely have an unclosed statement somewhere else in the code
@earnest phoenix no that makes no sense
kay
okay
@mossy vine well for me it works like , (err) => {} or somethin but yeah catch should work too I agree 
its because you are doing a callback
Yis
but this is a promise
Okae
so a .catch is what you need
ok
I forgot nothing to close
if (bc[iduser]) {
delete bc[iduser];
message.channel.send(`**✅ L'identifiant ${iduser} à été retiré de la liste noire avec succès.**`);
fs.writeFile("./blacklist.json", JSON.stringify(bc)).catch(err){
if(err) {
console.log(err)
}
}
}else{
message.channel.send(`**❌ L\'identifiant ${iduser} n'est pas dans la liste noire.**`);
}```
if only you indented the code properly it would be easier to read and find errors
You see the missing?
i cant read that code at all, please use a linter or something to have proper indentation
and no, i dont see it
likely outside of the scope
it can be anywhere tbf
thats not how .catch works
.catch(err => { code here }) not .catch(err){ code here }
the way you wrote it is the correct way for try {} catch(err) {}
but not for .catch()
Hello
In need help
message.member.send( embed1 ).catch(err => {message.channel.send("No te he podido enviar los comandos")})
why the bot send the 2 messges?
Someone knows about the blacklist system, I encounter many worries
lol no
ok
what blacklist system?
@real helm nothing wrong there, the problem is somewhere else in your code
Once your bot is submitted and approved, you get your bot invited to this server
oh
` js
if(command === "help"){
const embed= new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(color.verde_lima)
.setDescription(":emoji_10: Mensaje enviado correctamente\n\nRevisa tus mensajes privados para ver los comandos")
.setFooter("Programado por @real helm")
message.react("581159019633180756")
message.channel.send({ embed })
const embed1 = new Discord.RichEmbed()
.setTitle("__Comandos disponibles:__")
.setColor("21ea12")
.setThumbnail(client.user.avatarURL)
.setDescription("Sintaxis de comando:`<>` = Requerido, `( )` = Opcional\nMi prefijo es `/`\nPara más información de un comando `/help-<comando>` ")
.addField("General:", "`ping`, `serverinfo`, `report`, `avatar`, `userinfo`, `8ball`, `id`, `invite` , `uptime` ")
.addField("Admin Commands:", " `kick`, `ban`, `say`, `purge`, `encuesta` ")
.setFooter("Programado por @real helm")
message.react("581159019633180756")
message.member.send( embed1 ).catch(err => {message.channel.send("No te he podido enviar los comandos")})
} `
` `` (remove the space)
@earnest phoenix what are you talking about lol
if(command === "help"){
const embed= new Discord.RichEmbed()
.setAuthor(message.author.username, message.author.avatarURL)
.setColor(color.verde_lima)
.setDescription(":emoji_10: __Mensaje enviado correctamente__\n\nRevisa tus mensajes privados para ver los comandos")
.setFooter("Programado por @! Wᥱᥱd_Boყ#1031")
message.react("581159019633180756")
message.channel.send({ embed })
const embed1 = new Discord.RichEmbed()
.setTitle("__Comandos disponibles:__")
.setColor("21ea12")
.setThumbnail(client.user.avatarURL)
.setDescription("Sintaxis de comando:`<>` = Requerido, `( )` = Opcional\nMi prefijo es `/`\nPara más información de un comando `/help-<comando>` ")
.addField("General:", "`ping`, `serverinfo`, `report`, `avatar`, `userinfo`, `8ball`, `id`, `invite` , `uptime` ")
.addField("Admin Commands:", " `kick`, `ban`, `say`, `purge`, `encuesta` ")
.setFooter("Programado por @! Wᥱᥱd_Boყ#1031")
message.react("581159019633180756")
message.member.send( embed1 ).catch(err => {message.channel.send("No te he podido enviar los comandos")})
}
my bot
noone really cares what a bot is called
how I add a delete message in the .catch
@real helm it sends it because it cant send to message.member
Why not use .then() ?
after the message is sent
🤔 I think you need to try and understand https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise first
^ likely
can i say something
oh
i made this command already XD
require('discord.js').Util.fetchRecommendedShards(process.env.TOKEN) does not work
I use const result = async () => { await require('discord.js').Util.fetchRecommendedShards(process.env.TOKEN);
why not use the already required discord.js?
how i can make command that can use only developer
but i return result() { return _ref.apply(this, arguments); }
P.S. i made it already
i dont understand your code, but i did it like this js const Discord = require("discord.js"); const shards = Discord.fetchRecommendedShards(token)
@earnest phoenix i was replying to FellGill
I KNOW
if you want to lock commands, you can lock them to your ID for example
if(message.author.id === "youridhere") {
//command here that only you can use
}```
@quartz kindle now:
require('dotenv').config();
const Discord = require('discord.js');
const result = Discord.Util.fetchRecommendedShards(process.env.TOKEN);
console.log("Cordio sera spawné avec " + result + " shard(s)");
const manager = new Discord.ShardingManager('./src/index.js');
manager.spawn(result);
manager.on('launch', shard => console.log(`Launched shard ${shard.id}`))
Return:
Cordio sera spawné avec [object Promise] shard(s)
(node:3304) UnhandledPromiseRejectionWarning: TypeError [CLIENT_INVALID_OPTION]: The Amount of shards option must be a number.
already
@quartz kindle i made that command already
i forget
const result = async () => {await Discord.Util.fetchRecommendedShards(process.env.TOKEN)}; ?
im pretty sure the shard manager accepts auto as a value
Ok, but I put it or?
hmm?
yay
i set rich presence for my bot
Give me a complete example because there I do not understand or put this .then
@earnest phoenix it will be popular bot
ouh
@earnest phoenix js Discord.Util.fetchRecommendedShards(process.env.TOKEN).then(result => { manager.spawn(result) })
"in" is missed

