#development

1 messages · Page 771 of 1

grizzled raven
#
guilds.filter(g => g.members.get(user).hasPermission(permission))
strange falcon
#

Hey guys i deployed my discord bot on heroku and it's working partially (it does what it's supposed to do while appearing offline but that is another issue), and yeah i checked the heroku logs --tail and noticed I got the Heroku "H14" Error which seems to be related to me having no web dynos running, which brings me to the following questions:

Why am I getting this error? Discord bots aren't web apps right? Why would I get a H14 Error that causes my bot to behave weirdly and even seemingly crash?

I might be completely oblivious and dumb and am overseeing sth utterly obvious here, but if someone could help me out that'd be awesome dblSmile

modest maple
#

we dont support heroku here, sry. you will need to contact heroku support

strange falcon
#

ah aight yeah i thought maybe someone else used that service as well

empty owl
#

const Discord = require('discord.js')
const client = new Discord.Client();
var Weather = require('weather');

module.exports.run = async (bot, message, args) => {
  let code = args.join(" ")
const appID = ""

const appCode = ""
 
const weather = new Weather({
    appID,
    appCode
});
  
  weather.now('Brisbane, Australia').then(results => {
    message.channel.send(`The weather is ${results}`)
});
 
 
}



module.exports.help = {
  name:"weather"
}```
#

Cannot read property 'location' of undefined

#

I dont know where .locationis

#

ping me

valid frigate
#

results might be an object

#

oh wait it probably means that results is undefined, console.log it

sudden geyser
#

Are you sure the error's coming from that snippet of code

#

If you are, it may be an issue with the library or API it's using.

topaz fjord
#

@empty owl did you input your credentials for here.com

#

In appID and appCode

empty owl
#

@topaz fjord yea

#

The api is

#

And api lkey

quartz kindle
#

whats the stack trace?

#

it looks like a missing error handling in the library

#

the error is probably from here return resolve(data.body.observations.location[0].observation[0]);

#

the api might be outdated, or returning something unexpected

#

maybe ask the author (@ thatTonybo)

steady carbon
#

someone knows anything about shards in js? pika

quartz kindle
#

yes

gray pagoda
#

y!repeat wasd

#

@small igloo

tiny tinsel
gray pagoda
#

@tiny tinsel you coding a bot on C#?

tiny tinsel
#

@gray pagoda Yep.

gray pagoda
#

@tiny tinsel Skill, Repect++

tiny tinsel
#

🤔

gray pagoda
#

xD

tiny tinsel
#

I mean.. doesn't mean I have more skills than someone that uses Javascript.

sudden geyser
#

ehh, depends

tiny tinsel
#

@gray pagoda You should embed your help command.

#

It would look more clean.

gray pagoda
#

Yes

#

I will

#

just not now because I'm allready kinda busy trying to fix an error

tiny tinsel
#

Oh ok.

#

If you need help post here

gray pagoda
#

Ye

#

thank you man

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

who said they need to

#

need is not should

sage bobcat
#

One message removed from a suspended account.

tiny tinsel
#

@sage bobcat Never said It is a need.

#

@sage bobcat It would look more clean.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tiny tinsel
#

It is a suggestion, exactly.

sage bobcat
#

One message removed from a suspended account.

tiny tinsel
#

You are saying that I said It is a need.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

should is a suggestion, need is a command

tiny tinsel
#

I'm gonna stop the conversation here, thanks.

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

suggestion

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

lean palm
#

for bot rules - if you have a bot that has a deticated channel for a certain command and doesn't work in anyother channel does it still need a prefix

sage bobcat
#

One message removed from a suspended account.

blissful scaffold
#

Should does not sound like a suggestion to me

lean palm
#

bruuhh

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

"hey you should clean your room" implies a friendly suggestion that the room is messy and needs to be cleaned but not this very instant, it implies that there'll be a consequence
"you need to clean your room" is a command that says that you need to do it asap because of x reason

#

yall need to go back to sixth grade and re-learn modals

blissful scaffold
#

The only place where my bot does not need a prefix is in private messages, there is accepts commands with and without a prefix

sage bobcat
#

One message removed from a suspended account.

lean palm
#

ok

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tiny tinsel
#

It ain't enough important to start a debate about it in #development.

sage bobcat
#

One message removed from a suspended account.

tiny tinsel
#

@gray pagoda I'm gonna clarify, you don't have to embed your message. It was an suggestion.

gray pagoda
#

Ye ik

#

:p

#

If you have anymore you can DM me them

#

If u wanma try I sent you invite link on DM

tiny tinsel
#

Good I will add it to my Discord.

tiny tinsel
#

What can be the cause to a image embed sometimes being in the embed. Sometimes It is outside..?

earnest phoenix
#

what do you mean

sage bobcat
#

One message removed from a suspended account.

sudden geyser
#

@tiny tinsel, are you possibly uploading it as an attachment?

empty owl
tiny tinsel
#

@sudden geyser Yes I am.

#

But it works for some.

#

Sometimes It is outside.

sudden geyser
#

Confused. Do you mean the attachment is sometimes inside an embed, but, sometimes, it's an attachment?

earnest phoenix
#

when you're sending an attachment you need to reference it in the embed via the attachment protocol

#

attachment://filename.ext where the filename.ext is the filename and extension of the file you sent

tiny tinsel
#

@sudden geyser Sometimes It is inside the embed. Sometimes It sends it outside the embed.

#

@earnest phoenix That's what I do.

earnest phoenix
#

if it is outside the embed you're using the wrong filename and/or extension

empty owl
#

helps

#

https://ghostbin.co/paste/jvdnc
having some troubles with openweatherapi
smartJSON.temp = jsonObj.main.temp;
^
TypeError: Cannot read property 'temp' of undefined

west raptor
#

Read the error

#

It's lays it out for you

earnest phoenix
#

@empty owl log jsonObj

empty owl
#

I got it

#

@west raptor that’s not even in my code

earnest phoenix
#

ok

outer niche
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'wavelink' ```@bot.command()
async def play(ctx, *, query: str):
tracks = await bot.wavelink.get_tracks(f'ytsearch:{query}')

    if not tracks:
        return await ctx.send('Could not find any songs with that query.')

    player = bot.wavelink.get_player(ctx.guild.id)
    if not player.is_connected:
        await ctx.invoke(join)

    await ctx.send(f'Added {str(tracks[0])} to the queue.')
    await player.play(tracks[0])
