#development

1 messages ยท Page 368 of 1

thorny hinge
#

Same

low rivet
#

weren't u the guy that copied python from a yt video and then moved to js becuase I told you to understand the code GWjustinEyesReverse

thorny hinge
#

This is what happens when you try to run before you can crawl

#

๐Ÿ‘€

low rivet
topaz fjord
#
try {
    var [song] =  resolveTracks(url || searchString);
  } catch (error) {
    try {
      const presongs = await resolveTracks(`ytsearch:${searchString}`);
      const songs = presongs.slice(0, 10)
      if (!songs) return message.channel.send('๐Ÿ†˜ I could not obtain any search results for your query.');
      let index = 0;
message.channel.send(`__**Song selection:**__
    
${songs.map(song => `**${++index} -** ${song.info.title} [${moment.duration((song.info.length/1000) - 1, 'seconds').format('h:mm:ss')}]`).join('\n')}
    
Please provide a value to select one of the search results ranging from 1-10.`);     
    
        try {
        var response = await message.channel.awaitMessages(message2 => message2.content > 0 && message2.content < 11, {
            max: 1,
            time: 30000,
            errors: ['time']
          });
        } catch (err) {
          console.error(err);
          return message.channel.send('No or invalid value entered, cancelling video selection.');
        }
          const videoIndex = parseInt(response.first().content);
          const [song] = songs[videoIndex - 1];
          
      } catch (err) {
        console.error(err);
      } 
  }
  await handleVideo(song, false)
#

why tf is this broken

#

when it gets to songs[videoIndex - 1]

#

it says undefined is not a function, but when i console.log songs[videoIndex - 1] i get a result

thorny hinge
#

I'm in the process of switching databases

#

Using sqlite rn

#

Which db should I switch to and is there an easy way to transfer the sqlite stuff to it?

topaz fjord
#

idk

thorny hinge
#

Im thinking maybe rethonk

#

But is it easy to switch from sqlite to rethonk? ๐Ÿ‘€

topaz fjord
#

search up online switchers :/

thorny hinge
topaz fjord
#

any idea for mine...

#

its being very wierd

uncut slate
#

@topaz fjord doesn't resolve tracks return a promise

topaz fjord
#

no it returns an array

#

its a function that i made to search for tracks

uncut slate
#

then why are you awaiting it in one spot and not in the other

abstract mango
#

what are the default avatar urls again?

umbral pelican
umbral eagle
#

henlo

earnest phoenix
#

Hello, could someone tell me how to have playing do !help

#

and where to put it

pale light
#

lib?

earnest phoenix
#

like that

trim plinth
#

what language and what library

earnest phoenix
#

js and discord.js

trim plinth
#

mkk

shy rose
trim plinth
#

wait

#

try using setActivity

earnest phoenix
#

okay

#

where do I put it and how do I write the string of code, I cant find any documentaion online

#

@trim plinth

shy rose
#

client.setPresense("Hello") thats my taking from the docs

trim plinth
#

please do not ping me randomly

earnest phoenix
#

ok

shy rose
earnest phoenix
#

ok

topaz fjord
#

o shit it works

shy rose
#

um?

next hamlet
#

how do you get bot token using eval

shy rose
#

depends on the lib

topaz fjord
#

eval <client>.token for d.js

shy rose
#

and is youve defined the token as a var or an accesable way

next hamlet
#

idk man

#

this person tole me to test its eval...

legit telling me to find issues

elder rapids
#

First problem is the library allowing you to fetch the token from itself

#

imo all libraries should be like Discord.Net where you provide the token and it will never give anything to you where you can get the token

#

It stores it privately with no API interface

next hamlet
#

wait what do you put for <client>

topaz fjord
#

what ever you defined your client as

next hamlet
#

๐Ÿค”

#

tl;dr what can i do with an open eval

elder rapids
#

A lot

#

Especially if it's not sandboxed

shy rose
#

;-;

elder rapids
#

In hind-sight. Don't open eval commands at all

shy rose
#

is it node?

#

process.exit() is great

elder rapids
#

It's a terrible idea and it allows anyone to execute scripts on your server on the bots behalf in a sense

shy rose
#

fs and wipe dir if you wanna do dmg

next hamlet
#

process is not defined

shy rose
#

so maybe not node

#

what lang is it in?

next hamlet
#

take a look

elder rapids
#

oh....

#

It uses an external service to run js

#

or any eval stuff

#

No use trying to get anything from it

next hamlet
#

wellrip

drifting frost
#

Hey, using discord.js and err is always null. I'm not sure if what i'm doing is wrong, or its just broken..

require(./commands/${command}.js, (err) => {
if(err){
console.log(err);
return;
}
});

low rivet
#

@south finch What's the problem with a google command?

frigid juniper
#

How to enable Rich Embed to a bot ?

low rivet
#

lib

frigid juniper
#

?

heady zinc
#

google commands without safe search can return NSFW content

low rivet
#

what's ur lib @frigid juniper

heady zinc
#

out of a NSFW channel, it is against Discord's TOS

frigid juniper
#

Ah python

low rivet
#

@heady zinc oh okay GWproximThumbsUp

#

@frigid juniper which library

#

not language

frigid juniper
low rivet
#

no..

frigid juniper
#

Really ?

low rivet
#

there's disco

frigid juniper
#

Sorry so

low rivet
#

rewrite or async

frigid juniper
#

Async

low rivet
#

wait

#

did u try reading the docs

frigid juniper
#

yep

#

But maybe not enough

low rivet
#

i think so GWcfcThonk

frigid juniper
low rivet
#

or have u looked at source code GWblobbEyes

frigid juniper
low rivet
#

that's called rich presence

#

and bots can't have it GWblobbFrown

frigid juniper
#

Ah thats why I dont understand where is this

rich kiln
#

@drifting frost nah its not broke.., the code is wrong

frigid juniper
#

oh rip ๐Ÿ˜ญ

drifting frost
#

oof whats wrong?

frigid juniper
#

@low rivet thanks anyways, have a nice day ๐Ÿ˜

heady zinc
#

require has a callback ? o?

rich kiln
#

you cant use a callback on require

drifting frost
#

okay, any suggestions on what i can do instead?

rich kiln
#

you can do that

heady zinc
#

what do you want to do tho

low rivet
#

read docs GWcfcThonk

drifting frost
#

oof

heady zinc
#

if your aim is just to catch errors that could happen with your require

#

well only way i know is a good old try catch

rich kiln
#

you can use if too

drifting frost
#

thank you! I don't really know javascript but having healp around the corner is super cool!

jagged birch
#

