#development
1 messages Β· Page 477 of 1
Well depends actually
I think its possible
client.on('message', async message => {
if (message.author.bot)return;
if (message.content.startsWith(prefix) && message.channel.type !== "text")return mesage.reply("Please use my commands in a server");
if(!message.content.startsWith(prefix))return;
let messageArray = message.content.split(" ");
let cmd = messageArray[0];
let args = messageArray.slice(1);
let commandfile = client.commands.get(cmd.slice(prefix.length));
if(commandfile) commandfile.run(client,message,args);
if(cmd === `{prefix}list`){
return
}
if(cmd === `{prefix}time`){
return
}
if(cmd === `{prefix}convert`){
return
}
});
``` In your main file @lusty dew
Why return a message in dms
I have a command handler
you need a $ before thos {}
Yeah ik lol
lol
alot of things are difficult on the mobile version of discord
ikr?
I misspell words all the time
^^
So can somone show me how to set a channel for like logging?
get a database
So you could do like h.setlogs #265156361791209475
@tulip snow for logging of anything in general or what?
For djs what is the event for when a bot joins a server
i see you were helped in the djs server
ye
someone already helped them
How do you write to JSON file using fs like this
{
"dm": "off"
}
json files are known to get corrupted when editing with fs @tulip snow
https://www.npmjs.com/package/tmi.js <--- Isn't this used for a type of twitch thing?
@bright spear depends on the usage, if you use it as a database that's frequently accessed, yeah, but if it's a simple save of settings that's written to rarely then it would be fine to use json
is it guildMemberRemove
?
if (construction == true) msg.channel.send("Sorry Kayo is under construction.")```
how do I get this to not let anything happen after it
Return it
if (construction === true) {
return msg.channel.send("Sorry Kayo is under construction.")
} else {
//The rest of your command handler
} ```
or
you can ust do what he did
the else is not needed
when you return the msg, the function is exited
I indicated the else, to remind her to put it above the cmd handler xD
It should work, the question would be "how will you make it work for"
no
i know how it works
manage_messages works, but i just wanted to know about that one
it is
it will work with hasPermission
where can i find the list?
KK do you love me ?
im have bug on
https://discordapp.com/developers/applications/
this token is change automatic when i Restart the page
part of the token is a timestamp. it will change every time you refresh no matter what
How to make it constant does not change
you don't
const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
let usericon = message.rUser.iconURL;
const mentionID = rUser.id;
let serverembed = new Discord.RichEmbed()
.setDescription("User Information")
.setColor("#00ff00")
.setThumbnail(usericon)
.addField("User Name", message.rUser.tag)
.addField("User ID", mentionID)
return message.channel.send(serverembed);
}
module.exports.help = {
name: "userinfo"
}``` does the user name field work?
as long as the first and third parts don't change you're fine
does message.rUser exist?
its a let at the top
what should it be then?
and is usericon right?
you tell me
it doesnt
the bot says nothing
ok
const Discord = require("discord.js");
module.exports.run = async (bot, message, args) => {
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
let usericon = rUser.iconURL;
const mentionID = rUser.id;
let serverembed = new Discord.RichEmbed()
.setDescription("User Information")
.setColor("#00ff00")
.setThumbnail(usericon)
.addField("User Name", rUser)
.addField("User ID", mentionID)
return message.channel.send(serverembed);
}
module.exports.help = {
name: "userinfo"
}``` it doesnt send the usericon
in discord.js
pls help
isnt it avatarURL?
is ```js
.setThumbnail(message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0])))``` better?
@quartz kindle
Your token is invalid
That what "Incorrect login details were provided" usually means..
IKNOW.
IM HAVE BUG ON SITE
Before - Restart the page
After - Restart the page
token is change automatic when i Restart the page
uhhhh don't share your token in public
-_-
change your account password
@frigid bone he is change
log out of discord on site
check if it's still changing
@earnest phoenix ok i will do it now
It was already said above that the token constantly changes
Can you show me how you log into your client with the token?
the part that's changing for him shouldn't be
doubt it's a site bug though. probably more user error
still changing
it always changes when u refresh
@earnest phoenix
just re generate it and use that
it says under the token it resets when your refresh the page or generate a new token?
or was that on the old developer portal
idk but it was/is there
the auth part of his token is regenerating
is for me
the auth part only changes on regeneration
and he's regenerating it
I think so
i haven't had to regenerate or even look at my token in like a year
i guess the auth part does change on reload now
you should see if discord said something about it on the support website or in a blog post
highly likely they did
@earnest phoenix it changing seems to be working as intended. your bot not being able to log in is likely user error
did he send a snippet of his bot login code?
@earnest phoenix im test make new bot but he is bug
i think this bug on my account
im do it
are you testing the new app on heroku
or are you testing it locally
yah
which
but im test make new account discord
and make bot
the new account work
but my account not work
are you testing on heroku or locally
yas i do

your account is most likely not defective, its just either how you coded the bot/hosted the bot
your bot may be refreshing the token
"yes" is not a valid answer to a this or that question
IM BAD IN ENGLISH -_-
if you're doing the testing on heroku, other than it being a bad service for bot hosting, it may be causing a problem
try running your bot from your pc with a freshly regenerated token
hmmmm
@earnest phoenix im running bot on my pc and have error in token xDDDD fuck man
inb4 your api access was revoked for tos abuse 
can music commands for .js be found in the docs?
commands can't, they are built by YOU, and the documentation does not talk too much on music, its quite vague on the music part
@earnest phoenix much as I know, itβs normal
When you refresh the page, the token changes. However, any previously generated tokens will still be working perfectly unless you press the βregenerateβ button
how do I get server creation date with JDA?
@wide ruin if you're using discord.js: https://discord.js.org/#/docs/main/stable/topics/voice
FYI always mention what lib you're using.
Is there a way to change this (album and date ect) http://prntscr.com/kq2os8 using a library (Idk if ytdl-core has it but)
Can you explain? I don't get what you're trying to do
const Discord = require("discord.js");
const { RichEmbed } = require('discord.js')
module.exports.run = async (bot, message, args) => {
let reportschannel = message.guild.channels.find(486167748205084694);
message.reportschannel.send(args)
}
module.exports.help = {
name: "report"
}``` will this send a message in reportschannel?
discord.js
idk try it and see
It will not
let reportschannel = message.guild.channels.find("486167748205084694");?
thanks
Remember reportschannel.send()
1st one
thanks
const Discord = require("discord.js");
const { RichEmbed } = require('discord.js')
module.exports.run = async (bot, message, args) => {
let reportschannel = message.guild.channels.find("486167748205084694");
reportschannel.send(args)
let helpEmbedsub1 = new RichEmbed()
.setTitle("Successful")
.setColor(0x00ff00)
.addField(message.author, args, true);
}
module.exports.help = {
name: "report"
}```
thats what i have
ok?
but nothing sent
just get the channel
then it should be bot.channels.get("Id")
^
If .get doesn't work use .find
because you never sent the embed
lmfao
s
Can you just learn your lib pls
not just lib, but the whole lang
Well it looks like it could be valid js
are there any .py here ?
Yes
Hello all. I'm looking for a bot to get patch notes for an app on Google Play and the App Store.
@wide flicker https://developers.google.com/android-publisher/
@rustic axle that's not a bot or directions on how to make a bot post patch notes to my discord. Also I dont own the app..
lmao its an API for google play. so it probably has a way to get app patch notes
recyclingbin thought you wanted to make your own bot @wide flicker
^ considering you posted in the bot development channel
well they posted it in #topgg-api first and someone told them to come here lol
wew
Do you think I could use mee6 to grab the patch notes? @earnest phoenix yea @west raptor told me to post that here
@wide flicker no mee6 doesnt have that
as turtle said, its unlikely someone already made a bot for that
your best bet is finding some api and making your own bot
const args = message.content.slice(config.prefix).trim().split(/ +/g);```
how do i make it all appear on one line
d.js
do i just remove .split(/ +/g)
why pong
??
thats an array
it doesnt have lines
@wide flicker an api is an application programming interface
basically a way for you to make a program that connects to a service
a webhook is basically just a POST request to an endpoint
first you need to learn how to code tho
also google is good
Would it be possible for a webhook to get the patch notes from the apps Google Play direct URL when they get updated?
well
@bright spear how can I change it to a string?
@wide flicker you can probably just get the page content and check the patch notes, however you might not be able to know when it gets updated
@wide ruin uh try this? i dont really know how your code works but js message.content.slice(config.prefix).trim()
and please learn js and stop asking dumb questions about your own code
Ok so the webhook wouldnt update as the URL does? I really dont have years to learn code lol I just need patchbot for mobile
if you want to know instantly you'll need to see if google and apple provide apis for that
but i dont think they do
I don't think they make that stuff public
No it's only for the developer of the app
So it's safe to say it isnt possible? Because I dont have any solutions. Not sure what steps I'd need to take
My goal is to get the patch notes for all platforms of the game.
Would this be of any help?
https://developers.google.com/admin-sdk/directory/v1/reference/users/update
Can somone fix this for me? ```js
dmfile["dm"] = {
dmfile : "off"
};
fs.writeFile("DM.json", JSON.stringify(dmfile), (err) => {
message.channel.send("Restart DMS are now Off");
if (err) console.log(err)
});
Its writing ```json
{"dm":{"dmfile":"off"}}
Instead of ```json
{"dm": "off"}
Hey.
My bot still responds to bots but I used this code to prevent it.
async def on_message(message):
if message.author.bot:
return
await bot.process_commands(message)
The code doesn't work as the bot still responds.
~~ ~~ INFO ~~ ~~
langleague: python
libary: discord.py
bot: @ruby siren
~~ ~~
Is @bot.event there
nope 
rip
Could somone answer my question lol
@tulip snow what lib?
D.js
i mean:
dmfile["dm"] = {
dmfile : "off"
};
means you have:
dmfile = { dm : { dmfile: off }}
so its writing the correct thing
u just dont understand objects 
@slender thistle ty, doesn't respond to bots now :DDDDDDDD
π
How would I make it so that a member has to react to a message to obtain a role?
If you are using js of
c
use one of the ones that says reaction in them
I don't know what I want to use, all I want to do is make a simple moderation bot.
discord.js
if you are new to coding
or discord
or anything really
or .py if you like python better
or C# if you are insane
π
ok
oh fuck thats why my shit isnt working...
135 verbose stack Error: EINVAL: invalid argument, read 135 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\gentle-fs\lib\rm.js:245:7 135 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\iferr\index.js:13:50 135 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:287:18 135 verbose stack at FSReqWrap.oncomplete (fs.js:153:5)
hold on while I uninstall node.js while running my bot off of it
(node:7108) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open './autorole.json'
at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:348:35)
at Object.module.exports.run (/root/bot/SbireBot/commandes/autorole.js:10:34)
at Client.bot.on (/root/bot/SbireBot/index.js:83:31)
at Client.emit (events.js:182:13)
at MessageCreateHandler.handle (/root/bot/SbireBot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/root/bot/SbireBot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/root/bot/SbireBot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/root/bot/SbireBot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/root/bot/SbireBot/node_modules/ws/lib/event-target.js:120:16)
(node:7108) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7108) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Plz me help
@icy scroll it says autorole.json doesnt exist...
^
uh
#google traduction ππ€£
you dont install it, you make the file
Ah yes ok uh... I'm beginner π
its fine
well
what is it anyways
its not like we have the code here
its not like npm install
you have to write the actual code
Could I get some help setting up a webhook?
what webhook?
I want to get the updates from a website where the developers post updates for an app. They said I could use we webhooks to do it
how do I do command timeouts
How do you view the servers a bot is in (d.js)?
The names of the guilds
I had a different idea
It logs new ones instead
There is a on guildcreate, will guild.name work?
client.guilds.map(guild => guild .name) should get you an array of the names of the guilds your bot is in
And yes, a Guild object is pased on the guildCreate event
Whose name is accessible
let args = msg.content.split(" ").slice(1).join(' ')
if (!msg.member.voiceChannel) return msg.channel.send("Error: Please connect to a VC.");
if (msg.guild.me.voiceChannel) return msg.channel.send("Error: I'm already playing a song in a differant VC.");
if (!args[0]) return msg.channel.send("Please tell me a link to play!")
let validate = await ytdl.validateURL(args[0]);
if (!validate) return msg.channel.send("Please only tell me a URL to play!")
let info = await ytdl.getInfo(args[0]);
let connection = await msg.member.voiceChannel.join();
let dispatcher = await connection.play(ytdl(args[0], { filter: 'audioonly' }));
msg.channel.send(`Now playing: ${info.title}`)
},```
args is not an array
you joined it to a string
so
you might want to call args and not args[0]
@earnest phoenix
on all of them
did u install ffmpeg?
π
i mean, these error messages are pretty self explanatory
And/or imported it
yeah I'm not good with music
npm i ffmpeg wont work
how do I import it
wont worknpm i ffpmeg
Get it from here
https://www.ffmpeg.org
Here's a video tutorial
https://www.youtube.com/watch?v=SW-iKrT_nJs
Ever wanted to know how a core developer of DISCORD.JS uses his own library? I don't really care what you think, but if you want to leave feedback do so in t...
I've installed ffpmeg
btw
i think
you'll get better performance if you use d.js v12 without ffmpeg
it dont say I need to install it
New to v12 is the ability to play OggOpus and WebmOpus streams with much better performance by skipping out Ffmpeg.
Did u restart ur pc after installing ffmpeg
I forgot what was the way in d.py to catch someone connecting/disconnecting from a voice channel?
@ruby dust you might have some kind of voice state update event
discord.js has VoiceStateChange iirc
^```
host: 'api.exchangeratesapi.io',
path: `/latest?base=${base1}`
}```
Why cant I use a variable in my path?
"/latest?base=" + base1
just try that
or encode
(encoding is probs better)
encodeURIComponent(`/latest?base=${base1}`)```
I guess that is possible by checking before/after member objects in on_member_uptime event
uptime?
update
(β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»
lol
lol
<html>
^
SyntaxError: Unexpected token < in JSON at position 0```
when I have
host: 'api.exchangeratesapi.io',
path: encodeURIComponent(`/latest?base=${base1}`)
```
you mean breaking
snekfetch is depreciated
but its recommended you dont
Is there any way to change metadata on an mp3 file? kinda like the album and artist ect?
yes
cant use links in <iframe> ?
just brings blank page
Hello
im make music bot but he some time crashed when i say <-play Hello> but if me say < -play link > he it work any help ?
this code
@tulip snow you not chose the languge whe you make app
@tulip snow make sure the worker is set to node.js
just make new app
If you are using js
/shrug
@earnest phoenix i bet you didnt make any code to search youtube
also pls stop spamming your question everywhere
hmmmm
Bet he copied it from here https://github.com/bdistin/OhGodMusicBot
lol
And why are all of the bots saying I have been editing my messages?
Wtf
Eh whatever
iirc it triggers an edit event when it loads the link preview
Oh ye
I NEED HELP in a lanuage i dont know
what language
js
whats up
i need to use 1 simple code for after effects
i think after effects use js right?
yeh it does
so i want the audio to "wiggle" from the left to the right channel
can't you use keyframes
with audio balance
it will take me years
lmaoo aight
sec
Okay so, the wiggle expression can be used for audio by convert audio to keyframes and then paste the resulting keyframes into the wiggle control property
i think?
take a look at this from like 13 years ago. hopefully it's still relevant
well, i know how to wiggle audio , but what i'm saying is i want the left channel lets say go up by 1db and the right channel goes down by 1db then the right channel goes up by 2 db then the left channel goes down by 1 db
ohh.
so like wiggle the 2 channels seperatly
idk how to do that other than keyframes
dont you code js
i do yes but im not experienced in writing stuff for after effects
i got it
A !== B
how can I make this text print out like this ? instead of printing out blandly..?
ah ty ty
np
You can also do ```
\${credentials.botId}``
hi
hi
Hurrah im now a developer
to pass the test, tell me what being a developer means
oh yeah I keep forgetting that ` is a thing in JavaScript 
It's not just someone who can write code, its some one who understands how to build software
this is development, guys 
.prefix +
you should go to #memes-and-media or #general
ok
on the other hand, is there a way that ytdl-core can play a set youtube url, rather than requiring a user input? I know I sound really dumb lmao but im not sure
Just save the url in a var and use that instead of usere input
Check this out
.stack discord.js api
o
I searches stack overflow
How can I make the bot's server count and member list display in its playing status?
Which lib @earnest phoenix
discord.js
.addField ("Primary Profession",JSON.stringify(body.professions.primary[0].name + body.professions.primary[0].rank), true) How would I make anything past the "+" fall onto a line below it? Can't use \n and such obvs.
what is JSON.stringify(body.professions.primary[0].name + body.professions.primary[0].rank) supposed to output?
it's wow's api
brings up current profession + rank
works
just wanna make format a little nicer 
still not sure I completely understand so I'm taking a shot in the dark here but
would this work: JSON.stringify(body.professions.primary[0].name) + "\n" + JSON.stringify(body.professions.primary[0].rank)
?
cool beans 
-_-
wrong channel
ok im just ask rhis help good or bad ?
yes?
um
but I wouldn't dm
.setFooter(`Total Banned Users : ${client.ban.size}`) how would i get the number of bans from a server?
How do i scrape a dynamic website with PhantomJS? It just scrapes it like a static one
RangeError: You need to provide a client to bind to, either in the constructor of dblposter or in the bind function!
show the rest of the code, the require, and the new dblposter
const DBLPoster = new dbl(`api`);
DBLPoster.bind(bot.guilds.size);```
i type api which i get from DBL website
if dblposter is this https://www.npmjs.com/package/dblposter
then you're missing the client in the new dbl()
Hey, sorry for this post if it seems obvious. I'm new with node.js but understanding more but wanted to see how you would go about this. Say you wanted to welcome user with channel.send(`Welcome to the server, ${member}. Please visit #roles to assign a role.`); but you wanted the #roles to be a clickable channel. Is it possible?
you can do it like
channel.send(`Welcome to the server, ${member}. Please visit ${msg.channel.guild.channels.get(channelId)} to assign a role.`);
Ah thanks! I was quite close then. I had tried the same but ${msg.channel.get(channelId)}
@mystic harness use <#id>
oh, right, it also works...
if(message.author.bot) return;
if(message.channel.type === "dm") return;
let prefix = "-";
let messageArray = message.content.split (" ");
let cmd = messageArray[0];
let args = messageArray.slice(1);
if(cmd === `${prefix}8ball`){
if(!args[1]) return message.reply("Please ask a full question!");
let replies = ["Yes", "No.", "I don't know.", "Ask again later plez."];
let result = Math.floor((Math.random() * replies.length));
let question = args.slice(1).join(" ");
let ballembed = new Discord.RichEmbed ()
.setAuthor(message.author.tag)
.setColor("#FF9900")
.addField("Question", question)
.addField("Answer", replies[result]);
message.channel.send(ballembed);
}
});```
why this code not work >?
π€
Imma get ips
I saw that link
Thanks @sick cloud
You need to specify embed
({embed: ballembed})
For the send function
@earnest phoenix
@night imp i will try ty
If it was just named embed then you could just say embed
because it will just use the key and value
es20something
I want a code of my bot that can dm announcements to my server members
Can anyone of you help me with this?
What's wrong with just mentioning everyone to make an announcement?
100% less api spam
^
if people ignore your announcements api spam won't help Β―_(γ)_/Β―
Won't they just open the DM and close it at this point?
That literally won't do anything
I said i also want to learn it
if you mass DM your bot will het ratelimited, could be banned and it will be annoying
if people ignore ur announcements then 
pmuch all noob-friendly libs will prevent you from reaching the ratelimit
i mean you wont exceed it
so it is fine but still api spam in practice
whats the element for the vote button?
right click > inspect element
class='votebutton'
Make sure to like comment and SMASH that vote button
im looking to convert a integer such as 60000 into 60 mins
what would be the best approach to doing something such as that ?
60000*60 = 3600000 (60 minutes in milliseconds)
in discord.py in on_voice_state_update, the before and after are the equivalent of channel objects?
nvm I can't read docs properly
Is there a way too loop through this data without knowing what abc, abcd, !test etc is?
I am using js
@inner spruce Object.values(myVariable)
ty
how do i send a locale image with a embed? im using eris
Can have a local image with an embed by uploading the image and in the embed of that message would have image url of attachment://imagename.png 
Yeah thanks!
okay
how i can back my bot now ?
what
Does anyone know how to make a bot online 24/7 for free?
How do you make a music command?
you make it
you follow a tutorial
or
look here
Ok
there are a lot tutorial on how to make a bot in js
alright
mongoDB or MySQL ?
mongodb is good for big data
const Discord = require("discord.js");
const { RichEmbed } = require('discord.js')
module.exports.run = async (bot, message, args) => {
const success = new RichEmbed()
.setTitle(`Cleared ${args[0]} messages!`)
.setColor(0x00ff00)
if(!message.member.hasPermission("MANAGE_MESSAGES")) return message.reply("You don't have the required permission to use this command!");
if(args[0] < 1) return message.channel.send("Amount must be larger than 0!");
if(!args[0]) return message.channel.bulkDelete(10).then(
message.channel.send("No amount specified, deleted 10 messages by default!")).then(() => {
message.channel.send(`Cleared 10 messages!`).then(msg => msg.delete(5000))});
message.channel.bulkDelete(args[0]).then(() => {
message.channel.send(success).then(msg => msg.delete(5000));
if(args[0] > 100) return message.channel.send("${args[0] <== 100")
message.channel.bulkDelete(100).then(msg => msg.delete(5000));
});
}
module.exports.help = {
name: "purge"
}``` this deletes loads of messages after the .then bits
why did you have to require discord.js twice
just require it once
bulkDelete returns a promise? 
there is no good explanation for requiring it twice
Can I just have help with the fact it deletes loads please
Apparently it works now
why wouldn't it return a promise lmfao
you will need to parseInt args
Ok
idk @heady zinc
it returns a collection of the deleted messages https://discord.js.org/#/docs/main/stable/class/TextChannel?scrollTo=bulkDelete
javascript performs type conversion
i totally knew that
i parseInt as a habit
but this is javascript 

