#development

1 messages ยท Page 466 of 1

earnest phoenix
#

It's already hashe

#

D

shy rose
#

like websites use https but people dont target https they target the juicy backend

earnest phoenix
#

I can't hash it again

#

Lol

shy rose
#

i mean you can...

earnest phoenix
#

@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

shy rose
#

yeah...

#

what gave it away

earnest phoenix
#

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

shy rose
#

in todays world is a ceasar secure cause in attacks now does anyone try a Caesar shift ๐Ÿ˜›

earnest phoenix
#

@earnest phoenix they literally have a table called passwords

#

They are just encrypted

#

Lol

shy rose
#

no never store cred of any form in plain text

earnest phoenix
#

No

#

It's a sql

shy rose
#

in plain form...

earnest phoenix
#

No

#

No

#

Roboox uses sql

#

Roblox

#

Lol

shy rose
#

thats not the point of concern though

earnest phoenix
#

I'm gonna use MySQL eventually

shy rose
#

its your end with the plain text storage of them

earnest phoenix
#

Omp

#

Boi

#

Boi

#

Boi

#
  1. Use a library - don't try to write good encryption/hashing code yourself
#
  1. Don't store the password, store a hash (bcrypt seems to be good as of this date)
shy rose
#

nodejs has crypto build in an enterprise grade quality

earnest phoenix
#
  1. 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?

shy rose
#

if its hashed and salted then its not plain text

earnest phoenix
#

But u can store hashes in plain text

#

Lol

#

Wut eber

#

Ever*

shy rose
#

thats not plain text then....

earnest phoenix
#

Oh

#

Yeah true

#

I thought u meant .txt

shy rose
#

Ok im storing my password
5E884898DA28047151D0E56F8DC6292773603D0D6AABBDD62A11EF721D1542D8
whats my password?

earnest phoenix
#

Lol

shy rose
#

any ideas

earnest phoenix
#

Wit kind of hash?

#

@shy rose

#

what you was doing was against pc security standards.

shy rose
#

sha 256 no salt

earnest phoenix
#

Hold on....

shy rose
#

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

earnest phoenix
#

password

#

@shy rose

shy rose
#

congrats

earnest phoenix
#

Lol

#

Nice one

shy rose
#

now that youve done that heres a decent password

earnest phoenix
#

91616edff53fc91197486df85214e2de853e25e1f5bec2f8ad97c9249048c78d

#

my passwords are all 30 chars long

#

ann unique

shy rose
#

C469812B5475AC2608680AF1CBDB56C7428AC51E49A00B0B3BD1BC2A87C564E7

#

see heres a better password

#

but you see its not just plain text

#

you cant jsut directly revers it

earnest phoenix
#

@shy rose hash type?

shy rose
#

unlike plain text storage

#

sha256 no salt

#

i get the feeling your using a rainbow table

shy rose
#

also if that password is on a rainbow table ill be impressed

sick cloud
shy rose
#

tony your thoughts on plain text storage of credentials?

sick cloud
#

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

earnest phoenix
#

See @shy rose

#

It's totally fine for now

sick cloud
#

has this changed or something in v12 d.js?

(node:2239) UnhandledPromiseRejectionWarning: TypeError: msg.guild.me.voice.channel.play is not a function
earnest phoenix
#

.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

sick cloud
#

ohh ok

sick cloud
#

wtf is this?

SyntaxError: Lexical declaration cannot appear in a single-statement context
earnest phoenix
#

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

sick cloud
#

no, and ok

earnest phoenix
#

is there a line reference?

sick cloud
#

oh, maybe

#

i found it

hot sleet
#
        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

earnest phoenix
#

hmm

#

try this

#

@hot sleet row[0].prefix doesnt exist

hot sleet
#

what

#

rwos is already existed

#

rows*

earnest phoenix
#
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

hot sleet
#

but the code works well on my pc

earnest phoenix
#

but not the server?

hot sleet
#

yeah

earnest phoenix
#

hmm.

#

are you using mysql? or sqlite

slender thistle
hot sleet
#

mysql

#

online mysql

#

i use .block command and it working on the bot

earnest phoenix
#

my bad

hot sleet
#

no

#

you tried to hep

#

help

#

thanks

earnest phoenix
#

