#development

1 messages · Page 630 of 1

restive light
#

nah

#

i wrote same program with c# and it works well

sinful lotus
#

stop blaming the programming language for your shortcomings

#

both have pros and cons but that doesnt mean its the programming language's fault

#

A good developer doesn't blame the programming language for bugs.

slender thistle
#

JS sucks :^)

sinful lotus
#

JS is imo simple language

restive light
#

for me, java is the sucking language ever

#

always gives error or bug at somewhere

sinful lotus
#

then dont use it

#

who forces you to use Java?

restive light
#

but c# is better and faster

sinful lotus
#

then use C#

restive light
#

i must use java

amber fractal
#

why

sinful lotus
#

simple commonsense

restive light
#

because im working on an IRC bot delivers messages from game to dc just works with the java

sinful lotus
#

If Java sucks, there woudnt be a game developed from Java imo

#

As I said stop blaming the programming language for you own fault

#

a programming language just follow the developer's code

#

and who wrote that code?

#

is it the Java program who wrote that code? lmao

#

also there is an option to make a C# wrapper that irc bla bla you do

restive light
#

you cant

#

only works with java's algorithm

sinful lotus
#

thats why make a wrapper

restive light
#

i tried vb and c#

#

on it

sinful lotus
#

why not make a Java server and just use websockets to send messages

#

imo a lot of possibilities if you just stop on complaining Java sucks

pliant needle
#

The shit I miss?

#

Also java's hella fun to use

earnest phoenix
#

@restive light const need to be in the event

#

under the event and not above

sinful lotus
#

it doesnt need to be in event

#

it needs to be in global scope

#

but not the literal global variables

#

just in global of that file

earnest phoenix
#

@digital sparrow how to move file?

digital sparrow
#

wtf i delete it where u know?

earnest phoenix
#

bc when you delete a message to quickly the message stay here

#

with a fcking ghost ping on the channel

digital sparrow
#

oh

dusky sedge
#

Link

#

رابط

earnest phoenix
#

@dusky sedge?

earnest phoenix
zealous veldt
#

]]moreinfo

covert turtleBOT
#

If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.

ember matrix
#

Anyone help me to createa bot

mossy vine
pale marsh
#

Learn a programming language first

#

Like python or java

undone carbon
#

Just stick to one channel when asking questions, don't spam all the channels to get answers, you have already got your answer in #general

drowsy sentinel
#

Python or JavaScript for beginners, then you can dive later into java. I recommend codecademy for you @ember matrix.

mossy vine
#

Really, it doesnt matter which language you learn first

ember matrix
#

@drowsy sentinel python

sinful lotus
#

result[0].noprefix then this is undefined

#

yeah but if the code is complaining about noprefix is undefined, then it is undefined

#

its probably an issue with flow or something you forgot to clean or add or something

#

specially if thats an public bot, users may have found a way to break your bot

#

causing that noprefix to be undefined

#

then did you actually console.log noprefix on that ?

#

console.log the whole result[0]

#

not the var noprefix

#

where did you put that?

#

where in the if result 0

#

please include the whole code if possible

#

oh

#

the culprit is if(result[0].noprefix)

#

you put false in the settings

#

then that wont work

#
if(result[0].noprefix)

that line will never execute

var noprefix = result[0].noprefix

because you literally said the code to not execute that if its falsy

earnest phoenix
#

eh

pallid zinc
#

How to add line is canvas npm

quartz kindle
#

change the Y position

pallid zinc
#

I want a thick line

#
ctx.strokeStyle = 'rgba(0,0,0,0.5)'

ctx.beginPath()

ctx.lineTo(50, 102)

ctx.lineTo(50 + text.width, 102)

ctx.stroke()

#

Code

#

@quartz kindle

#

Sorry

#

For ping

quartz hill
#

How do I check if a channel is nsfw? (with nodejs)

drowsy sentinel
#

textchannel should have a readonly nsfw boolean.

primal heron
#

channel.nsfw

quartz kindle
#

@pallid zinc ctx.lineWidth

pallid zinc
#

Thanks

quartz hill
#

ok thx

pallid zinc
#

@quartz kindle can you give example

#

I try

#

ctx.lineWidth(100)

#

and it don't work

quartz kindle
#

ctx.lineWidth = 100;

pallid zinc
#

I try this also not working

#

Got it

#

Done thanks

quartz kindle
pallid zinc
#

Done bro

#

No need of this

pallid zinc
#

How to set line height

#

Just ping me if you had ans

quartz kindle
#

what do you mean line height?

pallid zinc
#

Sorry

#

Wrong chat

smoky mica
#

can anyone give some advice on how to make a web dashboard for my bot?

quartz kindle
#

learn how to run a webserver, how to use oauth2, how to use html+css, how to connect to your database

smoky mica
#

What webserver should I use?

#

I'm fine with coding the website UI but the webserver and etc I need help with

bright meadow
#

Apache2 MegaThonk

real mango
#

my role??!

smoky mica
#

Which role

quartz kindle
#

you can run a webserver inside your bot using something like express

#

or you can run a separate webserver (recommended) using something like nginx on linux

#

the separate webserver needs to have access to your database, so if you use something like sqlite, the server should be in the same machine as the bot

earnest phoenix
#

you should always reverse proxy your internal web app

patent gulch
#

Does anyone have any idea how to use webhooks with amazon ec2 t2.micro

lofty hamlet
#

Hi i want sort this for example a user data : { ID: 'userInfo_403159739178942464', data: { niveau: 1, testing: 0 } }

#

My copde does not work and i test every solution but does not work : ```let lvl = db.startsWith('userInfo_', { sort: '.data' })
let content = ""

    try {
        for (let i = 0; i < 10; i++) {
            let user = bot.users.get(lvl[i].ID.split('_')[1])
            content += `${i + 1}. ${user} ~ ${lvl[i].data}\n`
        }

        let embed = new Discord.RichEmbed()
            .addField(`Classement par Niveau PVM`, content)
            .setColor("RANDOM")
        message.channel.send(embed)

    } catch (err) {
        console.log(err);
    }```
#

@quartz kindle startsWith work now 😉

#

But i can't arrive to make my ranking

earnest phoenix
#

Hello

opaque eagle
#

Hello

earnest phoenix
#

I making caps blocker but

#

its not blocking caps ...

cursive dagger
#

What is your code?

