#development
1 messages · Page 683 of 1
Definitly, express also builds around the http module (afaik)
I think it makes routing and parsing a lot easier
(and parsing paramaters in paths etc. like /projects/:id/stuff)
oh
because in rest apis you do
/projects/some id here/tasks a lot
and parsing the parameters yourself is cancer, while in express you just do
app.get('/projects/:id/tasks..
and later you can access the id with req.params.id
im using restana in my api
but basically there are 375398457 http abstractions, just chose one lul
I mean, you have a bunch of options,
fastify, express, loopback (what is built on express)
just use what looks best to you, lol
Anyone able to help me out on this?
Running my own Windows server:
I have 2 bots (A&B) (dotnet core), which I want to run simultaneously.
Bot A gets launched fine, but starts 2 instances, thus sending command output twice
Bot B gets no instances at all...
(starting them through a batch file with 5sec delay in between them)
That's what I'm doing
then it should be fine. Something in your code is going wrong
cd DirA -> start "BotA" dotnet run ... -> timeout 5s -> cd DirB -> start "BotB" dotnet run ...
Ah nevermind, apparantly I forgot to change the drive when copying files over from my dev machine to my server
I'll point out the fact that I'm an idiot myself, so you all don't have to! 😂
Actually wanted to laugh at you for using a windows server, but from my experience Linux with dotnet is cancer

hello anyone whos good at js here? help please
dbl ask2ask @crude tide
Dont ask to ask
Just ask your question
it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.
what is the difference between the stream#close and the stream#end event?
(nodejs)
found it, end means there is no more data to write, and close means it closed
I get this in debug when trying to turn the bot on
URL: wss://gateway.discord.gg
Recommended Shards: 1
[WS => Manager] Session Limit Information
Total: 1000
Remaining: 0
[WS => Manager] Spawning shards: 0
[WS => Manager] Exceeded identify threshold. Will attempt a connection in 4155597ms```
bot wont start
Oh now it's online
But nevertheless what does that mean and how to possibly prevent it
don't login more than 1000 times a day
Lmao
how tf do you even manage to cross 1k logins a day without being in like 10k guilds
U dont have any shards
U have only single bot
That's why it don't show shards
In your bot, only server count

?
Wdym?
Explain
I can't get what u talking about
Hmm
Explain
I'll get it
May be
Widget
Hmm
Bot's Edit page unless you mean in the code

heeeelp, I need to convert from MP3 to PCM, but I only get WSHHSS
using node-lame
const encoder = new Lame({ output: outputFile, bitrate: config.audio.bitrate, raw: true, meta: {} }).setFile(inputFile);
await encoder.encode();
don't know anything for node but you can use ffmpeg
^
ffmpeg is good for this kind of stuff
yeah but I couldnt get it to convert pcm to mp3
nvm found something
its with streams but that will work too
fcking shit, now I can convert from mp3 to pcm but not back
this is all cancer
I can see it coming, I will just save the raw mp3 because I couldnt get it to work
this is bad
for items in raw_items:
countval = ([item[0] for item in raw_items]).count(items[0])
if countval == len(taglist):
pre_result.append(items[0])
the finished filtering shows how long it takes to run the code above
can someone find any way to optimize it?
raw_items has the form [[i, v][i, v][i, v]]
is that seconds or miliseconds?
if its miliseconds, 0.16ms is more than good enough
@quartz kindle its seconds
it's n^2 comparisons
wheras n is amount of items in raw_items
so you need to compare each item to all other items?
i dont understand that very well since it doesnt look like javascript
but if i understand correctly, there might be repeated comparisons you could avoid
as well as looping over numbers in a for loop should be faster than looping over items in a for in
@latent oasis where is that widget customizer?
@quartz kindle it's a rather complex one, both i and v can appear multiple times
hmm, is there an example you could provide?
@earnest phoenix no, I don't
Well you didn't say that ;)
...
So, I have a bit of a problem.
I recently ran into an annoying problem with one of my bots where it failed to connect to a certain couple of guilds once in a while
Somewhere during the process of getting the presence or something. "Unable to load json" or something.
I assumed it might have been because I was running v2 of Discord4J, weird considering other bots running it have no issues, and began to rework it into v3.
I got a good bit of it down, but one of the things I can't figure out is how to send files. Is it even possible in v3?
I apologize if this is a stupid question, but I'm new to v3 and reactive programming as a whole.
Java
Had a bot running 2.10 I believe with a mixture of v3 for music stuff
Worked fine until the weird error causing it not to work with a certain guild.
After a while, it went away. I assumed it was maybe something on Discords end until it popped up again. Not wanting to risk downtime, I started searching for a solution.
Unfortunately, I couldn't find any info on the issue and assumed it was perhaps due to v2 running outdated stuff.
No problem bud, thanks anyway!
Can anyone help give some examples of customizing a bots page?
Just certain text colors and the background
Hey my mac friends, while using git, have you ever gotten errors like this when trying to git add files?
warning: unable to access '/Users/<my username>/.config/git/ignore': Permission denied
warning: unable to access '/Users/<my username>/.config/git/attributes': Permission denied```
Ping me with responses thanks
looks like a ownership problem ¯_(ツ)_/¯
https://stackoverflow.com/questions/45204413/unable-to-access-users-dida-config-git-attributes-permission-denied if you havent seen this already @zealous veldt
will try it, thanks
Build master a21a66e8
There was an issue deploying your app. View the build log for details.
-----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
! Push failed
I get this error everytime I try to deploy the branch to Heroku
And apparently I need to deploy rhe fucking branch to it or it wont host it

I'm writing an image manipulation API for my bot, but how would I go about storing the images I made? should it be sent as a buffer or should I store it internally and send a link, or what...
what up bois
Promise { <pending> }Today at 7:08 AM
I'm writing an image manipulation API for my bot, but how would I go about storing the images I made? should it be sent as a buffer or should I store it internally and send a link, or what...
it depends on what you want to achieve
you'd usually always want to send the buffer
Does someone knows why user.bannable is undefined?
http://owo.sh/ABjg6Bo.png
http://owo.sh/NEQjmzd.png
the user is on the guild
and user seems to be ok
http://owo.sh/5rmU32N.png
hold on
nvm
I had to use msg.guild.member(user).bannable instead of using user.bannable
Restoration 100
Or message.mentions.members.first() should also work... @wheat jolt
^
I fixed it
Cool
Alright
Why does this happen on some shards on my bot?
https://cdn.discordapp.com/attachments/223867697312694272/616549158467403777/unknown.png
And removing the limit on emiter wont work
you have too many event listeners
either you're using duplicated events, like having .on("message") multiple times in your code, or you're using a lot of collectors and possibly not shutting them down properly
They have 11 listeners for guildMembersChunk
Let and const are block scoped
Also that code in general is really badly written, ngl
No, that’s not what that means.
Also don’t use JSON as a database
Lol
if (args.join(" ") == " ") wat
IKR
you are not checking if user is a bot. you are completely replacing user with user.bot
That whole file is filled with bad code like that
^
lol
let him experiment and learn
i told you why
you are replacing user with user.bot
so user no longer exists
when comparing, always use === or ==
Those two code blocks do the same thingjs let user; // If the user mentions someone, display their stats. If they just run userinfo without mentions, it will show their own stats. if (message.mentions.users.first()) { user = message.mentions.users.first(); } else { user = message.author; }``````js let user = message.mentions.users.first() || message.author;
Except one is more concise
It is
Your user is wrong because you redefine it
Also don’t use JSON as a db
Not the brightest idea mon ami
Your call
Lol nice joke
Anyways have a nice day
i didnt tell you to not use the user
i told you to compare it correctly, ie === not =
= means you're assigning a new value to it
aka, replacing
= assigns a value
== check value, not type
=== check value and type
also, to check if a user is a bot, you dont need to compare anything at all
you just do if(user.bot)
because if expects a true or a false, and user.bot is always either true or false
dont directly use, but its a dependency of a shit ton of packages
Yeah
I met someone online who used node but didn’t know what lodash was, which kinda surprised me
lodash itself seems like a useful thing, i just never found a need for it
i get annoyed when stackoverflow solutions tell you to use lodash for something simple
Lmao
i mean, why use a 17k line library and do _.divide(5,7) when you can just do 5/7
its like a js library version of a generic discord bot with 400 commands
its usefull for cloning and setting/getting/deleting nested propertys with dot notation strings
well if i need to do something like that, i usually just devise my own function
some dependencie has it installed anyway
That’s like saying “well if I want to interact with the Discord API, I’ll just write my own Discord API wrapper instead of using d.js” @quartz kindle
Yes, but my example is only one function, not an entire interface lul
Although writing my own lib does sound attractive
Lmao
I wrote one before but I got rid of it cuz I didn’t see the point in having one lmao
It was much better to just contribute to an existing lib
It was written in TypeScript and used a lot of TypeScript features like decorators and shit
if (user.bot) 
if (user.bot === true) 
if (!!user.bot)
At this point, just rewrite that in jsfuck
Or make a discord lib written in jsfuck
I’ll do that once I get home
like
Re-write eris in JSFuck
Okay actually I should finish my rewrite but I never do it
Lol
just stuck on this annoying problem for weeks
What is it
and this evening I will try the solution I didnt want to use, but probable have to cuzz nothing else works
converting audio
Must be tough
I got it
PCM => Mp3
working,
but not
MP3 => PCM
no its probably easy, I'm just retarded
Just put in an uno reverse card

Bam done
you are using await outside of an async def function
asyncio 
xd
it worked before
hm ok
Not really sure what you're trying to do there apart from running the bot
Either way, get_event_loop().run_until_complete in asyncio might be helpful
Perhaps
if you don't use .run, that is 
literally could just make a simple function or use client.run directly
I'm trying to make it restart on error (again)
pm2 
systemd
what would be the equivalent of client.shard.id on d.js master?
lmao even better, why am i not getting any logs on this
const { ShardingManager } = require('discord.js')
require('dotenv').config()
const manager = new ShardingManager(`${__dirname}/bot.js`, {
token: process.env.DISCORD_TOKEN,
totalShards: 1
})
manager.spawn()
manager.on('shardCreate', shard => {
console.log(`Launching ${shard.id}...`)
})
if i had to take a guess, i'd say you're spawning first and then telling it to log when a shard is created
trying putting the on method above the spawn
huh that worked, thanks
now i just need to figure out how i would do client.shard.id on master
guilds have a shardID
other than that, master has client.shard as well~
with .ids instead of .id
because of internal sharding, each process can have multiple shards
ah, so the first element of ids is what i need since i dont use internal sharding?
yup
shit i hit 2 by accident lol
You must shard at 2.5k
it's suggested to start sharding at 2k, enforced at 2.5k
i start the bot with sharding in mind to not have to rewrite lots of bullshit later 
Internal sharding makes it easy in v12
i think discord's fetchRecommendedShards gives you 2 shards starting from 1500 guilds
you guys know any services that provides you with an url, that you can manage and redirect to other url's ?
sssoooo, basically dynamic url shortener?
haven't of that before
How does guild distribution over shards work
As most times they aren't even at all
Is it random?
Based on users?
And who decides what shard a guild goes on
Like is it a discord thing
Or does the library do it
@copper cradle thank you, i'll check em out
Many questions
@mossy vine @earnest phoenix yes it is
if you start 5 shards on a 2 guild bot, you'll have shards with zero guilds
i started 2 on 3 
@late hill shard_id = (guild_id >> 22) % shard_count
i thought they just kick you from the gateway
starting 2 shards on 3 guilds can have all 3 guilds on one shard
due to the formula
eg all guilds were created on an odd timestamp
they'll all go to shard 1 of 2
huh thats interesting
Oh
hmm, you guys know how an url, is "auto opened" when it's a gif or image
is it possible to do that for an url that's forwards to an image or gif
dunno wot u mean
like this
the url is for this gif
but when i paste it here, discord just opens it
how do i make discord do that for an url that is forwarding to an url that is like the above
afaik u can only do <theurl> for no embed
?, so you can't ?
well, not really. You would need to check that before sending the url
you know any other solution that would achieve my goal `?
it isn't opening it
it just takes the metadata and shows it
it's called web scrapping iirc
can you forward metadata
I don't know
well long story short, i can only use 1 url for embedded images gifs, etc.
and i'd like to occasionally change what image or gif that url is
but i don't have an easy way of changing the url manually
can't
or host the image on your own vps
hmm
any vps services you suggest ?
|| use the german version for lower prices ||
I dont usually say this, but glitch is enough to have a express server send some images, or not?
yeah if you are fine with it resttartiing your server from time to ttime
I mean, if its only image hosting, nobody cares
should be fine
@loud salmon help my bot borke when i try close logut window box
fuck
smh
WoA yOu aRe tHe OwNeR oF poKeCorD?
woah
Old topic but yeah VPS prices tend to be cheaper when you view it from a VPN outside the U.S... even more cheap if you view it from a VPN in a third world country
contabo is a german provider and is well known in germany, I think that explains why you dont have to pay setup fees if you order on the german website
Promise { <pending> }Today at 5:23 PM
Old topic but yeah VPS prices tend to be cheaper when you view it from a VPN outside the U.S... even more cheap if you view it from a VPN in a third world country
this
it's because of conversion fees
sometimes they're miscalculated which can get you like a dollar off
and sometimes it's just conversion fees being stupid
not the case for contabo tho 
I used contabo in past and what they list on their page is true
this always surpasses 1024 characters here
const embed = new Embed()
.success()
.title('Server Information')
.field(message.guild.name, `ID: ${message.guild.id}\nOwner: ${message.guild.owner.user.tag}\nCreation date: ${message.guild.createdAt}\nMembers: ${message.guild.memberCount}`)
.field('Emotes', emotes);
what is emotes
emotes = message.guild.emojis.map(e=>e.toString()).join('');
what if the emotes exceeded 50?
clearly it will throw that error
you need to find a way to make sure tthe emotes wont exceed 1024
How can I do that
for example :offline: an emote in string iis this biig
ohohhh
\
outside of the codeblock
:offline:
thonk
nah dont works
anyways
\ :offline:
wont really work
anyways the emote contains <:nameofemoji:id_here>
iif you tried to send it all in one go you will get that error
you need to limit the emotes you wiill send
probably use .splice
your choice
.map().splice()
experiment with values
start from 20 maybe
iif that errors make it 10
then iincrease it a litttle by little
untill you hit that error agaiin
or just you know
I diidnt memorize whatt III diid
well it works in most servers
split by last possible space that doesn't cross the char limit
how would i splice only when its a certain amount
iif (the length of mapped values exceeds some threshold) spliice it
http://xyproblem.info/ - the best solution is to split by last possible space
Asking about your attempted solution rather than your actual problem
if (emotes.length >= 500) {
emotes.splice(emotes.length - 500);
}
well the whole thing
@earnest phoenix is that your website too?
not just emotes.splice
nope
if (emotes.length > 750) {
emotes = message.guild.emojis.map(e=>e.toString()).splice(emotes.length - 200).join('');
}
What would I do to make something like this work
ooh
parseInt
i'm going to skim over this because i have to go in a few minutes; create a new number which has a value of 0, this will act as our index. then create an empty array of strings. do a while loop where the condition is if the index is smaller than the input string length. inside of the while loop, add an if closure, in the if check if index + 1024 is smaller than the input string length, if it is, add a string to our string array which substrings at our index and ends at index + 1024. if it isn't (else), just add our input string substringed at our index. finally outside of the if closure set the value of the index to index + 1024
can you give an exampel
no
ple*
this is a method that will preserve all words but split them accordingly to the limit (1024)
i believe discord.js has a function that can do that, let me check
yup, Util.splitMessage
oh my god
thank you
emotes = message.guild.emojis.map(e=>e.toString()).join('');
maxEmotes = Util.splitMessage(emotes, { maxLength: 950, char: '', prepend: '', append: '' });
@quartz kindle Did I do this correctly?
nope apparently not
why are you doing parseInt(1000)? lmao
1000 is already an int
maxLength should be the max length of the field, so about 1000
They for it for the same reason people do ```js
{some_string_here}
char should be the character on which to split when the limit is reached
or js message.guild.member(message.mentions.members.first())
lul
Apparently The Source Code does that in their vids
@unborn shoal I think you meant to say "MM DD YYYY", since "Do" isn't a thing and neither is "MMMM"
for example, you have a string like this "some text here <some link here> some text here <some link here>" and you want to make sure this string does not go beyond 1000 chars, but you also want to keep the text -> link integrity. you would do something like limit: 1000, char:">", append:">"
so the message will be split on the last possible > before it goes over 1000 chars
o
and since the character you are splitting on is removed, you have to add it back
by appending it
So I'd probably do char:":", append:":"
wait
oh so >
maxEmotes = Util.splitMessage(emotes, { maxLength: 1000, char: '>', append: '>' });
@quartz kindle
exceeds 1024 chars
like this [list of emojis until 1000 chars, next list of emojis from 1000 to 2000 chars, next list of emojis from 2000 to 3000 chars]
ok
So, I have an array of Objects of a specific Class. I want to create a string joining some specific(actually just 2) properties of each of these objects. Is this possible in one line? Or do I need to span multiple lines. I feel like there was some array function for such purposes but I don't remember.
Language: JS
@unborn shoal you still need to pay attention to the embed max char limit, which is 6000 i think
so you can check if maxEmotes length is bigger than 5, send the rest in a separate message
@quasi forge array.reduce() is probably what you're looking for
or array.map().join()
@quartz kindle whst kind of embed?
cuz discord's embeds have a max char limit of 1000 iirc
or 1600
I'm not sure tho
Depends on which part
isn't it the same for every part of the embed?
No
field amount = 25, title/field name = 256, value = 1024, footer text/description = 2048
6000 is for all fields together i believe
any SQL big brains?
total is 6000 yes
b r u h
Well that's per embed :p
I never reach the limit so idk
@topaz sphinx just ask the question
INSERT INTO
AnimeArt_userBookmarks(user_id, image_id_list)
VALUES ($1, $2)
ON CONFLICT (user_id) DO
UPDATE AnimeArt_userBookmarks
SET image_id_list = $2
WHERE user_id = $1;
for some reason it errors on UPDATE
doe it doesnt say what error
just ERROR NEAR UPDATE
i've been digging trough solutions 3 hours straight
feel like sleeping already at 7 pm
which database? mysql?
in sqlite it should be DO UPDATE SET, without referencing the table a second time
depending on which database you're using, it might be the same, or not
[2019-08-29 17:17:51]: ERROR Uncaught Exception: MongoError: connection 5 to xxxxxxxxxxx.mongodb.net:27017 closed
cant connect to mongo
when i terminate and create new cluster still same error
@quartz kindle yeah i found it now!
INSERT INTO
AnimeArt_userBookmarks(user_id, image_id_list)
VALUES ($1, $2)
ON CONFLICT (user_id) DO
UPDATE
SET image_id_list = $2
WHERE AnimeArt_userBookmarks.user_id = $1;
sorry i were eating stuff, but now im back
iT RUNS
👍
If user can be User|undefined, do these two expressions equal each other?
Number(Boolean(user)) and Number(user)
I want to get 1 if user is defined and 0 if user is undefined
nvm Number(undefined) returns NaN
user === undefined ? 0 : 1
No I just did Number(Boolean(user))
it works fine
I originally got that idea cuz I had this ternary: js user ? 1 : 0
Which looked like it could be shortened
~~why this is not unloding the Command reload
delete require.cache[require.resolve('../../commands/Owner/reload')]
console.log("._.")
```~~
rate my progress rewriting my current soundboard feature
http://i.am.being-a.fail/ure/M2IB.gif

does it look good?
Yes
Chy4e do u know about closed connection error to mongo cluster??
How to fix it?
Hello guys, is there any way to catch all message on the channel, even if the message was sent when the bot was offline ?
No, I don't use mongo 
@late scroll you can fetch messages from channels, but you probably dont wanna do that
it only works if messages are not older than 2 weeks
Ye
its fine if you do it every once in a while or in specific channels
I wanted to write it
but if you do it in all channels at once it will possibly get you banned
both 
Sure?
no, just guessing lol
hmm
but you might lose your api access, like, at all
@quartz kindle the issues is messages are not 2 week old, and the channel i'm aiming would contains at max 10 messages
why would you need them
@late scroll if its only one or a few channels (ie, one per guild) then you can use fetchMessages
which library are you using?
discord.js
11.5.1
so it should be channel.fetchMessages(options)
ok thanks i'll try it
Can you create a bot easily on Android ?
easily? yes. quality? no.
Hm so basic things right? But how?
there are apps
Can you suggest me any if you know though
don't know any, google around
Ok thanks
though making bots on android is not suggested at all
the sheer nature of ARM is already a huge headache
Hm then is it also easy to make a bot on a PC?
Do I need anything special
The ability to code
What code is a bot based on?
Ur decision
that question doesn't make sense
Oo
It made way more sense on my head lil
I was meaning what code you need such python cc etc
But as you said anything that's good
that's a programming language
Or buying / downloading some bot maker, but most bots are doing the same thing because you don't have flexibility while creating them. But if you code them, you can do whatever you want
The language is your decision.
you can make a bot in any programming language you please, however it's suggested to use languages which already have discord api wrappers
So which is the most recommend programming language for dicostd bots
there's no recommended language
Ok @earnest phoenix and @onyx summit thank u very much for the info
use whatever you want
But JavaScript and python are the most used, but it really doesn't matter
yes
that's what interpreted the question as and then i was like "oh"
@onyx summit that's good to know
JavaScript, go, elixir, crystal, python, java, c#, lua
That's all the languages that definitely already have a Discord API wrapper (that's only my knowledge)

-bots
This user has no bots
-bots @warped mist
Wrong channel but ok
-bots
This user has no bots
I said wrong channel what is your heccing problem. Use #commands or #265156322012561408
Hey does anyone happen to have react experience ? I am having an issue with an event handler. I have a button html element for which I have a onClick handler but it seems that this handler can only be fired once? If I try to click on the button afterward it does not work anymore. My handler is is literally just console.debug
I also dont have any errors
what's your code
return of the render method
<button onClick={this.onClick.bind(this)}>Connect</button>
handler is :
onClick(e: React.MouseEvent<HTMLButtonElement, MouseEvent>): void {
e.preventDefault();
console.debug('test');
}
you need to pass it a function
onClick={() => ...}
what you provided is only an invocation if im correct
so it only fires once
I mean even if I remove the bind part it still does the same
I dont understand actually
good for you
Ok ?
Hostility 💯
How would i go about making my string split every like 5 - 10 words for example, and split it into a new line, i can split every x amount of characters but i want to do words so it doesnt just do random cutoffs
split the string by space, create a new empty string array and do a for/foreach on the split string array and build your string, every 5th word add the built string to your new string array
would it be dumb or even possible to just do my discordbot.org description in an image and have the html link to it ?
Is there anything out there better then express?
koa exists (https://npmjs.com/package/koa)
t.t im just horrible at html and markdown compared to what i can do on gimp or photoshop
made by the same developers but lighter
Yea, just trying to integrate oauth2 but i don’t like the http module that the docs are using. Plus want to expand my knowledge past just express.
If you want to make web dashboards I would also check out front end frameworks
Like React, Vue, Angular, etc
Yea ima use vue
Though I heard it mainly focuses on design then functionality or whatever.
Yea. What does angular do?
It does the same thing as Vue and React
Angular works with typescript, so 
Those all do the same thing... React is made by Facebook, Angular is made by Google, and Vue is made by some open source community
Yeah Facebook amazingly makes some open source stuff
They also made GraphQL (better alternative to RESTful APIs) I'm pretty sure
I wouldn't recommend you to use Angular, it's pretty hard to learn, I would say
When will Microsoft make their own front end framework lol
They seem like the kind of company that would do this stuff
like work on OSS projects
express just builds onto http
^
I've never actually used express in an actual app lmao... ik how to use it but never used it to made real stuff before
Express is what I’ve always used
Though I’d like to branch out
And learn something new
loopback 4 
I like to use Go for rest apis cuz shit's a little easier to do on there
and in the rare occasion i need to make an api in nodejs i just use the built-in http module
it's easier to use it than you think
import http from "http";
http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.write('Hello world');
res.end();
}).listen(process.env.PORT || 3000);```
I currently have to use loopback 4 at work, I think its a cancer thing. Everything requires 5 new files, with 100 Lines each
Lmao
You want authorization? ask no more, just create 5 new files lol
Anyone know what it means when MongoDB errors with "No SNI name sent, make sure using a MongoDB 3.4+ driver/shell."? I'm using the most recent version of everything, Ubuntu 18.04
I remove my server's IP from being able to access the database and it still happens, too
been trying to debug this for a few hours now
(I ask here because a lot of people here use Mongo I'd assume)
So express is just to start the server and make it function while http makes requests for info and such from websites or things like that?
Uhhh, no.
express is a webserver
webserver handles http requests
or https
dependiing on your flavor
Hm okay
Use http
So basically I can use express and leave out http
Yes, express uses http in it's core
you don't have to do anything with the http module
Yeah same but it's 9 in the morning
It’s 12:21am oof
But I got so much work to do with the web dash
Sadly coding it on glitch
Lmao
The vsc code server won’t let me view the web dash
Hey, I want to do a few things related to my bot page, 1. What CSS should I define to change the font color of everything I circled in red? 2. How do I remove the annoying things circled in blue or atleast, change it’s color?
Kinda like this
@bitter sundial help? :p
Mess with css selectors until they work
That’s all you can do
If you see a bot that already does that you can also steal their css if you want, but it’s much better to do it yourself in case you need to make changes in the future
How?
@lusty dew why use glitch 
Let's not start the ew glitch conversation again, there can be many reasons why the are unable to afford a paid host so just help them with what they have now or don't message at all
he literally has access to a dedicated server 
How can I check if a method has a specific decorator?
(ts)
ye thanks, but turns out I can't even access the actual method
what is the problem?
cant find python executable
thr problem is that you are using javascript
install python
i suggest you delete this and go learn python
@earnest phoenix please dont give irrelevant advice
what is dowland link? @mossy vine
thx so much
since its node-gyp that needs it
you need python 2.7
@royal herald or you could run npm install --global --production windows-build-tools
Any help?
I managed to get this far, but I still want to change the color of the things in red, and hide the things in blue :/
@mental thorn use the element inspector
Ooooh ok ty!
@earnest phoenix the programming language for your project is still a personal decision
it depends more on your use case tbh
if there are several that are equally as good, then preference
Its just a Discord bot, not a enterprise solution, who cares what language u use
fax
@onyx summit it was a joke
the language you use doesn't mean anything
what rather comes into play is what library you use for the language
ha ha
some are shit & unoptimized
Classic Comedy
ok yea anome pic :+1:
ok yea comic pic 
anemone? why are you calling people flowers
jimb?
there is no package that is called jimb
learn to read
oke
it says jimp, not jimb
@royal herald y do u use VS for js instead of VSC? 😄
Visual Studio has great support for Nodejs (at least enterprise), but I dont like to use it because you cant customize everything with addons and themes like in vsc
so its not wrong to use VS
In Java I have a string of the form "a[b]c"
I want to split this string to get a and c
I tried simply using string.split("[b]") but that doesn't work because the characters "[]" have a special meaning.
When I escape those characters like so "[b]" I get an error that there's an illegal escape character in there.
What am I doing wrong 😑
oof you can't see the escape characters
I put a \ before [ and ]
I dont know bout java, but in js 'a[b]c'.split('[b]' and 'a[b]c'.split('\[b\]' works
@onyx summit vs is just CLuNkY
Ok so
I found out that in java you have to put 2 escape characters because you also have to escape the escape character because it has a special meaning in java strings
damn
anyone can help me with loopback 4?
does someone know a simple way with I can get an array with members which have a specific role?
Collection.filter() on Guild.members
ah

It’s not really “setup”
I would recommend reading an article how oauth works
I had problems too, but its not that hard after you understand the concept
I can’t show my code at the moment as in about to leave for work but I’ll try and remember to do so when I’m at my computer
I’m about*
Okay 
If you are using node.js you can yank the code from guidebot dashboard
Guidebot dashboard is disgustingly bad imo

@opaque eagle front-end or backend?
Everything
Never used it, but I always appreciated the code from aig to copy and modify for my own use
Anything particular?
If I remember correctly, it’s attached to your bot’s code
It’s much better to have your dashboard independent of your bot
Uff, yeah probably
I think they did that because of all the kiddos hosting on glitch
ytdl-core or ytdl-core-discord?
not sure how to ask your queustion
one's more simple, the discord one uses await function
no problem
.bot-name{visibility:hidden;font-size: 0 !important}
.bot-name:before{visibility:visible;content:'Chat';color #212121;font-size:32px}
.bot-name:after {visibility:visible;content:'Hop';color:#00a8ff;font-size:32px}```
ah thats interesting, thanks
lol
wasnt intended to change the name just to re color it
but u can change the name to 😄
clever
always 100% 😁
Where is the vote button
not approved yet
yeah
cuz he's not a bot dev
tuff life :/
🙂
I have css that makes your vote button go wrmmmmm if you want
Is there a way to eval set your bots status
eval?
Thats
yes
Discord .js
just like you would set it in normal code
eval client#setActivity
Ok
bot.user.setActivity('javascripts', { type: 'WATCHING' })
bot is your client
I use client
i use bot
In my code
¯_(ツ)_/¯
I use banana
ewie
(╯°□°)╯︵ ┻━┻
haha
who doesnt alternate activity?
!eval client.user.setActivity('lol i like banana')
I’ll try it
furries 
😄

yeah u can
XD
do a filter of the guild members then get the .size at the end 🙂
^
const { ShardingManager } = require("discord.js");
const config = require("./config.json");
const manager = new ShardingManager("./app.js", { totalShards: "auto", respawn: true, token: config.bot.token });
manager.spawn(2);
manager.on("launch", shard => console.log(`Launching shard ${shard.id}...`))```
pretty sure spawns 2 shards right?
hello everyone
public static int getDblVoteCount() {
AtomicInteger votes = new AtomicInteger();
dblApi.getBot(ID).whenComplete((bot, e) -> {
votes.set(bot.getPoints());
});
return votes.get();
}
here how can i wait for the process to get the votes before returning the result ?
@broken shale yeah, that should spawn 2 shards
but why am I getting 0

are you getting Launching shard .... in the console
are you using stable or master
stable
try setting totalShards to 2 and call manager.spawn without any arguments
huh
or is the file wrong?
'./app.js'
since my ready event is handled by an eventLoader
@mossy vine Nvm I kept launching the wrong file
wtf
when you use glitch.........
Anyone know what the cause of this is?
This is my code: channelPins = await after channel.pins
and this is the exception:
Ignoring exception in on_message_edit
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/discord/client.py", line 270, in _run_event
await coro(*args, **kwargs)
File "main.py", line 165, in on_message_edit
channelPins = await after.channel.pins()
File "/usr/local/lib/python3.6/dist-packages/discord/abc.py", line 915, in pins
data = await state.http.pins_from(channel.id)
File "/usr/local/lib/python3.6/dist-packages/discord/http.py", line 220, in request
raise NotFound(r, data)
discord.errors.NotFound: 404 NOT FOUND (error code: 10003): Unknown Channel
Not sure why it's doing that
Such channel doesn't exist
Send full code
@broken shale rip
channelPins = await after
.channel.pins()
pinned_ids = [message.id for message in channelPins]
attachments = after.attachments
if before.content == after.content and after.author != client.user and len(pinned_ids) == 50:
oldest_pin = await after.channel.fetch_message(pinned_ids[-1])
try:
await oldest_pin.unpin()
except discord.errors.Forbidden:
await error(before, '''This channel has reached the maximum pin limit, Pin Archiver can't unpin the oldest message as it does not have the manage messages permission. This message has been archived but not pinned. ''')
Let's say I have a MySQL table named "guilds" with a "discordGuildId" varchar(18) field. How can I fetch all of the entries that have a discordGuildId that the current shard serves? (as to not return rows from guilds the shard is not connected to)
one option is to pass an array to the query, like SELECT * FROM guilds WHERE discordGuildId IN (array of guild ids)
idk if thats the most efficient method
That doesn't seem efficient though
another option is to use discord's formula somehow
Imagine passing 2000 IDs through each time 🤔
The problem with the formula is that I store the ID as a string, not a number, so I don't think I can do math on it
Eh it might just be a necessary evil 🤔
there must be a way, mysql is complex enough
What you're doing there is JS though, not SQL
JS does type casting, SQL does not afaik
Apparently I can type cast to INT/BIGINT though 🤔
Yeah that more or less solves my problem
so the top works but has deprecation warning is the bottom not a option object?
message.guild.createChannel('🌍global💬','channel')
message.guild.createChannel({name: 'global', type: channel})```
@barren crest stable or master?
stable
Stable is createChannel(name,optionsObject)
i mean the bottom would also work (provided correct channel type)
And as Luke said, channel type must be either text, voice, category, etc
how i add a custom emoji on a reaction with bot.
what library
msg.onReaction
Everything is optional except name
@rugged bramble you want to add a reaction to a message or you want to receive reactions when people react?
i want to do a voting system so i want to my bot add a custom reactions example: this 
Default emojis must be put there as unicode
You can google for unicode versions of them, and copy and paste as a string
You can also get it from a guild
@earnest phoenix Example i do this config.emojis(id)??
The djs stable docs show this example: .react(message.guild.emojis.get('123456789012345678'))
ye but emoji is on my server
Then get your servers guild id
😄
just pass the id into client.emojis.get("id") 
If you just sent config.emojis(id) you need a thorough doc reading today please
Stop fripp

hardly
bot.shard.broadcastEval(msg.channel.send('hi')) is this how you're supposed to use broadcast eval?
No
it has no reference to msg even then it would be wrong
It also takes a string
Think of eval()
also if running on 2 shards how would you specifically get the ping of shard 1 then shard 2
Ask for values ping on both and the keys 0 and 1 for their shard ids
Since it returns in order as an array
message.guild.createChannel({name:'userlog', type: 'text'})```
what in the world is wrong with this?
thats all it needs right?
Name is first Param
.create(name, opts)
name is first 😄





