#development
1 messages · Page 497 of 1
yeah, if I get a Missing Permissions error that usually means the bot was muted.
Some one have a idea how to get the invitation used by a user when he join ?
A way to make that, because discord api don't permit to do that
🤷
@lucid iris @late hill permissions in the invite aren't guaranteed to be granted
Yeh
they're just selected by default
Which means
users can remove them
In the end its up to server administrators
yeah as far as i know there's no "invite accepted" event
never rely on having permissions
You can't change anything about it
I don't even know what needs what permission.
Which is why I'm trying first to find what's going on so I can then fix it.
probably missing permissions to send message in a channel
How would I check if my bot's been muted with discord.js?
I find no results on it and the typedef only shows a boolean muted on guilds, channels and user settings.
Anyone here want to join the development team for @languid granite with a moderate expirence in Java?
How can I change an array of ID's to usernames?
You can loop through each item and retrieve the user
let devs = await Promise.all(client.settings.bot_dev.map(async (id) => {
dev = await client.fetchUser(id);
return dev.name; })
);
I just did this
with the help from someone in the official Discord.js server
why does discord fetch my meta tags only sometimes
Is it me or do the votes get reset back to 1?
let role = msg.guild.roles.find(r => r.name === "NSFW")
if(!role) return msg.reply(`${role} does not exist, let me make it for you.`);{
msg.guild.createRole({
name: 'NSFW',
color: 'RED'
}).then(role => msg.reply(`I created the role ${role.name} for you. Enjoy!`))
}
if(message.author.roles.has(role.id)) return message.reply(`${message.author.tag} Has the role I am letting them continue.`)
await (message.author.addRole(role.id))
Why isn't this making the role?
I get 0 errors
and I am confused
@earnest phoenix hmm, is there a way to make it show total count instead? The API seems to show the resetted count and it also seems to affect search results
Whenever someone can help it would be lovely :3
no changing how the site displays it
r u on master or stable neko
Stable
Hi
@earnest phoenix oh ok, thanks for the info
npnp
its primarily to promote the more favored / active bots
and let bots that arent used be put in the back
thats what i think at least
@lusty dew handle your errors
And maybe learn JS too...
whoa
I just made a slight mistake
Easy
Well
if(!role) return msg.reply(`${role} does not exist, let me make it for you.`);{
msg.guild.createRole({
name: 'NSFW',
color: 'RED'
}).then(role => msg.reply(`I created the role ${role.name} for you. Enjoy!`))
}```
It is not nice hearing people to tell you to learn something when you are trying
That code right there tells me otherwise
I fixed it
if(!role){
msg.reply(`${role} does not exist, let me make it for you.`)
await msg.guild.createRole({
name: 'NSFW',
color: 'RED'
}).then(role => msg.reply(`I created the role ${role.name} for you. Enjoy!`))
}
Maybe they're an erlang programmer.
await promise(...).then(...)``` Please don't do that
And just because you fix an error doesn't mean you know a language
I understand that
Never said I knew js because I fixed the error
Anyway
Bye
No need for an argument
or a mute
I don't understand why people get so standoffish when someone tries to point out their code issues...
that's exactly what it is
I tell you what I suggest, and you call me a dickhead
10/10 man
:/
Hmm
Yes, because your code tells me that you do
Simple as that
Now stop the conversation on it
If you think of it that way...
Before you get us both muted
Just hear me out please...
When someone says you need to learn something, they aren't insulting you...
they're pointing you in the right direction
Hmm, you need to work on tone a bit.
They don't want to you make the same mistake over and over
I can see where you're both coming from.
well, telling someone "go learn js" while they're trying to learn is something like telling someone "go learn how to drive" when they are driving
it can be seen as insulting
Making a Discord bot is a terrible way to learn.
Aka learning the library before the language
It is my way of learning
hey, if someone wants to learn how to drive by drifting let them be
I like you Tim
xD
Yes, but when they expect help Tim, they drive us crazy
but eventually they'll become a drift king, and you wont
even if it takes 20 years
You want to help them, but at the same time you want them to be independent
i did too
texlo was uh a bit insulting depending on how you take it
Regardless of it it's from a bot or not, there will be some core concepts involved.
brb
but there is indeed a huge difference between someone with 0 js experience and someone with a bit of web development experience like i had
And the use of ellipses would suggest an insult in most cases where you can't actually hear tone in their voice.
if the issue is strictly learning js, i believe the best way to learn it would be through web development and standard use in browsers
@hidden ginkgo You can't be too "truth-bending". I don't sugarcoat things
If you don't know it, I will tell you stratightforward
I'm not going to lie to you
Yeah, that's fair and personally I'd appreciate that.
^
We aren't all brewed from the same teapot though.
In neko's case, he presented code that categorically proved he did not learn the fundamentals of JS
He said he was learning. basic if blocks are one of the first things you learn
drop it please
Please drop it
I made a damn mistake
I am human, humans make mistakes
Your mistake isn't the focus of the conversation now
Okay...
I tend to give people the benefit of the doubt when they say that...
It seems like it
It's more about how we approach these situations
Programmers are a misunderstood breed of people
They mean well, but everyone thinks they're assholes
¯_(ツ)_/¯
😄
You need this.
ESLint lints your code and finds errors
finding a good config is a pain though
I'll share mine if you want it.,
there are several linting plugins for sublime text, if you use it
That's my baby
A question I asked earlier but I think got lost; when you make a bot in js, can you hot swap files like you could with something on the web?
what do you mean hot swap files?
For example, with Java I have to recompile, and reinitialise every time I change something.
with js you just need to restart node
Well, JS isn't compiled, it's interpreted
^
so you can actually restart the application in a few seconds once you change a file
Tools like PM2 and nodeman can do this easily for you
So you do have to restart the application is what I was getting at.
Yes you do
its possible to modify files without restarting the application
if you code it that way
for example, require files, and have functions/commands to re-require the files
Oh I think I understand better.
That makes sense, seems like dev can be pretty fast then
I have a "reload" command, but I barely use it
big oof
I just restart with PM2
pm2 has a "watch" option, where it watches a file for changes, and restarts automatically if it detects changes
@hidden ginkgo are you good with require.cache?
I'd be lying if I said I had any idea what you're referring to.
I know basic web js, that's about it lol
Okay.
well in layman's terms, when you require modules, they are cached in the require.cache object
If you want to acheive the "hot reloading" feature you so desire, you can:
- Cache your modules (.js files) in memory
- Create a function that deletes the module from require.cache
- Re-require the file
- Re submit it to the cache.
yep, simple enough
I do it in less than 20 lines
Could be even less for you, depending on the scope of your bot
I don't think I'll be programming anything in Js any time soon, we've got another guy at work that handles that 
It'd be interesting to learn about how it works compared to how the Java counterpart does though.
mind if I show how I implement it?
Sure thing
reload() {
return new Promise((resolve, reject) => {
try {
delete require.cache[require.resolve(`../../commands/${this.category.toLowerCase()}/${this.name}.js`)];
const cmd = require(`../../commands/${this.category.toLowerCase()}/${this.name}.js`);
const clas = new cmd(this.client);
this.client.commands.delete(this.name);
clas.category = this.category;
this.client.commands.set(clas);
resolve(this);
} catch (e) {
reject(e);
}
});
}```
Don't expect you to understand everything, but I'll take it step by step
Not familiar with the key words, but I pretty much understand what that's doing.
Unsure about the promise bit mostly.
you don't even need a promise there
It's a promise constructor, I'm creating the promise
basically the promise resolves if nothing fails, and the command is reloaded
Is using exceptions for flow control good practice in js? 
If module cannot be reloaded, I reject the promise, and the parent function receives the rejections
@earnest phoenix Promise is useless
no async calls are made within the promise
You might as well just return something if it was successful
@hidden ginkgo when working with promises, it's basically mandatory
You have to handle your promises, especially in Node.js. Otheriwse, you'll be granted with errors such as unhandledRejection
or throw otherwise
wrapping your code in a promise doesn't automatically make it asynchronous 
function requireAgain(x) {
delete require.cache[require.resolve(x)];
return require(x);
}
function reloadCommand(name) {
commands[name] = requireAgain(`./commands/${name}`)
}```
How do I check if a user has a role?
@grizzled sequoia In this case, I have a parent function that is calling this method. I want to await the promise's eventual resolution, which I created by using the promise constructor.
Sure, the promise is optional, but I personally believe that it sets a good structure flow for when I'm writing my code.
To each their own.
Which lang @lusty dew
D.js
why 2 separate functions? are you ever going to re-require something without reloading a command?
@earnest phoenix I agree with the last statement but because the code is blocking there's simply no need for a promise, might be using the wrong term here but it adds overhead when it's all blocking anyway
Natan's method has a few flaws
He's won't be able to ensure in any way that requireAgain() witll be executed before reloadCommand
If he does it in two functions
reload() {
try {
delete require.cache[require.resolve(`../../commands/${this.category.toLowerCase()}/${this.name}.js`)];
const cmd = require(`../../commands/${this.category.toLowerCase()}/${this.name}.js`);
const clas = new cmd(this.client);
this.client.commands.delete(this.name);
clas.category = this.category;
this.client.commands.set(clas);
return this;
} catch (e) {
return e; // Check if typeof is error
}
}