earnest phoenix
#
if (db.has(`capsE_${msg.guild.id}`) === false) return;
    if (db.has(`capsE_${msg.guild.id}`) === true) {
      let x = /\w*[A-Z]\w*[A-Z]\w*/g;
      if (msg.content.match(x)) {
if(msg.content.length > 4) {
    if (!msg.member.hasPermission("ADMINISTRATOR")) {
      msg.delete()             
        var y = await msg.channel.send('*Caps detected!*')
       y.delete(5000)
      return
    }
}
}
    }
});```
#

This @cursive dagger

lofty hamlet
opaque eagle
#

Is there an error in the console? @earnest phoenix

earnest phoenix
#

no @opaque eagle

late hill
#

Start by using 1 database call

#

And you can most likely remove === true / === false

lofty hamlet
#

@late hill me ?

late hill
#

No

lofty hamlet
#

Ok ...

#

Who cna help me please ,

late hill
#

@earnest phoenix

#

If you don't get any errors, check if the code is even executed

#

Using some logs for example

earnest phoenix
#

@late hill fixed

late hill
#

You should also check if the message was sent from a guild

lofty hamlet
#

Nobody can help me ?

sinful lotus
#

its hard to help you if you provide that little context

#

even I cant understand what you are trying to achieve

steel cloak
#

@lofty hamlet what's even your problem?

lofty hamlet
#

@sinful lotus the same

sinful lotus
#

My code does not work and i test every solution but does not work :

#

what is does not work

#

what is solution you did

lofty hamlet
#

I want make a ranking with my db

sinful lotus
#

what is the error

west spoke
#

uh

sinful lotus
#

lots of missing context

west spoke
#

Just use json? Idk

lofty hamlet
#

No

#

I use quick.db

steel cloak
#

can you send a screenshot instead of an channel link

sinful lotus
steel cloak
#

or just send the code here

sinful lotus
#

literally just read that page

lofty hamlet
#

The code is in this channel

#

Just click here

#

@sinful lotus no my system is different

sinful lotus
#

I dont see how its different if you just want to sort it

lofty hamlet
#

I want make a ranking with this : { ID: 'userInfo_403159739178942464', data: { niveau: 1, testing: 0 } }

#

No

sinful lotus
#

yeah but what you want to sort it?

#

why even do .data

lofty hamlet
#

I want sort .niveau

sinful lotus
#

then do db.startsWith('userBalance', { sort: true, sortBy: '.niveau' });

#

documentation never used .data

#

the examples there are pretty straight forward 👀

lofty hamlet
#

Yes i have try this db.startsWith('userInfo_', { sort: true, sortBy: '.niveau' }) but he send all of db of user i want he send juste .niveau

#

And just a top ten

sinful lotus
#

then do niveau on results

#

then filter the top 10

lofty hamlet
#

How i can make this with my db ?

#

Ups capslock

sinful lotus
#

literally follow the example code in the documentation

#

if it returns you the object

lofty hamlet
#

I have try a lot of system

sinful lotus
#

why not access the object value?

sinful lotus
#

Im literally pointing you in the r ight d irection

west spoke
sinful lotus
#

they have a documentation and I HAVE READ IT

#
/* In this example, assume the data is stored as follows:
{ ID: 'userInfo_1', data: { username: 'User', balance: 9000 } }
{ ID: 'userInfo_2', data: { username: 'User1', balance: 500 } }
{ ID: 'userInfo_3', data: { username: 'User2', balance: 10 } }
{ ID: 'userInfo_4', data: { username: 'User3', balance: 4000 } }
{ ID: 'userInfo_5', data: { username: 'User4', balance: 300 } }
{ ID: 'userInfo_6', data: { username: 'User5', balance: 50 } }
{ ID: 'userInfo_7', data: { username: 'User6', balance: 9999 } }
{ ID: 'userInfo_8', data: { username: 'User7', balance: 700 } }
*/

// NOTE: Sorting is optional.
db.startsWith('userBalance', { sort: true, sortBy: '.balance' });
/* Output:
[ { ID: 'userInfo_7', data: { username: 'User6', balance: 9999 } },
{ ID: 'userInfo_1', data: { username: 'User', balance: 9000 } },
{ ID: 'userInfo_4', data: { username: 'User3', balance: 4000 } },
{ ID: 'userInfo_8', data: { username: 'User7', balance: 700 } },
{ ID: 'userInfo_2', data: { username: 'User1', balance: 500 } },
{ ID: 'userInfo_5', data: { username: 'User4', balance: 300 } },
{ ID: 'userInfo_6', data: { username: 'User5', balance: 50 } },
{ ID: 'userInfo_3', data: { username: 'User2', balance: 10 } } ]
*/
#

this code means

west spoke
#

just use json. Dont make it overcomplicated

sinful lotus
#

get the data that starts with USERBALANCE then sort them, then sort them by .balance

#

as you can see the .balance there starts from high to low

sinful lotus
#

you clearly dont get the point

steel cloak
#

it's starting to sound like he's spamming that link

sinful lotus
#

the example code shows .balance THAT DOESNT MEAN COPY IT

lofty hamlet
#

He send the sort db of the user but he send the all of db af the user

sinful lotus
#

cause thats how it works

lofty hamlet
#

If i try this he send me

#

:

sinful lotus
#

oh my good ness cant you just listen?

#

I know perfectly what you are trying to do

lofty hamlet
#
{ ID: 'userInfo_40315973917891233124', data: { niveau: 0, testing: 0 } }```
sinful lotus
#
{ ID: 'userInfo_403159739178942464', data: { niveau: 1, testing: 0 } }

you have this data

#

you just need to change .balance to .niveau
then .splice the 1st 10 data from it

lofty hamlet
#

And in ranking i can't send this

#

I want juste the .niveau

sinful lotus
#

how hard is that if you just listened to me

#

quick db's

.startsWith(str, [options]) -> array

returns an array, meaning you can use array methods to it

#

array have .slice()

#

which accepts a start value and end value

#

where in in yoru case .slice(0, 10)

lofty hamlet
#

Hu

sinful lotus
#

look at the example, then look what they did on that .startsWith() method, then adapt it to your code not copy it

lofty hamlet
#

Yes i have my array

#

Sort

#

And now i want a top 10 with juste the value of .niveau

#

Hum

sinful lotus
#

then use .slice() method

lofty hamlet
#

I can't if i use console.log he send the values sorted but i use in a message he say it's empty @sinful lotus

sinful lotus
#

uhmm what

hushed quarry
#

are you sending it through an embed? if you get an error that it's empty, then your embed is wrong

lofty hamlet
#

@hushed quarry yes i send in an embed

hushed quarry
#

your embed is wrong

lofty hamlet
#

No but in console.log he send the values sort

west spoke
#

Just use plaintext for testing

lofty hamlet
#

But when i make this in an embed he is empty

hushed quarry
#

your embed is wrong then

#

