#development

1 messages · Page 1621 of 1

lyric mountain
#

Good, emotes are dead

craggy pine
celest sun
#

parle français pour voir ? (baguette,fromage interdit)

drowsy epoch
#

how

#

teach me

severe pike
dusky sundial
#
if "cod" in [role.name.lower() for role in ctx.message.author.roles]:
#

That will loop through the member's roles and check if any of them are named "cod"

#

The long version would be

        for role in ctx.message.author.roles:
            if role.name.lower() == "cod":
                await ctx.send("You can play cod")
                break
rocky hearth
#

in js is it possible to access a static property on a class with the instance?

sudden geyser
#

I think accessing .constructor on an instance returns the class.

#

But if you know the class, you should just type it out like MyClass.myStaticProperty

rocky hearth
#

will it also work on the class which inherits a parent class
here, I want to access the child class' static property

earnest phoenix
#

How long does it take for a user reactions rate limit to time out?

sudden geyser
earnest phoenix
#
                            message.channel.awaitMessages(filter, {
                                max: 1,
                                time: 7000,
                                errors: ['time']
                              })
                              .then(message => {
                                message = message.first()
                                knockCameFrom.send(message)
                              })
                              .catch(() => {
                                  message.author.send('Times up!');
                              });
                          })```why does this only check the server and not the users dm?
earnest phoenix
dusky sundial
rocky hearth
#

y ts doesn't hv static abstract members? pandasad

opal plank
#

im really concerned about that indentation @earnest phoenix

opal plank
#

so not sure what you mean

#

not the indentation itself, but the fact that it has so much space leads me to believe your code is getting enourmous

#

which is a red flag

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

yeah I need to separate it into other files

sage bobcat
#

One message removed from a suspended account.

rocky hearth
#

I meant this

abstract class A {
  static abstract absValue: null;
}
class B extends A {
  // should through an Error for not defining the absValue
}
opal plank
#

i dont think you can abstract a value

#

only a class or interface

sage bobcat
#

One message removed from a suspended account.

opal plank
#

i dont think abstract type is a thing

#

which is what you're trying to do

#

abstract simply merges an interface/class

rocky hearth
#

yeah, that's what I was expecting to be a thing in ts

opal plank
#

it cant be initialized itself

#

so using a non initialized class as a type will likely fail

#

what you're saying is that it SHOULD error but isnt?

rocky hearth
#

yes
so we could define a same static variable for all the child classes

opal plank
#

🤔

#

thats a bit too far for me to tell tbh, so i cant give much input, i'd recommend creating an issue on the ts repo

#

to ask about it directly

#

as far as my understanding goes, you can only abstract a class or an interface, not a type

#

so using the keyword abstract inside there should throw an error

#

thats what i meant, you cant abstract a type

#

static is fine

#

abstract is the issue

#

since it doesnt initialize itself

#

so you shouldnt even be able to abstract it inside there, as it has no extension

#

yup, just like i thought

#

you're calling it as a type, which should give this error

rocky hearth
#

hmm ok thanks 👍

opal plank
#

here

#

this should make more sense

#

now heres the other fun fact

ionic hornet
#

Cool

opal plank
#

if you compile this(without the last line) it should throw

#

cuz im calling an abstract class

#

actually my bad, this is referred to type

#

like i mentioned, abstracted classes/interfaces cannot be initialized

#

though you can still infer to their types

proven lantern
#

"composition over inheritance" -anonymous

rocky hearth
#

how can I define a type of "any Child class of a particular abstract Parent Class"?

lament rock
#

You would have to use Child1 | Child2 | Child3

rocky hearth
#

that would be cumbersome task

#

also is it possible to change the typeof abstract class to a normal class, temporary?

lament rock
#

If you just want a generic type, you can just use the parent class

class two extends absparent {...


const thing = new Map<string, absparent>();

thing.set("pog", two); //valid since two is an instanceof absparent
#

not while a process is running unless you unreference every instance of that class to the root scope and re-initialize every extension of that class with a new resolved module after dropping require cache

#

if a process isn't running, then yes

rocky hearth
#

actually Im trying to create a FactoryClass

lament rock
#

A factory function is any function which is not a class or constructor that returns a (presumably new) object

#

That was just from a quick google search, because I have never heard that term ever

rocky hearth
#

Is it possible to ignore a particular error on a line? Not all of them

lament rock
#

try catch

#

or actually resolve the error

rocky hearth
#

do u hv realised that, I was asking all these in ts context

lament rock
#

Yes

rocky hearth
#

ooh ok

lament rock
#

is try catch not apart of TypeScript

pallid creek
#

Hm

rocky hearth
#

I want to ignore the ts error

lament rock
#

So then. What's the error

rocky hearth
#

I want to ignore just this "Cannot create an instance of an abstract class."

lament rock
#

That's not a TypeScript error. That would be a runtime error as abstract classes usually don't have any constructor signatures. You shouldn't try to instantiate one

rocky hearth
#

abstract class dont exist in js

lament rock
#

The JS equivalent would be a function

rocky hearth
#

so it wont through an error I guess.
And I know, I'm not gonna intantiate the abstract class, but its childs

lament rock
#

You should just resolve the error, but if you REALLY know what you're doing, you can just put a // @ts-ignore over the error

rocky hearth
#

yeah, but that would ignore all the errors on the next line

lament rock
#

No it wont

#

it only ignores the next line

rocky hearth
#

I just want to ignore a specific error, on next line.
If there's a thing like that

lament rock
#

I literally just said

#

Then you can't do that

#

You can ignore all or none

rocky hearth
#

Phhheww! finally. Thanks though 👍

crystal wigeon
#

has anyone used paypal node sdk for integration?

lusty quest
#

i would use something like chargebee, paypal can be easy abused since you have to handle a lot of stuff yourself

crystal wigeon
#

i have no other option

lusty quest
#

why?

#

chargebee is free until you reach a certain volume of transactions

crystal wigeon
#

so my question with paypal is that, when you have the return url they dont send the price with it, but in the return url i need to call some execute method to execute the payment which requires price

#

regional issue ig?

#

i'm not sure if its available in my country

#

will have to check

#

i tried stripe, but they were not allowing individuals to receive payments in my country >.>

lusty quest
#

lol

crystal wigeon
#

pain

lusty quest
#

chargebee is quite nice, i dont use it for now but brain uses it for Trivia bot

rocky hearth
#

@crystal wigeon bro, use razorpay. It supports all payment gateways

crystal wigeon
#

paypal also has high tax %

#

i tried razor pay

#

but they couldn't verify

#

my bank

rocky hearth
#

🤔

crystal wigeon
#

they took weeks to respond

#

yeah

#

they dont have a "gaming" business model support

#

finally my paypal got verified but only accepts international payments

#

like bruh

#

they shutting down domestic

#

payments

lusty quest
#

turkey? ohh wait its banned there

crystal wigeon
#

lol

#

i might try brainTree next

#

so coming back to my original question

#

how would i get the price in the success return url

lusty quest
#

never worked with it ¯_(ツ)_/¯

crystal wigeon
#

sad brainTree isn't even available in my country

#

:c

#

so much pain

#

TT

runic depot
#

Any django developers?

#

i need help

pale vessel
#

just ask

clear marlin
#

#justask

runic depot
#

Somebody is spamming get requests to my server(100 per second)
What should i do?

tight nimbus
#

Detect the IP

#

And block it

runic depot
#

i want to write a defender to defend it

tight nimbus
#

I find that, read and would be util

marble juniper
#

just implement ip based ratelimits

#

or something

river sedge
small tangle
#

I have more of a question regarding Code Convention. I use the ImageIO class in Java to draw and it needs exception handling on read and write. Should I put a try catch block only in these operations or put the whole part in one big try block?

edgy tapir
#

i'm trying to do an animeme command but everytime i run it i only got 2 memes, i got 2 memes on eveyr subreddit, help ?```js
const Discord = require("discord.js");
const randomPuppy = require('random-puppy');