```
sudden geyser
#

what

stable horizon
#

your bot object has no wavlink attr

outer niche
#

how

tight mountain
#

i get this error when i start my bot (node:2477) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 guildCreate listeners added. Use emitter.setMaxListeners() to increase limit , and if I make something happen when guildCreate is triggered ( client.on("guildCreate", guild => { console.log("I joined a server!"); });), this happens

#

when it joins one server

blissful scaffold
#

You have 11 guildCreate listeners

#

Make sure you start the listener only once

tight mountain
#

i have made sure of that

#

it happens when there are no listeners in the code

#

and if there are

#

i think it is either a node.js thing or a linux thing as it happens with every bot i run

tiny tinsel
#

@earnest phoenix @sudden geyser It was caused by spaces in images name. I forgot to reply.

outer niche
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'wavelink' how can i fix this

earnest phoenix
#

i am doing git remote add origin https://github.com/aakash194/alpharemake.git

#

fatal: remote origin already exists.

#

getting this error

trim cape
#

@sudden forge

quartz hill
#

Can an await-like operation be performed on a synchronous function?
nodejs
I will use broadcasteval. But after I send it to all shards, I will continue processing.

lament meteor
#

you can use .then(() => {})

sinful lotus
#

.catch(() => null) miyanoWild

quartz hill
#

thx so much

zealous veldt
#

@earnest phoenix That means that you already have a remote named origin

slender thistle
#

@outer niche ```py
if not hasattr(bot, 'wavelink'):
self.bot.wavelink = wavelink.Client(self.bot)

#

me straight up copying something from examplle

outer niche
#

what is that

#

And what is it supposed to do

slender thistle
#

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'wavelink' how can i fix this

#

What might that code snippet do, I wonder...

outer niche
#

I've already fixed all that

slender thistle
#

So what's the current problem

outer niche
#

Installing and setting up lava link to work with wave link

slender thistle
#
WaveLink requires Python 3.6+
outer niche
#

Ik

slender thistle
#

It never said anything about installing Lavalink

outer niche
#

From what I have been told your supposed to lava link because of wave wink is a library from lava wink

#

Link

modest maple
#

No no no no

#

Wave link is the lava link wrapper

#

You shouldn't / can't get lava link in its raw form for python

outer niche
#

Because this is the error I keep on getting

#
    raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 2333)```
modest maple
#

I would advise you step back from bot making for a while and learn about reading docs and the basic of Python

#

Because all of these issues are the cause of you not reading up on stuff and just diving in

#

It was true about you trying to use ffmeg

#

And it is true with wave link

outer niche
#

That's what the wavelength people told me to do

modest maple
#

If you understood the basics you would know what that error is

#

And you would know some potential fixes to try and trouble shoot

outer niche
#

Like literally there support server that's what I asked him about that ever and they told me I needed to download lavalink.jar

modest maple
#

Us, the python discord and the d.py server should not be your first go to when you encounter and error that could be fixed by reading the docs

#

Troubleshooting is a major skill you need to learn when program and it wouldn't kill you to learn iy

outer niche
#

I tried to read the documents and then when I cannot find it I literally asked there support server that's the directions they gave me and did not respond again

modest maple
#

We're still talking python basics here

outer niche
#

Well that's not what I'm talking about

modest maple
#

5 seconds and a search

#

First thing that comes up

#

Go and learn the basics of python and how to read docs and trouble shoot because the amount of simple errors you get asking us to fix is depressing

outer niche
#

I've been staring at this page for 2 hours I cannot find it

slender thistle
#

Cf do you remember the Russia voice region enum in d.py

modest maple
#

I have no idea xD

#

I've never had a use for the Russia region enum

#

XD

slender thistle
#

Eh it's just russia, who could've thought

modest maple
#

@outer niche if you cannot read documentation you should not be making a bot

outer niche
#

I still get the same exact error even with that code on the website

modest maple
#

BECAUSE YOU NEED TO CONFIG IT BECAUSE COPY AND PASTING ISNT GOING TO SOLVE YOUR ISSUE

#

if you cannot read docs I cannot recommend you make a bot

#

Especially when using a more complex (and I say this bigging it up) wrapper like wave link that uses some of asyncio's neeter functions

earnest phoenix
#

wym???? i watched yt vid if works there!!

modest maple
slender thistle
#

when you wanna copy an example but it said ```py
CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'get_tracks'

earnest phoenix
#

the ctrl key felt that

slender thistle
#

It isn't seeing bot.wavelink properly bloblul

earnest phoenix
#

@zealous veldt so how i remove remote access and do another one

zealous veldt
#

git remote remove origin iirc

earnest phoenix
#

done

#

and after i again use the command

#

getting this error

slender thistle
#

@modest maple Would you happen to know the cause of my issue here lmao

#

I've got a bot variable but my cog is seeing it as None GWchadThink

modest maple
#

Is it global or class var or what

slender thistle
#

bot.wavelink = wavelink.Client etc

modest maple
#

Only thing I can think of is variable scope

slender thistle
#

which shouldn't be an issue because it's all under the same object

modest maple
#

Yh

#

Altho if it was self wouldn't It have to be self.bot.wavelink = ...

#

Only time I've ever had this sort of issues with the same class was because I had seperate processes going seeing two different objects

slender thistle
#

Yeah it would, I just shortened that

fair fulcrum
#

anyone can make a gambling website

#

or discord bot for gambling

modest maple
#

Erm

#

Not the right server to ask that rlly

quartz kindle
#

was that a question or a statement?

mossy vine
#

yes

warm marsh
#

What language is "best" for making an API?

#

I know the basics in a handful of different languages. Lua, Java, C#, JavaScript and a few others.

flat pelican
#

JS

#

There is no best language for making an API

#

I know that it's pretty simple to make one with JS, but you should be able to make "best" APIs with other languages

fleet chasm
#

you probably should choose where you are best, and spread off of that

flat pelican
#

^

warm marsh
#

Okay, I've done it with JS in the past but js doesn't seem too secure.

flat pelican
#

What do you mean by secure

#

You can make your API "secure" by making user tokens

#

and adding ratelimits

#

but again, it depends what you mean by "secure"

warm marsh
#

Alright.

#

Thanks!

flat pelican
#

You are welcome ig

grizzled valley
#

@modest maple yeah bro thanks i added the queue command and combined it with play

shadow gulch
#

SAX

green kestrel
#

im currently adding my first proper voting reward to my bot. previously, the reward was that you'd just get a role if you were on the official server. now im planning to give something more significant, a doubling of ram and cpu time allowance for the scripting system

#

does anyone else here have a reward in their bot for voting (as opposed to just outright vote locking) and does it get people to vote?

warm marsh
#

That's pretty smart. Getting a boost for voting.

green kestrel
#

yeah so its something anyone can use, but voters get to use it 'better'

warm marsh
#

Yeah I hate when bots just lock stuff behind voting.

green kestrel
#

ive also set it up so that there are 7 sites you can vote on for the same privilege, so you can rotate your votes

#

on the downside it will mean the votes are spread thinner rather than all being here at top.gg but on the other side its nicer for users

#

the boost lasts 24 hours, but some sites only let you vote once per 24 hours, others once per 12, but people gotta sleep, ya know?

#

i thought if i put that in and allow voting in many places, people whove overslept and missed their voting window can vote elsewhere that time, and not lose their access to the feature

flat pelican
#

That's a great @green kestrel idea

green kestrel
#

i also set it up so that it boosts all servers you own

#

rather than 'i just boosted, i gotta pick one'

flat pelican
green kestrel
#

