#development
1 messages ยท Page 466 of 1
like websites use https but people dont target https they target the juicy backend
i mean you can...
@shy rose im not sure if he knows that there is a law against storing passwords in a textfile for a service is actually a chargeable offence
hmm.
roblox doesnt even store the passwords
they store the cache'd salted encryption stuff
@earnest phoenix i just looked it up... If it's my credentials its pretty much fine. If it's another persons, they get to have the level of encryption they desire (i can't store it).
its not even code anymore
in todays world is a ceasar secure cause in attacks now does anyone try a Caesar shift ๐
@earnest phoenix they literally have a table called passwords
They are just encrypted
Lol
no never store cred of any form in plain text
in plain form...
thats not the point of concern though
I'm gonna use MySQL eventually
its your end with the plain text storage of them
Omp
Boi
Boi
Boi
- Use a library - don't try to write good encryption/hashing code yourself
- Don't store the password, store a hash (bcrypt seems to be good as of this date)
nodejs has crypto build in an enterprise grade quality
- Generate a unique "salt" for each user, and concatenate the password with the salt before hashing. This reduces the risk of rainbow table attacks.
Ok if i hash it can i store it in plain text?
if its hashed and salted then its not plain text
thats not plain text then....
Ok im storing my password
5E884898DA28047151D0E56F8DC6292773603D0D6AABBDD62A11EF721D1542D8
whats my password?
Lol
any ideas
Wit kind of hash?
@shy rose
what you was doing was against pc security standards.
sha 256 no salt
Hold on....
also never use that password
but like you see its not jsut right there you need to do work to get my password
and adding a salt prevents rainbow tables
congrats
now that youve done that heres a decent password
91616edff53fc91197486df85214e2de853e25e1f5bec2f8ad97c9249048c78d
my passwords are all 30 chars long
ann unique
C469812B5475AC2608680AF1CBDB56C7428AC51E49A00B0B3BD1BC2A87C564E7
see heres a better password
but you see its not just plain text
you cant jsut directly revers it
@shy rose hash type?
unlike plain text storage
sha256 no salt
i get the feeling your using a rainbow table
also if that password is on a rainbow table ill be impressed
tony your thoughts on plain text storage of credentials?
if your developing or it's a local project, i see no harm, but if your running it online and others use it / it's in production, it's an obvious no no
has this changed or something in v12 d.js?
(node:2239) UnhandledPromiseRejectionWarning: TypeError: msg.guild.me.voice.channel.play is not a function
.voice is not a property of GuildMember
oh master

well in master, .play is not a method of VoiceChannel, its on VoiceConnection
so channel.connection.play
ohh ok
wtf is this?
SyntaxError: Lexical declaration cannot appear in a single-statement context
Lexical declarations introduce new declaration forms for defining variables using the let and const keywords
@sick cloud are you doing it like let [a] = 1?
if so then remove the []
idk if its an ES6 problem or not
no, and ok
is there a line reference?
if(rows.length < 1) prefix = ".";
if (rows[0].prefix) prefix = rows[0].prefix;
this is mysql
in the test bot it give me the prefix
but in the vps
the bot crash
typeError: Cannot read property 'prefix' of undefined
if (!rows.length < 1) {
if (rows[0].prefix) {
prefix = ".";
} else {
prefix = rows[0].prefix;
}
} else {
prefix = ".";
}```
and make sure prefix is defined
like var prefix = ""
etc
@hot sleet row may exist but prefix might not
or it could be mispelt
but the code works well on my pc
but not the server?
yeah
my bad
i will clear everything then i will try again
im wiping my server lol, some kid tried to dox my site and failed
@earnest phoenix it worked when i added
if (!rows[0]) return;
if (rows[0]) console.log(rows[0])```
before the code
const Discord = require('discord.js');
const db = require('quick.db');
const bl = new db.add('blacklist_$');
exports.run = async (Discord, client, message, args) => {
let user = message.mentions.users.first();
await bl.set(`${user.id}`)
message.channel.send(`${user.id} has been blacklisted from all iManager commands.`)
}```
What is wrong with that?
@sharp grotto it blacklists Users
Hmmm
I have never tried that
If it was blacklisting words it would be easier
Sorry, unfortunately i cannot help with this!
ugh
If there is anything else you need help with im happy to help!
Just pm/dm me
Thanks for your time
use a proper database
and use an array of user IDs
if the array includes the ID, return
then switch, quick.db sucks
Well It was temp there until i rewrite it all
it's json iirc, prone to corruption and race conditions
I don't know what to do... (my bot is offline)
read the guide papi gave you
what papi?
ok
i need help with my status thing for my bot like guilds, shards etc, for dbl, but i use this code: but it does not work
local json = require('json')
local http = require('coro-http')
local discordia = require('discordia')
local DBL_Auth = 'my dbl token (secret ofcurse)'
local client = discordia.Client()
local data = {
['server_count'] = #client.guilds,
['shard_id'] = shard,
['shard_count'] = allShards
}
http.request('POST',string.format('https://discordbots.org/api/bots/%s/stats',client.user.id),{
{'content-type','application/json'},
{'authorization',DBL_Auth}
},json.encode(data))
it just catches error
& i use lua btw
snekfetch.get(url, opts => {
snekfetch.set(Authentication, "secrete ^^");
})
.then(console.log(snekfetch.body))```
it gives me this error Error: 401 Unauthorized
what is that for
fortnite stats
maybe check the url
its perfecy
let url = `https://api.fortnitetracker.com/v1/profile/${platform}/${args[0]}`
perfect*
Great
i will re send the problem
snekfetch.get(url, opts => {
snekfetch.set(Authentication, "secrete ^^");
})
.then(console.log(snekfetch.body))```
it gives me this error Error: 401 Unauthorized
- snekfetch is deprecated
- that's not how you do it
i don't know how to do it with snekfetch anymore
agh
or node-fetch
should i learn how to use node-fetch
i personally use request 
i use node-fetch
ok it will take about from 1 min
unless a project previously used snekfetch
to 1 day
snekfetch.get(url).set('authorization', 'token').then(...)
would be the correct use for snekfetch
is it authentication or authorization
idk i copied it
wheres the api docs
it doesnt say what header it needs
so
fetch(url, {
method: 'GET',
headers: { 'authentication': 'no api key this time' },
})
.then(res => res.json())
.then(json => console.log(json));```
try authorization
{ message: 'No API key found in request' }
no api keys
fetch(url, {
method: 'GET',
authorization: 'heck here'
})
.then(res => res.json())
.then(json => console.log(json));```
@bitter sundial was my mistake
your keyword is wrong
their docs suck
xD
How do you install discord.py for python?
Depends on which version you want to install
@hot sleet
Nvm
def is_repeat_none(self):
""" TODO """
return self.repeat_state == PlayerRepeatState.NONE
@property
def is_repeat_all(self):
""" TODO """
return self.repeat_state == PlayerRepeatState.ALL
@property
def is_repeat_single(self):
""" TODO """
return self.repeat_state == PlayerRepeatState.SINGLE```
whats wrong with this i see nothing wrong
got it working
after hours
oof
happy me
Is it just me or does guildDelete event make the Bot go off for a few seconds?
Or is that a bug with my client?
doesnt make my bot go off
Let me see again
See? It's offline for a few seconds, I'm not sure if this is a bug with my client
is there a way to check cpu usage in js? rn i only have a command to check memory and would like a general stats command
and what do you need help with?
https://github.com/oscmejia/os-utils @viscid falcon
thank you!
it will give the avg load of the cpu
in what a percentage?
i updated the link
var os = require('os-utils');
os.cpuUsage(function(v){
console.log( 'CPU Usage (%): ' + v );
});
os.cpuFree(function(v){
console.log( 'CPU Free:' + v );
});
``` sample from github @viscid falcon
ok thanks
@earnest phoenix and whats your problem, you still havnt said
then learn express
then dont use it
most help pages use express? 
correct me if im wrong
but express is a web server
please copy and paste the part of that that is a question
nothing to do with the page itself lmao
ok well if you know html, css, js like you said
just serve the help page with a different server
cant be that hard
^^^
you havnt even asked a question really
ok so use php
wew lad
first google result
updated 48h ago
made by evie from AIG
that was hard to find 
thats impressive that it took that much work to find
hello people , ``` async def cmd_repeat(self, player):
"""
Usage:
{command_prefix}repeat
Cycles through the repeat options
"""
if player.is_stopped:
raise exceptions.CommandError(
"Can't change repeat mode! The player is not playing!",
expire_in=20)
player.repeat()
if player.is_repeat_none:
return Response(":play_pause: Repeat mode: None", delete_after=20)
if player.is_repeat_all:
return Response(":repeat: Repeat mode: All", delete_after=20)
if player.is_repeat_single:
return Response(":repeat_one: Repeat mode: Single", delete_after=20)```
this doesnt seem to repeat the stupid song
What does player.repeat()/is_repeat_all do
?
I'm pretty sure you need to show what the player.repeat() actually does to be able to figure it out
this?
def is_repeat_none(self):
""" TODO """
return self.repeat_state == PlayerRepeatState.NONE
@property
def is_repeat_all(self):
""" TODO """
return self.repeat_state == PlayerRepeatState.ALL
@property
def is_repeat_single(self):
""" TODO """
return self.repeat_state == PlayerRepeatState.SINGLE```
Uh yeah do you have the repeat() function, as thats the main thing
""" TODO """
if self.is_repeat_none:
self.repeat_state = PlayerRepeatState.ALL
return
if self.is_repeat_all:
self.repeat_state = PlayerRepeatState.SINGLE
return
if self.is_repeat_single:
self.repeat_state = PlayerRepeatState.NONE
return
raise ValueError('Cannot pause a MusicPlayer in state %s' % self.state)```
@fast marten
idk it is allowed but
i need idea
does anybody have
How would I make an unban command (Discord.js / Node.js)
message.guild.unban()
that is very wrong
that is very right
yeah
const reason = args.slice(1).join(' ');
bot.unbanReason = reason;
bot.unbanAuth = message.author;
const user = args[0];
const modlog = bot.channels.find('name', 'l---server-logs---l');
if (!modlog) return message.reply('I cannot find a mod-log channel');
if (reason.length < 1) return message.reply('You must supply a reason for the unban.');
if (!user) return message.reply('You must supply a User Resolvable, such as a user id.').catch(console.error);
message.guild.unban(user);
message.reply(`Successfuly unbanned <@${user}>`)
found at internet
@obtuse wind
internet?
also spoonfeed much?
right there
yep it is
its just code for people to steal
yep it is
why did you link it 
can any one me with this lib? https://github.com/oscmejia/os-utils im unsure of how to get a cpu usage percentage without a function
@viscid falcon it's a callback function, if you don't want to use it as it is make a Promise that calls it and summon it using await in an async function
or... OR calcualte the cpu usage yourself without a module 
Okay I made a bot for this server right, and it keeps track of when the moderators go offline and online using presenceUpdate but that also counts the game playing, so when their game changes or updates etc, it will trigger it, but i want it to only do status, any way of that?
does presence update give the presence before and after?
yeah newMember and oldMember
But if they go offline their game will change aswell
so can you check if their status is 'offline'?
yes, so jsut dont do anything in that case 
So
if(newMember.game == oldMember.game) {
//
}```
no
thats idk what im doing tbh lmaoo
bot.on('presenceUpdate', (oldMember, newMember) => {
let statuscheck = bot.channels.get("480506245384634378");
let gizmoslip = bot.guilds.get("335187392719749133");
let moderatorrole = gizmoslip.roles.get("335190687886606338");
var moderators = moderatorrole.members.array();
console.log(moderators);
moderators.forEach(mod => {
if(newMember.user.equals(mod.user)) {
let yes = new Date();
statuscheck.send(`${yes} ${newMember.displayName} went ${newMember.presence.status}`)
}
});
})```
this is my current code
is .equals even a method of user?
yes
wew
well you shouldnt loop through them like that and check if they are equal
and you shouldnt do equals anyway, jsut check ID
what you should do is:
ok well it is a problem first of all
its not the problem i need help with
bot.on('presenceUpdate', (oldMember, newMember) => {
let statuscheck = bot.channels.get("480506245384634378");
let gizmoslip = bot.guilds.get("335187392719749133");
let moderatorrole = gizmoslip.roles.get("335190687886606338");
var moderators = moderatorrole.members
if (moderators.has(newMember.id)
&& oldMember.presence.status !== newMember.presence.status) {
//do ur thang
}
})
now you could probably change the order to not get all the roles if the status is the same
since in that case it would be redundant
and no need to mix var and let
those should all be const
but thats the basic idea
@slim heart
Okay, thank you.
how do I save data to a file so like warnings so I can display them
with a database
how do I made a data base
well you have to do some research of different databases and find which one is right for your application
guys listen i have rlly stupid idea but i need. how do I make a bulk announcement for servers where my bo is?
example use: The bot closed for a while cause of develop
you dont because thats against TOS
you announce it in a support server
sad :(
how do I get a guild name? msg.author.guild.name?
Can't it just be msg.guild.name?
it can
how do u change ur bot's name color on dbl description?
Is there a way to differentiate people other than names ? I want some commands to be used only by some whitelisted people.
@earnest phoenix use css
I can't seem to get user ID in java.
can anyone help me with discord.js-lavalink cuz im having trouble setting it up
fs.readFile(`./apilist.txt`,`utf8`, function (err, data) { if (err) throw err; data.split('\n').forEach((currentLine)=>{ let apipass = currentLine.split(":")[1] let apiurl = currentLine.split(":")[0]
Im using that to separate my api list.
BUT the apipass has is like this
apipass here
line after it ^
How can I fix that?
NodeJS (if thats not apparent)
i dont think you can split by \n
I did it with str.substring(str.length()-19,str.length()-1); There is probably an easier way but I couldn't find it.
@knotty steeple How should I then?
maybe a character like |
well sir
my url document is like this:
api.url.ext:apifor
it NEEDS to be by line
@knotty steeple
@dusky helm
Hew hew hew
Got this at the end of my npm update: anybody know what it means?
found 1 critical severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
it means one of your packages in npm has a critical vulnerability
hmm
if you read it, it says to do npm audit to get details
ok
aka package name, version, what the exploit is, etc
and maybe you can update it or get another package to replace it
is this safe to proceed with?
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Manual Review โ
โ Some vulnerabilities require your attention to resolve โ
โ โ
โ Visit https://go.npm.me/audit-guide for additional guidance โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Critical โ Sandbox Breakout โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Package โ safe-eval โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Patched in โ No patch available โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Dependency of โ google-translate-api โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Path โ google-translate-api > safe-eval โ
โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ More info โ https://nodesecurity.io/advisories/337 โ
โโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
well safe-eval and judging by the "more info" link is pretty bad
dpends how google translate api is using it
why does it need it tho 
idek
yeah tru
ok i would NOT use that holy jesus
it evals the response body fuck me sideways
wat
oh my god
i feel like thats a disaster waiting to happen
yes, definitely
so, create my own custom fork, and remove the eval?
yep thats an option
cuz i dont know any replacements
and npm install google-translate-api@githubusername/google-translate-api
ok thx
but yeah looks like that "safe"eval can be replaced most likely
yeppers
so ur on the right track to justfork and fix
that "safe"eval doesnt seem safe at all
or leave out the safe eval
ikr
hell no it aint
i feel like somebody oculd find a smart way to translate text that includes some malicious code
and itwould eval that as part of the response
and rip ur bot
i'm going to create a github org for my bot, host all of these forked repos there
@earnest phoenix i commited to github, ran npm i -S google-translate-api@mini-me-makers/google-translate-api and got this:
npm ERR! code ENOPACKAGEJSON
npm ERR! package.json Non-registry package missing package.json: google-translate-api@github:mini-me-makers/google-translate-api.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/node/.npm/_logs/2018-08-19T19_37_12_695Z-debug.log
oh i just read the package.json shit, sry about the ping
yep
that's funny, there is a package.json file in my current directory
@earnest phoenix but the package has got a package.json github even shows it: https://github.com/mini-me-makers/google-translate-api/blob/master/package.json
๐ค weird...
so is there anything i can do to make it recognize the package.json file?
OH
thats not about the package
uhh actually wait
waiting...
yeah the package.json in the repo is invalid
check the last dependency its got an extra comma
fix that and i _think _ it should work
weird that it says "no package.json" when its just a parsing error 
hmm

works?
oh yeah that could have happened when you removed the dependency :p
yeah
yeppers, it works, 0 vulnerabilities
๐
i do pride myself
# --SETFIELDNUM--#
@embed.command()
async def setfieldnum(self, ctx, num: int):
"""Sets the number of fields for the embed to use.
PLEASE NOTICE!
Defining a new field number will reset all fields."""
with open("../DSB_Files/embeds.json", "r") as filetoread:
embedsdict = json.load(filetoread)
try:
embedsdict[str(ctx.guild.id)]["fieldcount"] = num
for x in num:
exec("embedsdict[str(ctx.guild.id)][\"field_{" + str(x) + "}\"] = {\"name\": \"Field " + str(x) + " Name\", \"value\": \"Field " + str(x) + " Value\"}")
with open("../DSB_Files/embeds.json", "w") as filetowrite:
json.dump(embedsdict, filetowrite)
await say(ctx, f":white_check_mark: - Embed field count set to {num}!")
except KeyError:
await say(ctx, ":interrobang: - The bot had problems saving the settings! Did you even create a template? ``DD!embed create``")```
The for x in num: returns a "int object is not iterable"
The input has to be an int. The input is also saved to "num"
I put in a number, it returns that.
Err, so remove the : int for the num definition?
its not possible
yes, but also, dont use it with an int, or you will get an error
Then I can do a for x in range(num): maybe?
yes
range() accepts only ints. That's the key. Thanks.
np
fs.readFile(`./apilist.txt`,`utf8`, function (err, data) { if (err) throw err; data.split('\n').forEach((currentLine)=>{ let apipass = currentLine.split(":")[1] let apiurl = currentLine.split(":")[0]
Im using that to separate my api list.
BUT the apipass has is like this
apipass here
line after it ^
How can I fix that?
.trim() iirc
@inner jewel So can I use it like:
let apipass = currentLine.split(":")[1].trim()
?
that'd work
I forgot about trim 
there was a picture that shows how to convert userID to account creation date, can someone re-post it?
Isnt that in the api docs?
Any way to use a proxy for the WHOLE application (I access several APIs)?
How do i clear reactions from a user? discord.js
reaction.remove
I swear I can't find this anywhere, how can I create an invite url for my bot in discord.py?
https://www.youtube.com/watch?v=8o7I69O1RzE @knotty steeple
#roadtodiscordpartner Mic in this one may be a bit quieter mainly because I did it at night. Today I show you how to await messages, and create a basic votin...
@slender lagoon Just have one premade.
i dont think i need a tutorial for just one thing
I told u how to do it
it wasnt really helpful
@earnest phoenix ok thanks, thought there was a function.
@slender lagoon Might be, yet a premade would be much easier than scanning the docs. No?
@earnest phoenix well if there was and you knew, no docs scanning would be needed ๐ฌ
Thanks anyway, I'll make a premade one ๐
๐
eh im gonna go look at the docs myself
@knotty steeple you can use removeAllReactions
to remove all of them
and thats on the message itself
would that work on a reaction collector
@knotty steeple Yes
so how do i make it not do that
so
MessageReaction.remove(user)
if you have a message with a \๐ emoji
you can use
<Message>.reactions.find(r => r.name === '๐').delete();
i think
that or this?
<Message>.reactions.find(r => r.name === '๐').filter(u => u.id === 'a user id to remove').first().delete();
anyone knows how to draw circles in go?
hahaha so funny
Lol sorry matey
(password generator for discord.py bot)
I just get a huge error when compiling and have no idea how to find the issue itself.... *sigh*
did you try asking for help instead or just complaining, people here are pretty nice
@grizzled mango why are you pasting that
are you not allowed?
it's offtopic and self promotion
How do you get discord.py?
look at the docs
how would i send/edit a message to a specific channel on a specific guild
@viscid falcon lang?
y
You gotta read em. I know it sucks.
client.channels.get(channelID).send('My Message');
I wont be a dick though. ^
thanks
Anyone knows a good way to get multiple values from a json-object through okhttp (java)?
Basicly I want to get the values in http://whatthecommit.com/index.json without requesting it multiple times, because it then would give other outputs.
@earnest phoenix dude chill
NodeJS?
Anybody know how to design a leaderboard through embedding?
Some people need to type first
@compact wraith Design or coding or both?
Well, morely coding
Yeah no worries
Is it possible to jump in testing 1, not the best at explaining
yes
I think he/she means voice ๐ค
lol yup https://i.imgur.com/eJix6od.png
Still need to find a way to get and temporarly store multiple json-values
lol.
nvm found something interesting...
Java needs JON lmao
@earnest phoenix it didnt work
hey nootin
var response = ....
var object = new JSONObject(response);
var permalink = object.getString("permalink");
var hash = object.getString("hash");
var message = object.getString("commit_message");```
client.channels.get(channelID).send('My Message'); this code charles gave me didnt work
any ideas why
it say cannot read property send of undefined
Anyone any good with python?
make sure ID is a string @viscid falcon
oh thanks
Alrightly
in like 18 seconds ill find out if it worked
lol
@inner jewel I use java 8 which to my knowledge doesn't use var...
And I found something. I can simply put .json behind a permalink to get the values it has...
So uh heres the code in index.
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
app.get('/', function(req, res){
res.sendFile(__dirname + '/index.html');
});
io.on('connection', function(socket){
console.log('User Connected to Talko');
});
http.listen(3000, function(){
console.log('listening on *:3000');
});
io.on('connection', function(socket){
socket.on('chat message', function(msg){
console.log('message: ' + msg);
});
});
io.on('connection', function(socket){
socket.on('chat message', function(msg){
io.emit('chat message', msg);
});
});```
Thanks anyways
yay it works
@misty pawn you already have everything in that json
๐
no need to do 3 requests to get all data
also you can just replace var with the type of the thing
eg String/JSONObject
Alright, so @inner jewel
nah use let 
nah, java doesn't have a retarded implementation of var

and moose sucks butt, any idea on how i would edit that message, i see thiers .edit, but i dont know what to use it on
This is all I have so far.
are you planning on running it on your computer or in an actual server?
when are you needing to edit it?
on an interval, every 3 min
o
if you just use localhost:port in a browser you shouldn't need to worry about anything
im doing a live stats thing that updates periodicly
on a server you'd probably want to remove the :port part and keep just domain
Yes, but Natan
oh ok
I would want friends to be able to connect.
which is where a reverse proxy/port proxy comes in
you'd need to open the ports on your router/whatever
Damnit
Alright.
@inner jewel I'm not really sure, if I know enough java/json to know how to use that properly ๐
when you create the message store either the message object or the message's ID @viscid falcon
you already have a string with the response
you just need to parse it
literally just new JSONObject(theString)
and would i .get the id from that channel?
and then do js <msg>.edit('<new text>');
do let messageid = msg.channel.send().id; when you send the original message
ok thanks
you'd need to await that
^
or use a callback
nope either
not message.id?
let id;
msg.channel.send('stuff').then((m) =< {
id = m.id;
});
//id is undefined```
any code below the then() call
would have id as undefined
so what would i do im confused?
if i cant use id then how would i store the original message as an object?
const { id } = await msg.channel.send('stuff');
^^^^^^^^^^^^^^^^^
and use that in cunjunction with moose's code?
don't use moose's code at all
for editing the message? yes
actually no
lmfao
Actually, @uncut slate , wouldn't that give you the message object, not the ID?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
o nevermind you're right
moose pls
yes friend de jonas
let's keep things related to #development, thanks
ok billy bob
@inner jewel Sorry, but I'm more confused than before....
I tried to use something like this and later used JSONObject json = HttpUtil.getFakeGit(); (getFakeGit is just a simple thing that returns null on a failure (catch)):
private static JSONObject fakeGit() throws Exception{
Request request = new Request.Builder()
.url("http://whatthecommit.com/index.json")
.build();
Response response = CLIENT.newCall(request).execute();
try(ResponseBody responseBody = response.body()){
if(!response.isSuccessful()) throw new IOException("Unexpected code " + response);
return new JSONObject(Objects.requireNonNull(responseBody));
}
}
.string()
giving the response body to org.json won't do what it looks like it does
you need to read it first
and give a string to org.json
That's what I used before (just a example)
requireNonNull(responseBody).string()
Works now.
Thanks for having patience with me ๐
are you using nodemon?
is there anything else before that?
no
usually that message contains something like ```<--- JS stacktrace --->
==== JS stack trace =========================================```
and more stuff before
other than that it seems to be a crash possibly caused by an infinite loop or running out of memory
what node version and discordjs version?
achoo
bless you
achoo of this get for
+ bing
- bong
[ding]{dong}```
thank you 
hello:
world
hmm
thats makefile
i use LESS for enable/disable toggles in my settings command
example?
[enabled option]{disabled option}```
o wait actually no
i use this one for something else
let me remember what i used
[test]{test}```
this one
well yea i use diff for updatelogs
enabled disabled
cool
thats nice
yeah
An important detail I feel like is often forgotten when it comes to using syntax highlighting outside of code is that it should be an enhancement, not the core of the information, with mobile not supporting highlighting. Probably depends on the bot as well given using mobile on some bots wouldn't make sense though.
yeah
like my bot on mobile isn't an issue
because nobody uses it
my help command informs that colors are not available in mobile, and to refer to the brackets instead
that's a good solution too
the problem is, nobody actually reads the help command
.>
and i spent so much time on it too
https://i.imgur.com/glzCiKe.png my help is embeddy af
#commands those are animated
its a lot lol
wew
ohh
i made it so when i add new commands i dont have to change the amount of commands it slices all the time
lmao
i always forget bots can use animated emojis
mine's paginated too
my help isn't dynamic
but manually, assigned
i need to fix it
i dont plan on adding anything new for the time being tho
this should work right client.clearInterval(loop);?
yea should work
can you call clear interval like that?
well it isn't
idk i think you cant do that unless you save clearinterval as a function assigned to the object
the interval functions belong to the window/global object
idk if you can assign them to another object
as i said
it maybe only works when you do it with bot
var interval = setInterval();
clearInterval(interval);```
client.setInterval is nothing but a wrapper for setInterval, which also cleans up any intervals when you destroy the client
@zealous veldt it's not no color bar
oh i didnt know djs did that
it's just color bar == background
awesome thanks
tho that looks stupid on light theme
people who use light theme are stupid
they are
okay
o
```ini
[ hello ]
; world
: yes
```
thanks
np
@inner jewel
Got everything done
I just used a port fowarding rule off of OpenVPN
๐
noice
how do i shard with discord.py
1. use discord.js

how do I make the bot display how many servers its in on the discordbots website. right now it says N/A
Go to discordbots.org and check out the api link in there. Either do the REST requests yourself or download a lib for the language you wrote your bot in
Also I think itโs better to continue discussing this in #topgg-api
@dense needle
@latent heron async or rewrite
rewrite
Is there ANY way to use a proxy for the WHOLE bot application? I connect to several APIs that I need proxies for.
NodeJS/DiscordJS
Give me a ping with solutions.
Iโd assume using a vpn or something on your machine itself is the easiest solution @earnest phoenix
@pale marsh It requires like 50 proxies/new IPs.
Why would you even need proxies?
[REDACTED]
I have APIs that are connected to several times a minute, they time out the IP after just a few.
why do you need a proxy for the whole bot then? if they are timed out individually
Then youโre basically doing something against some ToS and you want us to help with it. Sorry but no
@pale marsh It isn't against the TOS at all.. They just do it to try stopping mass DDOS attacks.
I have already looked.
@quartz kindle What do you mean?
They timeout the whole IP address? What kind of api is that
its probably a rate limit by ip
@pale marsh It gets timmed out for a certain time
typical in open/tokenless apis
but like, if you have api A B and C, you're using a different proxy for each of them, having an extra proxy for the whole bot wont make any difference
unless you want only 1 proxy, and have all APIs under it
I want 1 proxy, all under it.
the thing is, you cant change the bot's ip without disconnecting/reconnecting to discord
so keep the proxy only for the APIs, not for the bot itself
Well, let's say the bot didn't disconnect. How should I do it?
Wait
Cant i make it so that the whole bot isn't under the proxy
But only the apis
set up a proxy server that listens to a port or target ip for example, and send your API requests to that
you can
How would I setup the proxy server? 
It's not exactly in any documentation.
If u help me with this ull be a god lol
i havent used any proxy server so i cant tell the details, but in theory, you would set up a proxy program running in your computer listening to localhost for example
and in you code, the apis will look something like this http.get(localhost/destinationiporaddress)
so the proxy program should intercept and reroute those requests
but i cant help you further because i havent actually tried it
Would that be another NodeJS app or the same one?
@quartz kindle would you be willing to do it for a bit of pay?
๐ ๐ค
Oooi
Thanks mate
Yeah the docs are very vague as most of them are
Ill have to play around
fr
does anyone know the endpoint to get a user's status... like online, idle etc
what lib
There isn't a specific endpoint. It depends on the guild relationships.
As far as I know
oh ok
can anyone help me figure out why my bot is having 2 processes
like it says the same command 2 times
discord python rewrite
Were you running two instances of your script?
Where've i messed up?
msg isn't a included function is my error
Now its not defined?
Ive created the first ai, to mess with me
Well what is inlcudes supposed to be
I think includes() is what you are looking for
First time actually using the code so im just following a video, but ive messed up somewhere and ive been sat here for 30 mins trying to figure out what ive done
the guy hasnt showed where hes defined msg
probably with Context.Message.Content. Or sth like that
why is my name hoister no hoisting
your name has [ as the first character which puts you higher up on the online list which is hoisting
Because of that xd
kk
@compact wraith .setAuthor(โNickโ, ImageURL)
or you can use setTitle
It just says msg.inlcudes is not a function
@compact wraith I believe msg is deprecated. Use message. Also, you spelt includes wrong
@slender thistle ?
I forgot what the link was, hold on :^)
lol np
Wait, which version of Discord.py are you using?
headers = {
"Authorization": self.token,
"Content-Type": "application/json"
"server_count": len(self.bot.guilds)
}
async with aiohttp.ClientSession() as session:
await session.post("https://discordbots.org/api/bots/{}/stats".format(self.bot.user.id), data=headers)
Was it something like that 
Oh, Content-Type
Just change guilds with servers
wat
msg cant be depreciated
its whats in the brackets <Client>.on("message", () => {})
so if he put msg there it should work ๐
if its not msg then its probably message
but you cant say its depreciated, its not defined
i can't give a role to the user which is on args 
like
args.user.addRole(args.role.id)
can someone help?
pretty sure args is the message content
args: [
{
key: 'user',
label: 'kullanฤฑcฤฑ',
prompt: 'Kime rol vermek istersin?',
type: 'user'
},
{
key: 'role',
label: 'rol',
prompt: 'Bu kiลiye hangi rolรผ vermek istersin?',
type: 'role'
}
]```
msg.member.addRole(args.role.id) gives the role to the author but i can't make it give to the user
since args is array that wont work 
Well I'm new to creating bots and I was following the steps of; https://www.digitaltrends.com/gaming/how-to-make-a-discord-bot/
And when I come to the Command Prompt part when I type the command it says "Access is Denied" can you help me fix it?
@west raptor.
type in what command
^
https://gyazo.com/bfca254b54864aabac35cb2477171840
Instead of my name.
C:\User[name]\Desktop\DiscordBot>node bot.js
that command
Hm, let me look at that tutorial real quick
Okay.
i suggest another tutorial
because thats using discord.io
and its outdated as fuck
no
o
you know basic js?
^
A friend also used that tutorial
Straight up told them it discord.io is a bad lib to go with as a beginner
Atleast
Imo
@slender thistle where do I put the token?
no its just
In a variable self.token ofc :v)
so self.token = "TOKEN"? xd
https://discord.js.org/ is better for beginners 
^
The devs are constantly updating it
Ok ty
wouldnt have this prob if he did
true
This might sound dumb, no lol. My friend tried to help me out but it got confusing as I'm a begginger ๐ญ
Okay thank you guys for the help
you cant just make a bot and you dont know how to code
you can go on websites like codecadamy and sololearn which i very much recommend
and get a code editor
notepad++ 
I personally recommend VSC
But
It's not good for like first time coders
Atom is good choice if it's your first time
Or notepad++ like Tom said
YES
is normal Notepad fine?
NO
no
No
No
notepad++ highlighting is perfectly fine 
Get atom
Or notepad++
af
visual studio is great
and its not as slow as atom
u can make coffe e while it boots up
Atom isn't slow
it is
Okay
Not for me
visual studio is for c# 
I got Notepad++
vsc is shit





