#development
1 messages · Page 674 of 1
I found that that my issue above was an issue with the d.js lib
it's getting fixed apparently
@peak quail did you log col to see if its what you want?
i just want to log the message.guild.members
const col = await message.guild.fetchMembers();
for(let item in col) {
}
try it like that
unless you intentionally want to use "of"
I wonder if they intentionally made it alittle obscure to obtain a list of user objects
i dont think they do
it's a very frequently asked question in here
its just that d.js relies on caches, so the function serves to fill up the guild cache
they changed it in master though, there you can fetch members as a collection and optionally not cache them
Was "Master" a recent release?
no, its been in ongoing development for years
ah just heard people talking about it lately
its more mature for general use now, so many people are switching over
Umm hello?
Umm
Hi?....
Sup
if a bot cannot send a message to a user, will the response be a 403?
Hello, I want to send messages to certain channels on all servers at the same time with my bot. What is the definition of this?
the definition is spam and api abuse
Im trying to have the bot check to see if it has the permission 'manage webhooks' from a message event. this should work right? (discord.js)
if(!message.guild.me.hasPermission(['MANAGE_WEBHOOKS'])) return message.channel.send('I need the `Manage Webhooks` permission to run this command');
so just send it as a string?
oh okay thanks. I was just asking cause when testing it, it didn't seem to work for when i gave it permission. it just kept saying it didnt have it even though it did
Anyone know anything about lavalink?
What is that
Is there a way to remove a specific role from everyone in the guild?
Yep but, add a cooldown
You can get api banned
For that
Oh
@earnest phoenix look the .forEach properties in the .guild object
Ok thank you
It's in js? @earnest phoenix
Yes
Okay so, you need to forEach all member in the guild and then forEach all roles
I can give you a simple exemple
Yes please
is it just me or why is my token always invalid
message.guild.members.forEach(m => console.log(m.id)) display all members id
Ok ty
@devout flicker are you using d.js master?
no
oof
@devout flicker contact discord
maybe your bot got banned
if the token always regen
ye was my guess but ill check my dependencies again
Update d.js anyways. The new changes to the api made tokens invalid on d.js master, which you said you werent on, but maybe you installed the wrong version.
ye already updating dependencies
hi so
i try to run my discord bot on a raspberry where i hosted my old one and get this
and i tried everything and nothing works
and what is rainbow code
What. Is. Rainbow. Code.
If you mean rainbow roles, then: https://twitter.com/discordapp/status/1055182857709256704
They are against ToS anyway
I dont know just i always want create a new bot in my server and give it rain bow role
cool, rainbow roles are not allowed
you can make it change color like once every 10 seconds, thats good enough
Tim its literally against TOS
His problem
none its against TOS
I need a program for my bot
then it wouldn't really be rainbow however I honestly dont know how far it goes
yeah
You need to code on PC
why codeanywhere tho
Android/IOS isnt supported
i used to use them but they are terrible
you can code anywhere but at a cost
But it is supported in my frind phone
cool
And we don't explain how to open a text editor 
Look
why do you even deserve to exist
Just (notes) right?
I use Terminal to edit code 
Use nano
@worthy adder Don't code on a phone. We won't help you if you do this
@twilit rapids use sublime u nerd, vim is of the past /s
There is a code in a app like node.js and so many codes
I use VSCode don't worry
cool, then use it, we don't care
Ok 👍
You're still qt though
and dont help you code
Use Google keep
So what i doing know
use Google calendar
learn how to code there
oi
@earnest phoenix @onyx summit both of you aren't helping
Yep
Yes, that's the point, tbh I don't want to explain someone how to edit files
I wanted to have a normal conversation, but someone is discussing how to edit files on ios
Anyway, good luck
In my pc i have (visual stodio)
Look at the space and beautifulness
Ok thanks
i use sublime lol
Yes
ok
server-side js 
Why does setInterval sometimes completely stop working and stops the interval on its own
And our bot relies 101% fully on intervals
And loops
it shouldnt stop on its own unless it crashes
I'll give a small overview, we have an interval that loops over around 500 elements with foreach every 5 seconds that gets data from db and does stuff only if it matches specific criteria (which only a few elements will at the time) sometimes, people say that it just stops and the bot no longer seems to fulfil the interval.
A restart fixes it as it restarts the interval but constant restarts aren't in my favour
What is a good issue tracker? I want one publicly for my github repo, but I want the content to be private
@split hazel what version of node
12 @tidal parrot
show me the interval code?
Is there any way, that I can get a GUI for an Ubuntu Linux Machine I have on a VPS?
Anyone have a trick to PreProcess messages before they're sent and cancel the event?
Example, specific spam auto deleted will make the chat flash as its visible then deleted a moment after
Hi
codyToday at 1:39 AM
Anyone have a trick to PreProcess messages before they're sent and cancel the event?
Example, specific spam auto deleted will make the chat flash as its visible then deleted a moment after
you can't intercept events
does anyone use heroku here
don't
@earnest phoenix do you know how to create a git repository
use git CLI
catch (err) { catchError(err, message) why is catch an unexpected token?
Ok well we need more information, like what you are trying to do here
And what language(assuming js)
you didn't close your try correctly
That is what I was thinking
how?
Idk
you tell us
//code here
}
catch (err) {
catchError(err, message)
}```
catcherror is a function
that's correct syntax wtf? 
Showing code here doesn't help us, because you just typed that that try and catch manually
COPY from your code directly
Because in your code you messed up
And by you manually typing a correct try and catch statement doesn't help us
if you can lo
please dont make fun of me for my error embeds im trying to reorganize them lol
if you can, paste it on https://paste.mod.gg
sending it here clutters it and makes it unreadable
trying one last thing
oh my goodness it worked
nevermind
the issue was something with the order of the }s
Seeeee
Who knows how to verify if he/she has DM's messages from a server activated?
you will get a http error if you are making raw http requests
I cant change the color of html5 elements in my detailed description!
Asking for help!
!important
..
h1 {
color: #00FF00 !important;
}```
thank you