lol, thanks @flat pelican you like it?

flat pelican
#

I don't see how technically you'll set it up, but yeah, it's original

green kestrel
#

its already set up

#

basically, every site that supports proper voting webhooks has a webhook back to my site, and they all send a row to the same table with a time, date, and origin url

#

the bot looks for an entry in that table, which it was already using to assign voter roles

#

if theres an entry dated within the last 24 hours, the limits are boosted for all servers that snowflake id is owner id for

#

if theres not, you dont get it

#

i then have a separate table that gives a voting url for each of the origin sites, so that i can produce a pretty list of "want to vote on this site? go directly here"

flat pelican
#

oh

#

Niceums

green kestrel
#

im hoping it gets more of an uptake on the scripting stuff

flat pelican
#

Time to copyright your idea and sell it to top.gg

green kestrel
#

lol

#

i think top.gg will directly benefit from it

#

because it will drive traffic to them in terms of voting

earnest phoenix
#

Kann mir jmd kurz helfen? Pls meldet euch mal Privat! Geht um den Bot code! Finde da den Fehler net..

mossy vine
#

are you still stuck on the missing closing something

modest maple
#

Anyone know if an Orm framework won't delete a row because it isn't being given a unique column ID

green kestrel
#

Depends on the framework

modest maple
#

Alchemy

warm marsh
#

@earnest phoenix nein.

#

sprich hier (Englisch)

#

butched no doubt

flat pelican
#

@warm marsh This channel is english only

warm marsh
#

I know

#

I was replying to @earnest phoenix

marble juniper
#

No german here

uneven wyvern
#

@warm marsh ur German?

blissful scaffold
#

A german wouldn't speak german badly 😛

green kestrel
#

yeah and english dont speak english bad like, ever innit.

#

🤣

west raptor
warm marsh
#

No

#

I am Scottish. I know like 0.001% German

cold notch
#

German best Language 😉

uneven wyvern
#

Also the hardest

sudden geyser
#

Laughs in English

mossy vine
#

language wars taken to another level

west raptor
#

This is some nice development discussion

mossy vine
#

we gotta discuss what language our bots should use

prime cliff
#

Laughs in ancient egyption hyroglyphs

vocal cedar
#

!help

uneven wyvern
#

@weak parrot I think you like that

slender thistle
#

@weak parrot ya yeet

vocal cedar
#

-hekp

uneven wyvern
vocal cedar
#

-help

#

@uneven wyvernq okey sorry

weak parrot
#

Thanks

earnest phoenix
#

Good evening, how can I do so that when I mention my bot, it looks like the prefix?

uneven wyvern
#

Well do the Prefix like <@botid>

#

so when u do @bot it gets mentioned

earnest phoenix
#

Yes or @lethal mauveplay nanana

uneven wyvern
#

Like that

earnest phoenix
#

but @lethal mauveplay 1h zen

#

but my prefix is n!

uneven wyvern
#

oh

#

do u use a command handler?

earnest phoenix
#

no

#

But my bot prefix is in file

modest maple
#

regex

#

orrr

#

just check

#

if mention text starts the message

earnest phoenix
#
    token: '',
    prefix: 'n!',
    youtube: '', // Youtube data api V3
    url: 'https://discord.gg/', // URL de votre serveur,
    color: '#7289d9',
    emotes: {
        music:  ":music:",
        repeat: ":repeat:",
        notes:  ":notes:",
        sound:  ":sound:",
        error:  ":error:",
        check:  ":succes:"
    }
};```
#

It's my options.js

#

in i stock my prefix

uneven wyvern
#

try it in an array

hard anchor
#

brain died

uneven wyvern
#

why

earnest phoenix
#

Just i want, the bot is mention it does like the prefix

hard anchor
#

i dont understand developement

late hill
#

yes

#

if you coded the part where you check for the prefix

#

it shouldn't be that hard to edit it so that it'll check for the prefix or a mention

#

mentions look like <@userid> or <@!userid>

uneven wyvern
#

How can i get the current date and let a timer on the console count down how many days are still there till next month?

modest maple
#

what language

quartz kindle
#

count down, you mean like printing the time left every x seconds?

#

or just print the time left once and exit the program?

uneven wyvern
#

@modest maple js

#

@quartz kindle yeah like that but how would I count down?

modest maple
#

ur tern tim

uneven wyvern
#

tern lmao

gentle cradle
#

.

uneven wyvern
#

no dotpost @gentle cradle

trim saddle
#

@modest maple one day

#

the mod team will be furries

#

i can smell it

west raptor
#

This is development, skull

raven sand
#

I don't know if this is the right place to ask this, but I'm running out ideas so maybe y'all can help me out. I'm a mod at this server and we use couch bot for channel promotion, some users although they have the twitch account linked with their profile and have streamer mode on, don't get the auto self promoting message. We have a role for the streamers who want to get promoted and that's how we usually trigger the messages. We requested them to unlink and link the accounts again, removed the role and added it again but they're still not getting the auto promotion.

#

Any ideas to try and fix this? I'm sorry if it's not the right place to do it

#

And thank you in advance for any assistance

modest maple
#

sadly not a support server for couch bot

#

nothing we can do im afraid :()

raven sand
#

peepoSad/ ty anyway

sage bobcat
#

One message removed from a suspended account.

uneven wyvern
#

why I can't view the profiles of the "bots" in #bids ?

late hill
#

It's a webhook

#

Which makes it perfect for thing like that

uneven wyvern
#

What's that?

late hill
#

Because you can override avatars and names on each request

#

In the channel settings, you can add webhooks

#

You then simply post to the webhook

#

using the webhook url

uneven wyvern
#

Ok ty

summer torrent
late hill
#

Well yeah

#

They aren't spaces

#

They are new lines

#

replacing \n would probably work

slender thistle
#

content.replace('\n', ' ').replace(' ', '') ftw

late hill
#

well yes

#

but no

#

probably want to keep some of the new lines

#

should be able to get a regex that'll match only on the additional newlines that you don't want

blissful scaffold
#

content.replace('\n\n', '\n')
Turn every 2 new lines into 1 new line

late hill
#

ok but

#

it'll do that once

blissful scaffold
#

replaceAll or whatever it's called in that language ^^

late hill
#

not a thing

#

would have to use a regex

#

You could just loop it but like, that's probably not as efficient as the regex would be

blissful scaffold
#

it's a thing in Java

#

I see that it doesn't exist in JS

late hill
#

yeh

#

he didn't specify

#

but i've seen him ask or help people here using js

#

So I'd assume

summer torrent
late hill
#

epic

summer torrent
#

also I am using JS

uneven wyvern
#

Index.js


Console.prototype.Log = async function(input) {
  return console.log(input)
}```

Testing/server.js

```const Console = require ("../index.js")

Console.Log("Hello")```

Ik it's a dumb Module. But somehow I get the error that `Console.Log("Hello") is not a Function` as Error. How would I fix it?
modest maple
#

can i ask

#

what is wrong with just doing console.log normally

uneven wyvern
#