I get this error randomly, dunno whats causing it..


    at VoiceChannel.get joinable [as joinable] (/app/node_modules/discord.js/src/structures/VoiceChannel.js:64:47)

    at Promise (/app/node_modules/discord.js/src/client/voice/ClientVoiceManager.js:46:19)

    at Promise (<anonymous>)

    at ClientVoiceManager.joinChannel (/app/node_modules/discord.js/src/client/voice/ClientVoiceManager.js:45:12)

    at VoiceChannel.join (/app/node_modules/discord.js/src/structures/VoiceChannel.js:120:30)

    at Client.client.on (/app/app.js:442:15)

    at emitOne (events.js:115:13)

    at Client.emit (events.js:210:7)

    at MessageCreateHandler.handle (/app/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)

    at WebSocketPacketManager.handle (/app/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)```
the line it is talking about is `voice.join()`. I think this error could be the reason my bot joins the VC without playing anything then leaves right away. Any ideas what I should replace `voice.join()` with? oh btw voice = `var voice = message.member.voiceChannel;`
alpine plover
#

"has" of null, what.

#

Is there a 'has" anywhere?

#

That error seems like a mess.

#

just looks like you're missing / misusing something.

uncut slate
#

yeah you need to show the source code

alpine plover
#

^ basically.

#

I can't tell what the issue is from that one line and a redirecting error, lol.

jagged birch
#
    if (message.content === (prefix + ' reee')) {
        if(message.member == null) {
  return;
}
            var voice = message.member.voiceChannel;
      // Only try to join the sender's voice channel if they are in one themselves
      if (voice) {
        voice.join()
          .then(connection => {
            const dispatcherone = connection.playFile('./sound/reee.mp3');
            dispatcherone.on('end', () => {
                voice.leave()
              });
          })
          .catch(console.log);
      } else {
        message.reply('REEEee y0u n33d t0 b3 1n a v0ice ch4nnel f1rst!1!!11 :alien:');
      }
    }```
#

is the full code

alpine plover
#

one hell of a reply.

austere meadow
#

https://please.zbot.me/RG1vU77a.png
line 64 of VoiceChannel is basically checking permissions for the client user to see if it can connect to the voice channel
'has' of null is basically saying permissionsFor(this.client.user) is null

#

why its null

#

im not sure

jagged birch
#

yea

alpine plover
#

does the bot have speak perms.

jagged birch
#

it does on all my servers

#

but i've got the bot on over 1k servers so

uncut slate
#

@austere meadow it will be null where the member object for that guild isn't cached (e.g. guild is noted as LARGE), the solution would be to fetch it

#

issue on d.js end tho, I think

austere meadow
#

yeah thought so

uncut slate
#

@restive silo comment? ^

restive silo
#

oh what

austere meadow
#

permissionsFor(this.client.user) is null when trying to join a voice channel basically

uncut slate
#

it could be

austere meadow
#

yeah it has never happened for me

#

so thats a bit weird

uncut slate
#

I had some issues with permissionsFor returning null before, it was the member obj not being cached ๐Ÿคท

restive silo
#

o

#

yea

#

wait

#

i know that bug

#

yea since some time there is a bug that sometimes your own member object is not cached for some reasons, this sometimes still appears for some reason

#

that would explain why it crash while testing .joinable

#

because d.js checks your own permissions on that member

uncut slate
#

A temporary fix would be to force cache the client user member object, I suppose

#

is it even possible to populate guild member cache manually?

restive silo
#

yea normally that shouldn't happen ofc, your own member object should always be cached

#

i think you can just run guild.fetchMember(client.user)

#

and then it should be cached

steel shoal
#

Hello

#

Who can help me code a seach command (discord.js)

heady zinc
#

What kind of lib doesn't cache the client

jagged birch
#

Righto, thanks for the help guys. Iโ€™ll give it a shot later.

mystic stone
#

It's just a basic bot with tired commands

uncut slate
#

well

#

no shit ๐Ÿค”

mystic stone
#

Yeah but why is it there

radiant basin
#

I thought it's an other bot.

uncut slate
#

it's a meme

#

you would notice by the code ๐Ÿค”

potent lily
#

thats the best bot i ever seen

mystic stone
#

Yeah but it has the same name as @Luca and a fitting description.

supple vessel
#

Maybe

earnest phoenix
#

With API

supple vessel
topaz fjord
#

@earnest phoenix u can't get it back to N/A after you post

#

Or do you want to post your server count?

thorny hinge
topaz fjord
#

What do you want to do post or what

supple vessel
topaz fjord
thorny hinge
#

Try looking for more

topaz fjord
#

Do u even get an error

potent lily
#

btw you need 100 servers to be able to apply a certification

topaz fjord
#

@earnest phoenix ^^^^^^^^

unique star
#

thats not true

#

lol

#

i applied with one of my bots at ~40

#

and got in

earnest phoenix
#

OwO. . .

scenic crest
#

@unique star it's changed iirc

unique star
#

o

#

when did it change Thonk

#

nvm they even added it

earnest phoenix
#

Is this the best place to request some help?

topaz fjord
#

With what

earnest phoenix
#

I added all of the libs in the classpath.

potent lily
#

was just for prevent you to do a depresion zoomeyes

#

thats why you just said

#

yes

#

do my name is in green ?

#

don't have any bot for the moment here

#

thats the DBL api

steel shoal
#

eyy

potent lily
#

wich one you tried ?

#

oh i see

#

there is some Missing line

#

dont forget @client.event ( or bot.event deppending what you choose )

#

@earnest phoenix before all async def on_ ect

#

if you have all ready an on_ready you have an exemple

#

try this i'm not not sure at 100% is that

low rivet
quasi sandal
#

I'm sending the followin json data to the website but the shard count doesn't seem to update (the server count DOES update)