i mean, you can simply learn about css specificity instead of abusing !important
Why ? if I say 'test' he doesn't speak
Learn python before getting into discord.py
I can see one problem which might ot actually be a problem
Yes i do, Its basic python problems. As i said, learn python before getting into discord.py
yes
You have done a lot of beginner mistakes in your code
if you know python, fix them up
Does anyone know a good guide for better-sqlite3
the only guide specific for better-sqlite3 is their docs lol
unless you need help with sqlite itself, then there are plenty of sqlite guides
better-sqlite3 is a wrapper for sqlite, so you should probably tackle it like this:
- how do i do x in sqlite? read sqlite guides.
- ah ok i figured it out, now how do it adapt it to use better-sqlite3? read the docs
Would around 600 intervals running congruently impact performance?
I'm looking to rewrite my giveaway bot timer
Well not just timer
Because 1 interval doing everything proved to not be very helpful
@pallid zinc I think you put an accidental comma after e which should be a +
Assuming all values are defined
And not supposed to be string
lmao
You know you can put it all in one string right
And save the hassle of like 10 values
i cant do it in pc
You can do something like
let numbers = "1⃣2⃣3⃣4⃣5⃣6⃣7⃣8⃣9⃣";
Yes but you're wasting time adding every number via variable when you can just add it to the code like
;one;
Which is 1⃣
trying to make tic tac toe command
so it wound be easy to edit if i do some think like this
just tell the answer
and leave everythink on me
i got my ans so thanks for doing nothing
The only thing you were missing was "\n" ? 😂
lol
message.channel.send(`**TIC_TAC_TOE** \n ${q} ${w} ${e} \n ${r} ${t} ${y} \n ${u} ${i} ${o}`)```
how can i only edit ${q}
any way?
It only lets you edit the entire thing
So just do the full thing again with an updated q
You're making tic tac toe
Which I don't think is extremely complex
But I'd suggest creating a class for it
You could nest arrays to recreate the playing field
Put some functions in your class that convert the playing field to a string value
aka a toString() method
It would be nice and structured to have all of that in 1 simple class that you can then reference from anywhere in your code
A 2D array if you've ever done that
if(message.content === "1"){ q = e}else{q = "1⃣"}
let playingField = [
["X", "X", "X"],
["X", "X", "X"],
["X", "X", "X"]
]```
Like that
You specify a variable for each field
Not necessary
Using my playingField structure above you simply use playingFIeld[y][x]
oof
lol
guys i need help i want to add bots to my server but i cant seem to get it done can anyone help me?
lol
discord is retarded
ok
with the A-I being your playfield
ok
If you used the 2D array as shown above
wait
ok
You'd access A using playingField[0][0]
B would be playingField[0][1]
ok
yup
That way you don't need 9 variables
ok
Or possibly even more when coding a game with more fields
How can i do that the bot send achievements with the say command? Without using links
Its possible?
which library
Discord.js
see the example for sending an attachment
i cant fix this thing since yesterday, i wont complicate
if you made .forEach loop
how would you stop it? (discordjs)
you cant, not in an easy way at least
forEach creates a function on each iteration, so with 10 items, forEach will create 10 functions. returning will return that individual function only
whenever i try to stop it with return, it will just spam messages
i cant find anything online
you need either an external control, or change it into a different type of iteration
you can use break/continue in a normal for loop for example
or you can use an external control variable, such as js let loop = true; something.forEach(t => { if(!loop) return; })
and then set the loop to false from inside
also depends on what exactly you're trying to do
tnx bruh, i'll try it
im trying to give all members a role
but cant stop on loop on error
you can also use try/catch and throw an error
try{
something.forEach(t => {
throw "error"
})
}catch(e){
}```
that should also stop the loop
A forEach()... I'll be damned
Better solution:js for (const t of something) { if (thing) break; // stops that iteration of the loop }
And also, depending on your circumstances, it might not be required for you to loop at all, you might be better off using smth like Array.map(), Array.filter(), Array.find(), or Array.reduce() which do it for you
he wants to add roles using a loop, so those functions would not suit his use case
unless he needs to return the role objects afterwards
future reference!
const role = "that role";
const addRole = member => member.roles.add(role);
const roleObjectsForSomeReasonEvenThoughWeAlreadyDefinedIt = await Promise.all(guild.members.map(addRole));```
So in Discord.JS I need to split the args so that anything after args[1] becomes a sentence. Because I slice args and then it goes like this
{"word1", "word2"}, but I just want it in a sentence. How can I do that?
Array#join
Gotcha. Thanks!
So, what do you people use with your bots?
I use discord.js
how old are you @earnest phoenix ;d
16? Why, uhhhmm, do you ask?
Right, moving to off-topic
I use Eris on js... i've also used dgo, serenity, drb, and sword in the past
It's certainly not beginner-friendly
You won't like it unless you're pretty good with writing code.
Personally, i prefer Eris over Discord.js, just because imo, Discord.js is bloated
D.js holds your hand through every little thing and makes everything "easier", while Eris is a lot more barebones
Yea
That's what I hate about D.js
Took me 3days to figure out how to send messages lel
lmao
Then I realized why not check the docs there is probably an example
I heard Eris has better mem usage
Get 👏 off 👏 stable 👏
Iirc d.js caches everything
@lusty dew client options
I may try and make a bot in Eris again
You have the ability to control it
Do you see any major bots using D.js? All of the top-tier ultra popular bots use Eris
That's my D.js patriot card
or they use cooler libs 
Python is eh C# fuck that
Java was kinda easy in the beginning but then I started to get confused
So I just gave up on it
lmao
Wanna try and learn Java fully though
Dyno, Tatsumaki, Dank Memer, Pokecord, BoxBot, Pancake, Idle Miner, Zira
Java has worse cpu usage than js
All the major bots either use Eris or anything but d,js
Java eats
and I didn't do shit to mine
I hate Java
Well my bot is gonna stick with d.js lel
Just wrote the code and hoped it wotked
Writing Java code is so redundant
Typed lang bad 👎
It's overall really terrible as far as the developer's experience and required-hassle is concerned