make it a simple embed, one that works, then add to it slowly and see where it fails

lofty hamlet
#

Now he send [object] [Object]

hushed quarry
#

that means you're trying to stringify the object

#

(which means it's the array)

lofty hamlet
#

Hu ok so

west spoke
#

array(text)?

lofty hamlet
#

array is not a function

earnest phoenix
#

Array(text)

lofty hamlet
#

Hu

digital sparrow
#

VPS + PM2 good? or what?

lofty hamlet
#

@west spoke already : object object

sinful lotus
#

turn it into string before sending it in an embed

west spoke
#

^

sinful lotus
#

use .map(x => x.property).join('\n')

earnest phoenix
#

Really idk what's saya mean but it should be work

lofty hamlet
#

@sinful lotus hu ?

sinful lotus
#

.map returns a new array with the function you specified

#

then makes them a string via .join()

#

so you can use it on an embed

lofty hamlet
#

How i can map 🤔

sinful lotus
#
array.map(x => `**${++index}.** [${x.title}](${x.url})`).join('\n')}
#

¯_(ツ)_/¯

#

.map returns a new "array" depending on function you use

#

.join() makes them a single string

lofty hamlet
#

What is index x.title and x.url ?

#

@sinful lotus

digital sparrow
#

VPS + PM2 Good?

hushed quarry
#

@digital sparrow the VPS is where you run your bot, you need it, and PM2 is a decent process manager

#

personally i find pm2 to be kind of limiting, but it's good for beginners

sinful lotus
#

thats just an example

#

thats my object

#

x is my object

#

title and url is the property

lofty hamlet
#

🤔

#

I can replace with what ?

#

And what is index ?

earnest phoenix
#

nevermind man

hushed quarry
mossy vine
earnest phoenix
#

my node-gyp has some errors

#

configure command gives errors

#
gyp info spawn args ]
gyp: binding.gyp not found (cwd: C:\Users\Win7\Desktop\Klas÷rler\JavaScript\Test) while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node_modules\node-gyp\lib\configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:200:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure"
gyp ERR! cwd C:\Users\Win7\Desktop\Klasörler\JavaScript\Test
gyp ERR! node -v v12.4.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
#

gr8

#

nobody knows anything

lofty hamlet
#

@hushed quarry yes but he send always object object

hushed quarry
#

then parse the array into something you can send

earnest phoenix
#

how may i fix it

mossy vine
#

im bad at copying

earnest phoenix
#

i dont know whats binding.gyp

#

and what it contains

hushed quarry
#

you might find more success opening an issue on their github repo so someone there can help you

earnest phoenix
#

i cant

hushed quarry
#

why not

earnest phoenix
#

im having good times with node-gyp for 2 weeks

#

cannot install bettersqlite integer or sth

#

im totally done

#

no more djs

digital sparrow
#

so if i run only pm2 without vps is worth?

mossy vine
#

you cant

#

pm2 is a process manager

#

that you run on your vps

lofty hamlet
#

(node:15377) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token o in JSON at position 1

#

Lmao i want juste make a fucking ranking with quick db wtf

#

I am since 2h

digital sparrow
#

i dont understand

earnest phoenix
#

read @lofty hamlet

sinful lotus
#

tbh all you need is provided on you

#

I would rather blame the lack of experience with JS in your problem

#

we pointed you to lot of sources

#

gave you examples

#

even documentation link

quartz kindle
#

@digital sparrow pm2 is just a process manager. You can use it on a vps or on your computer, doesnt matter

#

Using it or not using it doesnt have anything to do with running on a vps or not

digital sparrow
#

So i rip buy vps or no?

quartz kindle
#

If you want a reliable service yes

#

Its the only reliable way to run something 24/7

#

And you can get 2 years for free

#

1 on google and 1 on amazon

digital sparrow
#

i dont understand

quartz kindle
#

What dont you understand?

lofty hamlet
#

Hi the limit of the reactions is 25 or it is for one server or all servers or just the channel who the command is execute ?

earnest phoenix
#

what

#

reaction limit is the same on all server

ruby dust
#

some people have never heard of punctuations

lofty hamlet
#

@earnest phoenix sorry ?

#

Limit of reaction added in x time * sorry my bad

digital sparrow
#

how to move file form vps to pc or pc to vps?

lofty hamlet
#

Drag andd drop lmao 😂

#

Filezilla

digital sparrow
#

how?

#

teach me

#

me n0b

spare shoal
#

You just connect to your VPS with FileZilla then you drag and drop files

digital sparrow
#

idk how

earnest phoenix
#

download filezilla

#

put as ip your vps ip

#

as username put root

#

as password put your vps password

#

and as port put 22

mossy vine
#

or not root lol

digital sparrow
#

oh

#

idk what u say

copper cradle
#

just use root

digital sparrow
#

ok thx you my hater 💌

mossy vine
#

lmao just download filezilla and r e a d

digital sparrow
#

so how to move file vps to pc?

lofty hamlet
#

Drag and drop lmao

#

The right to the left

digital sparrow
#

how wtf

mossy vine
#

mate

#

i can hardly believe youre not trolling

#

you completely ignore everything we say

lofty hamlet
#

The right to the left

#

Raise your hands in the air

#

Lmao

digital sparrow
#

i dint understod

lofty hamlet
#

Go google so

ruby dust
#

🙌

digital sparrow
#

wtf

lofty hamlet
#

🙌

copper cradle
#

si

earnest phoenix
#

lmao

digital sparrow
#

HOW USE FILLEZILA

ruby dust
#

google it

late hill
#

What's "event loop latency p95"

#

It's one of the code metrics on pm2

lunar knot
#

Hey, does someone know, how to create an Embed like this for your own website?

mossy vine
#

@lunar knot iirc its meta tags

lunar knot
#

okay thanks

amber fractal
#

Open graph

queen violet
#

anybody know any c++

quartz kindle
#

@late hill the latency of node.js's event loop probably

late hill
#

🤔

queen violet
#

well if anybody answers ping me pls

late hill
#

There's also just event loop latency

quartz kindle
#

I kniw next no nothing c++

mossy vine
#

not to brag or anything but i can write a C++ program that prints hello world so

quartz kindle
#

P95 is probably 95th percentile

mossy vine
#

^ it is

#

after a quick search

spare shoal
#

@queen violet What do you want to know about C++?

digital sparrow
#

;

amber fractal
#

Why

viral plover
#

How do I mention a role in Javascript?
Several answers said roleObject.mention() should work but those are over 2 years old so I figured that it's deprecated and that's why it hasn't worked.

earnest phoenix
#

have you tried reading the docs

mossy vine
#
#

there is no such thing as mention()