{
    "server_count": 2570,
    "shards": [ 2570, 3 ]
}```
bitter sundial
#

that's an incorrect format

#

Use

{
    "server_count": 2570,
    "shard_count": 3
}

instead

wispy pulsar
#

its quite long

south finch
#

can u code block it

wispy pulsar
#

what

#

idk how

#

kinda new to discord

south finch
#

tbh do u know what hastebin is?

wispy pulsar
#

no

south finch
#

ok well its like a site u can post long docs on and get a link instead of like posting how u did

wispy pulsar
#

ok

south finch
#

try that

topaz fjord
#

Go to hastebin.com paste all your code there then click the save button

south finch
#

^

#

ty

wispy pulsar
#

ok

south finch
#

for once ur helpful zoomeyes

topaz fjord
#

Then give us the link

wispy pulsar
#

doing that now

topaz fjord
#

@south finch :(

south finch
#

im kidding pls :[

#

o boi btw, my bot now has an 8ball command

wispy pulsar
south finch
#

movin up in the world

wispy pulsar
#

that?

topaz fjord
#

Yes

south finch
#

what tutorial are you following?

wispy pulsar
#

that one

topaz fjord
#

Any what's your problem

south finch
#

did u do this?

wispy pulsar
#

yes

south finch
#

mm

#

@topaz fjord his bot won't "work" per say. Like he goes to run it and it won't start.

wispy pulsar
#

when i did the dependencies thing it gives me this

south finch
#

its put the packages in, so thats no issue

#

are you running the cmd prompt from inside the folder you put your files in?

wispy pulsar
#

no

trim plinth
south finch
#

there's your issue

wispy pulsar
#

but im putting the directory in so that it takes it from there

umbral pelican
trim plinth
#

hold shift while right clicking in your bots folder then click Open command window here, there you can run your bot from the folder

south finch
#

^

#

also io is kind of dead;; if u want a better tutorial to follow you can follow a diff one

#

like this one: https://anidiotsguide_old.gitbooks.io/discord-js-bot-guide/content/

wispy pulsar
#

k

low rivet
#

and use discord and know discord well before making bots

wispy pulsar
#

i read the tutorial you sent me @south finch and its a little cofusing

#

confusing*

south finch
#

you read through that whole thing pretty fast.

trim plinth
wispy pulsar
#

yea

#

i can speed read

south finch
#

just reading it isn't going to help you.

umbral pelican
wispy pulsar
#

im good at it

south finch
#

you gotta take the time to look at each thing.

#

We don't recommend it for nothing.

umbral pelican
#

you're not gonna get anywhere if you don't put any effort in drakeLUL

south finch
#

^^

trim plinth
#

@wispy pulsar give it another read and look carefully at it, it isn't a race

deep parrot
#

@wispy pulsar read this https://anidiotsguide_old.gitbooks.io/discord-js-bot-guide/content/getting-started/your-basic-bot.html

south finch
#

i already sent him to that

deep parrot
#

oow you did

#

welp

south finch
#

also bots aren't something u can just whip up out of nowhere. It takes time and patience to learn how to code one etc.

deep parrot
#

^^

topaz fjord
#

Speed reading Thonk

wispy pulsar
#

i had to move classes

topaz fjord
#

?

south finch
#

then wait till you have time to do stuff instead of rushing yourself?

split ermine
#

Is it frowned on to use discord bot maker on steam? ๐Ÿค”

quiet bobcat
#

Yes

split ermine
quiet bobcat
#

๐Ÿ‘€

#

You don't really code anything

split ermine
#

But sites made with WordPress, xenforo, mybb, drupal, etc. Aren't frowned upon. And rpg maker games can still be good so why not bots? bloblul

trim plinth
#

disgustang

split ermine
#

drops mic

quiet bobcat
#

Because coding bots are pretty easy

#

And games aren't as easy

trim plinth
#

coding bots aren't that easy actually

split ermine
#

^

glossy sand
#

it's frowned upon because DBM doesn't offer much in the way of customization

trim plinth
#

^

glossy sand
#

all the bots it produces are essentially the same

quiet bobcat
#

Yeah basically

glossy sand
#

and it's not frowned upon for... any of those other reasons

split ermine
#

That's understandable

glossy sand
#

you're free to use it if you like

split ermine
#

I just don't know how to code ๐Ÿ˜‚

quiet bobcat
#

You can always learn

inner jewel
#

fyi submitting the example bot is not allowed here

trim plinth
#

You can't add as much custom features as making bots from scratch if you use DBM

split ermine
#

I get maybe 3 hours of free time a day ๐Ÿ˜ง so Idek if I'll have time to learn

trim plinth
#

3 hours is more than enough to learn some coding everyday

quiet bobcat
#

Yeah

split ermine
trim plinth
split ermine
#

Any good websites to learn

trim plinth
#

its free

#

^^^

split ermine
#

1 step ahead of me lol

#

What language do you need for bots?

deep parrot
#

just one

south finch
#

you could honestly set 30mins to an hour everyday aside or every other day or something like that to learn

split ermine
#

What language though? I take it this site has lots of options, php, css html, java, etc. But what specifically for discord bots?

wispy pulsar
#

do you think i have a higher chance to succeed if I use python

trim plinth
#

not really

inner jewel
quiet bobcat
#

java, python, js, ect

inner jewel
#

there are channels for most libraries there

#

find one you like

#

and learn the language

split ermine
#

Ayeee thanks

quiet bobcat
#

Almost every app language has a discord lib

inner jewel
#

JS and python are considered easy

quiet bobcat
#

Or most of them

trim plinth
#

is there discord.html

inner jewel
#

but you might find other langs easier

trim plinth
split ermine
#

I'll probably do js

trim plinth
#

mk

split ermine
#

That'll help in other things too I'm pretty sure

inner jewel
#

lua is also easy

trim plinth
#

I do not like LUA >:(

inner jewel
#

also besides syntax and some basic stdlib

#

node is different from what you'll have for website js

quiet bobcat
#

Yeah

inner jewel
#

websites have way less stuff and access to the machine

split ermine
#

So it's harder to make a bot than a website?

quiet bobcat
#

Not really

inner jewel
#

depends

trim plinth
#

depends

#

.o.

inner jewel
#

for me making a bot is way easier

#

because i suck at webdev

quiet bobcat
#

same

split ermine
#

I own like 20 websites atm ๐Ÿ˜…

inner jewel
#

my websites are basically apis and a page with bot stats

trim plinth
#

@split ermine h a v e y o u c o d e d a s i n g l e o n e mmLol

split ermine
#

N.o.p.e.

trim plinth
#

mk

glossy sand
split ermine
#

I've edited the coding on them

#

But I have no idea how to code anything from scratch

glossy sand
#

please head to #general if you're not contributing to the topic here

topaz fjord
#

@inner jewel teach me java

inner jewel
#

me
teach

topaz fjord
#

Yes

#

U

prime geyser
#

Heya

#

How are you ?

south finch
worn ridge
#

Does anyone knows how to restrict Google Forms to logged-in users

#

?

next hamlet
#

if you send a nw server amount is it instant?

#

I sent is but its still returning N/A

next bluff
#

In my experience server count requests seem pretty instant

next hamlet
#

then i fuked up my code

#

shit

elder rapids
#

rip u

earnest phoenix
#

Hello

elder rapids
#

Did the request even return correctly lol

earnest phoenix
#

I need JavaScript dev

potent lily
#

Why ?

#

Send you're question ๐Ÿ˜ƒ

#

There is a lot of JS people here ^^^

heady zinc
#

the server should return some 400 if you fucked up

#

should actually never tried

trim plinth
#

@earnest phoenix mmwaht do ya need

earnest phoenix
#

how do you make a bot that announces the release of a video of a specific ytb

trim plinth
#

I cannot answer that

heady zinc
#

ooooooooooooof

#

that was very fast

earnest phoenix
#

@heady zinc oh bae

potent lily
#

"bae" ? xD

trim plinth
elder rapids
#

webhooks

earnest phoenix
#

@potent lily xD il parle fr lui aussi

#

@elder rapids Ok

potent lily
#

Si tu veux je peux te traduire tes phrase hein xD
If you want i can translate yourrre shit

earnest phoenix
#

Euh

#

My shit? Tu es sur? XD

heady zinc
#

oh yeah he is

#

webhooks tm

digital fractal
#

Why is ```java
System.out.println(new DiscordBotsAPI(TOKEN.DBL).getUpvoterIds());

`null` ?
restive silo
#

shrug ask whoever wrote that wrapper thingy

heady zinc
#

you really don't need a wrapper for dbl's api

#

also its probably because it doesn't know the bot to get the upvotes from