It's a Test Module

#

but now I ask how I can fix that fuccin error

#

nvm

#

anyways can u help

sudden geyser
#

You need to make a new instance to access the .Log property.

ruby talon
#

Heyo, I got a question.
How would you do like that every time you hover over an item that has the class title it will add a - to the text, with this example HTML code.
(Using JS and no onover.)

<h2 class="title">MyContent1</h2>
<!-- HTML content here -->
<h2>Important note.</h2>
<h2 class="title">MyContent2</h2>
<!-- HTML content here -->
earnest phoenix
#

why do you not want to use onhover

ruby talon
#

Just wondering if there is another way to let the script do it auto. ^^

earnest phoenix
#

..huh

#

onhover is pretty much the only event that triggers on hovering

ruby talon
#

Smth wrong with trying to learn new stuff? MegaThonk

#

Oh

#

nvm, found the way I was looking for with addEventListener.

#

Ty tho. ^^

frank wyvern
#

i have this code:

        vc = message.guild.voice_client
        player = await vc.create_ytdl_player(stripped)
        player.start()z```
But it says `AttributeError: 'VoiceClient' object has no attribute 'create_ytdl_player'`

'stripped' stores the URL.
#

Any Ideas?

modest maple
#

You are trying to use a discord module to call a different module's functuon

#

Function*

slender thistle
modest maple
#

And that

#

Use ll

#

Just easier and better imo

uneven wyvern
#

@sudden geyser wait what?

quartz kindle
#

prototypes are like classes, there is the class object and the class instance

#

you create an instance by using the keyword "new"

#

somevar = new Class()

#

then somevar becomes an instance of the class, and can access its prototype

sudden geyser
#

this also, if you wanted to do Console.log like you normally would (console.log), you'd need to remove the prototype.

split hazel
#

Why does discord sometimes return "INTERNAL SERVER ERROR" when DELETEing, PUTting reactions

modest maple
#

when discord is having a moment and the bot cant get the connection time todo it

dull terrace
#

This code is correct?

@bot.command()
async def connect(ctx):
    channel = ctx.author.voice.channel
    await channel.connect()
@bot.command()
async def disconnect(ctx):
    await ctx.voice_client.disconnect
slender thistle
#

Why not tias

modest maple
#

spoiler alert no

#

and tim has already told you this

slender thistle
#

Let them suffer the consequences of their own creations

modest maple
#

they just not reading docs

slender thistle
#

Let them suffer

#

the consequences of their own actions

dull terrace
#

I have read the docs, I have tried several times but nothing that concludes a good result

#

😐

modest maple
#

because ur trying to pull a voice channel out of a user object out of thin air

#

out of fucking no where dude

dull terrace
#

ctx.message.author.voice

#

It's just for me

#
@bot.command()
async def connect(ctx):
    channel = ctx.message.author.voice.VoiceChannel
    await channel.connect()
slender thistle
#

Are you handling cases where the command is executed in DMs

dull terrace
#

No, just in a server channel

#

Ya pas quelqu'un qui est français juste ?

modest maple
#

well then how do u expect it to get the user's voice channe;

west spoke
#

the dm object has voice I believe

#

idk

sinful belfry
modest maple
#

no

#

just bad for servers cuz if the bot can @everyone its amazing spam tool

sinful belfry
#

nah it can't do @ everyone

slender thistle
#

Can it do @here :^)

modest maple
#

if its in a server that allows it to it can

#

and yh

sinful belfry
#

nope if it detects either of those it will just say 'no'

modest maple
#

well then gj ig?

slender thistle
#

Solid

sinful belfry
#

do u see any other harmful uses of this command or would u say it is ok?

modest maple
#

just an annoying pointless command but no

slender thistle
#

Spamming non-ToS-compliant content :^)

sinful belfry
#

haha well i dunno how to stop that

#

but thanks for the feedback

quartz kindle
#

@dull terrace you almost got it

#

keep trying

dull terrace
#

I followed your advice, I don't know if I should use Voice Channel or VoiceState or both

slender thistle
#

voice_state_instance.channel to get VoiceChannel

dull terrace
#

Ok

quartz kindle
#

VoiceChannel is the object/structure type

#

.channel is how you access it

#

VoiceState is the object/structure type
.voice is how you access it

#

its all in the docs

dull terrace
#

In theory I don't need VoiceState

slender thistle
#

in theory you get the voice channel the user is in from VoiceState

dull terrace
#

Ah

blissful scaffold
#

It's sad that my bot needs to send voice data before it can receive voice data 😦

dull terrace
#

But it's complicated since when you say things in English I don't understand the same thing in French 😐

modest maple
#

I'm pretty happy

dull terrace
#
@bot.command()
async def connect(ctx):
    channel = ctx.message.author.voice.VoiceState.VoiceChannel
    await channel.connect()
modest maple
#

I built and entire webscraper to scrape 1200 pages in under 5 mins

quartz kindle
#

you were closer before, now you made it worse

modest maple
quartz kindle
#

gj

blissful scaffold
#

scraping 1200 pages in 5 minutes sounds like DOSing 😛

quartz kindle
#

i think he made the scrapper in 5 mins

#

not that it scraps all pages in 5 mins

#

at least thats what i understood

#

lmao

slender thistle
#

Wonders of languages

blissful scaffold
#

ah yeah, i guess you are right

modest maple
#

It scrapes about 5 Ish pages a second on average

#

But it uses so much fucking ram

quartz kindle
#

selenium?

modest maple
#

Many many selenium drivers yes

quartz kindle
#

lmao rip

#

cant you just use an http module and a dom parser? or you need to go through ajax requests?

modest maple
#

Selenium is just faster overall and more reliable

dull terrace
#
@bot.command()
async def connect(ctx):
    channel = ctx.message.author.VoiceState.voice.VoiceChannel
    await channel.connect()
quartz kindle
#

still wrong

#

i told you before

#

VoiceState is the object type

#

you access it with .voice

slender thistle
#

Sounds like basic Python problems rather than miscommunication

quartz kindle
#

same as Member being an object type, and you access it by using .author

dull terrace
#

I change

fallow mango
#

yo can somebody help me debug my code? the commands output more than 1 response

fleet chasm
#

are you running two bots?

#

like 2 of the same token

earnest phoenix
#

2 instances

fallow mango
#

No, well I don't think so.

#

i have to bots in my server each different applications

quartz kindle
#

are you using multiple event listeners?

earnest phoenix
#

^

blissful scaffold
#

are you the guy that had 11 active event listeners yesterday or earlier today?

fleet chasm
#

no

earnest phoenix
#

...

fleet chasm
#

delete thtat

blissful scaffold
#

BOT TOKEN LEAK

slender thistle
#

Reset your token at least

earnest phoenix
#

exposed his toke?

fleet chasm
#

token giving out is BAD!

slender thistle
#

Calm down you all

fleet chasm
#

ok

fallow mango
#

oh noooo

blissful scaffold
#

time to reset your bot token

fallow mango
#

yep

fleet chasm
#

try closing all bot instances and rerun one bot instance, just to make sure

fallow mango
#

Can you do that if you are coding in sublime text editor?

earnest phoenix
#

what are you using to run your bot?

#

a bat file...

#

cmd

fallow mango
#

Im using the build function in sublime text editoir

broken shale
#

is it a good idea to run ubuntu on a raspberry pi

fallow mango
#

editor**

earnest phoenix
#

ah

#

dev to dev when making a bot just edit the code and run it using like a bat file

fallow mango
#

oh ok

slender thistle
#

Cancel Build

earnest phoenix
#

well I mean your gonna change your token anyways

fallow mango
#

ok so stop the build and then put it into a .bat file then run the bat file?

earnest phoenix
#

but thats also something to do

fallow mango
#

i changed the token

earnest phoenix
#

ima dm you

#

ok?

fallow mango
#

ok.

slender thistle
fallow mango
#

and whats the best text editing tool? Or is that just personal preference?

slender thistle
#

Preferences tbh

fleet chasm
#

whatever suits your purpose and current skills

slender thistle
#

Sublime is light compared to PyCharm, Visual Studio Code and etc

fallow mango
#

Traceback (most recent call last):
File "bot.py", line 1, in <module>
import discord
ModuleNotFoundError: No module named 'discord'

mystic violet
#

import discord.py ?

#

wait nvm im stupid

#

lmao

#

Im used to discord.js sorry

fallow mango
#

lol

#

its fine

#

just fixed it

#

time to learn js

#

Downloads Node.js, GIT, All the sockets

broken shale
#

sockets?

wicked badger
#

Does anyone know the minimum time for presence updates on bots (online, idle, dnd, etc)

quartz kindle
#

i think the rate limit was 5 per 60 seconds, but im not sure

#

you should be safe with once per minute

modest maple
#

Most libs have it set to 5 times per 60 secs

#

Discord docs say 5 times per 20

#

But go with lib limit and keep it safe

mild umbra
#

2v2 boxfight?

wicked badger
#

Alright, thanks

sturdy depot
#

what command do y'all what me to make next?

quartz kindle
#

technically, we dont "want" you do to anything

#

so just do whatever you desire

sturdy depot
#

kk

blissful scaffold
#

@sturdy depot what command do YOU want to make?

west raptor
#

inb4 nsfw command

sturdy depot
#

ill try any

blissful scaffold
#

I (usually) don't judge people for their commands

sturdy depot
#

k

blissful scaffold
#

but sometimes

quartz kindle
#

make a math command that always outputs 42

sturdy depot
#

no

quartz kindle
#

/math 2+2
42

sturdy depot
#

i already made a CORRECT math command

blissful scaffold
#

with eval?

quartz kindle
#

but thats no fun

#

you gotta be creative

blissful scaffold
#

make a math command that is correct with easy math, but is a little off with more difficult math so people don't notice it immediately

quartz kindle
#

yeah but where's the fun?

west raptor
#

make something unique, ngl everything generic has been done 10000 times when it comes to bot development

#

try to make a game or something

#

my suggestion

blissful scaffold
#

ASCII FPS Bot

west raptor
#

lmfao

blissful scaffold
#

0.1 FPS

west raptor
#

also i generally discourage "multi-purpose" bots

#

usually for those bots people go to something like dyno, mee6, or some other popular bot

#

make something and make it it's main thing

blissful scaffold
#

I always think it's weird when people ask how they can implement the Fun tag
And that they try to add as many tags as possible

west raptor
#

yeah

blissful scaffold
west raptor
#

true

blissful scaffold
#

Less = More

west raptor
#

mhm esp. when it's the most focused on thing

#

many mp bots lack quality and rather go for quanity

#

im often guilty of it too, actually

blissful scaffold
#

The only reason to make a multipurpose bot is if you get a private bot for your own server.
Those bots are usually aimed at what YOU need and not what many other servers need

west raptor
#

yeah

quartz kindle
#

one of my bots is so simple, it doesnt even have any code to see how many servers its in, so i have no idea

#

probably not many lmao

blissful scaffold
#

I have one private bot for my MMO guild that has everything in it that we need/want.
And then when I thought one of the functions of the bot was kinda unique I made a public bot with only that function

fallow mango
#

yo anyone down to make a bot together? (preferably a music bot)

quartz kindle
#

no thx

west raptor
#

this isn't the place to recruit

fallow mango
#

sad

blissful scaffold
#

nah, there are already enough music bots

fallow mango
#

me is now sad

#

oof

quartz kindle
#

what you say: make a bot together
what i see: make a bot for me

fallow mango
#

Lol

quartz kindle
#

sorry =P

fallow mango
#

its fine

unique nimbus
#

I mean that does happen Tim so I wouldn't blame ya

fallow mango
#

i mean anyone need a bot? i can make one for you

#

JK

blissful scaffold
#

Tech, if it is your first bot then I would advice you to make something easy, then once you know how to make bots and once you know the programming language you can try making a music bot

#

or if you already know how to make bots then probably have an idea how to make a music bot

fallow mango
#

yo can you get a custom status for your account??

west raptor
#

bot account? no you can't

fallow mango
#

oof

west raptor
#

discord doesnt allow it

fallow mango
#

how do people then? do they have agame through applications?

#

a game**

blissful scaffold
#

you dont need a custom status to make a game

#

I have seen bots that can play text games, like hangman

fallow mango
#

i mean like ill see people with custom status

blissful scaffold
#

people can have a custom status, bot can not

#

I hope they will add it for bots some time so we dont have to put Playing: in front of our help commands 😛

fallow mango
#

exactly

#

@client.command()
async def commands(ctx):
await ctx.send('`rr! ban, rr! unban, rr! purge, rr! kick, rr! 8ball, rr! ping, rr! tictaktoe, rr! prefix')