Promise just adds overhead/unnecessary complication
Don't get issues like this in our clunky compiled languages, just recompile and reupload 
well thats what i do in js too
I will ask elsewhere then
@lusty dew there's always the discord.js docs
I have read them
Everything you'll every need is there
but I get an error
won't be able to ensure in any way that requireAgain() witll be executed before reloadCommand what
it's executed inside reloadCommand
Cannot read property 'has' of undefined
if(hMember.roles.has(role.id)) return msg.reply(`${message.author.tag} Has the role I am letting them continue.`)
await hMember.addRole(role.id)
@inner jewel but is it? I don't see it there
and God forbid I assume 😃
I prefer js version of inserting variables into strings
In Java you either concatenate or parameterize which is slow as hell
@lusty dew msg.member.roles.has("id") i believe
name should work too iirc, although prone to ambiguity
yeah, but in a neat way
I don't understand why you'd do it that way, but okay
i prefer using concatenation than templating lmao
instead like "this" + something + "this"
You don't handle errors at all
you don't either
you reject the promise
leaving callers to handle
mine will just throw
leaving callers to handle
just use a try catch instead of a .catch
is templating as fast as manual concatenation?
using a promise has zero benefits
in terms of cpu time
templating just becomes concatenation after parsing
so should be same speed to execute
Natan, you don't make any sense 
yeah
string.format is a different thing entirely
it's way more powerful than template strings/concatenation
but comes with overhead
either way the overhead is negligible
unless you're doing millions and millions of strings per second
@hidden ginkgo templating times doesn't really make much of a difference in nodejs i believe
if it's performance you're after nodejs is the last place i'd look
if it does that'd be stupid
because it'd be either a poor template implementation or two different impls when one would be enough
microbenchmarks aren't really reliable
also if that's just doing eval(benchmarkcode) it's flawed
because then it's considering parse times
a JIT-less node would be the best environment for that type of test
isolating each test to one process each
and running one at a time
and using a good old loop and timestamps before and after
@hidden ginkgo Tough to say. You'll never notice the difference in regular day to day use
But if you're really keen on knowing, you can run benchmarks to see
idk how they do it, but jsperf is pretty much the most used js benchmarking website
i guess with a deterministic environment you could probably get reliable stuff but those are rare
so i assume its safe to somewhat trust their results
but of course the results highly depend on context
for example, another test which outputs to console.log instead of just declaring a variable, results in a speed difference of only 5% instead of 99%
another different test i did just now, that pushes the result to an array, resulted in a speed difference of 50%
but generally concatenation is always faster
I'm guessing that's just because of overhead though, at least it is in Java.
Concatenation is converted into the equivalent StringBuilder, while String.format is that but precursed by a Formatter
@queen sentinel
is there a way to simulate a vote to test functions regarding votes?
o that kind of voting
i need help
I have a file with an option of Owner as some roles
I mean Owner = Some roles
i want to make a code with staff list and i need this code
let staff_num = message.member.roles.find("name", "owner").members
but instead of searching a role it will search the option Owner
should it be something like
message.guild.members.filter(m => m.roles.some(r => r.name === "Owner"))
no need to filter every member and check for role name.
guild has roles prpoerty which is collection of roles
and roles have members collection
Anyone know a way you can jump like 5 seconds ahead in a voice channel playing music thing? ¯_(ツ)_/¯
discord.js
@earnest phoenix lavalink or ytdl-core/ffempeg ?
second one ^
ah...
https://www.npmjs.com/package/ytdl-core look there
there is a begin option
so u get the current time playing then u play again from there
idk if u can go ahead
ok
🤔 I didnt know that role has a collection of users lol @earnest phoenix
members. but yes in d.js they do https://discord.js.org/#/docs/main/stable/class/Role?scrollTo=members
guys how can i get the servercount ruuning and working ,can someone give some details
you have to post your server count to dbl API
I hope you know how APIs work, cause I aint helpin that far
and how shall count the guilds?
is that up to me
or there is any useful function
your discord client object suppose to have all guilds cached, so just get it's size and post that to API
nice i can make a loop and check for every 5 hrs or so thnx for help
-bot
hello all anybody know how to maby fix this error ? http://prntscr.com/l21f87
error says cannot read property filter of undefined
and since u never learned basic concepts that doesnt make sense to you 
but files is undefined
if you say so tom but oh well i forgot that your a pro in everything that you do
oh and nextime keep your salt to yourself i have come here for help not your SALT
@earnest phoenix
I believe it
Well first of all you should read the first error @slate kayak
it can't find a folder
Therefore leading you the property error
error saying cant folder doesnt exist
cannot read property x of undefined
salty when pointed out 
classic DBL