cerulean zinc
earnest phoenix
#

Can anyone help me with a website API / a forum for a mc server It's not for my bot it's for an other bot (private)
But I still can't seams to be able to fix the issue so I keep deleting & creating code.

If you do know please contact me (language: discird.js 11.3.0)

#

It's ain't easy to say that but I failed more then a week or so

#

And they wants it if they created a thread in announcements it sends in the forums channel

inner jewel
#

@digital fractal you need to give getUpvoterIds() the bot user id

next hamlet
#
    async def doPayload(self):
        dbl_token = "<token_hidden>"
        dbl_url = "https://discordbots.org/api/bots/" + bot.user.id + "/stats"
        dbl_headers = {"Authorization" : dbl_token}
        dbl_payload = {"server_count"  : len(bot.servers)}
        async with aiohttp.ClientSession() as aioclient:
            await aioclient.post(dbl_url, data=dbl_payload, headers=dbl_headers)

is this right?
YES, doPayload IS BEING RUN
that is confirmed

inner jewel
#

or in the constructor

#

also you're using an outdated version

digital fractal
#

@inner jewel ๐Ÿ†—

next hamlet
#

i dont think i did the api right

elder rapids
#

Did you even output the response?

#

I can see two problems if anything

next hamlet
#

continue

elder rapids
#

Response == bad (read to know why). Is content type set to application/json properly

#

But that shouldn't matter for content type

#

(maybe)

#

Honestly read the response if you get one

#

If you don't then ๐Ÿ‘€

next hamlet
elder rapids
#

Well I'd check response of server if anything

next hamlet
#

tbh idk how to do it xd

elder rapids
#

Look it up

next hamlet
#

wait i have an idea

#

nvm

#
async with aiohttp.ClientSession() as aioclient:
            async with aioclient.post(dbl_url, data=dbl_payload, headers=dbl_headers) as resp:
                print(await resp.text())
#

is this right?

#

(ignore spacing)

#

i dont thing print ever got ran

restive silo
#

you cant ignore spacing in python or? Thonk

next hamlet
#

i meant me copy pasting code from he file it broke it

restive silo
#

o

next hamlet
#

but yeah, print didnt get ran

#

(omg grammar)

#

WAIT IM STUPID

#

OMG YASS IT WORKED

unborn oracle
#

All right developers, i have a question. Do you think it would be a bad practice to automatically DM a sever owner after they kick my bot and ask for feedback?

quiet bobcat
#

Yeah, I think it would be kind of bad

#

Because what if they didn't remove it

unborn oracle
#

DM whoever kicked it then

#

If that's possible

quiet bobcat
#

Don't think that's possible though

thorny hinge
#

If they kick it, they probably don't want anything to do with it kek

quiet bobcat
#

^

unborn oracle
#

Noted, thanks :P

scenic crest
#

@inner jewel hows ur nightcore thing going

inner jewel
#

gave up

trim plinth
#

ยฐโ–กยฐ

#

Any good weather npm packages? (I'm using weather-js but I want a better one if there is better)

fleet epoch
#

how do i ping a role
discord.js

inner jewel
#

<@&id>

fleet epoch
#

how can i find the role id

#

thats the problem

topaz fjord
#

@trim plinth use an api

trim plinth
#

mk

topaz fjord
#

Use Google's geocode and darksky weather

next hamlet
#

wtf

#

mainly the last one

thorny hinge
#

How can I remove every single duplicate in a sqlite db?

next hamlet
#

sudo rm -rf /

inner jewel
#

doesn't work

#

:^)

mortal ore
#

XD

#

sudo help

#

:)

frail terrace
willow flint
elder rapids
#

yes

old glade
#

heyo

#

anyone used to dev in python ?

analog thicket
#

I use python for my bot

low rivet
#

i don't used to

junior lily
#

Did they do something to the api?

#

My console has been spammed with some 429 error ๐Ÿค”

gleaming summit
#

๐Ÿค”

low rivet
#

ratelimits are a thing @junior lily

cosmic plover
junior lily
#

oh shit didnt see dat

fleet mason
#

  let messagecount = parseInt(args[1]) || 1;

  var deletedMessages = -1;

  message.channel.fetchMessages({limit: Math.min(messagecount + 1, 100)}).then(messages => {
      messages.forEach(m => {
          if (m.author.id == bot.user.id) {
              m.delete().catch(console.error);
              deletedMessages++;
          }
      });
  }).then(() => {
          if (deletedMessages === -1) deletedMessages = 0;
          message.channel.send(`:white_check_mark: Purged \`${deletedMessages}\` messages.`)
              .then(m => m.delete(2000));
  }).catch(console.error);
}
``` whats wrong
#

error code ```ReferenceError: bot is not defined
at messages.forEach.m (C:\Users\sande\Desktop\mybot\commands\delete.js:9:30)
at Map.forEach (<anonymous>)
at message.channel.fetchMessages.then.messages (C:\Users\sande\Desktop\mybot\commands\delete.js:8:16)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)

quiet bobcat
#

In exports.run you have client and you don't have bot

#

replace bot with client

#

@fleet mason

#

Should fix it

fleet mason
#

ok when i run the command now it works, but it creates the message and then it deletes the message but none of my messages.

quiet bobcat
#

Are you trying to purge a specific users messages?

fleet mason
#

yea i want 2 purge commands. one that deletes a user messages and one who just deletes the last. but it dosent work atm

tender jetty
#

what

quiet bobcat
#

I can't help you with user purge, but I can help you with the other one

fleet mason
#

ok

#

thats fine i just want to learn

quiet bobcat
#
exports.run = (client, async, message, args) => {
async function purge() {

            message.delete();


            
            const fetched = await message.channel.messages.fetch({limit: args[0]});

            message.channel.bulkDelete(fetched)
                .catch(error => {
                    return message.channel.send(/*If there's an error it will post through this message.*/ `Error: ${error}`); 
                });
            let m = await message.channel.send({embed: {
            description: /*Deleted message here, eg:*/`Deleted ${args[0]} messages.`,
            color: 0x82eefd
            }})
            setTimeout(function () {
            m.delete()
            }, 7500)
        }
        purge();
}```
#

That should work

fleet mason
#

(node:8708) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: message.delete is not a function

quiet bobcat
#

hm

#

but it is

fleet mason
#

yea

quiet bobcat
#

You're using d.js right?

fleet mason
#

yep

quiet bobcat
#

What version?

fleet mason
#

where do i check that?

quiet bobcat
#

Do this: npm list --depth=0

#

you should see discord.js somewhere

#

Forgot how to do it for a specific module

fleet mason
#

+-- discord.js@11.3.0

quiet bobcat
#

hm

#

It should work

fleet mason
#

XD

heady zinc
#

Npm list module_name iirc

jaunty zenith
#

Hey I need some help.

#

How do I add bots?

quiet bobcat
#

To the website or to your server?

jaunty zenith
#

I need to add a bot called dyno I think.

#

Server.

quiet bobcat
#

Go to https://discordbots.org/bot/155149108183695360 and click invite, then select the server you want it to be in (you might need to log in to discord). Then click Authorize and complete the capatcha

#

And it should be in your server

jaunty zenith
#

If it doesnโ€™t work can I invite one of you to help me out?

quiet bobcat
#

Try it first

tame rivet
#

does anyone here know how to use sphinx? (pm me please)

jaunty zenith
#

How do I like.

quiet bobcat
#

?

jaunty zenith
#

Logout of an old account.

#

Itโ€™s annoying and I left that account a while ago.

quiet bobcat
#

then click on the cog wheel next to deafen

#

and click log out

jaunty zenith
#

Thanks so much

quiet bobcat
#

np

earnest phoenix
#

@earnest phoenix

fleet mason
#

@heady zinc when i run the command i got this C:\Users\sande\Desktop\mybot
`-- (empty)