#

anyone --\

#

know how to make a better list?

#

@client.command()
async def commands(ctx):
await ctx.send('`rr! ban, rr! unban, rr! purge, rr! kick, rr! 8ball, rr! ping, rr! tictaktoe, rr! prefix')

blissful scaffold
#

add new lines with \n

#

and maybe put it in an embed message

sudden geyser
#

save a variable as your prefix so you don't have to rewrite it every time

fallow mango
#

i mean a highlighted list.

blissful scaffold
#

There isn't really a way to highlight messages, but an embed message usually makes it look nicer

amber fractal
#

Over use is bad imo

#

just gets annoying

fallow mango
#

How get embed message? (If you couldnt tell i have a white neame)

blissful scaffold
#

Im not a JS dev, so I can't tell you how to do it

fallow mango
#

im using .py

#

rewrite to be exact

blissful scaffold
#

im also not a python dev xD

fallow mango
#

what u then

blissful scaffold
#

Java

fallow mango
#

ooooooof

slender thistle
#

rtfd

fallow mango
#

i see the fd

slender thistle
#

A small example for you
An embed with "foo" as a title and "bar" as a description

embed = discord.Embed(title = "foo", description = "bar")
# second way to do the same
embed = discord.Embed()
embed.title = "foo"
embed.description = "bar"```
fallow mango
#

is that py?

slender thistle
#

Uhh

#

Yes?

fallow mango
#

kk

sage bobcat
#

One message removed from a suspended account.

west spoke
#

anyone know why doing

Image.open(data)
``` returns this
#