i didnt see that

#

try to output everything in the rows

hot sleet
#

i will clear everything then i will try again

earnest phoenix
#

im wiping my server lol, some kid tried to dox my site and failed

hot sleet
#

@earnest phoenix it worked when i added

        if (!rows[0]) return;
        if (rows[0]) console.log(rows[0])```
before the code
earnest phoenix
#

wow thats uh

#

really interesting

worn hull
#
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

sharp grotto
#

Hmmm

#

I have never tried that

#

If it was blacklisting words it would be easier

#

Sorry, unfortunately i cannot help with this!

worn hull
#

ugh

sharp grotto
#

If there is anything else you need help with im happy to help!

#

Just pm/dm me

#

Thanks for your time

sick cloud
#

use a proper database

#

and use an array of user IDs

#

if the array includes the ID, return

worn hull
#

well most of my commands use quick.db

#

like bal,ban,mute,warn

sick cloud
#

then switch, quick.db sucks

worn hull
#

Well It was temp there until i rewrite it all

sick cloud
#

it's json iirc, prone to corruption and race conditions

light tangle
#

I don't know what to do... (my bot is offline)

sick cloud
#

read the guide papi gave you

light tangle
#

what papi?

sick cloud
#

read that

light tangle
#

ok

gaunt blade
#

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

knotty steeple
hot sleet
#
    snekfetch.get(url, opts => {
        snekfetch.set(Authentication, "secrete ^^");
    })
    .then(console.log(snekfetch.body))```
#

it gives me this error Error: 401 Unauthorized

knotty steeple
#

what is that for

hot sleet
#

fortnite stats

knotty steeple
#

maybe check the url

hot sleet
#

its perfecy

#

let url = `https://api.fortnitetracker.com/v1/profile/${platform}/${args[0]}`

#

perfect*

knotty steeple
#

well only other thing i can say is check your token

#

otherwise idk GWcmeisterPeepoShrug

hot sleet
#

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

torpid juniper
#
  1. snekfetch is deprecated
  2. that's not how you do it
#

i don't know how to do it with snekfetch anymore

hot sleet
#

agh

knotty steeple
#

use request

#

or node-fetch

torpid juniper
#

or node-fetch

hot sleet
#

should i learn how to use node-fetch

torpid juniper
#

yes

#

it's easier

knotty steeple
#

i personally use request GWqlabsOilUp

torpid juniper
#

i use node-fetch

hot sleet
#

ok it will take about from 1 min

torpid juniper
#

unless a project previously used snekfetch

hot sleet
#

to 1 day

bitter sundial
#

snekfetch.get(url).set('authorization', 'token').then(...)
would be the correct use for snekfetch

hot sleet
#

agh

#

i will try that

#

๐Ÿƒ

#

same error

bitter sundial
#

is it authentication or authorization

hot sleet
#

idk i copied it

bitter sundial
#

wheres the api docs

hot sleet
#

new error, but in node-fetch
{ message: 'No API key found in request' }

bitter sundial
#

it doesnt say what header it needs

hot sleet
#

so

#
fetch(url, { 
        method: 'GET',
        headers: { 'authentication': 'no api key this time' },
    })
        .then(res => res.json())
        .then(json => console.log(json));```
bitter sundial
#

try authorization

hot sleet
#

{ 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

night imp
#

your keyword is wrong

hot sleet
#

it wasn't authorization

#

TRN-Api-Key instead

#

it worked

bitter sundial
#

their docs suck

hot sleet
#

xD

bitter sundial
#

either you document that or you use something standard

#

smfh

earnest phoenix
slender thistle
#

Depends on which version you want to install

earnest phoenix
#

help

hot sleet
#

@earnest phoenix i don't use py
but to get better help put the code

#

not all the code

earnest phoenix
#

@hot sleet

earnest phoenix
#

Nvm

earnest phoenix
#
    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

west raptor
#

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?

topaz fjord
#

doesnt make my bot go off

west raptor
#

Let me see again

earnest phoenix
#

help me

#

please

#

please

#

i'm done with this crap

#

my the song isnt repeated

west raptor
viscid falcon
#

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?

topaz fjord
viscid falcon
#

thank you!

topaz fjord
#

it will give the avg load of the cpu

viscid falcon
#

in what a percentage?

topaz fjord
#

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
viscid falcon
#

ok thanks

#

@earnest phoenix and whats your problem, you still havnt said

#

then learn express

#

then dont use it

earnest phoenix
#

most help pages use express? waitwhat

#

correct me if im wrong

#

but express is a web server

viscid falcon
#

please copy and paste the part of that that is a question

earnest phoenix
#

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

viscid falcon
#

^^^

earnest phoenix
#

u dont

viscid falcon
#

you havnt even asked a question really

knotty steeple
#

@earnest phoenix yea express is a web server

#

to do web stuff

earnest phoenix
#

ok so use php

#

wew lad

#

first google result

#

updated 48h ago

#

made by evie from AIG

#

that was hard to find OMEGALUL

viscid falcon
#

thats impressive that it took that much work to find

earnest phoenix
#

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

fast marten
#

What does player.repeat()/is_repeat_all do

earnest phoenix
#

?

fast marten
#

I'm pretty sure you need to show what the player.repeat() actually does to be able to figure it out

earnest phoenix
#

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```
fast marten
#