fleet mason
#

whats wrong with this code: ``` exports.run = (client, async, message, args) => {
async function purge() {

          message.delete();



          const fetched = await message.channel.messages.fetch({limit: args[0]});

          message.channel.bulkDelete(fetched)
              .catch(error => {
                  return message.channel.send(`/*If there's an error it will post through this message.*/ Error: ${error}`);
              });
          let m = await message.channel.send({embed: {
          description: `/*Deleted message here, eg:*/ Deleted ${args[0]} messages.`,
          color: 0x82eefd
          }})
          setTimeout(function () {
          m.delete()
          }, 7500)
      }
      purge();

}

heady zinc
#

Why the hell is there "async" as an argument

#

I believe that is your problem

#

Am on phone so can't help much but im pretty sure "async" at "exports.run = (client, async..." Has nothing to do here

leaden bane
#

When async becomes an argument... :))))

fleet mason
#

Ready to server in 20 channels on 1 servers, for a total of 15 users.
(node:14020) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: message.channel.messages.fetch is not a function
(node:14020) [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.
(node:14020) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: message.channel.messages.fetch is not a function

#

it dosent work

#

i removed a sync and it dosent work

#

async*

uncut slate
#

that's a v12 thing

restive silo
#

^

#

only master has <TextChannel>.messages.fetch()

fleet mason
#

ok how do i fix it?

quiet bobcat
junior lily
#

Shit seems like i ratelimited

#

when the hell will it be gone

bitter sundial
#

1 hour

uncut slate
#

@fleet mason don't copy and paste code, that's how you fix it :b

austere meadow
#

hey, im getting a bit of a weird issue with lavalink.js
what im trying to accomplish is an automatic-ender of sorts, where if the voice channel is left without any users in it for a certain period of time, it will disconnect from that guild
everything is basically working, but one major issue is that on client.player.leave(guild.id), music also stops transmitting in all other guilds, it doesn't disconnect or delete the player in other guilds, it just stops transmitting audio, lavalink still thinks its playing on the other guilds
i know this may not make sense but if anyone here has any idea what might be going on i'd appreciate any help blobthumbsup

restive silo
#

wait that sounds like the discord bots voice bug

inner jewel
#

@austere meadow leave and rejoin voice channel

#

(you,not the bot)

austere meadow
#

oh so is it just a bug on discords end or something

inner jewel
#

client bug

austere meadow
#

ah okay

restive silo
#

this bug is around since a long time now and still not fixed

#

also its only if on a shared server the bot leaves VC

#

means if you only share 1 server this bug cant happen

heady zinc
#

^

#

this bug is old af

#

probably here since discord birth

austere meadow
#

ah okay

#

thanks guys blobheart

frail kestrel
#

@fleet mason, .fetchMessages()

fleet mason
#

@frail kestrel where do i put that+

#

?

#

it didnt work

frail kestrel
#

where did you put it

#

show code

#

@fleet mason

fleet mason
#

i tried something else and now i get this error (node:12628) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: message.delete is not a function

#

how isent message.delete a function

echo shadow
#

is message null?

fleet mason
#

the message is just a normal command. i have it working in my other commands

echo shadow
#

pastebin?

fleet mason
#

async function purge() {
    message.delete(); 

  if(message.author.id !== config.ownerID)
    {
        message.channel.send('You need the \`bot-commander\` role to use this command.');
        return;
    }


    if (isNaN(args[0])) {
        // Sends a message to the channel.
        message.channel.send('Please use a number as your arguments. \n Usage: ' + prefix + 'purge <amount>'); 
  
        return;
    }

    const fetched = await message.channel.fetchMessages({limit: args[0]});
    console.log(fetched.size + ' messages found, deleting...'); 

    // Deleting the messages
    message.channel.bulkDelete(fetched)
        .catch(error => message.channel.send(`Error: ${error}`));
}

purge();
}
echo shadow
#

yeah, that's because message doesn't exist inside of purge()

#

no

#

pass message into purge() as an argument

fleet mason
#

purge(message)

echo shadow
#

yes

#

and update purge()' declaration to take an argument

wooden shoal
#

Its all in the exports.run scope, so message should already be defined

echo shadow
#

oh, hrm

fleet mason
#

it didnt work...

wooden shoal
#

But try passinh it as an argument and see what happens

#

Ok so some tests

#

In the purge function, just add a line to log message

#

See if it is logged

#

Then you know message is defined and something else is broken

fleet mason
#

ok so i put a console log before message.delete()

wooden shoal
#

Oh

#

Hm

#

Yeah idk there..

fleet mason
#

ok so now i did it and the same error

wooden shoal
#

Ok..

#

So message is not defined...

#

Hm..

fleet mason
#

its something with message.delete();

wooden shoal
#

What event is this running on?

#

Oh wait i know

#

Remove the purge function all together

#

Only have the contents

#

And have async before exports.run

#

That should work

#

In my brain..

fleet mason
#

XD

trim plinth
#

\ . > . /

fleet mason
#

ok so i remove the purge() and then add a asic on the start and then remove async function purge()

wooden shoal
#

K

#

Show me the code now

fleet mason
#

  exports.run = (client, message, args) => {

  console.log('it works.');
    message.delete(); 


  if(message.author.id !== config.ownerID)
    {
        message.channel.send('You need the \`bot-commander\` role to use this command.'); 
        return; 
    }

  
    if (isNaN(args[0])) {
      
        message.channel.send('Please use a number as your arguments. \n Usage: ' + prefix + 'purge <amount>'); 
      
        return;
    }

    const fetched = await message.channel.fetchMessages({limit: args[0]}); 
    console.log(fetched.size + ' messages found, deleting...'); 

  
    message.channel.bulkDelete(fetched)
        .catch(error => message.channel.send(`Error: ${error}`));


}

wooden shoal
#

K.. Does it work?

fleet mason
#

nop

#

const fetched = await message.channel.fetchMessages({limit: args[0]});
^^^^^^^

SyntaxError: Unexpected identifier
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:607:28)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Client.client.on.message (C:\Users\sande\Desktop\mybot\mybot.js:27:23)

heady zinc
#

You can't use await out of an async function

potent lily
#

hum ?

leaden bane
#

Yup.

potent lily
#

Never noticed x)

wooden shoal
#

It has to be async exports.run

leaden bane
#

Anyone please tell me how to use the Discord Bot List API please? I'm using Python...

austere meadow
#

there's plenty of python examples in there

potent lily
#

async def on_server_join(server):

We need the @client.event before no ?

leaden bane
#

Yup

potent lily
#

There is none on the exemple

#

That's why lot of people don't do it correctly and come here to ask some help ^^

#

@austere meadow ๐Ÿ˜›

austere meadow
#

what

#

no python examples in there?

potent lily
#

Yes but is not correct

#

There is some line missing

austere meadow
#

oh

#

huh interesting

#

sorry i didn't know

potent lily
#

That's okay that's make a while and usually people who know what they are doing correct himself the little error ^^

leaden bane
#

That was funny haha...

potent lily
#

Hum ?

leaden bane
#

Nothing...

potent lily
#

๐Ÿ‘€

earnest phoenix
#

why is ytdl messed up?

restive silo
#

ytdl works fine

earnest phoenix
#

info.title doesnt wanna work for me

#
                        ^

TypeError: Cannot read property 'title' of undefined```
potent lily
#