normally it doesn't try to make the data the name

blissful scaffold
#

Maybe try to open a file with the file name instead of with the data 😛

west spoke
#

no, normally i read the bytes of the image and open the image through PIL with that.

#

and it has always worked fine

west raptor
#

Update in the library probably

#

Image.open sounds like it takes a string or object

west spoke
#

likely

#

i do the exact same thing for my bot's api stuff.

#

i get the image bytes and write it to a image

#

and it works fine

#

but no raspbian has to be special

#

yeah its likely a new thing, Image.frombytes is new

west raptor
#

Might wanna do that instead then

#

Also wtf is that naming convention

west spoke
#

^

#

also i hate that raspberry pi likes to combine old versions of the same file

#

its annoying

blissful scaffold
#

what do you mean with combine old versions of the same file?

west spoke
#

i have no idea, it just does

#

functions i define aren't current even though I have restarted

flat pasture
#

Hi...
Im kinda new to bot development only been doing it for a month or 2 now
And i need help making embed Messages!
I use java script
Discord.js
And im using Visual Studio Code
To code my bot

fleet chasm
#

you can read this https://discord.js.org/#/docs/main/stable/examples/embed
and if you want to add some more elements than described in that example, try looking at RichEmbeds' documentation

flat pasture
#

I dont understand that very well

blissful scaffold
#

you know how to create a normal message?

flat pasture
#

Yes

blissful scaffold
#

An embed is the same, except you use a RichEmbed

flat pasture
#

Ok let me see if i can switch them

#

So my code is pretty much the same from Discord.js Docs what would i have to change in that Event to make it an embed?

I have been watching Anson but none of his tutorials help me

west raptor
#

I don't mean to be rude but you should seriously learn JavaScript beforehand

#

Doing stuff like this isnt for beginners

flat pasture
#

Well i mean i can take by business else where if needed...

#

I asked for one thing to get help with and you act like i know nothing about Java Script...

west raptor
#

If you say so.. you're not going to get anywhere without knowing the basics

flat pasture
#

I code websites April

west raptor
#

This isn't a website

blissful scaffold
#

backend JS is different from frontend JS

west raptor
#

Nodejs is completely different from vanilla in some cases

flat pasture
#

I asked for a bit of help with Embeds and i fell as people are starting to become a little disrespectful...

west raptor
#

I'm recommending you what should be in your best interest

blissful scaffold
#

Corrupt Portable Network Graphic gave you the link to the official example, that should be enough to discover how to add an embed ^^

west raptor
#

None of us are out here to be disrespectful but we're also not gonna spoon-feed you and tell you how to do everything

outer niche
#

How wud i go about blacklisting a disvord on python

blissful scaffold
#

check the id of the discord server you are executing a command for and if that id is blacklisted then don't execute the command

outer niche
#

That is not what i mean like i do not want a welcome message to came hear how can i fix it

blissful scaffold
#

when you try to send a welcome message first check the id of the server and stop sending the message if the server is blacklisted

outer niche
#

Oml u do not get what i am trying to say thar is no command

blissful scaffold
#

i am not talking about a command

#

you want to send a welcome message for new people?

outer niche
#

Yes

blissful scaffold
#

when you want to send that message, first check the server id

#

when there is a new user you also know what server that user joined

#

and you simply check the id of the server that the new user joined

outer niche
#

U are not giting it

earnest phoenix
#

Re-explain it better then please 😩

blissful scaffold
#

then ask your question again and make us understand it

outer niche
#

Okay so when I am making a welcome message I want it to go into every server except this one and I do not want to have to go check something every time someone joins somewhere to see if it is this server

flat pasture
#

Ok so my apologies from a little while ago...
Here is my issue
I type all the codeing stuff for the embed then it has issues it tells me things are unexpected
I did exactly what you all told me to do

blissful scaffold
#

check on what line the error happens and see what is wrong there

flat pasture
#

It happens to everyline is the problem

blissful scaffold
#

Don't just copy and paste examples.
Read the example and understand what the example does.
After that you add it the way you want it to your own code

flat pasture
#

Im not copy and pasting

blissful scaffold
#

and you understand the code example?

flat pasture
#

Yes

blissful scaffold
#

then at the place where you first send the normal text message you are now first creating a new RichEmbed and then you are sending that embed instead of the text?

flat pasture
#

Yes

#

I fixed it i put the event in wrong

hardy nest
#

I am very new to coding and am trying to learn. I am trying to go off of the guide in the faq channel but I am stumped can some one help me?

tiny tinsel
#

Wassup

earnest phoenix
#

Google

#

Or

#

Stackoverflow

hardy nest
#

Well Im stuck on the part where I am trying to make a folder and set up the npm through the CLI

earnest phoenix
#
npm init
sudden geyser
#

oh I'm dumb

earnest phoenix
#

NodeJS

valid frigate
#

also you can expedite npm setup by doing npm init -y

#

if you literally could care less about the config or whatever

dusky marsh
#

Doing it that way is much easier imo

#

i hate the other way

#

takes too long

valid frigate
#

yeah mostly you dont give it a second look

#

so why not

outer niche
#
async def search(ctx, *,query):
    lol = '+'.join(query)
    await ctx.send(f"https://www.youtube.com/results?search_query={lol}")``` how can i make it not do all the +
slender thistle
#
lol = '+'.join(query)
``` what do you think this does
outer niche
#

i mean ya but it is like puting spaces

#

see thar = is a space and u i not wnt that

blissful scaffold
#

don't add the pluses

slender thistle
#

Yeah no

#

That's not Python

#

Ocha please let's not add more confusion

earnest phoenix
#

Sorry.

outer niche
#

i gpt it

slender thistle
#

hooray

uneven wyvern
#

@quartz kindle I basically only forgot module.exports = new Console ;-;

peak ivy
#

Why does it take to update my bot, it still comes out as 5 servers in 42 votes, but in reality they are +300 servers and 45 votes

#

The test votes are not sent either

earnest phoenix
#

is there a way to make my bots ping normal, sometimes if i run ping command its like 1600 ping but if i do it again its 168

#

why is that

#

and is there a way to reduce my bots ping

blissful scaffold
#

@peak ivy do you have a test bot that is on 5 servers and also sends data to DBL?

peak ivy
#

yes, I had it, but today I changed the tokens, I even regenerated it

quartz kindle
#

@earnest phoenix better internet

grizzled valley
#

anyone know if discord.py rewrite version has removed the HelpFormatter or not? cuz im getting an attribute error that Bot has no attribute formatter

dull terrace
#
@bot.command()
async def connect(ctx):
    channel = ctx.message.author.VoiceState.voice.VoiceChannel
    await channel.connect()