module.exports = {
name: "animememe",
cooldown: 1,
aliases: ["animeme", "ameme", "animem"],
description: "Anime meme",
usage: "animememe",
run: async (bot, message, args) => {

randomPuppy('goodanimemes')
.then(url => {

    message.delete().catch(O_o=>{});
    const p = new Discord.MessageEmbed()
    .setColor("GREEN")
    .setTitle("**Anime Meme !**")
    .setTimestamp()
    .setImage(url)
    .setFooter(bot.user.username.toUpperCase(), bot.user.displayAvatarURL({ dynamic: true }));

    message.channel.send(p);
    
    })
}

}

Like i got the same 2 memes everytime

sorry for resend
wispy holly
#

Guys

#

I need help

#

for

#

change my bot's status

edgy tapir
#

client.user.setActivity

wispy holly
#

Thats not working

#

ı tryed

edgy tapir
#

do you get any errors ?

wispy holly
#

no

#

Thats just not workiing

misty sigil
#

It should work

edgy tapir
#

yeah, with not working u mean the bot has no status ?

misty sigil
wispy holly
#

and nothing happened

misty sigil
#

can I see the code

wispy holly
#

Want a github sources?

misty sigil
#

No I want to see the client.user.setActivity line

wispy holly
#

ok

#

`const ;chalk = require("chalk");
const moment = require("moment");
const Discord = require("discord.js");
const ayarlar = require("../ayarlar.json");

var prefix = ayarlar.prefix;

module.exports = client => {
console.log(
[${moment().format("YYYY-MM-DD HH:mm:ss")}] BOT: Aktif, Komutlar yüklendi!
);
console.log(
[${moment().format("YYYY-MM-DD HH:mm:ss")}] BOT: ${ client.user.username } ismi ile giriş yapıldı!
);
client.user.setStatus("online");
var oyun = [
"3",
"2",
"1"

];

setInterval(function() {
var random = Math.floor(Math.random() * (oyun.length - 0 + 1) + 0);

client.user.setActivity(oyun[random], "");

}, 2 * 2500);
};
// Set the client user's activity
client.user.setActivity('discord.js', { type: 'WATCHING' })
.then(presence => console.log(Activity set to ${presence.activities[1].name}))
.catch(console.error);
n`

#

my ready.js

earnest phoenix
small tangle
#

Can i attach an image to an embed without have to locally save it? (using JDA)

earnest phoenix
#

urls should work fine

#

you can try it

small tangle
#

im doing some imageio work with it, so i have a bufferedimage

earnest phoenix
#

¯_(ツ)_/¯

small tangle
#

Yeah uploading an urls are working, maybe im finding something FeelsSmartMan because i want to minimize the ImageIO calls

earnest phoenix
#

Hey, I have a problem to my snipe.js

#
const Discord = require("discord.js")
const db = require("quick.db")

module.exports = {
name: "snipe",
description: "Affiche le dernier message supprimé du channel.",
usage: "snipe",
run:(bot, message, args) => {

const msg = message;
if (!msg) return message.channel.send("❌ Il n'y a pas d'ancien message supprimé !")

let SnipeEmbed = new Discord.MessageEmbed()
    .setAuthor(message.author.tag, message.author.displayAvatarURL())
    .addField(msg.content)
    .setColor("RANDOM")
message.channel.send(SnipeEmbed)
}
}
#

Error:

Error:
(node:1870) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘tag’ of undefined

11:56 AM

Jump Toat Object.run (/app/Commands/Moderation/snipe.js:14:35)

11:56 AM

Jump Toat module.exports (/app/Events/Messages/message.js:46:11)

11:56 AM

at processTicksAndRejections (internal/process/task_queues.js:93:5)

11:56 AM

(Use node --trace-warnings ... to show where the warning was created)

11:56 AM

(node:1870) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line options | Node.js v15.10.0 Documentation). (rejection id: 1)

11:56 AM