i like channels https://media.turtle-bot.com/f/9KHod.png
its not
it is
its just that part looks weird to u
no
channel
you can make a channel that is type inteface
you can pass that in to a function

and load the channel in the function
@knotty steeple https://gobyexample.com/channels
why
As much as no sane language would allow comparisons between strings and numbers, no sane language would chose this as mascott
inb4 because its made by google
@heady zinc actually they would
since they can make this qtie http://cultofthepartyparrot.com/guests/hd/partygopher.gif
its not
: (
https://github.com/egonelbre/gophers there is lots of art here
it's so fucking disgusting it's even worse than turtles
can you even believe that
i never thought i'd see the day
imagine being so depressive that you actually have hatred for a mascot
pretty depressing tbh
@knotty steeple so go is weird because you dont get pretty basic types such as interfaces?
god i feel sorry for the developer world if its being taken over by js devs with no knowledge of a basic type system
wew
too late, the entire world runs on dependencies
require("improved-oxygen-particle-physics-and-breathing-system")
who creates a language and is like "implicit global variables? that sounds like a great idea!"
this scope is also unecessarily badly designed
its so bad some of the most hailed people in the community abandoned it because they got sick of it
what would be the correct way to have globals?
explicit
guess they just made it "simpler"
google 
no
its a language so badly designed that the ECMA are having to add new constructs to it to try fix it, but they cant replace the old ones because it would break too many websites
yes
smh
well, despite being badly designed, it still works nicely for most people, and does what they want it to do
same with php
like php, because of bad design decisions and low barrier to entry, its got a load of terrible devs and terrible code out there
and the ecosystem as a whole has suffered as a result
that being said, its slowly getting to a better state
but it made it simpler and more accessible, creating more devs, cheaper websites and cheaper workforce
hence why they push these languages
i pushed to have js replaced with ts at the company i work
typescript?
yea
typescript wew
isnt that just a compiler?
no
typescript is transpiled to javascript
^
its got a nice configurably strict type system
no more of that shit of type x doesnt have property y
basically it helps code better by pointing out issues that regular js doesnt care about
regular js does care about it
it just doesnt tell you until it dies
unless youre gonna suggest that js will pull attributes out if its ass if it doesnt find one on a type
well im not an expert, so i never faced any of those issues
no one never comes across issues dealing with the type system in a dynamically, weakly typed language
not at a decently large scale for sure
theres a reason a lot of larger js projects are migrating or already use typescript
vscode, vuejs etc etc
why wouldnt you though
sometimes i do 
arrow functions are great
im used to regular functions, and they work, so why change
i dont use this either, except if using jquery
then it sounds very much like you havent worked with a codebase of any half decent size :p
either that or god bless the company you work/will work for
i could work as a contractor, but i have my hands full with my own project
working hasnt stopped me from havingmultiple projects
Β―_(γ)_/Β―
you sound a lot like the kinda guy whose codebase i had to take over
implicit global abuse, no arrow functions, no OOP
just a few thousand lines of JS
because its "good enough" and "it works"
yup, thats me
then do yourself a favour and keep working for yourself if you wanna keep it that way
thats my plan
a question tho, is there important reason to use arrows and classes, when you can do the same things the "old way"? like performance gain, compatibility gains, etc
its a lot easier to reason with constructs that are well defined
or is it just to improve cooperation with multiple people?
if only you will ever work on the codebase, then its just a matter of how much do you care about how good your code is for you to code in
if youre working in a place where others in the future or present will be working on it as well, a lot more is at stake then
being able to reason with why your code does what and not have to battle with badly designed and literally ancient constructs can save you a lot of time and headaches
"this" doesnt have property xyz? yea javascript decided to fuck with your scoping again
idk about the future, but for the time being, im the only one who's gonna work with it
and even if i dont use those newer features, i do review my designs and code flow a lot
so i like to think to my self its not that bad, and understandable if anyone ever gets their hands on it
if only you work on it, then youre the only one who you can yell at and and youre the only one who will care about the code :p
think of it this way
if the "old way" is good enough, why are they changing it/adding the other stuff
well, as primarily a web dev, browser compatibility is more of an issue than code design
use transpilers
a few years back when i was more active as a web designer, i absolutely had to work with the ancientest of the techs
babel, webpack
let them take care of that
thats what theyre designed for
to let you use the cool new tech while still having perfect compatibility
babel is nice, indeed
can you do ternary operators in python? if you can, how
Ternary?
idk what it means but in js it would be like
something ? yes(something) : nope(something)
so in our case, something would return true which would run yes(something) but if it wasnt run nope(something)
a if condition else b
oh ok
Does anyone know a good npm package for steam o.O I want to make a steam command that gives you all the info of whatever game you search
just make requests from the api yourself
Error: RSV2 and RSV3 must be clear
?
anyway that's a websocket error, bad payload
So npm install uws?
on a guildCreate event you could do this correct
if (guild.owner.user.id === 'id here') {
guild.leave()
}``` a friend is having issues with some one inviting his bot to multiple servers
thats just to troll him
that looks fine
alright
Can somone tell me how to fix ```js
Uncaught Exception: Error: RSV2 and RSV3 must be clear
Hmmm
if I was requesting something from Steam what URL would I use?
api.steampowered.com <---wouldn't it be this one?
Can somone please help me I cant figure out that error
I did and got this https://github.com/discordjs/discord.js/issues/1762 I tried everything on it and it didnt work
go to the discord.js server and ask
my bot went offline for no reason does anyone know why??
check logs
ok
What service are you using to host it @barren brook
js
You could have stopped the process
he could be self-hosting
Ik
@barren brook did you close the cmd prompt?
yes
ill open it
ok
still offline
run the file
ok
node <filename>.js
alright
Ok I'm here
Oh I forgot about the new layout
what is he trying to do
Yeah it's been off
yes there
@west raptor was showing my bots page to him, but it became irrelevant and I didn't want it floating around even if it hardly showed anything
Got it thank you
ah alright

request.get(`https://store.steampowered.com/api/storesearch?cc=us&l=en&term=${game}`)
I have a question
what would game be defined as
var game = await this.fetchGame
I have it as that
but not sure if it will work
What is this in the current scope?
Depends on your needs
I am trying to make a steam command that requests data from the game a user searches
Like: !steam Rust and it gives the info on that game
Any good guides on sharding with eris?
Eris, a NodeJS Discord library
snekfetch is deprecated
Read docs
so better use something else
oke thanks
Np
should work yes
what are you trying to do?
this is the example they give const { body } = await request.get('https://registry.npmjs.com/node-fetch'); console.log(body);
Ok
I am trying to
request.get(`https://store.steampowered.com/api/storesearch?cc=us&l=en&term=${game}`)
define game
but what I had before
did not work
Which one is better Navy or Army
is it a json response?
Not that I know of
what does body return?
what does the request return?
Also, I am basing it off of this, but not coping the code
https://github.com/dragonfire535/xiao/blob/master/commands/search/steam.js
I want it to do the same thing that does
Returns info on a game
and you're trying to get the game name from that info?
well
I want the URL
to like
when they do !steam Rust
it will return info on that game
@outer niche How is that related to coding?
I did not mean to put it in here sorry
Np π
Well