quartz kindle
#

still wrong lol

#
message = Message Object;
message.author = Member Object;
author.voice = VoiceState Object;
voice.channel = VoiceChannel Object;
channel.connect() = join voice channel```
ruby talon
#

Is this still the yt dl co'nect thingie ?

modest maple
#

Wut

#

No this is just connecting normally xD

green kestrel
#

nice, my module loader is fixed 😄

#

now i can reload bot functions without having to restart it at last 😄

fallow mango
#

Y do people use their @bot.command as @bot.command its very confusing? THAT'S why i do @client.command

unique nimbus
#

because preference

fallow mango
#

makes sense

#
async def kick(ctx, member : discord.Member, *, reason=None):
    await member.kick(reason=reason)```
#

seem efficient?

#

and with the info i just gave you.... Any command ideas?

#

@dull terrace how do you highlight your code?

dull terrace
#

It's client.command

#

I'm fail

fallow mango
#

like what command do you use to highlight your code

#
@bot.command()
async def connect(ctx):
    channel = ctx.message.author.VoiceState.voice.VoiceChannel
    await channel.connect()

@dull terrace

#
@client.command()
async def kick(ctx, member : discord.Member, *, reason=None):
    await member.kick(reason=reason)```
#

oh their we go

#

@dull terrace nvm

dull terrace
#

Yes

#

I'm just fail ^^

fallow mango
#

how

#

did you do your prefix?

#

as i can see

#

we both code in Python 19 or some version using the Rewrite Version of Async

#

@dull terrace ^^

#
AttributeError: 'Member' object has no attribute 'VoiceState'``` @dull terrace
#


channel = ctx.message.author.VoiceState.voice.VoiceChannel
AttributeError: 'Member' object has no attribute 'VoiceState' ```
#

@dull terrace those are my errors when i build the bot with that command.

#

im going to dm you

quartz kindle
#

his code is wrong, and we were trying to show him how to do it

fallow mango
#

i tried

quartz kindle
#

you copied his wrong code, thats why you're getting errors lol

fallow mango
#

i showed him the error output i got trying to debug it

#

or seeing what he did wrong

quartz kindle
#

he probably saw those errors in his console as well, but he is having trouble understanding how Class properties and OOP works in general

#

and how to read documentation

fallow mango
#

the documentation has all the things u need to know

quartz kindle
#

exactly

#

but if you dont have a basic understanding of the language, you're gonna have a hard time understanding the docs

cursive kiln
#

i have been working for a week on this code and it no work, and i dont know why and nobody gave me a helpful answer can you help me?
const Discord = require('discord.js')
const Client = new Discord.Client()

client.on("ready", async ready => {
consloe.log("i am ready")
})

client.on("message" async message => {
if(msg.content === "ping") {
message.channel.send("pong")
})

client.login(token)

quartz kindle
#

code is case sensitive

#

if you define it with a capital C, you need to use it everywhere with a capital C

#

also you misspelled this

earnest phoenix
#

also msg is undefined

#

it should be message

#

@cursive kiln i swear ur gotta be a troll

quartz kindle
#

probably just a beginner

mossy vine
#

also unclosed if statement

#

what the fuck

fallow mango
#

@client.command()
async def commands(ctx):
await ctx.send('rr! ban rr! unban rr! purge rr! kick rr! 8ball rr! ping rr! tictactoe rr! prefix')

mossy vine
#

is there a problem with this code

earnest phoenix
#

yuck static help command

fallow mango
#

@mossy vine any better way to make a list

shadow flume
#

Hey folks, i'm making a fun little discord bot

But i am struggling a bit here

I want the bot to count every time someone have said "uwu" in the server

But i can't seem to figure out how the "fetchMessages" work

anyone that can help out?

#

Or is there another way to have a bot look through all the old messages of the server?

fallow mango
#

any better way to make a command list?

#

@client.command()
async def commands(ctx):
    await ctx.send('``rr! ban, rr! unban, rr! purge, rr! kick, rr! 8ball, rr! ping, rr! tictactoe, rr! prefix``')```
shadow flume
summer torrent
#

"message.channel.messages.fetch(toString())"

grim aspen
#

i have no idea where to start

quartz kindle
#

are you using discord.js v12?

summer torrent
#

yes this is v12

quartz kindle
#

also, fetching messages only allows you to get 100 messages at a time

#

its very impractical to try to fetch all messages in a server lol, given that there might be hundreds of thousands or even millions

shadow flume
#

Have they allowed for bots to search for specifics yet?

#

I read that it is possible but undocumented, so not really allowed to use

quartz kindle
#

nope, bots cannot use the search end point

shadow flume
#

Gotcha

#

if we ignore the "tostring" part of that screenshot LUL

What could i do to atleast make it look through those 100 messages at a time?

quartz kindle
#

have you checked the documentation?

fallow mango
#

@client.command()
async def commands(ctx):
await ctx.send('rr! ban, rr! unban, rr! purge, rr! kick, rr! 8ball, rr! ping, rr! tictactoe, rr! prefix')

#

Any better way to make a command list

modest maple
#

Yrs

#

Yes

#

Using a embed

#

Also

#

Jesus Christ don't call a bot object client

vital lark
#

which library

summer torrent
#

which library do you use

dull terrace
#
@client.command()
async def connect(ctx):
    await ctx.message.author.voice.channel.connect(timeout=60.0, reconnect=True)
vital lark
#

@earnest phoenix it kinda does since discord.net and dsharpplus have different implementations for sending embeds

#

@dull terrace what's wrong?

modest maple
#

@dull terrace wrong

#

Go back and learn OOp again

#

Please

dull terrace
#

😅

modest maple
#

Youre just trying each thing one by one

#

And asking us one at a time

vital lark
#

well, if you read the docs

dull terrace
#

I read the doc

vital lark
#

it would be SendMessageAsync iirc

earnest phoenix
#

create a new instance of EmbedBuilder, add whatever to it and call Build on it, it returns an Embed object you can pass to the embed argument in SendMessageAsync

sudden geyser
earnest phoenix
#

How add this

modest maple
minor kelp
sudden geyser
#

is there anything below/inside the defined function

minor kelp
#

Only

#
    bot.add_cog(utility(bot))
modest maple
#

Where r u putting that tho

minor kelp
#

It worked before i added something to a command.

modest maple
#

Go to line 92

minor kelp
#

Its at the bottom.

modest maple
#

And send code

minor kelp
#
def setup(bot):
    bot.add_cog(utility(bot))
#

I don't see the problem.

#

It's like that with every other cog.

#

Just this one decided to break.

restive furnace
#

it could be different line, send him whole code, ex. in dms

minor kelp
#

Its line 92.

sudden geyser
restive furnace
#

w/out ur tokens etc. and errors could be caused by different lines even tho it saying so

minor kelp
#

ill use pastebin lol

sudden geyser
#

ew

modest maple
#

Lmao

minor kelp
#

still has syntax highlighting

modest maple
#

When you get shown a non tracker paste site and go with pastebin instead