(node:1870) [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.
pale vessel
#

message.author is undefined MegaThonk o

earnest phoenix
#

yes but

pale vessel
#

why are you mixing msg and message? they're both the same

#

just message

earnest phoenix
#

oh wait, I modified:

const Discord = require("discord.js")
const db = require("quick.db")

module.exports = {
name: "snipe",
description: "Affiche le dernier message supprimé du channel.",
usage: "snipe",
run:(bot, message, args) => {

const msg = bot.snipes.get(message.channel.id)
if (!msg) return message.channel.send("❌ Il n'y a pas d'ancien message supprimé !")

let SnipeEmbed = new Discord.MessageEmbed()
    .setAuthor(message.author.tag, message.author.displayAvatarURL())
    .addField(msg.content)
    .setColor("RANDOM")
message.channel.send(SnipeEmbed)
  }
}
#

same error to the tag

#

with message.author

pale vessel
#

you sure you want to use message?

#

not msg

#

for the author icon and text

earnest phoenix
#

oh wait

#

I replace msg to message?

pale vessel
#

if you want to show the deleted message's author and icon

earnest phoenix
#

yes but

#

SyntaxError: Identifier 'message' has already been declared

pale vessel
#

Why

earnest phoenix
#
const Discord = require("discord.js")
const db = require("quick.db")

module.exports = {
name: "snipe",
description: "Affiche le dernier message supprimé du channel.",
usage: "snipe",
run:(bot, message, args) => {

const message = bot.snipes.get(message.channel.id)
if (!message) return message.channel.send("❌ Il n'y a pas d'ancien message supprimé !")

let SnipeEmbed = new Discord.MessageEmbed()
    .setAuthor(message.author.tag, message.author.displayAvatarURL())
    .addField(msg.content)
    .setColor("RANDOM")
message.channel.send(SnipeEmbed)
  }
}
#

line 10

pale vessel
#

just change it back to msg

kind glade
#

did u type some in index.js

pale vessel
#

and use .setAuthor(msg.author.tag, msg.author.displayAvatarURL()) instead

earnest phoenix
#

I changed to message

#

oh

#

wait

pale vessel
earnest phoenix
#
const Discord = require("discord.js")
const db = require("quick.db")

module.exports = {
name: "snipe",
description: "Affiche le dernier message supprimé du channel.",
usage: "snipe",
run:(bot, message, args) => {

const msg = bot.snipes.get(message.channel.id)
if (!msg) return message.channel.send("❌ Il n'y a pas d'ancien message supprimé !")

let SnipeEmbed = new Discord.MessageEmbed()
    .setAuthor(msg.author.tag, msg.author.displayAvatarURL())
    .addField(msg.content)
    .setColor("RANDOM")
message.channel.send(SnipeEmbed)
  }
}
#

cannot read porperty 'get'

pale vessel
#

Full error?

earnest phoenix
#

just the line 10

pale vessel
#

Are you sure bot.snipes exists?

earnest phoenix
#

in discord.js yes

pale vessel
#

Not in discord.js for sure

#

It must be custom

#

Add console.log(bot.user.id, bot.snipes) above const msg

#

Run the command again and check the output

earnest phoenix
#

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined

#

O_O

pale vessel
#

Well, bot is not your client

#

Check your handler

earnest phoenix
#

wait

#

its client

#

but the same error with id

#

oh

#

@pale vessel I changed bot to client and I have this: const msg = client.snipes.get(message.channel.id)

#

error with get

pale vessel
#

It doesn't matter what you call it

#

The problem is your handler not passing the correct reference to client

earnest phoenix
#

my event message.js?

pale vessel
#

Yes

earnest phoenix
#

my command.run?

pale vessel
#

Try console.log(client) and check what it actually is

pale vessel
pale vessel
earnest phoenix
#

command.run(message, args, prefix);

#

I add bot or client?

pale vessel
#

See

#

You need to pass client OR remove client from your run function

#

bot and client is the same, depends on which one you name it

earnest phoenix
#

yes but client is not defined so

pale vessel
#

command.run(bot, message, args, prefix); or command.run(client, message, args, prefix);

#

Whatever you called your client

earnest phoenix
#

id is not defined

pale vessel
#

Yes, it's your handler

#

Does your other commands work fine?

earnest phoenix
#

yes I think

pale vessel
#

Like your ping command

earnest phoenix
#

others commands like ban etc

#

euhhh

pale vessel
#

Check run:(bot, message, args) => { part of your ban command

#

Does it look the same?

earnest phoenix
#

wait

#

but

#

my ping command

#

has error

#

(node:6248) UnhandledPromiseRejectionWarning: TypeError: command.run is not a function
at module.exports (/app/Events/Messages/message.js:46:11)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:6248) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)

#