viral plover
#

I use them most of the time but they can be difficult to navigate.

earnest phoenix
#

d.js docs are arguably one of the easiest docs to navigate

mossy vine
#

^

viral plover
#

It doesn't tell me how to mention a roleObject.
I can view its properties and change stuff about it, but unless I've missed it a couple times it doesn't tell me how to mention it.

#

I might just be stupid.
Is it just <@roleObject.id>?

earnest phoenix
#

@&

viral plover
#

I knew they were different.

#

Thanks, that's what I came here for.

earnest phoenix
#

<@> is user
<@&> is role
<#> is channel

west spoke
#

<!@> is nickname

queen violet
#

@spare shoal you still there?

spare shoal
#

Yeah

amber fractal
#

You can also just use .toString() on role object, user objects, guild member objects, and channel objects

#

And probably more

sacred minnow
#
function sleep( millisecondsToWait )
{
var now = new Date().getTime();
while ( new Date().getTime() < now + millisecondsToWait )
{

}
}

if(message.content.startsWith(`${prefix}hec`)){
if(!mUser){message.channel.send("zimi pe cine sa hecuiest boule")}else {
message.channel.send("ii dau flood lu "+ mUser)


let passwordarray = ["s#rfAF4g", "f5$#FG","eGR2!F^","S#@d.H&*","Vbw%^&754","f#r$T45","9Am4_d].F6n","3g#WRF","32asLJH%","@95rD.vwGb","s*1.ad3Op","qyYWQ9%gRh"]
var parola = passwordarray[Math.floor(Math.random()*passwordarray.length)]

let emailarray = ["@yahoo.com","@gmail.com","@outlook.com","@hotmail.com"];
var email = emailarray[Math.floor(Math.random()*emailarray.length)]

let da = ["***","****","*****","******","*******","********","*********"]
var asta = da[Math.floor(Math.random()*da.length)]

  message.channel.send("**Email:** ``"+mUser.username+asta+email+"``\n**Parola:** ``"+ parola+"``").then(mesajnou =>{
sleep(1000);
mesajnou.edit("**IP:** ``127.0.0.1``")
sleep(1000);
mesajnou.edit("**Adresa:** ``dracu stie``")



})
}
}```
#

i tried to make it wait before editing the message

#

but instead of waiting one second and then editing and repeat

#

it sends the message, waits 2 seconds and edits at the same time

heady zinc
#

oh no

#

that's really bad

#

oh god

#

in what year are you even living in

sacred minnow
#

why

heady zinc
#

please use async/await and don't use vars

unique nimbus
#

I dont do js can you say how its bad please

#

oh

sacred minnow
#

but how

unique nimbus
#

await sleep(1000)

#

try that

heady zinc
unique nimbus
#

idk

sacred minnow
#

ok

heady zinc
#

this function

dusky marsh
#

the fuck

heady zinc
#

will loop until the time has elapsed

#

and as while is synchronous

#

it will block the entire thread

#

until the time has elapsed

earnest phoenix
#

hardcoding passwords, best way of security

unique nimbus
#

best password is 123abc

#

I can make it better by doing !123abc!

#

because epic gaming moments

spring ember
#

@heady zinc nice sleep function

#

Fairly optimized

heady zinc
#

yes

#

that's definitely the future of software engineering

amber fractal
#

Use promises and resolve after a certain amount of time

unique iron
#

Ok, newbie here. I wanna add something to this to increase the value of my json file by 1

if(msg.startsWith(prefix + "cheese")){
message.channel.send(${message.author.username} made a cheese :cheese:);
message.channel.send("Total cheeses: " + bot.total.total);
}

warm marsh
#

use fs.

#

But constant changing of JSON files is something you don't really wanna do.

split hazel
#

What is the best host with around 10GB ram?

cursive dagger
#

You get what you pay for

earnest phoenix
modern sable
#

@earnest phoenix restart bot, this server had a outage and your bot probably wasn't kicked at all

opaque eagle
#

How can I make my bot get the user object of any user if I have their ID using the api?

#

Even if they don't share a server with the bot...

hushed berry
#

What lib?

opaque eagle
#

No just the api endpoints

hushed berry
#

/api/users/{user_id} iirc

opaque eagle
#

ty

#

And would that work for any user, regardless of if they share a server or not?

hushed berry
#

yep

hexed heart
#

...

feral slate
#

Does anybody know a placeholder that will say what the channel that the command was ran from was called like if you run it in a channel called #test in the code the placeholder would have that code

#

I’m using discord.js

warm marsh
#

Reword that please?

slender thistle
#

If command was executed in a channel called #test, get that channel

#

That's what they technically mean

shy turret
#
client.on('message', message => {
  if (message.content.startsWith('test')) {
    function channelSend(message, 'test')
    message.channel.send('test')
  }
}

function channelSend(message, command) {
  const channel = message.guild.channels.find(channel => channel.name === "channelname")
  channel.send('The command ' + command + ' has been ran!')
}

I didn't test, I'm guessing it is something like this.

#

IDK though

feral slate
#

Ok so I’m working on a ticket system for my bot. The tickets name is the username of the person I wanted to ask is there a placeholder where I could compare it to the users username and have an if else output

slender thistle
#

Spoonfeed...

shy turret
#

let me try my coed

feral slate
#

@shy turret I’ll try it I have my bot restarting now

slender thistle
#

If only you didn't spoonfeed, my fam

feral slate
#

It sent the same message for both even tho it shouldn’t have so it doesn’t work

#

The %close command it sent test for a channel with my username and without

#

Even though it shouldn’t have

slender thistle
#

= isn't comparing

#

startsWith is a function

feral slate
#

So should I do msg.content.startsWith(msg.author.username) ?

slender thistle
#

If that's what you need

feral slate
#

Well it doesn’t work it sends the error message for both even the one with my username

shy turret
#
client.on('message', message => {
  if (message.content.startsWith('test')) {
    message.channel.send('hi')
    command = 'test'
    channelSend(message, command)
  }
});

function channelSend(message, command) {
  const channel = message.guild.channels.find(channel => channel.name === "channelname")
  channel.send('The command `' + command + '` has been ran!')
}

When you send the message test (starts with), it will say in a channel named channelname a message and also reply to the command in the message channel.

#

@feral slate oh use == not =

slender thistle
#

Or ===

shy turret
#

yah ^

feral slate
#

I’ll try that right now

shy turret
#

use ===

#

not ==

slender thistle
#

Depends on use case

shy turret
#

yah == is numbers only I think right?

#

well

slender thistle
#

Easily Googleable

shy turret
#

it transfers text to numbers like
10 would be 10 and 1ooo0 is 10.

slender thistle
#

What...

shy turret
#

nvm

#

@feral slate I think you can put bot.on('message', msg=>{ only once if u want to.

slender thistle
#

Adviced to

feral slate
#

== and === don’t work

shy turret
#

if (msg.content.startsWith === msg.author.username ) {

feral slate
#

I’ll try that

shy turret
#

and I also advice you to use return functions

#

(it stops the event/action)

quartz kindle
#

also, you shouldnt be listening to multiple message events

feral slate
#

Msg.content.startsWith === msg.author.username doesn’t work just tested it

shy turret
#

wait I see it

feral slate
#

Where?

shy turret
#
if (msg.content.startsWith === msg.author.username ) {
  msg.channel.send('test')
}
#

proper*

feral slate
#

It’s right before else {

#

@shy turret

shy turret
quartz kindle
#

startsWith is not a property, its a function

shy turret
#

what's after that if?

feral slate
#

A space

quartz kindle
#

lmao

shy turret
#

what's after if (msg.content.startsWith === msg.author.username ) {?

#

then it just goes to the } else { thing

quartz kindle
#

the brackets are not wrong

shy turret
#

oh wait

#

nvm

#

I just saw that..

feral slate
#

Msg.channel.send(‘test’)

quartz kindle
#

the startsWith is wrong

shy turret
#

if (message.content.startsWith('test')) { this is my code

quartz kindle
#

and you shouldn't have .on("message") multiple times in your code

shy turret
#

if(msg.content === "%close"){ also means it needs to be "%close" and there can't be any parameters (if u are using parameters)

feral slate
#

I’m aware because all I want it to do is delete the ticket channel if it is called your username

#

Else it just say an error message

shy turret
#

client.on('message', message => { is in my code...
bot.on('message', message => { with }); at the end is also cool for you

feral slate
#

The reason I have .on multiple times is that sometimes I disable parts and that would just break the code

shy turret
#

then just use it once?

slender thistle
#

Switch or if statements still would work

quartz kindle
#

you can disable a part using comment blocks lol

earnest phoenix
#

just... use comments or booleans which are literally on/off states?

shy turret
#

example........

quartz kindle
#

the problem with listening to the same event multiple times is that it multiplies the amount of work your bot does

shy turret
#
client.on('message', message => {
  if (message.content.startsWith('!help')) {
    message.channel.send('one command')
    return
  }

  if (message.content.startsWith('!userinfo')) {
    message.channel.send('second command')
    return
  }
});
#

only 1 listener with 2 commands

amber fractal
#

That should also become a command handler

#

which is much more efficient

opaque eagle
#

Do u happen to know another programming language? @shy turret

west spoke
#
 async def has_user_voted(author_id):
     import urllib
     voteurl="https://discordbots.org/api/bots/543966796944769044/votes"
     for line in urllib.request.urlopen(voteurl):
         json=line
     if author_id in json:
         return True
     else:
         return False
#

I'm getting a 401 for this

#

Do I need to do anything for it?

#

I am logged in and I can see it fine.

#

Does dblapi have something similar I can do for this?

earnest phoenix
#

you need to provide your token in the authorization header

west spoke
#

Yeah but when I do it it says token not defined

#

Headers

#

Same thing ff

earnest phoenix
#

that's an user ™ issue ™

west spoke
#

I think I may have fixed it idk

#

Or not

shy turret
#

@opaque eagle sadly yes

#

barely know python and won't even try to learn

opaque eagle
#

Yeah, I figured...

shy turret
#

know qb64, html, etc

#

Scratch, Skript

#

a little bit of batch

steel cloak
#

imagine being a professional batch programmer

hoary helm
#

i recently updated to node.js 12.4.0 from node 11.15.0 and this happened
i've removed it, reinstalled it, and rebuilt it twice

opaque eagle
#

Get me process.versions

#

enter that in repl and send what it showss

hoary helm
#

kek

#
{
  node: '12.4.0',
  v8: '7.4.288.27-node.18',
  uv: '1.29.1',
  zlib: '1.2.11',
  brotli: '1.0.7',
  ares: '1.15.0',
  modules: '72',
  nghttp2: '1.38.0',
  napi: '4',
  llhttp: '1.1.3',
  http_parser: '2.8.0',
  openssl: '1.1.1b',
  cldr: '35.1',
  icu: '64.2',
  tz: '2019a',
  unicode: '12.1'
}
#

@opaque eagle

opaque eagle
#

R u sure u re-installed it?

hoary helm
#

yes

opaque eagle
#

idk tbh, sry

hoary helm
#

its fine

strange snow
#

Anyone else having authentication issues right now?

earnest phoenix
#

and no

amber fractal
#

Dont ask here?

earnest phoenix
#

better? mmLol

#

@amber fractal

golden vector
#

im pretty sure im stupid, but im trying to color the warn and error messages but always make an error. This is my 4th attempt..

client.on('warn', '\x1b[33m' + console.warn);

client.on('error', '\x1b[31m' + console.error);
zealous veldt
#

]]moreinfo

covert turtleBOT
#

If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.

golden vector
#

ah ok

#

well im trying to color warnings and errors in my console to see them better.
I'm using discord.js
code:

client.on('warn', '\x1b[33m' + console.warn);

client.on('error', '\x1b[31m' + console.error);
earnest phoenix
#

lol

#

console.log('\x1b[33m%s\x1b[0m', stringToMakeYellow); //yellow```
#