I prefer typed langs
I dont like typed langs
I don't see how java is a hassle
writing java code is really redundant
but I don't use java so I wouldn't know that much
Kotlin gang
I feel like kotlin gets rid of that redundancy
Whats the point of defining a type? All the benefit I see is that it allows you to know what a variable is by glancing over code if it's not actually defined.
kotlin is fine
what's scratch
Smh
👀
mit programming language
that looks like its for kids
It's for the script kiddies who think they're gonna make it big
lol that's not a coding lang
Iirc it’s made using js
that's a tchotchke
Hmph
I don't like block coding languages
What if you optimized it to allow http calls
they don't let you feel how actual coding is gonna be
those aren't coding languages
As soon as I heard we were gonna be using scratch I got up and walked out
Watch those who use scratch thing java, js, etc. Is just drag and drop
I would literally just end myself
ArrayList<Integer> arr = new ArrayList<Integer>(); doesnt this seem redundant?
it does
that's why java sucks
but other typed languages r actually good
like go, rust, ts
Idk I've used C# and Java didnt like either
Strong-typing is really useful
What’s the easiest Lang to learn
probably javascript
that depends
In your opinion
I just dont see the benefit to define a type
on what u know already
i would say lua
syntax is simple, and as its the most popular language there are so many awesome guides out there
defining types isn't useful for every scenario @amber fractal
Lua was so fucking gay
cough
discordia
cough
Outside of roblox and gmod
i only see lua used for game modding
What language(s) do u know already? That helps in defining what "easy" means to u @lusty dew
there are some lua libraries for discord bots
I know a little js but not enough to be considered an expert
I know some lua but it was boring so I stopped
Not many uses for lua
I don't see that as redundant
I'd consider learning more JS first @lusty dew
it make sure you strictly follow the type you defined
before trying to learn other langs
knowing one language really well is better than knowing how to do hello world in 10
A string isnt gonna get in your array in js unless you put it in there.
Why do u hate strong typing so much
Lol
It's so useful
and afaik you can leave out the <> when actually creating the array list
Thats what my problem with typing is, programatically you know what the variable is.
/*
* @param {number} a
* @param {string} b
* @returns {string}
*/
function thing(a, b) {
return a + b;
}``````ts
function thing(a: number, b: string): string {
return a + b;
}```
Which one would u rather write
honestly, i would stay with the first
First
I like the private public and protected in java
I would rather do the second
For both
in the first one you obviously know whats code and whats documentation. second one takes longer to read and can be confusing
How is it confusing
You know what you're passing into the function anyways.
^
So why does the type matter
type checking is 1-2 lines anyways
The second one is the easiest one to read
Static types can ease the mental burden of writing programs, by automatically tracking information the I would otherwise have to track mentally.
without jsdoc you can still pass in what you want if you don't do proper checks
I don't have to remember that a function takes such and such types and returns smth, becuz the code keeps track of it for me
thats why jsdoc is a thing
and I can infer that in any point of my code using my ide's suggestions
but you're not gonna put jsdoc on your own bot
^
there's literally no point
The first function actually can do more than the second, because it doesnt have ttpes
jsdoc is designed for documentation first
unless your releasing the code
You can add whatever you want, not just a number and string
but each function should have a specific purpose @amber fractal
then make it obvious from the function name?
addNumbers(1, 2)
addStrings('a', 'b')
@mossy vine I'm talking about when Steven said
The first function actually can do more than the second, because it doesnt have ttpes
So I should have
return a + b
}``` and
```function thing2(a, b){
return a + b
}``` ?
Because the top one is for numbers
And the bottom is for strings
in some languages yes
doesn't make sense in such a niche scenario
Oh wait they do the same thing
but i used adding as an example for more complex tasks that functions r used for
@topaz fjord the code is literally the same
That was the point
The second function is redundant
As you can do it with the first
Exactly my issue with typing
You need seperate functions to do the same thing
How is making a useless function your issue with typing
With seperate types
You don't
You literally do or it will say that you passed the wrong type
because you can specify the type to be anything in typed languages
Not the way I was taught tho
This scenario doesn't even make sense either way
no one makes a separate function to add two numbers/strings unless they're stupid
I just dont see why int x = 5 is better than let x = 5 you know what x is either way
It's an integer
The code also knows that
Why
i would've wanted go
I'd like to create an AI
java is useful lmao
Python is fast
it's not a language that no one uses
I'm aware, still dont like it
Learning it was hell
The ap test was as dumb as ap tests are
It's used more in companies than anything else
For ML applications python has the most fleshed out libs. Id stick to that for ML/AI stuff
Python is what Im learning next
Well depends on what you mean by ai as thats become so convoluted over the past few years
If you want to do some Java stuff I would also reccomend learning some kotlin.
Lol no
In probably just gonna learn low level languages from now on
Kotlin actually solves some issues you have with java tbh
const botconfig = require("../botconfig.json");
module.exports.run = async (bot, message, args) => {
let lel = args[0];
if(!lel) return message.channel.send("hehe boi");
message.mentions.users.first().send(lel)
}
module.exports.help = {
name: "dm",
aliases: []
}```
`k/dm @stray garnet Hello`
It sends: `Hello`
`@stray garnet`
how to let it only send the `Hello`?
Of the 3, imo Kotlin > Java > Python but I do think python is great for stuff like small scripts.
Python just is not that good for larger projects imo
@amber fractal What? Why
Strongly typed languages are a huge preference of mine
strong-typing is neat
@stray garnet
At work we have a legacy python monolyth backend (~3 million lines) And it is such a waste of time trying to track down what type every function returns/brings in
@amber fractal Oh, would it ne allowed to only make it for me?
why would u want to dm random ppl through ur bot out of the blue
^
https://i-was-scammed-by.dabbot.org/5e1znMj.png
that's why you can do
List<Integer> list = new ArrayList<>() (since java 7, released in 2011)
var list = new ArrayList<Integer>() (since java 10, released march last year)
if you're going to complain about syntax that's been outdated for 8 years you're doing it wrong
Oof
@inner jewel not my fault the college board teaches outdated stuff tho is it?
I didnt choose to learn it the way I did, I was forced to.
I would've still preferred to not learn java at all
hi, where can i find the gen code "message.member.name" etc..
wdym?
Yes..
@rustic sphinx give more information please
you know there are codes that define you to make it easier, for example: let member = message.user.tag
where can i find them i don't know ...
a site or github
but, the discord has a slightly different code than js
ok
@rustic sphinx if it's in js it's normal syntax
idfk if I spelled that right I'm tired
Eg
let userID =message.member.id;
someone here use ibmcloud?
@rustic sphinx https://discord.js.org
under documentation
@tight heath thx
How do you make your bot stay on 24/7?
ye
Really?
but 500 mb
Yep
Please can I have the link?
or you could get like a cheap £5/month vps and like host the bot off that
And I’m to poor for that
loool fair do's
Thank you
@dusky mist see dm
Glitch: The friendly community where everyone builds the web (and hosts discord bots)
Tbh I’ve got the bots online and stuff it’s just they ain’t staying on when I turn off my pc
I’m way too poor
Wydm?
Js, phyton....
Js?
*js
Js my heart ❤
😁
Anyone have experience with express api?
Yeah I guess. I'm trying to make an API with express. Do you mind helping me in DM's?
i'd rather help here if you dont mind
I have a question about better-sqlite3
I saw it told you to name a file in a migrations folder something specific do I have to name it that
@quartz kindle i can dm you a vsc liveshare we can use.

Good luck with that
That's not how this works
does nodejs keep bot online all the time anyhow?
I'm not asking him to code it for me. I'm asking him for help.
I've never had an issue with uptime
No
and never added anything to project
If your pc or whatever shuts down or sleeps the process stops
sorry, i dont help privately for free

That’s what a vps is for it never goes to sleep so it keeps the command running
Tim
Question
@pale mango you can always make an earnest attempt to code something then ask for help with syntax
so 1 small task at a time
nobody really wants to coach someone through something from 0 to 100
Tim to make an api would I have to specify the websites I want to scrap let’s say images for
Or is there a way to just scrape a specified topic or genre of images across the internet
you have to either scrape or build your own database
and scraping requires specific rules for specific websites, so yes, you need to specify websites and rules
the closest thing to "scraping across the internet" would be to scrape google images lol
or something similar
Is there a tutorial online for oauth2 callbacks?
A guide made by the community of discord.js for its users.
Idk, have you used google
I feel most of the questions here would be answered faster if someone just put their question in google instead of here.
or played around with a blank sheet compiler
that's the nature of a chat room though
you just want a response
😄
I saw it told you to name a file in a migrations folder something specific do I have to name it that
When looking at the better-sqlite3 npm page^^
what are you trying to do?
you dont need to do anything regarding migrations unless you're specifically migrating a database to/from another db/version
oh you're using better-sqlite3-helper
No
Wait what
Bruh I’m dead
I thought I was looking at better-sqlite3
So how do i create a table with better-sqlite3
I’m confused on how to use better-sqlite3 not very descriptive on how to use it st least not me
At*
const db = new Database('foobar.db');```
Foobar.db?
name it whatever you want
thats your database file
it will be created if it doesnt exist
then you start executing standard sql statements like this:
db.prepare("SQL STATEMENT").run(parameters)```
so creating tables for example
db.prepare("CREATE TABLE IF NOT EXISTS guilds (id TEXT PRIMARY KEY,channel TEXT,role TEXT,message TEXT,strength INT,sensitive INT);").run();```
What does text primary key do
when creating tables, the first value is the column name, the second is the column type
the third one can be a specific option, in this case, primary key means this column is the primary key
primary keys are unique values which are automatically indexed
Sql seems easy in some ways
it is
The way it looks to me as if you are saying a sentence
db.prepare("INSERT OR REPLACE INTO users (id) VALUES (?)").run(userid)```
or basically just INSERT, not need for REPLACE here
selecting all users js db.prepare("SELECT * FROM users").all()
selecting one user js db.prepare("SELECT * FROM users WHERE id = ?").get(?)
the () is for inserting multiple values in multiple columns
Ah okay
you can also use named placeholders
So basically getting info from multiple columns
db.prepare("SELECT * FROM users WHERE id = @id").get({id:userid})
anyway read the api docs and read some sqlite guides
But I get it for the most part
nearly all sqlite statements can be done simple by db.prepare().run()
or db.prepare().all()/.get() for retrieving values
select is the sql statement
.get() is the better-sqlite3 function to return the value
Ahh okay so basically if you do
db.prepare(Select * From users Where id=?).get(userID)
Would get the userID
would get all the data from the first row that matched the user id
no, without .get its a statement
you can store it, execute it later, use it in a transaction, etc
Ah mk
you can do things like ```js
let s = db.prepare("INSERT INTO users (id,name,rank) VALUES (?,?,?)");
users.forEach(t => {
s.run(t.id,t.username,0)
})
Oh cool you can put placeholders in to put parameters in later?
yes, that is the purpose of creating a prepared statement
True
Btw when creating a table
Should I do it for guilds on join?
Like when the bot joins the guild it instantly creates an entry for that guild
you should create tables only once. a typical use case is to write the table creation statements that you need (and carefully plan ahead the columns you will need etc, because sql is a relational database, unlike document-oriented which lets you arbitrarily add fields/keys/columns), run you script once to create them, then remove or comment out those lines
then you work with rows
add and remove rows for guilds, users, etc
Well yea what I mean was
Create the table once ofc
But when a bot joins a guild should it create an entry to that table on join
that is up to you
It wouldn’t cause problems?
you can do it like that, or only do it when the guild actually uses your bot
it wont cause problems
Which would be the better option
i would go for the second option because im a performance maniac
only run things when you actually need them
i would also cache your most used things
for example, save an entry to db and also to an object/map. then when you need it, try to get it from the object/map, if it fails, then get it from db and also add it back to the object/map
this is especially important for custom prefixes, so you avoid hitting your database on every single message (which can be hundreds/thousands per second)
yes you can
I don’t wanna cloud things
I just looked at that oauth2 guide, am I missing something? It doesn't run the alert
<script>
window.onload = () => {
const fragment = new URLSearchParams(window.location.hash.slice(1));
if (fragment.has("access_token")) {
const accessToken = fragment.get("access_token");
const tokenType = fragment.get("token_type");
fetch('https://discordapp.com/api/users/@me', {
headers: {
authorization: `${tokenType} ${accessToken}`
}
}).then(res => res.json())
.then(response => {
const { username, discriminator } = response;
alert(`Hello, ${username}#${discriminator}!`);
}).catch(console.error);
}
}
</script>
I assume I’d make it functions?
@earnest phoenix add a few console.logs along the way to see which parts of the code run successfully
@lusty dew thats a option yes
I forgot you don’t need to do anything in the ready event for better-sqlite3 do ya?
@quartz kindle I don’t need to do anything in the ready event do I?
@earnest phoenix did you try console.log(fragment) right after you define it?
before the if
@lusty dew not necessarily, up to you
I did a console.log just below the opening script tag and nothing happened
So it's not running the script at all
how are you running the html file?
through an Express application
api.get("/dashboard", async (req, res) => {
res.sendFile(__dirname + "/dashboard/index.html");
});
can you do view-source in your browser?
oh i was following this guide: https://discordjs.guide/oauth2/#putting-it-together
A guide made by the community of discord.js for its users.
nothing happens still
Hey anyone can help me?
well actually in this case it should be fine to use the frontend because its the user's token in question
not yours
Error: Socket Hang Up how can i fix this :/
that usually means its a connection issue
@earnest phoenix try using express.static
oh i forgot its a separate console, but it only logs to here: https://plexi-development.sucks-hairy-balls.xyz/nkslv.png
i know, i meant thats the only logs it sends
so apparently fragment doesnt have access_token
whats the url you used?
my oauth2 URL
with a fragment?
it works here
it shows your tag?
shows an empty dashboard
thats what i get too, but it should be showing a popup with your tag
hmm let me check
mine? works for me
Not me smh
wait you're right, tf
oh its cause i deleted the channel L
Lmaooo
thanks for letting me know lol, fixed
I think inv should still work though
Doesn’t it
Haven’t payed much attention to discord invites and how they work lel
no wonder i havent had new members join smh
Lel
there is something wrong with your oauth2 url
https://plexi-development.sucks-hairy-balls.xyz/9hnvq.png i dont it how the guide says 
implicit grant type is not suggested, it's very unsafe
ah yeah that worked, thank you :)
is there a more reliable guide for this? cause the one im reading has gave 2 faults so far from whats been said here xd
i mean, the problem is that you didnt read it completely
it says in there to change your response_type to token
After you change the response type, you can test the url right away. Try visiting it in your browser and you will be directed to a page that looks like this.```
you should still avoid storing the token on the front, phishers can grab the token
thats why the token expires
Mmm I love light theme on discord
expires after a week
which is enough time for someone to steal the token
especially with CSRF attacks
a week? i thought this was like a 6 hour token or something
it's a week, that's why some people who do sessions server side make sessions expire after a week
well, if he scrolls down, there is a guide for the code grant method as well
^ I'll continue with the guide, I was just testing what I had so far, thank you again guys
How do you link the website to your domain?
through DNS, change the DNS to your IP
server IP*
if you want to go more in depth and more secure, you should also reverse proxy
oh i tried using CloudFlare but it was really difficult with Express for some reason
so I reverted and my friend has gave me some iptables rules to set
cloudflare has a guide on how to use it with apis
which includes a set of things you need to disable
another thing you can also do is use nginx as a reverse proxy, which is what i do
Nginx?
same
My friend uses it don’t know what it does though
web server
nginx is a webserver
its just a web server
like apache
so Tim, are you using Express too? with nginx
im using restana instead of express
which is basically the same thing, but faster
im kinda new to express, it was the other PiBot Developer who shown me it
which doesnt really matter tho
express is the most popular node server
also has the most features, and biggest community
but depending on your usage needs, it can be quite bloated and slow
there are dozens of alternatives out there which are smaller/faster than express
they just have less features, and might be harder to use
in any case, most times it wont make a difference
express can handle 10-15k requests per second
so one more thing, once the token has authorised or whatever, is there a way to pass my client to the website? so i can use client.guilds.get etc on the webpage
if you're not hitting that much volume, you can stay with express
for comparison, restana can hit 45k reqs/s
the developer of restana is going even further, he also made 0http, which claims to reach 70k+ requests/second
What website would ever get that high of requests?
usually social networks and such
youtube has other problems
youtube's problem is storage and bandwidth lmao
Ah true
And garbage compression 
youtube's problem is youtube
i fucking hate windows atm
i've been trying to build this fucking module for hours
on linux it works in 5 seconds
yeah i got everything, now the final boss is python is installed in program files
and i get cant find command files/python in c:/program
lmfao
fucking spaces in directory names
but i dont feel like moving python only for this
seriously, i even went through shit like npm deleting itself
or npm not updating because npm is open and cant be deleted
now it refuses to install gyp because an unrelated npm module gives resource busy or locked
im not moving, i need to setup a local test environment to work on a rather complex function
oh
yes tim. its a fact
dude wtf is this shit, i dont get it
i completely uninstalled the module, deleted the folder from packaje.json and node_modules, but when i install gyp its still trying to build the module
during installation?
well apparently it didnt get removed from package.json, even though i did uninstall -s
@quartz kindle how do you get the Discord.Client() on the HTML javascript?
someone know any free host for bot w db?
Heroku is free
Anyone know why this aint working
https://paste.fedoraproject.org/paste/HaFtlsph2XUPbepc4MpreQ
well
http://prntscr.com/ost22s show me full code
because both versions of message don't work together
i am confusion
it has to be one message functionn
you want all the code?
im just trying to make a command that makes the bot resend a certain custom emoji
no just the code for that code you have for the command



0⃣ 1⃣ 2⃣