my ban command: async execute(message, args, prefix) {

pale vessel
#

Check your exports

#

It's called execute on that one

#

but you use run

#

Change it to run

earnest phoenix
#

so I use: run: (message, args, prefix) { ?

pale vessel
#

Yes

#

or async run(message, args, prefix) {

earnest phoenix
#

handle rejections?

#

aka errors i think

#

what

#

all my commands don't works

#

:/

pale vessel
#

Did you copy your commands from tutorials?

#

They're not consistent

earnest phoenix
#

yes :/

#

a little

#

just the snipe

pale vessel
#

The ping command still doesn't work?

earnest phoenix
#

all commands don't works

pale vessel
#

You said the ban command works

earnest phoenix
#

yes i tested but no

pale vessel
earnest phoenix
#

with the error command.run not a function

pale vessel
#

Yes, you probably had it named execute on that one too

#

Pick one, run or execute?

earnest phoenix
#

run

pale vessel
#

Change everything that has async execute to async run then

#

All the commands

earnest phoenix
#

good

#

command.run is not a function :/

pale vessel
#

You sure you haven't missed a command?

#

Add console.log(command) to check which command threw that error

earnest phoenix
#

yes

#

wait

#
const discord = require("discord.js");
const { discordInviteLink } = require('../../config.json');

module.exports = {
  name: 'discordserver',
  description: `Envoie un lien d'invitation au serveur support de Synapse.`,
  usage: 'discordserver',
  guildOnly: true,
  async run(message) {
    message.channel.send(discordInviteLink);
  }
}
#

@pale vessel cannot read property 'send'

#

or undefined

pale vessel
#

message is probably not what you think it is

#

Can you show your command handler?

earnest phoenix
#

command.run(client, message, args, prefix);

pale vessel
#

Can you spot what's wrong?

#

message is client

#

Not message

earnest phoenix
#

ah!

#

so I remove client

pale vessel
#

Yes, or add client to your invite command

#

run(client, message)

#

It doesn't matter

earnest phoenix
#

yess works!

#

wait I test all commands

pale vessel
#

If you remove client, you can still access it by using message.client

#

All right

#

Do it to all commands

earnest phoenix
#

oh

#

ban command

#

(node:9855) UnhandledPromiseRejectionWarning: Error: val is not a non-empty string or a valid number. val=undefined
at module.exports (/app/node_modules/ms/index.js:34:9)
at Object.run (/app/Commands/Moderation/ban.js:15:21)
at module.exports (/app/Events/Messages/message.js:46:11)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use node --trace-warnings ... to show where the warning was created)
(node:9855) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:9855) [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.

#

and mute commande don't works too

willow mirage
#

does node.js is running on multi-cores ? or I have to setup it?

restive furnace
#

it is single threaded

#

you need to cluster if you want to use multiple cores

willow mirage
#

hmmm ok

#

thx

earnest phoenix
#

@pale vessel you see?

#

Oh I found

#

good

river panther
#

jenius

earnest phoenix
#

oof

#

But I have a problem:
My code: https://hatebin.com/soevascgit
My error:

(node:13342) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'users' of undefined
at Object.run (/app/Commands/Fun/hack.js:7:35)
at module.exports (/app/Events/Messages/message.js:46:11)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:13342) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
quartz kindle
#

show message.js line 46

#

@earnest phoenix

river panther
#

hey tim

#

yo tim

earnest phoenix
#

just ask

river panther
#

how tim?

#

nah, i was asking how he life going

earnest phoenix
#

If you're here to only say "hi", please go to #general

#

This is development channel, not a place to have a conversation about life.

river panther
#

bruh, everyone takes tim's help but no one asks how is he or how is his day going

#

ok ok

willow mirage
#

I tried to run discord bot in a multi processor and this happend lmaoo

river panther
#

how can i get the number of servers i am in from this console?

#

i tried

const id = "my id";
id.guilds.cache.size;
quartz kindle
earnest phoenix
#

It's not that easy.

willow mirage
river panther
#

but for my bot all i do is bot.guilds.cache.size

earnest phoenix
river panther
#

what all can we get from that console then?

willow mirage
#

is there any way to run like one processor is for d.js and another is for express server (dbl stuff)

pale vessel
#

no

quartz kindle
quartz kindle
#

thats your problem

willow mirage
#

bruh

pale vessel
#

Just run it in different processes

earnest phoenix
#

you can use pm2/screen or 2 terminal if you have gui

pale vessel
#

Run it separately

quartz kindle
#

or use worker threads if you want everything to be tied together

earnest phoenix
#

oh thx

willow mirage
#

but i want to pass variable between it

earnest phoenix
#

but

willow mirage
#

...

quartz kindle
#

you need ipc

earnest phoenix
#

@quartz kindle

(node:14711) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'bot' of undefined
at Object.run (/app/Commands/Fun/hack.js:33:20)
at module.exports (/app/Events/Messages/message.js:46:11)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:14711) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14711) [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.
willow mirage
#

ipc ?

#

what is that

quartz kindle
#

inter process communication

earnest phoenix
#

I need to add "bot" to my command run and execute?

willow mirage
#

bruh

#

docs?

river panther
quartz kindle
river panther
#

do
const bot = discord.Client

quartz kindle
#

so use client in the code

#

or change client to bot at the beginning

river panther
#

yes

#

tim how can i get as good as you?

earnest phoenix
#

You need to practice and learn ig.

river panther
#

i started with java

earnest phoenix
#

Oh and also be expert at searching google

river panther
#

oh

quartz kindle
#

lmao

earnest phoenix
quartz kindle
#

???

river panther
earnest phoenix
#

in my command

#

its for fun hack a member

#

but we can fun hack a bot too

river panther
#

like the dank memer?

earnest phoenix
#

@river panther starting to get off topic my guy.

#

yeah

river panther
#

eh, do i mean, you have defined it as client, so use client, no bot

quartz kindle
#

you did mentions.users

#

so member is a User, not a Member

#

then you do member.user.bot

willow mirage
#

I think i will go back to 1 processors, this makes my brain explode

earnest phoenix
#

yes but if its a bot

quartz kindle
#

which is the same as user.user.bot

earnest phoenix
#

return

#

so I replace to member.bot?

quartz kindle
#

that member is not a member, its a user. you are doing user.user.bot

earnest phoenix
#

oh

#

so I add const user like const member

quartz kindle
#

you can do member.bot yes

earnest phoenix
#

oh

river panther
#

tim, my bot shows the slash command bot it doesn't work

quartz kindle
#

but you should probably clarify that its a user and not a member

river panther
#

the code

cinder patio
#

Also, what are you doing, lmao? Generating fake token / client ids for bots?

earnest phoenix
#

no, its good

#

thanks!

river panther
#

what do?

quartz kindle
# river panther the code

i've never used interactions, but you have an error in your terminal, how about showing that error?

river panther
#

nah, that error is not related to the slash

#

its for the meme command ig

quartz kindle
#

alright

river panther
#

yes, meme line 12

quartz kindle
#

then check the return value of the api call

#

its a promise, you should at least resolve it and/or catch it

cinder patio
#

How did you add the bot to the guild

#

does it have the applications.commands scope

quartz kindle
#

also log interaction.data.options to make sure thre really is an index 0 with a name

river panther
#

yes

#

oh, ok

river panther
river panther
quartz kindle
#

i was talking about client.api.interactions

river panther
#

oh, ok ok

#

let me go see

quartz kindle
#

but you can fix that one also while you're at it

river panther
#

wait, can you also correct my meme command?

quartz kindle
#

show imageapi

river panther
#

i see no error in what i have written

#

ok

quartz kindle
#

is imageapi an npm module?

#

if so, you have to catch the response

river panther
#

yes

quartz kindle
#

its attempting to parse a response with json

#

but the page is not returning a json response

river panther
#

oooooooh

quartz kindle
#

and the library is chosing to not handle it

#

so it just gives an error back to you

river panther
#

how fix?

quartz kindle
#

catch it

river panther
#

ok

quartz kindle
#

img = await api().catch(() => null)

#

if(!img) return message.channel.send("failed to get image")

river panther
#

ok

#

also, when is the v13 coming?

#

its in beta right now, right?

cinder patio
#

There isn't a set date

#

It'll be released when it's ready

river panther
#

@quartz kindle i just got error from slash

#

its scary

sharp thicket
#

@river panther Your token is invalid wherever you're trying to login

river panther
#

oh

sharp thicket
#

or

#

it didnt get a token

#

@river panther did you make the code yourself or is it a tutorial?

river panther
#

a friend

sharp thicket
#

whats their name coz we might have the same friend l0l

river panther
#

bruh

#

idt i can tell the name

sharp thicket
#

Salvage_Dev?

#

looks like his tutorial

#

i used to moderate for him

#

Oh well

#

@river panther did you fix it?

river panther
#

he is an total idiot

sharp thicket
#

lol no

river panther
#

yes, he is, he banned me because i was trying to ask him if i can ip ban a guy using anip grabber

#

and he banned me for it

sharp thicket
#

tf?

river panther
#

yes

sharp thicket
#

Can we go to dms coz i used to be his mod...

river panther
#

nah, nvm tbh, used to be?

#

you got fired?

sharp thicket
#

yea i quit

#

coz i was bored

#

but ok

#

thats off topic

#

Did you fix the token issue? @river panther

river panther
#

oh, yes, off time this came, no

#

i am trying

sharp thicket
#

alr

#

can you show index.js?

river panther
#

yes

sharp thicket
#

dont show ur token here tho

river panther
#

ik

sharp thicket
#

the end of index.js

#

where ur bot logs in

river panther
#

this?

sharp thicket
#

whats token defined as?

river panther
#

token

#

token.json is the name of the file

#

and i have saved it as token

sharp thicket
#

bruh

#

i asked how it was defined

river panther
#

?

nocturne peak
#

show us the structure of the token variable

#

how do you define the token variable

river panther
#

but my token is there

sharp thicket
#

Hi milo

sharp thicket
river panther
#

oh wait, bro unban me

nocturne peak
#

complain in my dms ok

#

not here

sharp thicket
earnest phoenix
#

;help

sharp thicket
#

Can i complain for mod back

earnest phoenix
#

@icy maple

sharp thicket
slender thistle
nocturne peak
#

show us how you defined the token variable

sharp thicket
#

oop

nocturne peak
#

like const token = xyz

sharp thicket
river panther
#

i have done it as

{
  "token: "the token was here"
}
earnest phoenix
#

lol

sharp thicket
nocturne peak
#

thats not what im asking

river panther
#

then?

nocturne peak
#

how do you define the variable called token

#

in your javascript

river panther
#

oh

sharp thicket
#

const token = something

river panther
#

yes

sharp thicket
#

should look like that

river panther
sharp thicket
#

k

#

yo kevs here

#

hi

nocturne peak
#

whhats the erorr you having

daring olive
nocturne peak
#

kev

#

hi

daring olive
#

Hi

river panther
sharp thicket
river panther
#

yes

nocturne peak
sharp thicket
#

oh interaction

nocturne peak
#

when its stable

river panther
#

thats what my friend said

#

thank you

#

and unban me

nocturne peak
#

bye

sharp thicket
#

STOP IT DAMN IT

slender thistle
#

Leave it for DMs

river panther
#

ok bye

#

yo shiva

sharp thicket
woven sundial
#

Hi, may I ask question about bash development or is this channel only for bots ?

slender thistle
#

General development questions are allowed

river panther
#

all kind of development

#

we can also develop your skills of talking to a girl

woven sundial
#

I'm testing something. If it doesent work ill ask here

pale vessel
#

can someone just remove that (bot) in the topic since that shit always confuses everyone

slender thistle
#

cc @modern sable

earnest phoenix
#
2021-02-28T12:42:50.045160+00:00 app[worker.1]:                                     url: item.channel.thumbnails?.default.url,
2021-02-28T12:42:50.045161+00:00 app[worker.1]:                                                                  ^
2021-02-28T12:42:50.045162+00:00 app[worker.1]: 
2021-02-28T12:42:50.045162+00:00 app[worker.1]: SyntaxError: Unexpected token '.'
#

wat i do

willow mirage
#

is there any i can fetch a Img from a url and convert it to Buffers

#

like

earnest phoenix
#

yup

willow mirage
#
const img = await fetch('https://example.com/example.png');
typeof(img) //Buffers
#

@earnest phoenix how

earnest phoenix
#

i think solve

#

yup solve

willow mirage
#

oh

#

i googled

#

nvm

lusty quest
#

if you use axios const response = await axios.get(url, { responseType: 'arraybuffer' }) const buffer = Buffer.from(response.data, "utf-8")

earnest phoenix
#

my package is got outdated

#

thats why

willow mirage
#

how i can send a Image via buffers

#

like

#
message.channel.send(IMG_BUFFERS)
pale vessel
#

message.channel.send(new Discord.Attachment(buffer, "image.png"));

willow mirage
#

ok ok

pale vessel
willow mirage
#

it is MessageAttachment btw xD

#

but thx

pale vessel
#

oh yeah 🍭

#

sorry, I use { files: [{ attachment: buffer, name: "image.png" }] }

#

just thought MessageAttachment would be easier to use

earnest phoenix
#

npm 12x nice

#

node*

pale vessel
willow mirage
#

help it returns me this thing

#
<Buffer ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ... 262094 more bytes>
#

smh

woven sundial
cinder patio
#

the image getting rendered to your console?

willow mirage
#

bruh

#

no

cinder patio
#

The buffer is most likely not correct.

willow mirage
#

I had a ArrayBuffer

#

I want to convert it to Buffer

cinder patio
#

Then pass the ArrayBuffer to the Buffer.from function

willow mirage
#

I did that

cinder patio
#

require('../../tools/function/typedArraytoBuffers')(final) Showing that function would help

willow mirage
#
module.exports = function typedArrayToBuffer(array) {
    return array.buffer.slice(array.byteOffset, array.byteLength + array.byteOffset)
}
cinder patio
#

You can do Buffer.from(final) too, the Buffer.from accepts any iterable

lusty quest
cinder patio
#

what happens

#

And what is result.data btw

#

Are you trying to convert a base64 string to a buffer?

lusty quest
#

const buffer = Buffer.from(ArrayBuffer, "utf-8") did you tryed this?

willow mirage
#

i think the problem is the ArrayBuffer

#

it is wrong

#

255 everywhere . . ..

lusty quest
#

how did you make the array?

cinder patio
#

Where are you getting that from

willow mirage
#

from a package

#
const url = user.user.displayAvatarURL({format: "png", size: 512});
                request.get(url,  async(err, res, body) => {
                    console.log(body)
                    const image = await Image.load(body)
                    console.log(image)
                    const result = image.grey();
                    const final = new Uint8Array(result.data);
                    const img = new Buffer.from(final)
                    console.log(img)
                    return require('../../tools/function/sendMessage')(message, {files: [{attachment: img, name: 'image.png'}]} );
                });
lusty quest
#

if you use urls you could just use axios to make an array buffer

cinder patio
#

result.data is already a uint8 array, so there's no point in copying it

willow mirage
#

hmm

#

I think the problem is the lib

#
Image [IJSImage] {
  width: 512,
  height: 512,
  data: Uint8Array(1048576) [
    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
    255, 255, 255, 255,
    ... 1048476 more items
  ],
  size: 262144,
  components: 3,
  alpha: 1,
  bitDepth: 8,
  maxValue: 255,
  colorModel: 'RGB',
  channels: 4,
  meta: {},
  position: [ 0, 0 ],
  computed: null,
  sizes: [ 512, 512 ],
  multiplierX: 4,
  multiplierY: 2048,
  isClamped: true,
  borderSizes: [ 0, 0 ]
}
pale vessel
#

uh no

#

the lib is fine

willow mirage
#

uhh

cinder patio
#

show require('../../tools/function/sendMessage')

willow mirage
#

just a reaction things

#

basicly message.channel.send()

#

damm it bro

#

it hsa built in toBuffer()

sinful atlas
#

@lusty quest can you help me

rustic nova
#

just ask here

earnest phoenix
#

what

#
(node:6163) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6163) UnhandledPromiseRejectionWarning: TypeError: db.findOne is not a function
at Object.run (/app/Commands/Moderation/warn.js:14:12)
at module.exports (/app/Events/Messages/message.js:46:11)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:6163) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:6163) [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.
sage bobcat
#

One message removed from a suspended account.

trail carbon
#

Hey guys, topgg isn't working for me.

earnest phoenix
#

My code:

const db = require('./warn.js')
const { Message, MessageEmbed } = require('discord.js')

module.exports = {
  name: 'warn',
  description: `Warn un membre du serveur.`,
  usage: 'warn (membre) (raison)',
  requiredPerms: 'BAN_MEMBERS',
  permError: "❌ Tu n'as pas la permission !",
  async run(message, args, prefix) {
        const user = message.mentions.members.first() || message.guild.members.cache.get(args[0])
        if(!user) return message.channel.send(`❌ Je ne trouve pas ${args[0]} !`)
        const reason = args.slice(1).join(" ")
        db.findOne({ guildid: message.guild.id, user: user.user.id}, async(err, data) => {
            if(err) throw err;
            if(!data) {
                data = new db({
                    guildid: message.guild.id,
                    user : user.user.id,
                    content : [
                        {
                            moderator : message.author.id,
                            reason : reason
                        }
                    ]
                })
            } else {
                const obj = {
                    moderator: message.author.id,
                    reason : reason
                }
                data.content.push(obj)
            }
            data.save()
        });
        user.send(new MessageEmbed()
            .setDescription(`You have been warned for ${reason}`)
            .setColor("RED")
        )
        message.channel.send(new MessageEmbed()
            .setDescription(`Warned ${user} for ${reason}`).setColor('BLUE')
        )
    }
}
crystal wigeon
#

anyone use grafana?

small tangle
#

Git keeps warning me that im exposing my URI connection string, but I'm storing my password in an .env file so im good or?

crystal wigeon
#

never commit .env files

earnest phoenix
#

unless private

small tangle
#

no the env is not commited

crystal wigeon
#

not sure then

earnest phoenix
#

you will have to show more

small tangle
#

i mean besides the password the connection string i a plain string

sage bobcat
#

One message removed from a suspended account.

small tangle
#

thats not he case the env is not pushed

sage bobcat
#

One message removed from a suspended account.

small tangle
#

are there any forbidden chars in an env file?

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

wide wharf
#
    footer: {
      icon_url: client.user.avatarURL(),
      text: "© Its_IsmailZ#8826"
    }

Uhm the icon should be my pfp and not the one of the bot

lusty quest
#

i love how people ping certain people in here who just havent said anything for 30 minutes

cinder patio
#

Use message.user

crystal wigeon
#

@opal plank sorry for the ping, i saw your earlier messages where you had a grafana dashboard to monitor commands, mind helping me out with that? i got it to install xd

#

googlefeud do you know anything about grafana?

cinder patio
#

nope but I'll maybe use it in the future

#

when I have something worth monitoring

crystal wigeon
#

im desperate for it rn

wide wharf
crystal wigeon
#

grafana

#

djs

#

to monitor bot commands

opal plank
#

well yeah, but what exactly

#

you have multiple ways to do that

#

you need to add a source

crystal wigeon
#

when a suer types some command i want grafana to pick up what he typed etc

#

do you have some docs?

#

apparently they have bad docs :c they didnt even specify the port it runs by default

lusty quest
#

use some time series database like Prometheus

crystal wigeon
#

which i found out it was 3000

opal plank
lusty quest
#

or Influxdb

opal plank
#

too much for them brain

lusty quest
#

rip

opal plank
#

i offered prometheus for Luke which is using for the bdlstats, even he thought it was overkill

crystal wigeon
#

i saw the prometheus thing, but i currently dont have time for new things

opal plank
#

for tracking commands its way too far

crystal wigeon
#

i was thinking quickdb

opal plank
#

what db you using hoax?

crystal wigeon
#

postgres

opal plank
#

then thats the one you wanna check

#

add source and add a query

wide wharf
# cinder patio Use `message.user`
/home/container/index.js:50
      icon_url: message.user.avatarURL(),
                             ^

TypeError: Cannot read property 'avatarURL' of undefined
    at Client.<anonymous> (/home/container/index.js:50:30)
    at Client.emit (events.js:326:22)
    at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
    at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
    at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
    at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:132:16)
    at WebSocket.emit (events.js:314:20)
    at Receiver.receiverOnMessage (/home/container/node_modules/ws/lib/websocket.js:825:20)