earnest phoenix
#

and ads

minor kelp
#

i have PRO.

modest maple
#

Hastebin is legit partnered with discord

#

Python discord*

earnest phoenix
#

imagine paying to paste text

modest maple
#

Ikr

minor kelp
#

lol

modest maple
#

Ima send the link anyway

minor kelp
#

its spam so

#

its not there

#

"spam"

#

anywayy

earnest phoenix
#
/root/alphaold/handlers/events/disconnect.js:7
      .setAuthor(client.user.username, client.user.displayAvatarURL)
                             ^

TypeError: Cannot read property 'username' of null
    at module.exports.<anonymous> (/root/alphaold/handlers/events/disconnect.js:7:30)
    at module.exports.emit (events.js:321:20)
    at WebSocketConnection.onClose (/root/alphaold/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:400:19)
    at WebSocket.onClose (/root/alphaold/node_modules/ws/lib/event-target.js:124:16)
    at WebSocket.emit (events.js:321:20)
    at WebSocket.emitClose (/root/alphaold/node_modules/ws/lib/websocket.js:191:10)
    at TLSSocket.socketOnClose (/root/alphaold/node_modules/ws/lib/websocket.js:850:15)
    at TLSSocket.emit (events.js:333:22)
    at net.js:668:12
    at TCP.done (_tls_wrap.js:557:7)```
#

help me out in this error

minor kelp
#

wait.

#

client.user.username?

#

wouldnt client.user.user not work?

#

i dont know js so

#

im just guessing here

modest maple
#

Well have a guess seeing that client is different from the bot object

minor kelp
#

to his problem yeh

#

you found the error in mine yet?

modest maple
#

I thought u were talking About u

#

XD

minor kelp
#

hm?

modest maple
#

I'll have to look when I'm on my pc in 10 mins or so

earnest phoenix
#

its correct client.user.username

sudden geyser
#

@earnest phoenix the client has likely not logged in yet

#

are you calling it before its ready

earnest phoenix
#

uhh i didn't put the token yet

#

in the files

#

l o l

minor kelp
#

l o l

earnest phoenix
#

you can't access the data before it's downloaded

#

let me do it

#

and it isn't going to be downloaded unless you log in with an actual token

modest maple
#

@minor kelp what cog was it not loading?

minor kelp
#

Utility.

modest maple
#

Oh wait yeet

#

You can't tell it to load cogs on a class object

minor kelp
#

all other cogs work.

#

and it does it the same way ;-;

modest maple
#

You're saying load this cog: proceeds to send a UN initialised class

#

Only think I can think of

minor kelp
#

How is it uninitialized?

modest maple
#

¯_(ツ)_/¯

minor kelp
#

You're still on your phone.

modest maple
#

Yep

minor kelp
#

This is what loads the cog technically

#
class utility(commands.Cog, name="utility"):
    def __init__(self, bot):
        self.bot = bot
#

and in literally any other cog

#

thats how it looks

#

and it works

sage bobcat
#

One message removed from a suspended account.

minor kelp
#

thats what cogs do

earnest phoenix
#
3|index    |     at Object.exports.fetch (/root/alphaold/node_modules/discord.js/src/client/voice/opus/OpusEngineList.js:27:9)
3|index    |     at AudioPlayer.playUnknownStream (/root/alphaold/node_modules/discord.js/src/client/voice/player/AudioPlayer.js:96:37)
3|index    |     at VoiceConnection.playStream (/root/alphaold/node_modules/discord.js/src/client/voice/VoiceConnection.js:478:24)
3|index    |     at module.exports.playQueue (/root/alphaold/struct/player/Queue.js:84:45)
3|index    |     at processTicksAndRejections (internal/process/task_queues.js:97:5)```
getting this error wjen i play music in my bot just say ``preparing lava link``
minor kelp
#

Fusian

#

Fusion*

#

Error: Couldn't find an Opus engine.

sage bobcat
#

One message removed from a suspended account.

minor kelp
#

You can see that.

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tulip wave
#

But harder to get working

sage bobcat
#

One message removed from a suspended account.

tulip wave
#

Depending on sustem

minor kelp
#

my music doesnt work either lol

earnest phoenix
#

how

#

npm i opus this

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tulip wave
#

Discord.js used node opus or opusscript

minor kelp
#

i really wanna know what has bricked my cog ;-;

sage bobcat
#

One message removed from a suspended account.

tulip wave
#

Delete cog and try again?

sage bobcat
#

One message removed from a suspended account.

minor kelp
#

its one line causing it

sage bobcat
#

One message removed from a suspended account.

minor kelp
#

i dont see an error with that line

#

its the same line for every cog

#

just this one broke

tulip wave
#

Just rewrite the line

sage bobcat
#

One message removed from a suspended account.

minor kelp
#

ok

#

why didnt i think of that

sage bobcat
#

One message removed from a suspended account.

tranquil drum
#
2020-01-21T15:46:26.679564016Z app[worker.1]: [JDA MainWS-ReadThread] WARN net.dv8tion.jda.core.handle.GuildSetupController - Accumulating suspicious amounts of cached events during guild setup, something might be wrong. Cached: 13000 GuildId: [redacted]
2020-01-21T15:46:39.531749642Z app[worker.1]: [JDA MainWS-ReadThread] WARN net.dv8tion.jda.core.handle.GuildSetupController - Accumulating suspicious amounts of cached events during guild setup, something might be wrong. Cached: 14000 GuildId: [redacted]

wtf is happening?

minor kelp
#

Warnings.

#

That's whats happening.

tranquil drum
#

it's eating my memory and im getting java.lang.OutOfMemoryError

#

it's never happened before

earnest phoenix
#

i mean memory issues and errors are normal for java

minor kelp
#

^

tranquil drum
#

pretty sure its not normal for the bot to get 14000 cached guild events immediately after starting

minor kelp
#

find whats causing it to do that

earnest phoenix
#

check if there's any library updates

tranquil drum
#

log says warning is from net.dv8tion.jda.core.handle.GuildSetupController but im looking at the source and nothing in that class logs this

earnest phoenix
#

i have install opus but stoll same error

minor kelp
#

is it loaded?

earnest phoenix
#

???

minor kelp
#

Is

#

It

#

Loaded.

#

@sage bobcat i tried rewriting that line

#

didnt work ;-;

sage bobcat
#

One message removed from a suspended account.

minor kelp
#

:(

sage bobcat
#

One message removed from a suspended account.

minor kelp
#

i hope

earnest phoenix
#
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download 
[@discordjs/opus] Success: "/root/alphaold/node_modules/@discordjs/opus/prebuild/node-v79-linux-x64/opus.node" is installed via remote
npm WARN discord.js@11.5.1 requires a peer of @discordjs/uws@^10.149.0 but none is installed. You must install peer dependencies yourself.
npm WARN wandering-filament@0.1.0 No repository field.

+ @discordjs/opus@0.1.0
updated 1 package and audited 310 packages in 5.753s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities```
#

getting this