Colors reference:

Reset = "\x1b[0m" 
Bright = "\x1b[1m" Dim = "\x1b[2m" Underscore = "\x1b[4m" 
Blink = "\x1b[5m" 
Reverse = "\x1b[7m" 
Hidden = "\x1b[8m" 
FgBlack = "\x1b[30m" 
FgRed = "\x1b[31m" 
FgGreen = "\x1b[32m" 
FgYellow = "\x1b[33m" 
FgBlue = "\x1b[34m" 
FgMagenta = "\x1b[35m" 
FgCyan = "\x1b[36m" 
FgWhite = "\x1b[37m" 
BgBlack = "\x1b[40m" 
BgRed = "\x1b[41m" 
BgGreen = "\x1b[42m" 
BgYellow = "\x1b[43m" 
BgBlue = "\x1b[44m" 
BgMagenta = "\x1b[45m" 
BgCyan = "\x1b[46m" 
BgWhite = "\x1b[47m"```
#

console.error(color)

golden vector
#

oh

earnest phoenix
#

i think its that, not sure

golden vector
#

ill try

earnest phoenix
#

never used console.error

golden vector
#

tried it, but sorta weird

while running the error was the color but crashed the bot

zealous veldt
#

lmao what

#

that's just the error doing it's job

#

I don't think you correctly handled it

earnest phoenix
#

You can use a npm module

zealous veldt
#

yeah

#

I recommend chalk

earnest phoenix
#

yes

golden vector
#

welp ok

earnest phoenix
#

And what is client.on('error' i didn't found anything about it, on discord.js docs and on google

#

Oh its very very old

high lava
#

It took me like 3 seconds. lol

lavish forge
#

Would it cut down on CPU usage more by running a sync or async in my setInterval in djs? Thonk

heady zinc
#

what

#

intervals created through setinterval are always async

lavish forge
#

I'm talking about function wise.

#

Run a sync or async

#

Cause this person wants their api queried every 10 seconds, and if there's a change it needs to continue down the list.

pallid zinc
lavish forge
#

I had it async, but for some reason it ended up reaching 100% CPU usage.

#

sync it's staying around 1-3%

#

GO

#

GOD

pallid zinc
#

What

lavish forge
#

Change it to == 'idcard'

pallid zinc
#

Ok

lavish forge
#

You force it to lowercase, but you check it against something with an uppercase letter at the beginning.

pallid zinc
#

Hmm

lavish forge
#

Did that work?

pallid zinc
#

Thanks

#

Yup it work

#

The problem is I use toLowerCase but I add a upper case

keen saddle
#

i'm trying to submit a bot to discordbots.org but it says i need to join this discord first.

pallid zinc
#

How to send message to all the member of guild

dusky marsh
#

message.guild.members.forEach(member => member.send('hi'))
@pallid zinc

#

For d.ja

#

js*

mossy vine
#

Thats api abuse and a dick move

#

And doing it in this server will even get you banned iirc

vital nest
#

yes, it is bvannable and they will remove the bot from their site

#

the better way would be to do an @ everyone

#

this way people can disable notifications if they want too

earnest phoenix
#

Who can tell me what's going on with the game messages from the bots?

mossy vine
#

@earnest phoenix discord is bad. Game messages sometimes disappear. Restart the bot to fix it

earnest phoenix
#

Thank you

sinful lotus
#

async is just a wrapper around promises

#

you cannot change the fact JS = single thread

heady zinc
#

laughs in workers

sinful lotus
#

thats why workers is invented afterall

heady zinc
sinful lotus
#

cool

heady zinc
#

@modern sable pls fix

warm sail
#

Using JDA, I want to get the image/icon relevant to the game a user is playing. However, in RichPresense both getLargeImage and getSmallImage are often null, even though an icon is visible in Discord for the activity of that user. Any ideas how to get the relevant image/icon for a game by its application ID?

heady zinc
#

it probably is null because there's no image for the game hmm

warm sail
#

Yeah, I doubt Fortnite and Destiny 2 have "no image".

#

However, their RichPresense has no image URLs in JDA...

heady zinc
#

because discord itself doesn't give it

#

i assume JDA does hacky stuff and tries to fetch the image from discord's cdn from the id

warm sail
#

So the question remains, how to get the image for a game, e.g. using the application ID...?

heady zinc
#

hm

#

https://cdn.discordapp.com/app-icons/{application_id}/{asset_id}.webp?size={size}

#

i think that might work, though it might also be what JDA does too

warm sail
#

Yeah, but the asset ID is something I don't have if it's not present in the rich presence 😦

#

I can see in the Game SDK that devs can provide it, but I can't see how to retrieve that information.

heady zinc
#

oh the property itself is null?

warm sail
#

yes

#

It's only not-null if the activity itself has a special image. It's not always the actual icon for the game.

#

But both have visible icons when I check the user list in the Discord client

modern sable
#

@heady zinc huh?

heady zinc
#

bot dmed me without explicit command

modern sable
#

oh

heady zinc
#

ah

#

actually i think i know why

#

i remember finding out that games presence in discord was hardcoded as fuck

#

lemme try to find it

warm sail
#

I need to get the list of assets first

#

Now I just need to find the right documentation for what "type" is in that context.

heady zinc
#

i assume 1 is large and 2 is small

warm sail
#

proly, but I need to see if JDA has support for this somewhere before I implement my own handler

#

Thx for the help 😃

heady zinc
#

well you found it by yourself in the end so all thanks goes to you 😩

warm sail
#

https://cdn.discordapp.com/app-icons/{application_id}/{asset_id}.webp?size={size} was the trigger, otherwise I wouldn't have searched for "asset ids".

wide verge
#

!help

real helm
#

Hello

#

Hello
I found this in a website.
Welcome(client, {
privatemsg : "Default message, welcome anyway",
publicmsg : "Default Public Message where you can flag use @MEMBER to mention the newcomer",
publicchannel : ["recepción",]
})

Im using the discord-welcom npm

#

And he publicmsg don't work

stoic pilot
#

How bot Play#4329 ??

earnest phoenix
#

with magic

pallid zinc
#

Do you know how to add a bar with point level

#

In canvas

quartz kindle
#

explain

pallid zinc
#

Can't explain anymore

warm sail
#

you mean like a progress bar?

pallid zinc
#

Yup

#

Tell or prefer a guild

earnest phoenix
#

calculate the percentage of progress then create a bar with the width percentage (which is the percentage of progress) of the max width of the bar

pallid zinc
#

Ok

autumn rain
#

Is someone experienced with patreon?

#

Specifically the webhooks

hushed quarry
#

don't use the webhooks. you won't get them if your web server is offline. use their oauth api (even though it's a pain to implement)

autumn rain
#

How would the oauth api work then, I mean how to check if I got a new patreon?

hushed quarry
#

read their docs. they have plenty of examples on getting it to work

#

including what the api gives as a response

pale marsh
#

I'd recommend finding a library that does the job for you though

hushed quarry
#

just make sure you check declined_since in the response because they'll literally give you declined patrons + active patrons

#

@pale marsh that's no fun

autumn rain
#

it looks like there was a library for java

pale marsh
#

But it's not as time consuming ¯_(ツ)_/¯

autumn rain
#

but then I've found the webhooks and webhooks are usually realtime?

hushed quarry
#

if your web server is offline, you will not get them

autumn rain
#

they resend the request after 1hrs, 3hrs and so on, if the webserver doesnt respond with 200

#

up to 5 tries or sth

hushed quarry
#

if this involves patreon perks for your users, i don't think your users would want to wait an additional hour to get their perks tho

#

but w/e you do you

autumn rain
#

mhm

heady zinc
#

patreon webhooks aren't reliable enough to entirely rely on it

#

they don't always have discord id

pale marsh
#

Weird

hushed quarry
#

oh yeah i forgot about that, that too

heady zinc
#

but adding support for it would still save time for some of your users

pale marsh
#

That's on purpose?

heady zinc
#

it's because not all your patrons have their discord account linked

hushed quarry
#

if your patron doesn't have their discord id linked at the time they subscribe, then yeah it won't show

pale marsh
#

Gotcha

heady zinc
#

so yeah you should mostly use the oauth api, and as justin said check declined_since

#

these fuckers will even give you people who aren't even your patrons but only subscribed to your page angeryroll

hushed quarry
#

i have an explicit check to see how much they donated, it's really annoying

earnest phoenix
#

yeah patreon's api is a dumpster fire

lofty hamlet
#

Hi

#

What is the max time awaiting message in discord ?

pale marsh
#

Wdym?

opaque eagle
#

Awaiting a message isn't a Discord API thing... some libs provide it, but it's just programming logic underneath the syntactic sugar.

earnest phoenix
#
  symbol:   variable BOT
  location: class Main
6 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
1 actionable task: 1 executed
Compilation failed; see the compiler error output for details.
4:18:39 PM: Task execution finished 'Main.main()'.

should i run with?

#

wait i think i fix that ]

#

nvm, fix i have a small issue in the code Handspepe

earnest phoenix
#

how do I check in discord.js, if anyone has a role (with ID)

#

?

#

So that only the role with the ID 475686675898568 the Say command can

amber fractal
#

Master or stable?

#

of d.js

earnest phoenix
#

Discord.js

amber fractal
#

yes ik

#

master or stable

earnest phoenix
#

What

amber fractal
#

Version

#

I'll assume stable

earnest phoenix
#

Node.js Version?

amber fractal
#

no

#

d.js version

pallid zinc
#

I also what to know that

#

And I use stable

amber fractal
#

Then the link I sent

pallid zinc
#

Ok

earnest phoenix
#

Oh, i must look

#

I do not believe in it

amber fractal
#

Their roles are a collection mapped by role id

earnest phoenix
#

Oof

amber fractal
#

A collection extends a map

earnest phoenix
#

No

#

That only the role Developer of the support server of the bot can use the Say command

#

@amber fractal

amber fractal
#

yes

#

so you can check if they have that role

earnest phoenix
#

With ID?

amber fractal
#

Yes

earnest phoenix
#

Ok

amber fractal
#

The collection is mapped by id

earnest phoenix
#

Map.prototype.has(3745646775567)

#

?

#

or Map.prototype.has("3745646775567")?

#

Map.prototype.hasRole("3745646775567") ? @amber fractal

#

So, or?

amber fractal
#

what

earnest phoenix
#

Map.prototype.hasRole("3745646775567")

amber fractal
#

uh

#

no

earnest phoenix
#

Oof

#

._.

amber fractal
#

<GuildMember>.roles.has(id)

earnest phoenix
#

What is guildmember?

amber fractal
#

If you are trying to get roles of someone in a server from a different server you need to fetch the server

earnest phoenix
#

msg.author.roles.has(46555665)?

amber fractal
#

not author

#

member

#

Author is a user object

#

member is a guildmember object

earnest phoenix
#

msg.member.roles.has(3675676678) ?

amber fractal
#

essentially

earnest phoenix
#

Okay

amber fractal
#

but the id is a string

earnest phoenix
#

?

amber fractal
#

an id is a string

#

not an integer

earnest phoenix
#

What?

copper cradle
#

do u even know the basics of JS??

amber fractal
#

3675676678 is an integer "3675676678" is a string

#

and ^^

earnest phoenix
#

OK

copper cradle
#

a string '928' an int 822

earnest phoenix
#

Ok

#

That you mean

copper cradle
#

The ID should be between ""

earnest phoenix
#

Ok

#

msg.member.roles.has("3675676678") ?

copper cradle
#

well yes

#

but

#

a role ID is larger than that, are you sure you got the right one?

earnest phoenix
#

This is no role id

copper cradle
#

oh

earnest phoenix
#

It is a example id

copper cradle
#

ok

earnest phoenix
#

The right id is: 563784176063479809

#

msg.member.roles.has("563784176063479809")

#

?

#

Anyone know how to check if a user has nitro (games)?

#

DiscordJS doesnt support this so

quiet topaz
#

Ask the User

earnest phoenix
#

Finna ask 4000 users brb

shy turret
#

can someone create me an eval command?

#

cuz IDK how to make one

quiet topaz
#

Yes

#

I dm you

slender thistle
#

@earnest phoenix Not possible without violating Discord ToS

#

Spoonfeed is bad

earnest phoenix
#

just found something on djs docs actually

slender thistle
#

Good luck helping people learn getting spoonfed

earnest phoenix
#

also, if it violates tos why would they put it in their docs

shy turret
#

lol

slender thistle
#

To make sure the docs are fully documented

earnest phoenix
#

premium_type? integer the type of Nitro subscription on a user's account identify

slender thistle
#

Also it's probably there since the times when Discord didn't care about selfbots

earnest phoenix
#

eh

earnest phoenix
#

its an oauth property

#

and d.js wraps the entire api regardless

opal gust
#

wasaap cool people

#

The Documentation in discord developer is a bit confusing for me

#

like i'd want to start doing cool stuff but the documentation doesn't explain well how to use a method

graceful granite
hushed quarry
#

set a valid value field

#

yours is undefined

copper cradle
#

^

graceful granite
#

i want the commands to be where the undefined is

#

but cant find out how

copper cradle
#

.addField("Name of the command", "desc")

hushed quarry
#

@opal gust what method

graceful granite
#

im just learning js through a friend and discord.js website

copper cradle
#

if you're using JS ofc

#

yeah

#

use the one I gave you

graceful granite
#

i used that without the first part

opal gust
#

@hushed quarry any method like let's say i want to get the user id

graceful granite
#

i dont want a separate title each time

opal gust
#

it isn't explained how to use it
i had to use other websites to find a way but i want to understand how to use the documentation

copper cradle
#

you only used the first part

earnest phoenix
#

@graceful granite use .setDescription('**Commands**')

graceful granite
#

ok

earnest phoenix
#

field need to have 2 entries

graceful granite
#

but how do i get bot commands then a list of my commands

#

in that darker grey tone

#

@earnest phoenix

hushed quarry
#

if you coded your bot, you should know how to access your commands

graceful granite
#

?

hushed quarry
#

are you using a command framework or did you code it

graceful granite
#

i coded it

hushed quarry
#

how are your commands set up

graceful granite
#

im doing my .help command

#

and i want an embed, which i have

opal gust
#

@hushed quarry don't want to annoying but did you get what i meant?

graceful granite
#

but i would like my field bot commands to have the list of commands under it

hushed quarry
#

@opal gust you need to authenticate with an Authorization header set to your token

#

then do the corresponding method

#

(for bots, prefix the token with "Bot " -- space included)

#

@graceful granite you need to show code for me to understand what you're trying to do

graceful granite
#

found a way i can do it how i like not sure why but i got errors

#

i didnt before i added in a new line at the bottom and errors came up

#

it worked fine untill i added that bottom line, and its not the "" or ''

late hill
#

addField() takes 2-3 args and not 4?

graceful granite
#

hm?

late hill
graceful granite
#

yeah but i added a hyper link surely that doesnt count as an arg

late hill
#

Why wouldn't it

#

lol

#

Just add the link to the field value?

graceful granite
#

how do you do that

#

i could find anything on it online

late hill
#

Instead of putting 2 strings

#

Combine them as 1

#

If you want a newline put \n between them

graceful granite
#

didnt fix my error

late hill
#

Show current code & perhaps show the error 😂

graceful granite
#

@late hill btw sorry im new to js aha

late hill
#

You have another one in the bottom field

graceful granite
#

omg... those bad mistakes

#

i make so many silly mistakes its unreal, thanks aha

late hill
#

You could also send it all in one message

#

I think channel.send("regular message content", embed) works in discord.js

low wasp
#

yes it does

graceful granite
#

oh thx

split lantern
#

@graceful granite You can use \n if you want a newline in the embed field

graceful granite
#

thx x)

warm sail
#

Anybody know a possible reason why my bot isn't getting all presence updates I expect? Or how to troubleshoot such an issue? I'm using JDA and I'm not receiving any presence updates for several users. Setting a logging breakpoint in net.dv8tion.jda.core.handle.PresenceUpdateHandler#handleInternally shows that I do not get all presence updates. What do I do now?

amber fractal
#

Same on d.js

#

You're only getting actual presence updates i.e. changing from online to idle to dnd etc

#

status changes arent going through for some reason

warm sail
#

Is that only since recently?

amber fractal
#

yep

#

worked yesterday

#

idk if discord removed it or if it's just broke rn

warm sail
#

😅 I thought I broke something when my bot was suddenly added to 10 huge guilds.

#

Is there any issue or support ticket etc I can track about this?

amber fractal
#

not that I know of

warm sail
#

A Twitter message or anything else?

amber fractal
#

I tweeted jake mmLol

#

I dont expect a response tho

warm sail
#

I'll tweet @cosmic surgeapp and see what happens... Don't have high hopes though 😦

#

Damn, I pinged a random user with that

#

Oops

#

(sry)

amber fractal
#

Happens

warm sail
#

Opening a support ticket as well

#

Fingers crossed

warm sail
#

I just wrote a small d.js test and it's definitely a Discord issue/change.

frail terrace
earnest phoenix
#

403 error

#

is that a youtube video @frail terrace

frail terrace
#

yes

#

it worked like 10 mins ago

#

i know 403 is forbidden

#

but the vid worked before

earnest phoenix
#

can u like curl the youtube link

#

and see if google thinks that you are a bot or something

frail terrace
#

from my bot?

earnest phoenix
#

from the machine that runs the bot

frail terrace
#

i am on a windows machine

#

one sec

earnest phoenix
#

one guy

#

has the same issue

#

in the official jda server

#
  • lavaplayer server
#

let me send you an invite

frail terrace
#

i got a long-ass thing when curling

earnest phoenix
#

2eGUuA that's the support server

frail terrace
#

how can i tell? looks fine to me

earnest phoenix
#

some people report 403 errors there too

#

yes with a quick read it seems that this happens when you use ytsearch a lot

frail terrace
#

ok so i was

#

damn

#

how can i bypass then

earnest phoenix
#

do you have a dynamic ip

frail terrace
#

no

earnest phoenix
#

look at this, it's the legit way to search for youtube videos

#

you need an api key from google

frail terrace
#

i do have one

#

i think lavalink was blacklisted

earnest phoenix
#

does lavalink use your key

frail terrace
#

no

earnest phoenix
#

or it just scraps youtube

#

that's the issue

#

does your bot play the youtube video if you put the link directly

frail terrace
#

yeah

#

let's try

earnest phoenix
#

that doesn't get you blocked from google

#

you will have to edit it a bit

frail terrace
#

too bad my bot is in c#

earnest phoenix
#

oh i thought it's in java cause you use lavalink

#

one momento

frail terrace
#

which part does the magic

bright meadow
#

the screenshot from the error above is java

frail terrace
#

wait does it just use different keys

#

lavalink is a java application

bright meadow
#

There was a java.lang.something line

frail terrace
#

my bot uses a wrapper to communicate

earnest phoenix
#

yeah lavalink is written in java @bright meadow

bright meadow
#

k

earnest phoenix
#

it's basically a server that processes the songs

#

and upsamples/downsamples

frail terrace
#

mhm

#

my api key wasn't blacklisted

#

it searches fine

earnest phoenix
#

yes but do you use it for lavalink

frail terrace
#

not that key, no

#

i pass the url directly into lavalink

earnest phoenix
#

oh then it isn't an issue with the key

#

i thought lavalink was trying to search the video without the api key

frail terrace
#

nope

earnest phoenix
#

what lavalink version do you use

frail terrace
#

just downloaded the latest

#

oh shit

earnest phoenix
frail terrace
#

a new one was released lemme grab

#

i was on 3.2.0.3

earnest phoenix
#

some ppl suggested to use a dev version of lavalink

#

yeah

#

bingoo

frail terrace
#

and now windows won't move the jar to the correct directory

#

ok now it works! epic.

frozen tiger
#

guys I'm planning to make an online dashboard. My website is currently built in PHP (Laravel) so should I use something like forms to update data ? (don't bother me w/ php pls 🙏)

cursive dagger
#

Forms works, but using client side js to send is prob better bq no reload so it's faster

fiery stream
#
  async function createCanvas() {
    const image = await fsn.readFile("https://cdn.glitch.com/b2838ab8-1d50-4644-b583-c093a6be8b39%2Fimageedit_1_9745658379.jpeg?v=1549225671662");
 
    return new Canvas(300, 400)
      .addImage(image, 0, 0, 300, 400)
      .setColor("#FFAE23")
      .setTextFont("28px Impact")
      .setTextAlign("center")
      .addText("kitten!", 150, 370)
      .toBufferAsync();
  }
};``` how do i make bot send the canvas
split lantern
#

upload the image

#

check the docs for Discord.Attachment

unique nimbus
#

@fiery stream save it and attach it