```**ERROR**
opal plank
#

query builder should be fairly easily to use

cinder patio
wide wharf
crystal wigeon
#

aight, thanks!

#

okay, so grafana only does the reading from DB? i have to post my commands to that DB where grafana picks it up correct?

small tangle
#

Oke now my whole connection string is an env variable monkaS

#

weird that it complained in the first try

neon citrus
earnest phoenix
#

2021-02-28T15:13:22.663863+00:00 app[worker.1]: ${message.guild.owner.user.username}#${message.guild.owner.user.discriminator},
2021-02-28T15:13:22.663865+00:00 app[worker.1]: ^
2021-02-28T15:13:22.663866+00:00 app[worker.1]:
2021-02-28T15:13:22.663866+00:00 app[worker.1]: TypeError: Cannot read property 'user' of null

pale vessel
#

message.guild.owner is null since it's not cached

earnest phoenix
#

wat i du

pale vessel
#

Fetch the owner guild.members.fetch(guild.ownerID)

#

It's a promise so you have to await it

earnest phoenix
#

use remove?

#

user*

#

the guild object should have owner im pretty sure

quartz kindle
#

https is a protocol

#

domain without protocol would be xigg.glitch.me

earnest phoenix
#

why are you using glitch anyway

rocky hearth
#

in ts I've

const SYMBOL = {
  INDRA: 'I', SHASTRI: 'A', CHARAN: 'C', RISHI: 'R',
  SENAPATI: 'S', RATHA: 'M', ASHVA: 'H', GAJA: 'G',
  PYADA: 'P'
}
type Sym = // How do I grab all the values from SYMBOL as a type here? Like this, 'I' | 'A' | 'C' | .... 'P'
velvet jetty
#

HI

rocky hearth
#

then?

quartz kindle
#

what do you want to use this type for?

rocky hearth
#

as a function parameter type, in switch cases....

quartz kindle
#
enum SYMBOL {
  INDRA = 'I', SHASTRI = 'A', CHARAN = 'C', RISHI = 'R',
  SENAPATI = 'S', RATHA = 'M', ASHVA = 'H', GAJA = 'G',
  PYADA = 'P'
}

type Sym = keyof typeof SYMBOL;
``` something like this should work i tihnk
cinder patio
#