Uh yeah do you have the repeat() function, as thats the main thing

earnest phoenix
#
        """ 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

obtuse wind
#

How would I make an unban command (Discord.js / Node.js)

earnest phoenix
#

message.guild.unban()

knotty steeple
#

that is very wrong

earnest phoenix
#

that is very right

knotty steeple
#

or is it

#

ok

#

so do that with user id

earnest phoenix
#

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

knotty steeple
#

internet?

earnest phoenix
knotty steeple
#

also spoonfeed much?

earnest phoenix
#

right there

knotty steeple
#

that website

#

is noob heaven

earnest phoenix
#

yep it is

knotty steeple
#

its just code for people to steal

earnest phoenix
#

yep it is

knotty steeple
#

why did you link it GWqlabsNotLikeNoot

earnest phoenix
#

idk copy paste is ez right??

viscid falcon
woven palm
#

@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

earnest phoenix
#

or... OR calcualte the cpu usage yourself without a module awesmart

slim heart
#

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?

earnest phoenix
#

does presence update give the presence before and after?

slim heart
#

yeah newMember and oldMember

earnest phoenix
#

ok so maybe you could compare their status beore and after

slim heart
#

But if they go offline their game will change aswell

earnest phoenix
#

so can you check if their status is 'offline'?

#

yes, so jsut dont do anything in that case waitwhat

slim heart
#

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

earnest phoenix
#

is .equals even a method of user?

slim heart
#

yes

earnest phoenix
#

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:

slim heart
#

I mean thats not the problem tbh

#

Its more just game updates

earnest phoenix
#

ok well it is a problem first of all

slim heart
#

its not the problem i need help with

earnest phoenix
#
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

slim heart
#

Okay, thank you.

earnest phoenix
#

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 :(

slender thistle
#

Can't it just be msg.guild.name?

knotty steeple
#

it can

earnest phoenix
#

how do u change ur bot's name color on dbl description?

soft canyon
#

Is there a way to differentiate people other than names ? I want some commands to be used only by some whitelisted people.

knotty steeple
#

use an id

#

@soft canyon

hot sleet
#

@earnest phoenix use css

soft canyon
#

I can't seem to get user ID in java.

knotty steeple
#

well look at the docs for your library

#

it has to have a way to get a user's id

earnest phoenix
#

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)

knotty steeple
#

i dont think you can split by \n

soft canyon
#

I did it with str.substring(str.length()-19,str.length()-1); There is probably an easier way but I couldn't find it.

earnest phoenix
#

@knotty steeple How should I then?

knotty steeple
#

maybe a character like |

earnest phoenix
#

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

earnest phoenix
#

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

knotty steeple
#

why does it need it tho Thonk

earnest phoenix
#

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

knotty steeple
#

that "safe"eval doesnt seem safe at all

earnest phoenix
#

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

#

๐Ÿค” 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 thonkasdf

#

hmm

#

works?

#

oh yeah that could have happened when you removed the dependency :p

#

yeah

#

yeppers, it works, 0 vulnerabilities

#

๐Ÿ‘Œ

#

i do pride myself

nimble star
#
    # --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"

earnest phoenix
#

try for x in nums

#

if you have a nums variable

nimble star
#

The input has to be an int. The input is also saved to "num"

#

I put in a number, it returns that.

earnest phoenix
#

ok then, dont try to iterate an int

#

simple python

nimble star
#

Err, so remove the : int for the num definition?

earnest phoenix
#

its not possible

#

yes, but also, dont use it with an int, or you will get an error

nimble star
#

Then I can do a for x in range(num): maybe?

earnest phoenix
#

yes

nimble star
#

range() accepts only ints. That's the key. Thanks.

earnest phoenix
#

np

earnest phoenix
#

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?

inner jewel
#

.trim() iirc

earnest phoenix
#

@inner jewel ?

#

Ive never heard of that...

inner jewel
earnest phoenix
#

@inner jewel So can I use it like:

let apipass = currentLine.split(":")[1].trim()

#

?

inner jewel
#

that'd work

earnest phoenix
#

Great, thanks man.

#

I asked a NodeJS developer and he had no clue.... Heh.

knotty steeple
#

I forgot about trim GWfroggyAngryEyes

sour grove
#

there was a picture that shows how to convert userID to account creation date, can someone re-post it?

inner jewel
#
fromUnixMS((id >> 22) + DISCORD_EPOCH)```
floral zinc
#

Isnt that in the api docs?

inner jewel
#

yes

#

that's where i got the image

earnest phoenix
#

Any way to use a proxy for the WHOLE application (I access several APIs)?

knotty steeple
#

How do i clear reactions from a user? discord.js

earnest phoenix
#

reaction.remove

slender lagoon
#

I swear I can't find this anywhere, how can I create an invite url for my bot in discord.py?

earnest phoenix
#

@slender lagoon Just have one premade.

knotty steeple
#

i dont think i need a tutorial for just one thing

earnest phoenix
#

I told u how to do it

knotty steeple
#

it wasnt really helpful

slender lagoon
#

@earnest phoenix ok thanks, thought there was a function.

earnest phoenix
#

@slender lagoon Might be, yet a premade would be much easier than scanning the docs. No?

knotty steeple
#

what is reaction
is remove a function

#

etc

slender lagoon
#

@earnest phoenix well if there was and you knew, no docs scanning would be needed ๐Ÿ˜ฌ

earnest phoenix
#

@slender lagoon Eh. Sorry mate.

#

I dont think one does exist,

slender lagoon
#

Thanks anyway, I'll make a premade one ๐Ÿ˜„

earnest phoenix
#

๐Ÿ˜ƒ

knotty steeple
#

eh im gonna go look at the docs myself

pearl mirage
#

discord epoch

#

epic

#

well, I guess that delays the year 2038 problem ecks dee

sick cloud
#

@knotty steeple you can use removeAllReactions

#

to remove all of them

#

and thats on the message itself

knotty steeple
#

would that work on a reaction collector

sick cloud
#

yes

#

use <Message>.removeAllReactions()

knotty steeple
#

wait

#

if you do that it removes all reactions

#

including the bot's?

earnest phoenix
#

@knotty steeple Yes

knotty steeple
#

so how do i make it not do that

earnest phoenix
#

so

#

MessageReaction.remove(user)

sick cloud
#

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();
inner jewel
#

anyone knows how to draw circles in go?

earnest phoenix
#

Yes

#

You go and draw a circle tickYes

inner jewel
#

hahaha so funny

earnest phoenix
#

Lol sorry matey

sick cloud
#

never used go

#

you should go learn

grizzled mango
misty pawn
#

I just get a huge error when compiling and have no idea how to find the issue itself.... *sigh*

viscid falcon
#

did you try asking for help instead or just complaining, people here are pretty nice

sick cloud
#

@grizzled mango why are you pasting that

grizzled mango
#

are you not allowed?

sick cloud
#

it's offtopic and self promotion

grizzled mango
#

ok

#

sure

earnest phoenix
sick cloud
#

look at the docs

viscid falcon
#

how would i send/edit a message to a specific channel on a specific guild

earnest phoenix
#

@viscid falcon lang?

viscid falcon
#

oh srry

#

js

earnest phoenix
#

Mk.

#

Ur gonna be really pissed at me

viscid falcon
#

y

earnest phoenix
#

You gotta read em. I know it sucks.

#

client.channels.get(channelID).send('My Message');

#

I wont be a dick though. ^

viscid falcon
#

thanks

earnest phoenix
#

np

#

@misty pawn Spit it out.

misty pawn
#

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

earnest phoenix
#

NodeJS?

compact wraith
#

Anybody know how to design a leaderboard through embedding?

misty pawn
#

Some people need to type first

earnest phoenix
#

@compact wraith Design or coding or both?

compact wraith
#

Well, morely coding

earnest phoenix
#

Ill help u in a sec

#

k?

compact wraith
#

Yeah no worries

earnest phoenix
#

Alright

#

so do you have the values loaded into variables?

compact wraith
#

Is it possible to jump in testing 1, not the best at explaining

earnest phoenix
#

yes

zealous veldt
misty pawn
#

I think he/she means voice ๐Ÿค”

zealous veldt
misty pawn
#

Still need to find a way to get and temporarly store multiple json-values

#

lol.

#

nvm found something interesting...

zealous veldt
#

Java needs JON lmao

viscid falcon
#

@earnest phoenix it didnt work

inner jewel
#

@misty pawn org.json

#

you parse the response body

zealous veldt
#

hey nootin

inner jewel
#
var response = ....
var object = new JSONObject(response);
var permalink = object.getString("permalink");
var hash = object.getString("hash");
var message = object.getString("commit_message");```
viscid falcon
#

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

compact wraith
#

Anyone any good with python?

zealous veldt
#

make sure ID is a string @viscid falcon

viscid falcon
#

oh thanks

kindred widget
#

Alrightly

viscid falcon
#

in like 18 seconds ill find out if it worked

zealous veldt
#

lol

misty pawn
#

@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...

kindred widget
#

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);
  });
});```
misty pawn
#

Thanks anyways

viscid falcon
#

yay it works

inner jewel
#

@misty pawn you already have everything in that json

zealous veldt
#

๐Ÿ‘

inner jewel
#

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

kindred widget
#

Alright, so @inner jewel

zealous veldt
#

nah use let omegalul

inner jewel
#

nah, java doesn't have a retarded implementation of var

zealous veldt
kindred widget
viscid falcon
#

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

kindred widget
#

This is all I have so far.

inner jewel
#

are you planning on running it on your computer or in an actual server?

zealous veldt
#

when are you needing to edit it?

kindred widget
#

Im thinking its going to be my server

#

at some point maybe a server

viscid falcon
#

on an interval, every 3 min

kindred widget
#

my pc*

#

my pc****

zealous veldt
#

o

kindred widget
#

not my server

#

lol

inner jewel
#

if you just use localhost:port in a browser you shouldn't need to worry about anything

viscid falcon
#

im doing a live stats thing that updates periodicly

inner jewel
#

on a server you'd probably want to remove the :port part and keep just domain

kindred widget
#

Yes, but Natan

zealous veldt
#

oh ok

kindred widget
#

I would want friends to be able to connect.

inner jewel
#

which is where a reverse proxy/port proxy comes in

#

you'd need to open the ports on your router/whatever

kindred widget
#

Damnit

inner jewel
#

there's no other way

#

if the port is closed traffic can't reach you

kindred widget
#

Alright.

misty pawn
#

@inner jewel I'm not really sure, if I know enough java/json to know how to use that properly ๐Ÿ˜…

zealous veldt
#

when you create the message store either the message object or the message's ID @viscid falcon

inner jewel
#

you already have a string with the response

#

you just need to parse it

#

literally just new JSONObject(theString)

viscid falcon
#

and would i .get the id from that channel?

zealous veldt
#

and then do js <msg>.edit('<new text>');

#

do let messageid = msg.channel.send().id; when you send the original message

viscid falcon
#

ok thanks

inner jewel
#

you'd need to await that

topaz fjord
#

^

inner jewel
#

or use a callback

zealous veldt
#

yeah sorry

#
let id;
msg.channel.send('stuff').then((m) =< {
    id = m.id;
});```
inner jewel
#

nope either

zealous veldt
inner jewel
#
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

zealous veldt
#

true yeeah lol

#

im shit dev

viscid falcon
#

so what would i do im confused?

#

if i cant use id then how would i store the original message as an object?

uncut slate
#
const { id } = await msg.channel.send('stuff');
zealous veldt
#

^^^^^^^^^^^^^^^^^

viscid falcon
#

and use that in cunjunction with moose's code?

uncut slate
#

don't use moose's code at all

viscid falcon
#

oh

#

ok

zealous veldt
#

for editing the message? yes

#

actually no

#

lmfao

#

Actually, @uncut slate , wouldn't that give you the message object, not the ID?

uncut slate
zealous veldt
#

o nevermind you're right

topaz fjord
#

moose pls

zealous veldt
#

yes friend de jonas

uncut slate
topaz fjord
#

ok billy bob

misty pawn
#

@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));
        }
    }
inner jewel
#

.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

misty pawn
inner jewel
#

requireNonNull(responseBody).string()

misty pawn
#

Works now.
Thanks for having patience with me ๐Ÿ˜…

earnest phoenix
#

guys

#

wait

#

wrong pic

#

wat dat

quartz kindle
#

are you using nodemon?

earnest phoenix
#

no

#

discord.js

quartz kindle
#

is there anything else before that?

earnest phoenix
#

no

quartz kindle
#

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?

zealous veldt
#

achoo

quartz kindle
#

bless you

zealous veldt
#

achoo of this get for
+ bing
- bong
[ding]{dong}```
#

thank you Kappa

#
hello:
    world
#

hmm

#

thats makefile

quartz kindle
#

i use LESS for enable/disable toggles in my settings command

zealous veldt
#

example?

quartz kindle
#
[enabled option]{disabled option}```
zealous veldt
#

o

#

gotem

quartz kindle
#

o wait actually no

#

i use this one for something else

#

let me remember what i used

#
[test]{test}```
#

this one

knotty steeple
#

well yea i use diff for updatelogs

quartz kindle
#

enabled disabled

zealous veldt
#

cool

knotty steeple
#

diff matches the updatelog command tbh

#
- Removed thing
+ Thing added
quartz kindle
#

thats nice

zealous veldt
#

yeah

quartz kindle
#

my update logs are a mess

#

lmao

uncut slate
#

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.

quartz kindle
#

yeah

zealous veldt
#

like my bot on mobile isn't an issue

uncut slate
#

When it comes to diff, +- will obviously tell a story color doesn't need to, but could be vague

zealous veldt
#

because nobody uses it

quartz kindle
#

my help command informs that colors are not available in mobile, and to refer to the brackets instead

uncut slate
#

that's a good solution too

quartz kindle
#

the problem is, nobody actually reads the help command

#

.>

#

and i spent so much time on it too

zealous veldt
#

its a lot lol

knotty steeple
#

wew

quartz kindle
#

o nice

#

gifs?

zealous veldt
#

oh btw, how do you embeds with no color bar on the side?

#

emoji

quartz kindle
#

ohh

knotty steeple
#

i made it so when i add new commands i dont have to change the amount of commands it slices all the time

#

lmao

quartz kindle
#

i always forget bots can use animated emojis

knotty steeple
#

in the help command

#

because its paginated

quartz kindle
#

mine's paginated too

zealous veldt
#

my help isn't dynamic

quartz kindle
#

but manually, assigned

zealous veldt
#

i need to fix it

quartz kindle
#

i dont plan on adding anything new for the time being tho

sick cloud
#

this should work right client.clearInterval(loop);?

knotty steeple
#

yea should work

quartz kindle
#

can you call clear interval like that?

sick cloud
#

well it isn't

knotty steeple
#

idk

#

im sure i saw it

#

in the docs

#

before Thonk

quartz kindle
#

idk i think you cant do that unless you save clearinterval as a function assigned to the object

knotty steeple
#

maybe it only works when you do bot.setInterval()

#

and not setInterval()

quartz kindle
#

the interval functions belong to the window/global object

#

idk if you can assign them to another object

sick cloud
#

i done this
const loop = setInterval ...

#

but yea, clearInterval just doesn't work

knotty steeple
#

as i said

quartz kindle
#

so yeah, just do clearinterval

#

without client

knotty steeple
#

it maybe only works when you do it with bot

quartz kindle
#
var interval = setInterval();
clearInterval(interval);```
uncut slate
#

client.setInterval is nothing but a wrapper for setInterval, which also cleans up any intervals when you destroy the client

inner jewel
#

@zealous veldt it's not no color bar

quartz kindle
#

oh i didnt know djs did that

inner jewel
#

it's just color bar == background

zealous veldt
#

o

#

its #36393f?

inner jewel
#

change to light theme and you'll see

#

i think yes

zealous veldt
#

awesome thanks

inner jewel
#

tho that looks stupid on light theme

zealous veldt
#

people who use light theme are stupid

viscid falcon
#

they are

sick cloud
#

okay

zealous veldt
#

yes tony

sick cloud
#

ini

#
[ hello ]
; world
: yes
zealous veldt
#

o

sick cloud
#

```ini
[ hello ]
; world
: yes
```

zealous veldt
#

thanks

sick cloud
#

np

kindred widget
#

@inner jewel

#

Got everything done

#

I just used a port fowarding rule off of OpenVPN

#

๐Ÿ‘

zealous veldt
#

noice

latent heron
zealous veldt
#

1. use discord.js

earnest phoenix
dense needle
#

how do I make the bot display how many servers its in on the discordbots website. right now it says N/A

pale marsh
#

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

solid cliff
#

@latent heron async or rewrite

latent heron
#

rewrite

earnest phoenix
#

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.

pale marsh
#

Iโ€™d assume using a vpn or something on your machine itself is the easiest solution @earnest phoenix

earnest phoenix
#

@pale marsh It requires like 50 proxies/new IPs.

pale marsh
#

Why would you even need proxies?

earnest phoenix
#

[REDACTED]

#

I have APIs that are connected to several times a minute, they time out the IP after just a few.

quartz kindle
#

why do you need a proxy for the whole bot then? if they are timed out individually

pale marsh
#

Then youโ€™re basically doing something against some ToS and you want us to help with it. Sorry but no

earnest phoenix
#

@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?

pale marsh
#

They timeout the whole IP address? What kind of api is that

quartz kindle
#

its probably a rate limit by ip

earnest phoenix
#

@pale marsh It gets timmed out for a certain time

quartz kindle
#

typical in open/tokenless apis

earnest phoenix
#

What time said

#

Tim*

quartz kindle
#

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

earnest phoenix
#

I want 1 proxy, all under it.

quartz kindle
#

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

earnest phoenix
#

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

quartz kindle
#

set up a proxy server that listens to a port or target ip for example, and send your API requests to that

earnest phoenix
#

So basically i can't do it

#

Without it disconnecting

quartz kindle
#

you can

earnest phoenix
#

How would I setup the proxy server? GWslippyPeepoW

#

It's not exactly in any documentation.

#

If u help me with this ull be a god lol

quartz kindle
#

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

earnest phoenix
#

Would that be another NodeJS app or the same one?

#

@quartz kindle would you be willing to do it for a bit of pay?

#

๐Ÿ˜ ๐Ÿค”

quartz kindle
#

there are libraries for it, you can try this one for example

earnest phoenix
#

Oooi

#

Thanks mate

#

Yeah the docs are very vague as most of them are

#

Ill have to play around

earnest phoenix
#

fr

earnest phoenix
#

does anyone know the endpoint to get a user's status... like online, idle etc

sick cloud
#

what lib

gilded blaze
#

There isn't a specific endpoint. It depends on the guild relationships.

#

As far as I know

earnest phoenix
#

oh ok

earnest phoenix
#

can anyone help me figure out why my bot is having 2 processes

#

like it says the same command 2 times

#

discord python rewrite

neon swift
#

Were you running two instances of your script?

compact wraith
#

msg isn't a included function is my error

#

Now its not defined?

#

Ive created the first ai, to mess with me

latent willow
#

Well what is inlcudes supposed to be

#

I think includes() is what you are looking for

compact wraith
#

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

earnest phoenix
#

probably with Context.Message.Content. Or sth like that

#

why is my name hoister no hoisting

quiet bobcat
#

your name has [ as the first character which puts you higher up on the online list which is hoisting

earnest phoenix
#

Because of that xd

#

kk

#

@compact wraith .setAuthor(โ€œNickโ€, ImageURL)

#

or you can use setTitle

compact wraith
#

It just says msg.inlcudes is not a function

earnest phoenix
#

includes

#

not inlcudes

wild tide
#

@compact wraith I believe msg is deprecated. Use message. Also, you spelt includes wrong

compact wraith
#

ahahaha

#

for sake

#

my lawd

wild tide
#

lol

#

also your name is hot :>

grizzled scarab
#

@slender thistle ?

slender thistle
#

I forgot what the link was, hold on :^)

grizzled scarab
#

lol np

slender thistle
#
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 Thonk

#

Oh, Content-Type

grizzled scarab
#

I'm using 0.16 (or something like that)

#

not re-write xd

slender thistle
#

Just change guilds with servers

knotty steeple
#

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

gleaming glen
#

i can't give a role to the user which is on args Thonk

#

like

#

can someone help?

knotty steeple
#

what is args

#

defined as

gleaming glen
#

i did them all

#

im using commando

#

the problem is that

knotty steeple
#

pretty sure args is the message content

gleaming glen
#
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'
                }
            ]```
knotty steeple
#

well args is an array

#

soo

gleaming glen
#

msg.member.addRole(args.role.id) gives the role to the author but i can't make it give to the user

knotty steeple
#

since args is array that wont work Thonk

earnest phoenix
#

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.

Digital Trends

Discord bots can make life a lot easier for users of the gaming-centric online chat application. Here's what you need to know to get started making your own Discord bots, from coding them to adding them to your servers.

knotty steeple
#

type in what command

west raptor
#

^

earnest phoenix
#

C:\User[name]\Desktop\DiscordBot>node bot.js

#

that command

west raptor
#

Hm, let me look at that tutorial real quick

earnest phoenix
#

Okay.

knotty steeple
#

i suggest another tutorial

#

and its outdated as fuck

earnest phoenix
#

Oh, Could you dm me one?

#
  • That might be why it says "Access is denied"
knotty steeple
#

no

earnest phoenix
#

o

knotty steeple
#

you know basic js?

west raptor
#

^

#

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

grizzled scarab
#

@slender thistle where do I put the token?

knotty steeple
#

no its just

slender thistle
#

In a variable self.token ofc :v)

knotty steeple
#

depreciated

#

so

#

very

#

outdated

#

its a dead library

grizzled scarab
#

so self.token = "TOKEN"? xd

knotty steeple
#

https://discord.js.org/ is better for beginners GWfroggyPepoThumb

west raptor
#

^

knotty steeple
#

and its updated

#

more

west raptor
#

The devs are constantly updating it

earnest phoenix
#

Ok ty

knotty steeple
#

also

#

you didnt answer my question

#

@earnest phoenix

#

do you know basic js

earnest phoenix
#

wouldnt have this prob if he did

knotty steeple
#

true

earnest phoenix
#

This might sound dumb, no lol. My friend tried to help me out but it got confusing as I'm a begginger ๐Ÿ˜ญ

knotty steeple
#

well learn

#

basic js

#

lmao

earnest phoenix
#

Okay thank you guys for the help

knotty steeple
#

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

west raptor
knotty steeple
#

like atom, visual studio code

#

sublime text

#

etc

#

its better than notepad

earnest phoenix
#

notepad++ POGGERS

west raptor
#

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

knotty steeple
#

notepad++

#

no

earnest phoenix
#

YES

knotty steeple
#

syntax coloring is

#

bad

earnest phoenix
#

is normal Notepad fine?

knotty steeple
#

NO

earnest phoenix
#

no

west raptor
#

No

hardy fiber
#

No

earnest phoenix
#

notepad++ highlighting is perfectly fine waitwhat

west raptor
#

Get atom

knotty steeple
#

visual studio code

#

its hot

west raptor
#

Or notepad++

knotty steeple
#

af

earnest phoenix
#

visual studio is great

knotty steeple
#

and its not as slow as atom

earnest phoenix
#

u can make coffe e while it boots up

west raptor
#

Atom isn't slow

knotty steeple
#

it is

earnest phoenix
#

Okay

west raptor
#

Not for me

knotty steeple
#

visual studio is for c# zoomeyes

earnest phoenix
#

I got Notepad++

knotty steeple
#

well

#

visual studio code has tooltips

pale marsh
#

vsc is shit