So ?

#

title doesn't exist

#

or is not readable

#

๐Ÿคท

earnest phoenix
#

this is js :/

#

and ytdl-core should read it

tawny lava
#

info is undefined

languid dragon
#

well u cant blame ytdl-core for that

earnest phoenix
#
      const title = info.title;
      message.channel.sendMessage(`Now playing \`${title}\``)
      })```
languid dragon
#

ur probably doing something wrong lmao

earnest phoenix
#

wat is wrong with da code?

#

it worked like an hour ago

#

now it doesnt

potent lily
#

Code don't stop working for nothing

#

There is always something who cause it to

earnest phoenix
#

i didnt touch the code for over a week

tawny lava
#

just checked, getInfo takes the ID of the video I believe

#

not the name

earnest phoenix
#

it does take the name

potent lily
#

Or do some debug ๐Ÿคท

#

look what is inside info

#

whit a debugger ๐Ÿคท

earnest phoenix
#
Use this if you only want to get metainfo from a video. If callback isn't given, returns a promise.```
languid dragon
#

are u using a youtube link

#

a full link?

earnest phoenix
#

yes

#

without the <>

#
      ^

Error: Could not extract signature deciphering actions```
tawny lava
#

o nvm it's an open issue on github

earnest phoenix
#

:/

#

welp rip my music code

#

youtube-search seems to work still thou :/

#

so we wont be able to use ytdl-core for a while

wooden shoal
#

Does anybody know if you can have an output of over 1 when using synaptic js

fleet mason
#

why do i get this Error ```
C:\Users\sande\Desktop\mybot\commands\purge.js:1
(function (exports, require, module, __filename, __dirname) { async exports.run = (client, message, args) => {
^^^^^^^

SyntaxError: Unexpected identifier
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:607:28)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Client.client.on.message (C:\Users\sande\Desktop\mybot\mybot.js:27:23)

#

This is my code ``` async exports.run = (client, message, args) => {

console.log('it works.');
message.delete();

if(message.author.id !== config.ownerID)
{
message.channel.send('You need the `bot-commander` role to use this command.');
return;
}

if (isNaN(args[0])) {

    message.channel.send('Please use a number as your arguments. \n Usage: ' + prefix + 'purge <amount>');

    return;
}

const fetched = await message.channel.fetchMessages({limit: args[0]});
console.log(fetched.size + ' messages found, deleting...');


message.channel.bulkDelete(fetched)
    .catch(error => message.channel.send(`Error: ${error}`));

}

glossy sand
#

it's exports.run = async () => {} not async exports.run = () => {}

#

the async is a modifier of the function not of exports

fleet mason
#
(node:5612) [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.```
#

now i get that error code

#

ok i got it to work but it gets a problem at this line when i dont type a number ``` if (isNaN(args[0])) {
console.log('it works3');

    message.channel.send('Please use a number as your arguments. \n Usage: ' + prefix + 'purge <amount>');

console.log('it works.3');
return;
}```

#

would changing the 0 to null help?

#

ok i got it to help but if i type !purge 1

#

i get a error

glossy sand
#

read the error lol

#

it tells you all you need to know

fleet mason
#

yea

#

i fixed it

#

wow now it worked im so lost

#

this is the error that i sometimes get. Error: DiscordAPIError: Unknown Message

prime cliff
#

Its means the message you are trying to get is not valid

thin kindle
#

Hi

thorny hinge
#

@earnest phoenix hello

gleaming summit
#

hi

earnest phoenix
#

ola comas estas amigos

thorny hinge
#

So what db are you using

earnest phoenix
#

Me habla espaรฑola

gleaming summit
#

??

earnest phoenix
#

well

#

Dm @thorny hinge

gleaming summit
#

@thorny hinge May I recive the examples about DB (JSON and SQLite)?

thorny hinge
#

Theres docs for both

topaz fjord
#

For anyone who uses lavalink what is in place of the connect/disconnect events

inner jewel
topaz fjord
#

@inner jewel it doesn't show a workaround

wispy axle
#

m.edit(Pong! Latency is ${m.createdTimestamp - message.createdTimestamp}ms. API Latency is ${Math.round(client.ping)}ms);

#

would this work?

thorny hinge
#

Why wouldn't it

#

Try it

wispy axle
#

ok

thorny hinge
#

If you're asking if it'll work by itself, no.

earnest phoenix
#
const strings = args.join(" ");
    if(strings.startsWith('-player')) {
        playerdata = strings.replace('-player', '').trim();
        playerData = playerdata.split(" ");
        console.log(typeof playerData[0]);
        if(!playerData[0]) {
            msg.channel.send('no player');
        } if(!playerData[1]) {
            msg.channel.send('no region');
        } if(playerData[1].toUpperCase() !== 'PC' || playerData[1].toUpperCase() !== 'XBOX' || playerData[1].toUpperCase() !== 'PS4') {
            msg.channel.send('invalid region');
        }
    }

i'm trying to make a rocket league cmd, but when I reach the last else, even if playerData[1].toUpperCase() is one of those values, it sends that "error" message. any help?

uncut slate
#

log it and make sure

earnest phoenix
#

i am sure

uncut slate
#

then playerdata is wrong ๐Ÿคท

#

log it

#

also it's better to ['A', 'B', 'C'].includes(playerData[1].toUpperCase())

earnest phoenix
#

aaaah

#

hmm

#

maybe it's that?

#

i've already logged

#

before

#

playerData[0], playerData[1].toUpperCase() and typeof on both

uncut slate
#

what do you want the check to do

#

because if you want to see if it's none of them, you want to use &&

#

(or preferably Array::includes)

earnest phoenix
#

thank you so much aetheryx <3

old glade
#

Heyo, I'm looking for python Discord dev for a project

#

I can't afford to pay the dev(s) tho

cerulean zinc
#

also auto updates

glossy sand
#

terrible

#

good website design entails not using unnecessarily complex and long animations lol

wooden shoal
#

iDerp that is amazing

pale light
#

How does top bots work on website zoomeyes

umbral pelican
#

it's just most updoots

#

and on front page is random from 1st page of top boats

pale light
umbral pelican
#

cough should be first 2 pages cc tonkku

glossy sand
#

should be first page of search results for "author:phanta#1328"

earnest phoenix
#

how do i make it like if reply is y or n it says something in js

glossy sand
#

a... conditional?

#
if (msg.content === 'y') {
  // do somethibg
} else if (msg.content === 'n') {
  // do something else
}
earnest phoenix
#
    msg.reply("Am i a human?");
    if (msg.content === 'y') {
    msg.channel.send(`I know`);
  } else if (msg.content === 'n') {
    msg.channel.send(`YES I AM`);
  };
  'servers': (msg) => {
    msg.channel.send(`I am in **${client.guilds.size}** servers!`);
  },```
i do that then it does this
#

it does the same thing for , and nothing

#

@glossy sand

glossy sand
#

uh well

#

you would, in this case, be trying to check the message content of the message that initiated the prompy

#

and you already know the conditional will never take either branch

earnest phoenix
#

i want it to send a message and then check there next message for y or n

glossy sand
#

so add some construct to store state and use two different message hander depending on that state

#

you might even want to implement some sort of middleware that routes between different message handlers, including the command handler

deep parrot
#
events.js:137
      throw er; // Unhandled 'error' event
      ^

Error: Connection lost: The server closed the connection.
    at Protocol.end (/root/Bots/SiriBot/node_modules/mysql/lib/protocol/Protocol.js:113:13)
    at Socket.<anonymous> (/root/Bots/SiriBot/node_modules/mysql/lib/Connection.js:109:28)
    at Socket.emit (events.js:165:20)
    at endReadableNT (_stream_readable.js:1101:12)
    at process._tickCallback (internal/process/next_tick.js:152:19)
``` need some help with this.. this keeps crashing my bot.
earnest phoenix
#

makes no sence to me @glossy sand

topaz fjord
#

@deep parrot u eneded your mysql connection

deep parrot
#

But on what tho

topaz fjord
#

in your code

earnest phoenix
#

Hey guys

#

but it works on my home machine but not the server

#

@topaz fjord sorry for tagging, but do you know?

hidden quiver
#

@dusk verge.command(pass_context=True)
async def warn(ctx, user: discord.Member):
await bot.say("warn" {}. .format(user.name))
await bot.warn(user) will this work for warn command?

#

anyone know?

#

@here anyone know? sry for tag but it is urgent for my bot to work with warn commands

wooden shoal
#

what is the error?

hidden quiver
#

it says not known

wooden shoal
#

paste the error

hidden quiver
#

Ignoring exception in command None
discord.ext.commands.errors.CommandNotFound: Command "warn" is not found

wooden shoal
#

well, command warn is not found

hidden quiver
#

it no work idk how fix

analog thicket
#

What's the command ment to do?

hidden quiver
#

warn people

#

like [warn] @hidden quiver

analog thicket
#

Ur await bot.warn(user) doesn't seem like it would do anything to me

hidden quiver
#

it should

analog thicket
#

Well ur trying to do bot.warn and there is no built in warn method

hidden quiver
#

idk how set that ๐Ÿ˜ฆ

analog thicket
#

U don't, you get rid of that line commpletely

hidden quiver
#

k

#

then how make a warn command?

#

jat nvm

analog thicket
#

Well how do u want to warn people, send em a DM or something?

faint cedar
#

s>reload ready

#

ofc not here either

earnest phoenix
#

Anyone know why my bot joins, says it's playing, then leaves?

#

No errors

#

It just started today

#

I fixed it

winged osprey
#

YouTube updated sigs

earnest phoenix
#

Ye

winged osprey
#

Ah ok

earnest phoenix
#

Thanks though ^_^

frail kestrel
#

@earnest phoenix if youโ€™re using d.js, d.js has a built-in awaitMessages() method.

leaden bane
#

Anyone using discord.py could help me on this? Looks like the API doesn't have an event for when the client leaves a server...

leaden bane
#

Do you know how to get the bot's upvotes count by itself (discord.py)?

gleaming summit
#
(node:13868) UnhandledPromiseRejectionWarning: Error: SQLITE_CANTOPEN: unable to open database file
last tapir
#

Hey folks I am super new to discord and bots....and coding in general...but where do I get started on development?

leaden bane
#

You need a tutorial?

low rivet
#

@leaden bane there is an event

leaden bane
#

Which event?

low rivet
#

on_guild_remove

gleaming summit
#

Anyone help me with SQLite.

leaden bane
#

I'm not seeing it in the discord.py's documentation... Its syntax is on_guild_remove(server), right?

gleaming summit
#

IDKk anything.. I can MySQL but that was not in Node

low rivet
#

async or rewrite @leaden bane

gleaming summit
#
(node:6084) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'run' of null
    at Promise (E:\auberant\node_modules\sqlite\main.js:219:19)
    at new Promise (<anonymous>)
    at Database.run (E:\auberant\node_modules\sqlite\main.js:218:12)
    at message.channel.send.then (E:\auberant\react\setup.js:14:8)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
(node:6084) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
#

Who can help me with this err

#

The query is ```js
db.run('CREATE TABLE cash (account TEXT PRIMARY KEY, balance INT, private TEXT)')

leaden bane
#

@low rivet What did you mean?

gleaming summit
#

But I don't know why.

low rivet
#

do pip show discord.py

last tapir
#

@ leduyquang753#3761 yes I do need a tutorial

leaden bane
#

0.16.0

low rivet
#

it's on_server_remove then

leaden bane
#

@last tapir I will guide you thru making a bot.

last tapir
#

Great thank you.

leaden bane
#

@low rivet I tried but it seems not to be working...

low rivet
#

send code

leaden bane
#
@bot.event
async def on_server_remove(member):
    if member.id != bot.user.id:
        return
    global count
    count -= 1
    await bot.send_message(log_channel, """The bot has left the server **{}** (ID {}).
{} servers left.""".format(sv.name, sv.id, count))
low rivet
#

In a cog or not?

#

and... what is global count.....?

leaden bane
#

The servers count...

low rivet
#

just use len(bot.servers) GWcfcThonk

leaden bane
#

I was lazy to change that xD...

low rivet
#

continue having shit code then GWmythiBlobCool

leaden bane
#

...

last tapir
#

Ooooo he talked about your code!!

low rivet
#

what's the problem about code

last tapir
#

Dunno

leaden bane
#

Hmmm...

earnest phoenix
#

bjr

leaden bane
#

Somehow my bot's server count is not updated???

#

Solved: Token was not correct...

spare spruce
#

witch part of bot is shard

restive silo
spare spruce
#

how i fix shard not defined in discordjs

restive silo
#

use the shard manager ?

spare spruce
#

yeh i try call it out to API

#
dclient.on('ready', () => {
    require('superagent').post('https://discordbots.org/api/bots/203781450905026561/stats')
    .set('Authorization', config.authorization1)
    .send({ server_count: dclient.guilds.size, 
          shard_count: dclient.shard.count, 
     shard_id: dclient.shard.id })
    .end((err, res) => { 
    if(!err) { console.log('Updated Server Count to https://discordbots.org/'); return; }
        console.error(`Failed to Update Server Count for https://discordbots.org/`, err);
    }); 
});```
restive silo
#

do you use d.js sharding manager?

spare spruce
#

never used sharding manager before mostly i done is calling out Discords connected

#

and there is 1 but idk how exicute it

austere meadow
#

i know it seems like im coming here daily with shitty issues about lavaplayer and stuff but hopefully after this it should be all good
im getting this issue where Lavaplayer is having issues retrieving tokens or a cipher key https://please.zbot.me/JA7wWq2f.png
im not sure why im getting this and it happens on most videos

restive silo
#

youtube had an update yesterday what forced most downloader/libraries to update, could be related

#

not sure tho

restive silo
#

yea

austere meadow
#

is there anyway i can update lavaplayer without having to wait for a new version of lavalink to come out

north fog
#

update it by youself ยฟ

heady zinc
#

pmuch lul

austere meadow
#

why do i have to put so much effort into this notlikeblob

restive silo
#

because youtube updateโ„ข

heady zinc
#

cuz google is eviiiiiiiiilll

inner jewel
#

@austere meadow lavalink already has a patch

#

but you can update just lavaplayer if you want

#

jar files are basically zips

austere meadow
#

yeah i know but the update is on v2

inner jewel
#

tho lavaplayer doesn't have a single jar

austere meadow
#

and there isn't a wrapper for js on v2

inner jewel
#

rip

topaz fjord
#

@austere meadow u use java right

austere meadow
#

i use javascript

#

for my bot

topaz fjord
#

O

#

Are you getting a playback failed

#

For lavalink

#

1.3

austere meadow
#

the only errors ive been getting is the one i listed above about the new update

#

otherwise its been pretty smooth sailing for me

#

relatively

topaz fjord
#

o

#

I've been getting a playback failed error for only music and the lavalink.js Creator told me to update lavalink idk wether he means the module or the server

austere meadow
#

do you have the whole error with you

#

can you show it

topaz fjord
#
com.sedmelluq.discord.lavaplayer.tools.FriendlyException: Something broke when playing the track. at com.sedmelluq.discord.lavaplayer.tools.ExceptionTools.wrapUnfriendlyExceptions(ExceptionTools.java:40) at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:102) at com.sedmelluq.discord.lavaplayer.player.DefaultAudioPlayerManager.lambda$executeTrack$1(DefaultAudioPlayerManager.java:348) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalStateException: Must find action functions from script: /yts/jsbin/player-vflBjp0_H/en_US/base.js at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeSignatureCipherManager.extractTokensFromScript(YoutubeSignatureCipherManager.java:185) at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeSignatureCipherManager.getCipherKeyFromScript(YoutubeSignatureCipherManager.java:141) at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeSignatureCipherManager.getValidUrl(YoutubeSignatureCipherManager.java:100) at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack.loadBestFormatWithUrl(YoutubeAudioTrack.java:99) at com.sedmelluq.discord.lavaplayer.source.youtube.YoutubeAudioTrack.process(YoutubeAudioTrack.java:60) at com.sedmelluq.discord.lavaplayer.track.playback.LocalAudioTrackExecutor.execute(LocalAudioTrackExecutor.java:90) ... 4 common frames omitted
austere meadow
#

yeah thats the same error im getting

#

its because of the new youtube update

#

they made changes to the way they cipher stuff or something

topaz fjord
#

O

#

But strangely it only happens with music

austere meadow
#

so im assuming you're in the same situation as me and im not sure what to do

topaz fjord
#

But when I play a let's play video it works Thonk

austere meadow
#

most videos just outright dont work for me

#

so i dont think its worth staying on lavalink for now

topaz fjord
#

Hmm

austere meadow
#

i switched back to ytdl-core just for now

#

just so that people have something thats working

topaz fjord
#

Im Waiting for someone to make a module for lavalink 2.0

austere meadow
#

yeah same

#

can't wait for that whentm

heady zinc
#

^

topaz fjord
#

There so many py libs tho

austere meadow
#

i tried looking at making my own wrapper but gave up pretty quickly after i realised im just bad at programming

topaz fjord
#

smae

#

I would but im stumped since they removed disconnect and connect

#

The events

#

So idk what they replaced it with

austere meadow
#

yeah im in the exact same boat

#

i didnt know how to use the discord api with VOICE STATE UPDATEs and stuff so i was just like ยฏ_(ใƒ„)_/ยฏ

heady zinc
#

blake pls

austere meadow
#

look i know im bad

heady zinc
#

no ur good

#

ur not lizard at least

austere meadow
#

00f

#

paradox why dont you make a wrapper

#

you are good at programming

heady zinc
#

since when am i good at programming tho

austere meadow
#

idk you just sound smart lmfao

heady zinc
#

LOL

#

tbh i plan to at some point

topaz fjord
#

Only thing im good at is discord bots...

heady zinc
#

but if there is one thing i don't want to deal with

#

its voice mmLol

austere meadow
#

same

topaz fjord
#

But I am fiddling with java rn

#

Since im gonna do the switch ๐Ÿ”œ

austere meadow
#

@topaz fjord correct me if im wrong but i thought your bot was in js?

topaz fjord
#

Still is

austere meadow
#

ah

topaz fjord
#

But soon is JDA

#

So I can utilize Lavalink/Lavaplayer without any wrappers mmLol

austere meadow
#

true

#

but that seems a bit far away

heady zinc
#

what's the deal with voice state update tho ๐Ÿ‘€

topaz fjord
#

O ye

#

Jacz is working on a wrapped for 2.0

#

*wrapper

austere meadow
#

@heady zinc to join a voice channel you need to use the voice state update or something

#

one sec

#

voice server update sorry

heady zinc
#

wah

#

very gud api

topaz fjord
#

Seems useless tbh

heady zinc
#

nice ๐Ÿ‘Œ

topaz fjord
#

Just change 1.3

#

And turn it into 1.4 mmLol

cerulean zinc
#

Anyone know anything good for making widgets?

wispy axle
heady zinc
#

the actual message?

wispy axle
#

idk how to make my bot post a pic so yeah

heady zinc
#

see d.js docs

wispy axle
#

what should i search?

heady zinc
#

the .send() method

wispy axle
#

Mk

heady zinc
#

afaik it describes what you can send

wispy axle
restive silo
#

look at MessageOptions

wispy axle
#

is it this?

restive silo
#

no its not

wispy axle
#

i mean its has avatar command

#

Kay

heady zinc
#

well

#

in fact

#

you can just return the url

#

in your message

ebon vault
#

He can also make an embed and set the image

wispy axle
frail kestrel
#

it worked

#

you're sending the avatar url