Except it's key = value but yeah

rocky hearth
#

yeah, but the keys will also be included in the Sym

cinder patio
#

You want only the values?

rocky hearth
#

yup

quartz kindle
#

i found this answer in SO

#
type valueOf<T> = T[keyof T];
#

then use type Sym = valueOf<typeof SYMBOL>

pale vessel
#

SO moment

rocky hearth
#

it says, Sym = string

quartz kindle
#

try valueOf<SYMBOL>

rocky hearth
#

This worked!
But what does as const do here?

cinder patio
#

it means the object values will never change

#

so typescript will think myObj.a is 1, not number

rocky hearth
#

Oh! and how it is different from Object.freeze()?

cinder patio
#

Object.freeze affects your actual transpiled code, as const only tells the typescript compiler that it will never change

rocky hearth
#

then y doesn't this work?

const myObj = Object.freeze({ a: 1, b: 'some_string' });
type values = typeof myObj[keyof typeof myObj];
cinder patio
#

Because typescript isn't that smart.

#

It doesn't know that Object.freeze makes the object read-only

#

it's just a function to ts

rocky hearth
#

No it does

latent heron
#

woah

#

what text editor is this?

cinder patio
#

yeah Object.freeze returns a Readonly type, as const doesn't just make the type readonly, it turns the types from number to 1