but honestly it's not that hard to understand the error
salt is what makes a good helper

Anyone know how to make a blacklist command, that when a user is added it blocks them from using commands ?
@earnest phoenix u know how to use dbs?
Somewhat.
bot test?
there is no such thing as hack proof, everything can be hacked. but regarding discord bots, the most common vulnerability is if you leak your token, so as long as you make sure to never accidentally make your token public, you're good to go
other possible vulnerabilities are leaked VPS ssh keys or auth information, or an open eval command
oh god finnaly now i can make sure i dont have any vulns
like command injection
i doubt it is also possible
its only possible if you have an eval command, or similar
or if you make your bot with php and open sql queries
and where i woul dleak my token i wonder
lmfao
did someone hack my accoun tlol
no
most people put their bot on github or similar, and forget to exclude their token files
thats how "hacking" happens
how to not get your bot hacked on discord:
- properly secure your commands (just an id check is enough)
- learn how to use gitignore/whatever ignore file your VCS uses
i host on vps, but i push directly via ssh
if i get backdoored im fked
i just use git so i can roll back changes easily
how do I get a bot info by the client id
GET /users/:ID
I'm talking about the discord api
and i am too
oh ok
lol i wonder what if a pass a wrong int to dbl api updatestats function
when i try to use lavalink 3.0
i get this error
(intermediate value) is not iterable
you mean a fake server count? @earnest phoenix
there is nothing stopping you from doing it, but if you get caught you'll probably get banned xd
there was some dude who was apparently accidentally posting double the server count because he had 2 shards
😂 😂 😂 😂
hi \o
oh i though @rocky spire was @quartz kindle
daaaaaaam homie
because you are the best
@south finch how are you bro. i love ya lad
wat
yeah
yeah
we share our stuff together
so i didnt know so i shared our stuff with the other dude
sorry tim
wtf
Is there any thing to know if a bot is down ? Like on the website, there's a logo (online or offline) and I was wondering how the status was checked.
Or just, a loop checking something every 30sec to know if the bot is getting down ?
The way the website knows the status is if the bot is in this server
im pretty sure the website checks the discord api for the bot's online status on page load
Yep but its not instantly refreshed and that's normal
I need something to know directly when something goes wrong and the bot is getting down
if its your own bot, the best way is to do that server side
using some process manager
that alerts on process change
well, first decide how do you want to be notified
by discord? by email? by text message?
I don't want to be notified, I want to restart the raspberry when my bot is down
oh thats way easier
Use pm2
pm2 autorestarts when a program crashes
But ... I'm using screen package
is your bot in node.js?
No python : the script is running in a screen
well, im sure there are many ways to auto-restart a python script on crash
pm2 can run python btw
hey bois
example
I am running my Python script in the background in my Ubuntu machine (12.04) like this -
nohup python testing.py > test.out &
Now, it might be possible that at some stage my above Python ...
Its more difficult cauz the screen is getting closed when a script has finished running
oh pm2 can run python, didnt know that
They have interpreters
if you run pm2, you dont need a screen
iirc if you are able to catch the process id from another process on a unix machine you should be able to check if it crashes
if your PI is running linux, and you access it via ssh, you can install pm2, and run pm2 start script.py
ye
pm2 will automatically create a process and manage it for you
no need for screens or tmux
Oh OK, I'll check that
and you can check status, amount of crashes, last error, ram/cpu usage, etc
I suggest also specifiing interpreter as well when running it
just so it runs the right lang
who knows if it could fail so
i was using tmux with while loops directly in terminal before i switched to pm2 xD
I don't really know this app but I'll learn how its working
o shit pm2 has an enterprise version
Thanks a lot guys for your advices and have a good evening / day (10PM for me XD)
Anyone know why when I do my eval command it sends like five of the same messages.
you probably have the multiple instances of the bot running
if it is just for the eval message then not
no he probably has multiple instances
How..
Does anyone know of a npm package that can generate images of source code based on the code I send it
like a source code image generator api
No mentions probably
also isn't avatarURL()
Members don't have usernames or avatars, users do
@smoky spire
msg.mentions.users.first()????
Yes
Ty @smoky spire
.first() is discord's collection method for the first value
mentions.users extends discord collection which extends map
What are you trying to get at
@earnest phoenix its avatarURL in 11 and avatarURL() in 12
btw @smoky spire that won't work for people without avatars, to make it work for them use displayAvatarURL instead of avatarURL
Yes I know
How would I go about localizing my bot, as in supporting multiple languages? I'm using Discord.js
you learn different languages
or have translators do it for you
google translate 
make a database of strings/texts by language instead of hardcoding your dialogues
^
oh god
l o l
I am the bot developer for a roblox server -_-
oof
for discord.py, anyone know what this error means?
Task exception was never retrieved
future: <Task finished coro=<ConnectionState._delay_ready() done, defined at /home/runner/.site-packages/discord/state.py:166> exception=ConnectionClosed('WebSocket connection is closed: code = 1000, no reason.',)>
Traceback (most recent call last):
File "/home/runner/.site-packages/discord/gateway.py", line 447, in send_as_json
yield from super().send(utils.to_json(data))
File "/home/runner/.site-packages/websockets/protocol.py", line 330, in send
yield from self.ensure_open()
File "/home/runner/.site-packages/websockets/protocol.py", line 422, in ensure_open
raise ConnectionClosed(self.close_code, self.close_reason)
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1000, no reason.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/runner/.site-packages/discord/state.py", line 185, in _delay_ready
yield from self.chunker(split)
File "/home/runner/.site-packages/discord/client.py", line 1680, in request_offline_members
yield from self.ws.send_as_json(payload)
File "/home/runner/.site-packages/discord/gateway.py", line 450, in send_as_json
raise ConnectionClosed(e) from e
discord.errors.ConnectionClosed: WebSocket connection is closed: code = 1000, no reason.
@hybrid shadow tried switching eq to experimental?
wdym?
what os are u using
i dont have full control on that site
oof
U*
what abt this error:
Exception in thread Thread-7:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.6/threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "/home/runner/keep_alive.py", line 20, in run
app.run(host='0.0.0.0',port=8080)
File "/home/runner/.site-packages/flask/app.py", line 943, in run
run_simple(host, port, self, **options)
File "/home/runner/.site-packages/werkzeug/serving.py", line 814, in run_simple
inner()
File "/home/runner/.site-packages/werkzeug/serving.py", line 774, in inner
fd=fd)
File "/home/runner/.site-packages/werkzeug/serving.py", line 660, in make_server
passthrough_errors, ssl_context, fd=fd)
File "/home/runner/.site-packages/werkzeug/serving.py", line 577, in __init__
self.address_family), handler)
File "/usr/local/lib/python3.6/socketserver.py", line 453, in __init__
self.server_bind()
File "/usr/local/lib/python3.6/http/server.py", line 136, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/local/lib/python3.6/socketserver.py", line 467, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
Hey anyone run into problems with voiceRecieve.on('opus' not receiving events?
who do humans ping mee
does anyone know mySQL very well and fancy looking at two queries and telling me why one works and the other doesnt?
show maybe i can help
@earnest phoenix
this doesn't work:
SELECT *
FROM ocelotbot_spooks AS spooks1
JOIN ocelotbot_spooks ON ocelotbot_spooks.id = (SELECT min(id) AS next FROM ocelotbot_spooks AS spooks2 WHERE spooks2.id > ocelotbot_spooks.id AND spooks2.server = ocelotbot_spooks.server)
but this one does
SELECT *,
(SELECT min(id) AS next FROM ocelotbot_spooks AS spooks2 WHERE spooks2.id > ocelotbot_spooks.id AND spooks2.server = ocelotbot_spooks.server) AS next
FROM ocelotbot_spooks
@bitter sundial now for real why would you need an api token for like quering top bots sorted by server count as example
What output are you getting?
its kinda pointless imo
@restive silo to control api abuse, like scraping
ah did it go that bad?
well i mean i understand that then for like security reasons its fine i guess,
well currently the api/bots* requires no auth and has a limit of 500 so people can "scrape" the whole site in like 10 requests
that will just make people actually scrape the website and do more requests by doing so 
okay now it's maybe offtopic development question
The Scenario: A hosting company calls you and explains that they developed their own in-house control panel. However, they wish to move away from it to a more feature-complete commercial control panel that contains all of the standard features that website owners are looking for. They wish to eliminate development costs associated with maintaining their own control panel so they can get back to providing shared hosting more efficiently.
Is cPanel & WHM “The Hosting Platform of Choice” for this user?
is it?
uuh its a choice
now whether its the choice would depend to actual specifications of their in-house control panel and whether a combination of WHM and cPanel would be sufficient enough
discord.js, is it possible to get the user's role colour?
no
Ok
Is there a way to get a members role colour?
find their highest role and check the color of that role
doesn't member have a color parameter in d.js or something
Thanks
oh they do? lol I didn't notice that when I looked at that before 😄
should've known tho
So member.roles.displayHexColor
no
Would that be right?
read the docs
I did
displayColor is a property of GuildMember
Oh
Well it's going off a ping, defined as mUser
So mUser.GuildMember.roles.displayHexColor?

i'd recommend learning the language/library properly before making a bot
it's a second, or a third week he's been asking these kind of questions
Oh, so remove roles
botum hala test edilmedimi
No, displayHexColor is a property of a member, not a role
Right, looked at roles and is it just hexColor
That's what it said on guildMember.highestRole
@smoky spire right?
You said you just wanted the color that the member shows right?
just use member.displayHexColor 
again, learn the library
mUser.displayHexColor
you could find the answer to your question with a simple ctrl + f on the docs
not ust the library, they will keep asking these stupid questions cause they've been doing it for 3 weeks I think
Will you test my Discord botum?
Do you guys this this would be confusing? like do you think people would try -auto reset premium
https://i.imgur.com/KPsWxFv.png
What does it do
well i mean
the explaination for what auto reset is
is on that second hyper link
but do you think the premium bit is confusing
I was thinking you could do [Premium] or smth like that
uh
😳
hmm
maybe directly below it?
Hi niko.
I'd say either that, directly above in a smaller font, in a red [P] before it, or possibly even as another line after Required Permissions
how about making it a tag (might misled users into believing that it's not a link)
That could work also
@abstract crystal I dont believe I have that much control
is this a website, if i may ask
hello to all, can one help me with a very simple bot? He should only choose a random user with a specific role. (Python)
python*
@abstract crystal kinda
you right xD
so you want to get the role (you can get it with the discord.util.get) then use role.members to get the list of members and use random.choice to select a random member
first Thank you
i try it but i must say, im a noob in coding, i think i need more help 😅
@hushed berry is there any wiggle room with css? (i'm guessing probably not) only thing required would be background color and border radius
@unborn estuary remember: documentation is always your best friend
http://discordpy.readthedocs.io/en/rewrite/
yeah, actually, there is 😊
maybe but my english isn´t so good
but i try it
thx
i just have absolutely no clue how to use it
Are you german?
yes
Das ist ja schön c:
hehe hi ^^
its ok

.tag {
align-items: center;
background-color: #f5f5f5;
border-radius: 290486px;
color: #4a4a4a;
display: inline-flex;
font-size: .75rem;
height: 2em;
justify-content: center;
line-height: 1.5;
padding-left: .75em;
padding-right: .75em;
white-space: nowrap;
}
and the html would be
<p>-auto reset <span class="tag">premium</span></p>
@hushed berry
so uh
how would i make my bot have multiple prefixes through an array
like
i know how to do
{guild_id: "prefix"}
check if first matches, if so run command
*/eval
let a = ["*/", "this is so sad */", "*/*/"]
let strong = "this is so sad */ping"
a.forEach(prefix => {
message.channel.send(strong.startsWith(prefix))
})
if not, repeat with prefix 2
alright
i'll try the if statement thing
and if that doesn't work i'll use an idiots guide
OwO
i really appreciate the help
its not perfect
i couldnt figure out how to define a new element
so i kept the superscript and just applied the css to that instead
which works, i guess
right?
well it works xd
maybe ill have to submit a ticket or something to ask how to do that thing
but ty anyways 
it looks much nicer
also eww
i hate that pepe blush
lol
@abstract crystal isn't that the Bulma tag
bad
and a bit modified
uwu

um a lot of sites
then host it on your own
well that would defeat the purpose of this then!
wut
is external stylesheet too much to ask?
What are you even making ur weebsite with
how do i get the 300 characters
<div style="display: none">
this broke
yeaaaaaaaaaaaaaaaa
yeeet
</div>
but it didnt work
lol
....
To get 300 characters you type more
Actually make a meaningful description 
Just add a shitload of css
nou
copy and paste entire bootstrap
i dont know for a description
If dbl was made with react I bet it would be 100 times 👌
react™
yes
uhhh
random words then
No
lorem ipsum
Spam to fill long desc gets you declined
lorem ipsum
inb4 bot declined
hahayes


ol
@languid vault yeah, you actually need to have something there for it to pass verification lol
?help
no !help is better
is there any alternative to npm forever?
it works nicely but i cant see console and error
s
pm2
systemd
im figuring out pm2
seems better
this ubuntu
driver support absolutely terrible
but pm2 gives me remote access to keep an eye on bot ;d
what's the best way to store commands (their names): a db or in json
i just have them in an array somewhere in the main file lul
but i'd like it to be dynamic
like enabled/disabled?
or per server configuration?
then you need a db yes, to keep track of server ids
json also works, but db is safer
with or without restarting the bot?
restarts
then you can have each command in a file in a folder, and on bot startup read the folder
that way you can just create a new file and your bot will see it automatically
Does anyone know if sharding will improve my bot's ping?
improve your internet to get better ping
hola una pregunta
alguien me recomienda un bot parecido al @runic bridge
ty mini mod
other langs in #memes-and-media
no
for your bot?
Ya
is it hosted on ur pc
thats 2 bad
move it to a server close to discord
like i said improve internet
aka us east coast
Ya the server is in CHicago
Yes I have full access
I host mine in N.Y. and i get ~ 22-28ms
Well my bot is weird
Sometimes it has really good ping
And sometimes it has really really bad ping
And its affecting the bot's server count and stuff
rip
ur using same internet?
whats the ping you're getting?
until 200ms on average its considered normal
optimally, you would have 60-100ms
Im getting more than 10 seconds ._.
what the fuck
whoah
Sometimes it can go up to a minute
are you sure thats the bots ping and not some code problem?
maybe try changing servers?
That would cost money
hosting in N.Y seems to do well for some bots
@ivory pebble how much do you pay for your vps rn
why dont u use ur own host
there are many VPS with free/trial options
Im using galaxy gate, 10$
how do you have that bad ping
I dont know..
im using Galaxy Gate same plan and i get 20ms
galaxygate has very good reviews here, it shouldnt be that bad lol
isnt it just better to host by yourself?
No
no
no
why lol
It might be my music system thats causing this
consumer internet vs dedicated server internet
consumer internet sucks
its unstable
slow
etc
GG has unlim bandwith so idk if its music
Ya its really weird
you can try asking in their support server
if your music is using a lot of bandwidth then it could be the issue
similar to how torrent makes your ping go to 2k+
try disabling the music temporarily?
or use lavalink
Music is the only feature of the bot 
That would be a problem if I disabled that, since its a music bobt
still, its worth a try
try a simple ping command
with and without music
if ping is normal without the music system running, then you have your answer
and the problem is the code, not the server
Okay
try making a new bot with only a ping command, and shut down your main bot for 10 seconds to test the ping
See
The bots ping isnt always bad
It becomes bad after I run node index.js by like 3 hours
or sometime like that
then its possible you have a memory leak or something
Okay, well thanks for all the help
Hey
@wicked summit are you using express?
Umm already know it
ok
so if my bot doesn't have the permission to do something in a guild
should it be
if(client.user.hasPermissions !== "some-value-lol-foobar") || if(message.guild.me.hasPermissions !== "some-value-lol-foobar")
i feel like client.user.hasPermissions isn't a function
so
if(!message.guild.me.hasPermission('EMBED_LINKS')){
// do stuff
}
Progress
Can somebody tell me how can I mentions specific server in js
I need to disable level up and coins messages from this server
anyone here maybe can help me ^w^
i got confused 3 hours
So i want make an JSON to save a image using a link in GLITCH
this https://sharif.glitch.me
but i'm confused why the images can't randomly sended there.
my code:```js
var express = require('express');
var http = require('http');
var app = express();
// pinging
app.use(express.static('public'));
// http://expressjs.com/en/starter/basic-routing.html
let img = require('./image.json')
let rstatus = img[Math.floor(Math.random() * img.length)]
app.get('/', function(request, response) {
response.send(( {image: rstatus} ))
})
// listen for requests :)
var listener = app.listen(process.env.PORT, function() {
console.log('Your app is listening on port ' + listener.address().port);
});
setInterval(() => {
http.get(http://${process.env.PROJECT_DOMAIN}.glitch.me/);
}, 280000);
Is if(message.guild.id = “id”) a thing?

no its json
i put a link image there
and want get it randomly
but
can't random
Ooh
@earnest phoenix yes but you need to use normal quotes: "
Hey everyone
is anyone familiar with digital ocean ?
How much time can i host my bot with 50$ ?
I've heard ovh sucks
Actually i'm using Heroku
it's totally free
i have never had a problem with ovh
but i sometimes get memory leaks
is it pricy ?
cheapest host i can think of
much moreso then digital ocean
but if you need the support structure
i would go with Digital ocean
if you have a good grasp on how server management and maintnance works
ovh
on digital ocean
they start at 3.30 a montht for 2 gigs ram
Can someone give me a code line for my bot.js? It keeps crashing after 24 hours (thats not the problem) but the problem is that it wont start up automatically again!
pretty affordable
@paper zinc are you running it with PM2 or nodemon?
or just 'node blah.js'
Wtf is both of that
thanks uber
i use node blah bleh oh my mac pro in the corner of my room
what kind of server are you hosting it on
ok
soe if your running it off your pc
pm2 will run it and if it crashes etc it will instantly restart
0 downtime
just install it
and run 'pm2 start blah.js'
here
How do I do for this part
npm install pm2 -g
pm2 start 'blah.js'
pm2 list
i use it on my server
works wounderfully
and it stores files to cache i believe so when you change files it wont effect till a restart meaning 0 downtime
@earnest phoenix you can write text directly
use markdown like in discord
or use html
pm2 is lovely
there's a button to preview so you can test what you want
but read its docs
or else youll be lost
I put the code of my bot
if you want a easier solution but less stable and more thrown together i guess you could run it on nodemon
he put the code of his bot
ded
It is mandatory
no
it is not
no
haha ! XD
i have a french friend irl, only thing he taught me was swearing
and slang
wesh
wesh is not french
`npm install pm2 -g
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! stack: 'Error: EACCES: permission denied, access '/usr/local/lib/node_modules'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/admin/.npm/_logs/2018-10-06T08_40_55_276Z-debug.log`
from north africa people