#

Object.freeze can't do that cause it's a function

latent heron
#

i wish Atom had a feature like that blobpain

#

it looks so cool and useful

lusty quest
#

vsc i guess

cinder patio
#

It's VSC

lusty quest
#

vsc got so many really good plugins

latent heron
#

christ

#

that's a good plugin

lusty quest
#

i like error lens

latent heron
#

i know what it's called, but i don't think Atom has a plugin for it

cinder patio
#

why are you using Atom and not VSC

rocky hearth
#

How do I correctly make a generic?

latent heron
#

what are you trying to do here

fair apex
#

guys

latent heron
#

get the type of a value from array T with [keyof] as the index?

fair apex
#

how to make am embed

#

discord.js

latent heron
#

check the d.js docs

fair apex
#

okay

lusty quest
rocky hearth
cinder patio
#

Remove the typeof

#

Or try typeof (...) though that probably won't work

latent heron
#

i don't think he needs to do the keyof typeof T

#

just have it as keyof

#

if he's trying to get the typeof for the specific index value, then it's pointless to get that type as well

safe creek
#

was there anything new added in discord py 3.9.1

#

or just bug fixes

latent heron
#

you're referring to python 3.9.1, not d.py 3.9.1

safe creek
#

ye my bad

#

that

#

anythin new or nah

latent heron
#

bug fixes

safe creek
#

mmmk

#

so the usual

river panther
#

i found how to correct represent myself

#

correctly*

safe creek
#

thays one way to get terminated

river panther
#

ofc

#

but he has a partnership badge too

safe creek
#

thats sad af

#

lmao

river panther
#

exdi

safe creek
#

now i want to report him xd

lusty quest
#

or knows how to edit html

safe creek
#

or that

river panther
#

mhm

safe creek
#

i can try to add him to see if he does

latent heron
safe creek
#

whats his dicord

latent heron
river panther
#

RJain#1234

#

when he made that video

#

he indian

#

niceee

latent heron
#

some random server started using my bot API

lusty quest
#

commands used?

safe creek
#

mmk

latent heron
#

and the usage spiked

lusty quest
#

add either a Ratelimit or make it a private API

safe creek
#

not accepting friend requests

latent heron
#

it relies off of another API

#

i also have limits

#

something tells me that this isn't exactly a small server haha

lusty quest
#

or 3 dudes with no other hobbies

river panther
latent heron
#

lol

river panther
#

his latest video

#

not something which a developer needs

rocky hearth
#

how Luca got verified??

river panther
#

i can do that with

#

photoshp

#

op

#

oh wow, its a premiere, perfect timings

lusty quest
pale vessel
#

the badge looks fatter

earnest phoenix
#

couldve jus inspect elemented my dude

#

wouldve looked more legit

sudden geyser
#

the badge looks the same

pale vessel
sudden geyser
#

just looks like inspect element

lusty quest
#

looks also fake

safe creek
#

what id

pale vessel
#

That's inspect element

safe creek
#

oh

#

nvm

lusty quest
#

yea but i have eyes and see the real bot here

safe creek
#

xd

#

luca will never get verified tho

latent heron
#

the more i think about it, the more useless i see verification of bots being outside of the premise of legality

safe creek
#

its a private bot xd

earnest phoenix
#

except if they make 85+ fake servers

safe creek
#

no

river panther
#

maybe because this server has many members

safe creek
#

lol

lusty quest
#

verification gives discord the ability to have a real person to sue if the bot does some bad stuff

latent heron
#

thats

safe creek
#

ye

latent heron
#

exactly what i just said

rocky hearth
safe creek
#

ban

#

lol

river panther
#

what

#

hiw

lusty quest
#

the edges look off

river panther
#

is she a bot?

sudden geyser
#

I knew it! iara isn't human!

safe creek
#

ye

latent heron
#

it's a bad photoshop

safe creek
#

the bottom is cropped

river panther
#

oh no

#

i pinged someone else

#

but mistake

lusty quest
#

lol ghost pinging a community manager

river panther
#

who has a bad pfp

latent heron
#

who knew the insult "you're a bot" could be taken so literal here on discord 😳

safe creek
#

lolollollololollololollololololoollolololollolololololol

#

yup

river panther
#

beuh exdi

crystal wigeon
#

fkin hell redis keeps throwing no auth error even when im providing an auth

#

wtf

lusty quest
#

maybe the auth is wrong

#

is the server self hosted?

crystal wigeon
#

its correct

#

i checked with redis-cli

rocky hearth
#

I'm just copy pasting element in the dom, why its styling gets changed?

crystal wigeon
#

typed the same pass

#

and it works

lusty quest
#

did you use a connection url?

latent heron
earnest phoenix
crystal wigeon
#

its localhost

lusty quest
#

yea but you can still use a connection url

crystal wigeon
#

yeah

#

i tried putting the ip

#

didnt work

#

mindfk

lusty quest
#

js?

crystal wigeon
#

yeah

#

nodejs

#

it worked before

lusty quest
#

did you send client.auth?

crystal wigeon
#

same syntax

#

yeah

pale vessel
crystal wigeon
#

client = redis.createClient(port, host)
client.auth(pass)

latent heron
#

lmao

safe creek
#

yes

crystal wigeon
#

;-;

earnest phoenix
#

Hey anyone here to help me?

latent heron
#

no

lusty quest
#

hmm looks right

earnest phoenix
crystal wigeon
#

ikr

lusty quest
#

is the redis server running?

crystal wigeon
#

idk why it keeps

#

throwing

#

fkin hell

#

yeah

#

it is

#

i just connected with redis-cli

lusty quest
#

restart the redis server

crystal wigeon
#

used the same auth

#

did

lusty quest
#

what does the error say?

crystal wigeon
#

ReplyError: NOAUTH Authentication required.

lusty quest
#

hmm

crystal wigeon
#

wasted 1 hour

#

on this

lusty quest
#

or try using a connection url [redis[s]:]//[[user][:password@]][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]

crystal wigeon
#

like

#

wtf

latent heron
earnest phoenix
#

only one hour?

crystal wigeon
#

fml man

#

the errors make no sense

#

i mean 1 hour

#

to try to get this auth

#

to work

earnest phoenix
#

welcome to programming

crystal wigeon
#

i tried 3 methods

#

ik

#

i been doing programming for 3 years now xd

earnest phoenix
#

its never enough

ember dragon
#

what do i do if... An error has occurred while validating your input:
Invalid token. Please try again.

lusty quest
#

the token you provide is invalid

ember dragon
#

what token

lusty quest
#

probably discord bot token

ember dragon
#

where do i find it

earnest phoenix
#

you should give more context or code

lusty quest
#

did you know how to create a discord bot?

ember dragon
#

i know how

lusty quest
lusty quest
ember dragon
#

the bot client ID

lusty quest
#

no

#

you need a authentification token

ember dragon
#

oh

lusty quest
#

dont post the token here

narrow rover
#

lol

safe creek
#

post your token and ill mess up your bot : D

earnest phoenix
#

damn ur a big pro wow wow

ember dragon
#

XD

earnest phoenix
#

actually discord has this service if you post ur token on discord or github

#

it regenerates one for you immediately

rocky hearth
#

how discord know if a token has been published to github?

lusty quest
#

they probably have a integration with github to scan each repo that contains certain keywords for certain strings

#

like if a repo gets uploaded using one of the common libs they can see that it is a discord bot

#

then just look for a token

rocky hearth
#

that must be require a huge computational power.

earnest phoenix
#

I posted mine once mistakenly and they regenerated one immed

#

and sent me a notification on here

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

not rly yeah

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

rocky hearth
#

still there are crores of tokens to be search

crimson vapor
#

just do 'first part' + 'second part' so github can't find it

#

no more dms

wide wharf
#
  if (message.content.toLowerCase().startsWith(prefix + "avatar")) {
            const user = message.mentions.users.first() || message.author;
            const avatarEmbed = new Discord.RichEmbed()
            .setColor(0x333333)
            .setAuthor(user.username)
            .setImage(user.avatarURL);
        message.channel.send(avatarEmbed);
}

Why doesn't this work?

earnest phoenix
#

you realize a simple query can look through those crores in a few ms?

lusty quest
sage bobcat
#

One message removed from a suspended account.

cinder patio
wide wharf
cinder patio
#

call it

lusty quest
#

update d.js?

sage bobcat
#

One message removed from a suspended account.

wide wharf
wide wharf
sage bobcat
#

One message removed from a suspended account.

wide wharf
#

ok lemme test

cinder patio
#

You should read up on functions if you don't know how to call one...