#development

1 messages · Page 737 of 1

modest maple
#

How

#

It uses like 500MB ram

#

XD

knotty steeple
#

uh

#

is that reasonable?

#

on a 4gb pc?

#

with all of its resources already used?

modest maple
#

It's pretty reasonable

knotty steeple
#

no it fucking is not

modest maple
#

Depends on what other tasks are taking up reasorces

sudden geyser
#

cpp walks in looking for an ide

modest maple
#

I mean hey the python IDE exists that uses like 50MB ram for python

#

So if you rlly want lightweight

#

Use python

knotty steeple
#

python doesnt need an ide

modest maple
#

Well it does but...

#

XD

#

As for CPP VSC is probs the best

sudden geyser
#

or write in notepad for lightest weight

knotty steeple
#

visual studio*

#

vsc !== vs

modest maple
#

Close enough

knotty steeple
#

not at all

modest maple
#

Idk if jetbrains have a cpp IDE

sudden geyser
#

samurai I knew what they meant

#

they do

#

but no community version

modest maple
#

Oof

knotty steeple
#

i asked for an ide for java stop recommending me to use python because you use it

earnest phoenix
#

i personally use intellij

knotty steeple
sudden geyser
#

do intellij

modest maple
#

You might have to bite the bullet

#

Like 500MB is pretty reasonable even on 4GB

#

That or get more ram xD which on a MacBook is merrrr

knotty steeple
#

actually the macbook has 2gb

#

im not getting more ram just for an ide

sudden geyser
#

yikes

knotty steeple
#

yes its very bad

modest maple
#

F

knotty steeple
#

but for games which i play the core 2 duo helps its case instead of a hecking celeron

modest maple
#

How df do you get by on 2GB ram

sudden geyser
#

my computer has 2 gb too

knotty steeple
#

anything that uses more than 200-300mb besides a game is unreasonable

#

to me anyway

earnest phoenix
#

2gb in 2019

knotty steeple
#

the macbook is from 2019 - 10

earnest phoenix
#

how do yall live without having a breakdown

knotty steeple
#

you see

#

i just minecraft

#

which is still a fucking terribly unoptimized game by itself because java mmLol but

earnest phoenix
#

minecraft & crash because the code is so bad and unoptimized 😎

knotty steeple
#

my friend has 4gb and a pentium

#

they get like 100fps

#

on optifine

#

on the surface

#

i get 30-40

#

the celeron pc is worse i get like 20-30

#

csgo works on this macbook but not on the other pc

#

i play light and indie games most of the time

#

or games with minimal settings

#

i never have more than 4 apps running

#

thats how

distant plank
#

I don't understand why I get this error, can someone help me?

(node:22) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined
let spamdischannels;
    let delspammessage;
    let supsafe;
    let affectbots;

configbd.query(`SELECT * FROM config WHERE id = ${message.guild.id}`, (err, rows) => {
        if (rows.length < 1) {
          configbd.query(`INSERT INTO config (id) VALUES ('${message.guild.id}')`)
          spamdischannels = "relleno";
          delspammessage = 1;
          supsafe = 0;
          affectbots = 1;
        }
        else {
          spamdischannels = rows[0].spamdisabledchannels;
          delspammessage = rows[0].spamdelmsg;
          supsafe = rows[0].supsafe;
          affectbots = rows[0].affectbots;
        }
      })
    
    //Retenciones
    let channelarray = spamdischannels.split(",")
    if (channelarray.includes(message.channel.id)) return;
knotty steeple
#

whatever ur trying to split is undefined

vital lark
#

Array#split doesn't exist (if channelarray is an Array)

sudden geyser
#

A callback is triggered "later". In the callback where you query from your database, the new stuff you set would have not been set in time. So, in reality, you're trying to split undefined. You could move your code within the callback, use promises or set default values.

distant plank
#

@sudden geyser thanks, I put all the code inside and it already works

sudden geyser
#

good work

earnest phoenix
#

How could I use Carl bot reaction role to work with my embedded message?

sudden geyser
#

Ask in the bot support server; not this one.

earnest phoenix
#

@sudden geyser what’s the link

sudden geyser
shy turret
outer niche
#

i do not know what to do

slender thistle
#

Either wrong env var or you didn't install dblpy

outer niche
#

what is a dbltoken

slender thistle
#

Your bot's token generated by DBL for authentication use on https://top.gg/

outer niche
#

how wud i get it

slender thistle
#

or on your bot's Edit page

outer niche
#

so the api key @slender thistle

slender thistle
#

Yes

outer niche
#

oo ok thx

slender thistle
#

Did you read the example

outer niche
#

what example

slender thistle
outer niche
#

this duz not help me

#

i still dont git it

slender thistle
#

Well did you provide your Client/Bot instance to the DBLClient

#

under argument bot

outer niche
#

i am so cunfused

slender thistle
#

You need to pass a botkwarg to DBLClient

#

the value of that kwarg must be either your Bot/Client

outer niche
#

so thes

#

?????

slender thistle
#

What's the difference between them

#

Is bottoken your bot's Discord token

#

DBL and Discord tokens are different

outer niche
#

ik i put the api key i whar it ses dbl and discord whar it ses bot

slender thistle
#

Where are you trying to create DBLClient

outer niche
#

in the code

slender thistle
#

Do you have bot variable accessible at the time of creating an instance of DBLClient

outer niche
#

is the dblclient the api key

slender thistle
#

What

outer niche
#
bottoken = "bottoken"

bot = DBLClient(token=dbltoken)
bot = discord.Client()

@bot.event
async def on_guild_join(server):
    await client.post_stats(jsonObject={
        "server_count": len(bot.servers)
        })

@bot.event
async def on_guild_leave(server):
    await client.post_stats(jsonObject={
        "server_count": len(bot.servers)
        })```
#

that is what i have

slender thistle
#

Why are you naming your discord.Client a bot and DBlClient a client

#

Why are you using bot.servers

#

Why are you accessing a variable that does not yet exist (DBlClient needs a bot, you are only declaring it one line below)

outer niche
#
bottoken = "bottoken"

bot = DBLClient(token=dbltoken)
bot = discord.Client()

@bot.event
async def on_guild_join(server):
    await client.post_stats(jsonObject={
        "server_count": len(bot.servers)
        })

@bot.event
async def on_guild_leave(server):
    await client.post_stats(jsonObject={
        "server_count": len(bot.servers)
        })```
#

so that

slender thistle
#

Do you know how variables work in Python

outer niche
#

no

slender thistle
#

Welp

#

You won't get far at this rate

#

Do you mind looking at your code and telling me how you would use DBLClient and discord.Client at the same time

#

without them interfering with each other

outer niche
#

idk i am so tired i have ben at this all day

#

atm i am tring to ferger ot the error

vital lark
#

what shivu is trying to say is, append bot in the DBLClient's constructor

#

i.e bot=bot

slender thistle
#

I don't know how to make myself clear without literally spoonfeeding

outer niche
#

so it is not bot.event

vital lark
#

that's not were talking about...

slender thistle
#

What do you think I meant by DBLClient arguments

outer niche
#

so it is bot.bot

slender thistle
#

?????

outer niche
#

idk

slender thistle
#

Do you know what function arguments are

outer niche
#

yes i am sorry i am done with this i am so tirerd

ember atlas
#

What are possible reasons my bot is not registering any new commands I make?

earnest phoenix
#

How would I make it, so a bot would change the nickname of everyone except bot users

sudden geyser
#

Check if your user object in whatever language or library has a property that tells if the user's a bot or not.

#

for example: Discord.js can be found with <User>.bot

#

@ember atlas, could you explain how you're registering them and what language/library?

ember atlas
#

I think i figured it out

#

Thanks anyways tho 🙂

earnest phoenix
#

ok

west raptor
#

@earnest phoenix filter them out

earnest phoenix
#

how

west raptor
#

<members>.filter(m => !m.user.bot)

#

In Javascript

earnest phoenix
#

oh ok

#

thanks dream

west raptor
#

Np

earnest phoenix
#

i want to make a bot

#

make it

loud salmon
#

did you read faq

#

@earnest phoenix it says ask for additional help. not to start here

earnest phoenix
#

oh

formal vine
#

so I own a rasberry pi 2, anyone know of some cool things I can do on it? Related to games, bots etc

#

I don't have the slightest idea

loud salmon
#

👏 pi 👏 hole 👏

formal vine
#

what does that even mean

raw kayak
#

Does anyone know how to make my bot stay online 24/7

loud salmon
formal vine
#

leave prompt open

loud salmon
#

@formal vine https://pi-hole.net/

raw kayak
#

Ph sorry

formal vine
#

I kinda read what it said but can you explain exactly what it is

#

lmfao

#

i'm confused

loud salmon
#

adblocker but network wide

#

instead of browser wide

merry tundra
#

hello

#

i have a problem

#

the token of the first application was enterd

#

and i want to change the bot by the new bot

modest maple
#

Just use the new token of the new app

#

And use that token in Ur bots code

merry tundra
#

@modest maple iwant them to change the id of the bot

formal vine
#

Would anyone be able to assist me with a code that adds up the amount of times that someone has typed in a command, and then they are able to see and use that information themselves.

modest maple
#

@merry tundra your Bot ID would change with your new bot application

#

If you want to add a new bot to DBL / change the bot to a different one you'll need to go back through the approval process

sonic bay
#

@normal epoch

gilded plankBOT
#

tickNo This user has no bots

wheat jolt
modest maple
earnest phoenix
#

I can’t get my bot online anyone know how

#

which lib are you using

sterile minnow
#

@earnest phoenix wich libary do u using?

restive furnace
#

Whats wrong with my configuration?

  port: 2333
  address: 0.0.0.0
lavalink:
  server:
    password: "secret"
    sources:
      youtube: true
      bandcamp: true
      soundcloud: true
      twitch: true
      vimeo: true
      mixer: true
      http: true
      local: false
    bufferDurationMs: 400
    youtubePlaylistLoadLimit: 1000 # Number of pages at 100 each
    youtubeSearchEnabled: true
    soundcloudSearchEnabled: true
    gc-warnings: true

metrics:
  prometheus:
    enabled: false
    endpoint: /metrics

sentry:
  dsn: ""
#  tags:
#    some_key: some_value
#    another_key: another_value

logging:
  file:
    max-history: 30
    max-size: 1GB
  path: ./logs/

  level:
    root: INFO
    lavalink: INFO```
my (vps) os is linux 
it doesnt give any errors, it just dont play it
#

(lavalink related)

#

(and yes the jar is running on the vps as a sudo, i tried it without sudo too but same result)

prime cliff
#

The console should always report errors for lavalink

restive furnace
#

I dont get any errors but i do get warnings :

WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils$1 (jar:file:/home/ubuntu/LavalinkFolder/Lavalink.jar!/BOOT-INF/lib/spring-core-5.0.6.RELEASE.jar!/) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release```
earnest phoenix
#

see if there are any newer lavalink builds

restive furnace
#

k

#

rn its 2.0.2

#

on my home pc i dont get any errors neither warnings

earnest phoenix
#

try to use that

restive furnace
#

k

#

wow my build in vps wa s582

#

lol

sterile minnow
#

Has someone a idea how to implement Spotify to a JS music Bot?

earnest phoenix
#

you're not allowed to

#

it's against spotify's TOS

sterile minnow
#

shit okay

#

And soundcloud or sth?

earnest phoenix
#

yeah soundcloud is allowed

earnest phoenix
modest maple
#

go to DBL

#

go to edit on your bot

#

copy the Url in Markdown

#

and change SVG to PNG

earnest phoenix
#

ok thanks kalps

shy turret
#

@earnest phoenix

#

https://top.gg/api/widget/<bot id>.svg

#

simple way

modest maple
#

.PNG* @shy turret

#

SVG won't get loaded in an embed

shy turret
#

https://top.gg/api/widget/<bot id>.png

#

oh lol ok

earnest phoenix
#

ok i did

shy turret
#

gg

trail reef
#

Would discord.js or discord.py be better for bot dev? I currently use discord.py because I know python but I was wondering if there would be any advantage to using discord.js

modest maple
#

nope

#

ur better off using a programming language you are experienced with

#

rather than switching to a language you dont know well

trail reef
#

any performance benefits of using one over the other?

modest maple
#

not really

trail reef
#

Is one updated more than the other?

modest maple
#

nope

trail reef
#

Ok thanks so much!

modest maple
#

np

valid frigate
#

mfw

#

node is good for real time apps and that includes discord bots

#

but if you're already good at python

#

¯\_(ツ)_/¯

quartz kindle
#

both python and node are bloated interpreters, so they are equally okay-ish (not good not bad)

#

which in modern day computing is not a big deal anyway

#

anyone here has experience with vert.x and/or es4x?

formal vine
#

if I were going to change my bots status, what folder should I put the code in.

#

the actual folder where all of the command code and stuff is in or what

#

file*

earnest phoenix
#

yes

formal vine
#

thanks

earnest phoenix
#

ur wlcome

#

welcome *

west raptor
#

@formal vine uh probably your ready event

manic light
earnest phoenix
#

try cleaning some commands

#

man my bot is saying on console:
user is undefined

manic light
#

in .git

#

its 100mb

#

but

#

whats inside idk

earnest phoenix
#

because i have client.user.setPresence()

#

so what i do

manic light
#

if u send all code page

#

i can fix for u

earnest phoenix
#

its not the code

#

its the package problem

#

discord.js

#

just client.user.setPresence() is getting problem

#

because i use glitch

restive furnace
#

@earnest phoenix wdym

#

@manic light if u use sqlite db on glitch it fills up pretty fast please move it to vps or somewhere if u wnat to save your bot

earnest phoenix
#

SuperHero when i have this comamnd in index.js client.user.setPresence() it says cannot read user of undefined

manic light
#

i m using json and yes i need to use vps but im scared about lost my data

#

and glitch have rewind

#

jsons are not stable

restive furnace
#

use sqlite

#

or mysql

#

or postgres

manic light
#

i have so many users

restive furnace
#

@earnest phoenix d.js version? your client name (like const bot = new Discord.Client())?

manic light
#

i cant

#

transfer i think

#

or i dont know

restive furnace
#

you cant but u need to or ur json files will rip always

#

or just make like users/userid.json

#

ez fix

#

xd

manic light
#

XD

earnest phoenix
#

discord.js: 11.5.1
const client = new Discord.Client()

manic light
restive furnace
#

Where you are doing this? on external file or main file?

manic light
#

attachments using disk space from glitch ?

restive furnace
#

of course if u saved them there 🤦‍♂️

#

@earnest phoenix

earnest phoenix
#

index.js

restive furnace
#

is it ur main file

earnest phoenix
#

yes

manic light
#

im using background for profiles .s

restive furnace
#

and it is on client.once('ready', () => {
//here?
})

earnest phoenix
#

yes

#

client.on("ready", async (message, client) => {}

restive furnace
#

client.user.setActivity('Hello', {type: 1}) //1 listening, 2 watching, 0 playing, 3 streaming if i remeber right
client.user.setStatus('idle')

#

make it to

earnest phoenix
#

i dont use that

restive furnace
#

client.once('ready', () => {}

#

use it it will fix it

#

if this doesnt fix it

#

client.once('ready', () => {}

earnest phoenix
#

but its not the client.once

#

or client.on

restive furnace
#

you dont need to declare client again if yits on main file and ready event doesnt have message property

#

make it to that what i send.

earnest phoenix
#

...

#

i used client.on("message"){}
and nothing happens

restive furnace
#

hmhm

#

bruh

earnest phoenix
#

just work normal

#

the client.on("message")
looks normal

restive furnace
#

Ready event is:
client.on(ce)("ready", () => {})
Message event is:
client.on("message", async message => {})

earnest phoenix
#

oh

#

so why the console.log(Mudando o status para: ${presence + " " + mudador.name}...) works normal?

restive furnace
#

??

earnest phoenix
#

look at the screenshot

#

theres a console.log

#

saying what presence my bot will put

#

why is this works normal

lavish shuttle
#

client.on(ce)("ready", () => {})

#

What's the (ce) doing there?

restive furnace
#

once

#

or on

lavish shuttle
#

Ahhh

earnest phoenix
#

.

#

ahh god

#

this is happening

#

Cannot read property 'user' of undefined

restive furnace
#

make it like let statuses = [
"playing",
"other playing"
]
let games = [
"game",
"other game"
]

earnest phoenix
#

status

restive furnace
#

is ur ready event still this client.on('ready', (client, message) => {})??

earnest phoenix
#

becuase i need client to modify the presence

restive furnace
#

delete client and message there firstly....

#

If its main file YOU DO NOT need to redeclare CLIENT

#

bruv

earnest phoenix
#

client.on("message") is on main file

restive furnace
#

🤦‍♂️

#

Ready event is:
client.on("ready", () => {})
Message event is:
client.on("message", async message => {})

Make those into THESE

earnest phoenix
#

done

restive furnace
#

now it should work then

earnest phoenix
#

worked!

ember atlas
#
const emoteargs = args.join(' ')
        if (!emoteargs) return message.channel.send('Provide an emote!')
        const emote = client.emojis.get(emoteargs) || client.emojis.get(e => e.name.toLowerCase().startsWith(emoteargs.toLowerCase()))


        if (!emote) return message.channel.send('Invalid Emoji!')

Anyone know what is wrong with this? For some reason, it shows invalid emoji when I try the emoji name, and works fine with ID

umbral field
#
        if (!emoteargs) return message.channel.send('Provide an emote!')
        const emote = client.emojis.get(emoteargs) ||client.emojis.get(emoteargs).id || client.emojis.get(e => e.name.toLowerCase().startsWith(emoteargs.toLowerCase()))


        if (!emote) return message.channel.send('Invalid Emoji!')
#

@ember atlas

ember atlas
#

ya same thing

late hill
#

bruh

#

get() for id find() for a function

ember atlas
#

?

late hill
#

client.emojis.get(id) || client.emojis.find(e => e.name === name)

ember atlas
#

oh you gotta use find for that part

#

Perfect, thank you.

valid frigate
#

mfw spoonfeed

shy rose
#

does anyone know a linter that will pick this up

(async()=>{
    console.log("Hang starts");
    await new Promise((resolve)=>{
        // Linter error here for no resolve
    })
    console.log("Promise drops")
})()

as far as ive found eslint nor jshint have it

#

*for vs code

sudden geyser
#

Do you have eslint configured to check for functions not returning anything (I think it's a rule)

shy rose
#

so would need the style of return resolve("idk") with that rule?

formal vine
ember atlas
#

Cant even read line 141

#

Can you paste it into a hastebin

formal vine
#

click the gyazo link and zoom in not the picture

#

I just did the same thing

ember atlas
#

still couldnt see it

#

would help if you could just hastebin

supple oar
#

whats with line 141?

formal vine
#

everything was working before I added that link Chevron

mossy vine
#

you have unclosed () somewhere

formal vine
#

line**

supple oar
#

ha right didnt check the right side sorry sec

formal vine
#

I have no idea where though lol

mossy vine
#

we dont either without the full code lol

supple oar
#

copy your code, paste it into the left side of

#

it will auto format on the right side when its working

#

until then you should see your error

formal vine
#

It says 153:1 is that the ink I should be lookigng at or what

#

line*

#

idk why I can't type line

supple oar
#

can you screenshot the browser tab?

shy rose
supple oar
#

@formal vine tbh too much that we cant see there, can you create a pastebin?

formal vine
#

with the code in it?

modest maple
#

hatebin

supple oar
#

if its possible

#

id have this fixed in vscode in no time

#

or a repo link if its on github

ember atlas
#

@formal vine can you paste the code in here and save it and send the link?

formal vine
#

Sure, doing it now

#

So I pasted it in and pressed save, and now what lol I don't see a copy link option

ember atlas
#

link changes in the addreess bar

supple oar
#

doesnt for me either rn

#

Something went wrong!

ember atlas
#

oh

supple oar
#

seems broken atm

formal vine
#

Yea I think it is

ember atlas
#

try hatebin

formal vine
supple oar
#

you have one } too much after your client.user.setActivity('with your head', { type: 'PLAYING', url: 'https://www.youtube.com/hierogg', });

ember atlas
#

^

formal vine
#

Fixed it! Thanks lol, I'm confused though, that was working just fine before lol

#

that part*

#

Wait now when I try and run it in cmd it doesn't say error or anything., It just doesn't go online

sudden geyser
#

just saying: You shouldn't update your bot's status for every sent message

formal vine
#

am I doing that? I legitimatley don't know

vital lark
#

is it in the .on('message') or .on('ready')

#

where that line of code to edit the presence is at

formal vine
#

Hypothetically, would you make fun of me if I had no clue what that meant?

vital lark
#

no

#

we're here to help you, not to bully you

formal vine
#

Phew, well I have no clue what that means.

vital lark
#

what I'm saying is:

#

where is you are editing the bot's presence at

#

like which event are you emitting from

#

i.e ready or message

formal vine
#

message i believe

modest maple
#

thats bad

#

spams API

vital lark
#

^

modest maple
#

do it under ready

vital lark
#

move that to the ready event

formal vine
#

Okay, I think I have it fixed. But the reason it's messing up is because I'm trying to add a third command. I just need to write code like the whole !ping pong thing Except obviously replace the !ping with my own command and ping with my own response.

earnest phoenix
#

How do I submit my bot into the website?

loud salmon
#

-faq 1 @earnest phoenix

gilded plankBOT
#

@earnest phoenix

Frequently Asked Questions 📜
viral plover
#

For some reason my bot is crashing without leaving any sort of crash log.
Are there specific issues that can cause a bot to crash without leaving a crash log?

earnest phoenix
#

no

#

you aren't handling your errors properly

viral plover
#

How do I handle them properly?
I'm used to getting crash logs and appropriately fixing the bug after knowing what's going on. I don't know what's changed to cause a lack of logs.

earnest phoenix
#

i dont know

atomic quarry
vital lark
#

?== doesnt exist in JavaScript

#

use !==

atomic quarry
#

Ok

sick cloud
#

learn js before trying to make a bot

viral plover
#

My issue was I was using console.error(); instead of console.error;.

sudden geyser
#

so something like bot.on("error", console.error())?

viral plover
#

More like whenever a message was sent I had .catch(console.error());.
It never caused any issues until now because none of the things that used it caused crashes.

supple oar
#

can you override a previously sent embed with a regular string response, removing the embed, whilst editing?

earnest phoenix
#

yes

supple oar
#

embeds via objects too?

#

I dont use new RichEmbed(), hence

earnest phoenix
#

uh

#

what

west raptor
#

??

supple oar
#

I'm not using Discord.RichEmbed()

#

but .send( { embed: { ... } })

supple oar
#

simply overwriting it with sentMsg.edit('foo') doesnt remove the embed

earnest phoenix
#

well yes

#

you are editing the content

#

not the embed

#

refer to the docs

#

the edit method takes in an options object

supple oar
#

the docs dont mention deleting an embed by overwriting it with text

earnest phoenix
#

you can set the embed to null

#

well

#

use common sense

supple oar
#

wew, one way to be a dick

earnest phoenix
#

????

supple oar
#

if it was common sense, i wouldnt ask

west raptor
#

or maybe this is stuff you should know ¯_(ツ)_/¯

#

cry isn't being a dick at all

earnest phoenix
#

if you have a drawing and want to write text without the drawing on the same paper you would have to erase the drawing first, no? (assuming you can't flip the paper)

that is, my guy, common sense

west raptor
#

and you could just as easily looked at the docs

supple oar
#

how so, again, the docs dont mention it, I started using discordjs less than 5 hrs ago 🤷

earnest phoenix
#

that's why i told you to use common sense

#

not every single use case has to be documented

supple oar
#

so you tell me to refer to the docs

#

yet the docs dont mention it

west raptor
supple oar
#

because the docs dont need to mention it

#

solid

earnest phoenix
#

i told you to see the docs to see what the edit method takes

#

aka to see what the options object offers

supple oar
#

it only says accepts an object

#

not null, e.g.

earnest phoenix
#

welcome to oop 👏

#

an object can be null or undefined

west raptor
#

optional

supple oar
#

has literally nothing to do with oop lol

#

yeah its working fine

earnest phoenix
#

d.js is literally oop but ok

atomic quarry
#

Every time I try putting a code in so my bot has a status the code has an error

earnest phoenix
#

what is the error and what lib are you using

atomic quarry
#

TypeError: Cannot read property 'setStatus' of null
at /home/runner/index.js:28:14
at Script.runInContext (vm.js:133:20)
at Object.<anonymous> (/run_dir/interp.js:156:20)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)Server started

#

Thats what it says

earnest phoenix
west raptor
#

could honestly just get the snippit where it's running

earnest phoenix
#

hard to read on mobile

west raptor
#

ah i see

earnest phoenix
#

it also reduces the clutter in chat ig

atomic quarry
#

Would you like me to dm the link?

earnest phoenix
#

no need

#

you can just send it here

atomic quarry
west raptor
#

I would put it inside the ready event

earnest phoenix
#

^

west raptor
#

ensures user is actually there

earnest phoenix
#

the client is not really populated until ready is fired

atomic quarry
#

Ok

#

@earnest phoenix Can you show me where the status will go?

earnest phoenix
#

what do you mean

west raptor
#

inside the ready event

#
client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});```
atomic quarry
#

Ok

near ether
#

is there a way to check when all shards have spawned?

#

manager.spawn().then(code) executes code after the first shard has spawned

modest maple
#

Isn't somthing like on_shard_ready()

earnest phoenix
#

throw err;

^


Error: Cannot find module 'express'

at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)

at Function.Module._load (internal/modules/cjs/loader.js:508:25)

at Module.require (internal/modules/cjs/loader.js:637:17)

at require (internal/modules/cjs/helpers.js:22:18)

Jump Toat Object.<anonymous> (/app/server.js:6:15)

at Module._compile (internal/modules/cjs/loader.js:701:30)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)

at Module.load (internal/modules/cjs/loader.js:600:32)

at tryModuleLoad (internal/modules/cjs/loader.js:539:12)

at Function.Module._load (internal/modules/cjs/loader.js:531:3)

#

hi my hastebin I get this error in the log of my site. the site is not running because of this error. I don't know how to fix this problem please help!

vital lark
#

it's saying the express module isn't found

#

might wanna npm i

earnest phoenix
#

no, I already loaded the express module into the file.

vital lark
#

did you install the dependencies

earnest phoenix
#

can you help me if I throw you the file, please?

vital lark
#

I am literally telling you the solution

earnest phoenix
#

I don't know, so I don't know how to do it.

quartz kindle
#

Do you have a package.json file?

#

Did you add express to it?

earnest phoenix
#

yes, I installed the express module there.

quartz kindle
#

If yes, use the command npm install if not, use the command npm install express. If you are hosting your bot in glitch, use the command enable-pnpm

earnest phoenix
#

it's not a bot, it's a hastebin site, it's an html project.

quartz kindle
#

Ok

#

Where is it hosted?

earnest phoenix
quartz kindle
#

Then run enable-pnpm

#

In the console

earnest phoenix
#

Ok

near ether
#

Tim how do you know so much

#

It feels like you know the answer to literally every question lmao

quartz kindle
#

Im good at insta-googling

near ether
#

I see you’ve mastered the art of google-fu

earnest phoenix
#

@quartz kindle dude, I'm sorry I couldn't do it. please come and do it.

modest maple
earnest phoenix
#

😢

quartz kindle
#

What do you mean you couldnt do it?

#

Explain what you tried

earnest phoenix
#

I couldn't try.I couldn't. I'm a failure.

quartz kindle
#

That doesnt help

#

Do you know where is the glitch console?

earnest phoenix
#

No @quartz kindle

quartz kindle
#

Click on "logs"

#

Then there should be a console button

earnest phoenix
#

hey guys how shall i make a rich embed

#

i had forgot cause i had left coding for few moths

#

Discord.js v11.5.1: new Discord.RichEmbed().setColor('#something')...
Discord.js v12: new Discord.MessageEmbed().setColor('#something')...

knotty steeple
#

@earnest phoenix are you using discord.js

earnest phoenix
#

yep

#

with a command

#

read message before

lunar crystal
#
    if(message.content === prefix + 'help') {
    const embed = new RichEmbed()
    .setTitle('**Voici la liste de mes commandes**')
    .setAuthor('Vitas®', 'https://i.imgur.com/pNldz9u.jpg')
    .setColor('#679ec5')
    .setDescription('**Mon Préfix est `!7`**')
    .addField('**Commande de modération**', '`ban` `kick`')
    .addField('**Commande utilitaire**', '`ping` `info` `serverinfo`')
    .addField('**Commande Fun**', '`caresse`')
    message.channel.send(embed);
    }
  });```
#

@earnest phoenix

earnest phoenix
#

thanks man

knotty steeple
#

no

#

dont fucking

#

spoonfeed

lunar crystal
#

But u can put a lot of features

#

Here is the main guide

knotty steeple
#

yes shouldve posted that first

lunar crystal
#

Yep sorry ^^'

earnest phoenix
#

i understand

#

ok

lunar crystal
#

For making an embed you have to put .setColorand .setTitle at least

knotty steeple
#

i dont get why people need rich embeds when you can just use the embed message arg

#

i guess its easier

earnest phoenix
#

.addField('title' , 'description')

knotty steeple
earnest phoenix
#

ı was ıu uub

late hill
#

Maybe less useful when simply using the discord.js one, but I made my own class for embeds (as eris doesn't have any) which I consider quite useful because it allows me to set defaults and such

#

If you're simply creating a "raw" embed object each time, it would be less flexible

earnest phoenix
#

ReferenceError: MessageEmbed is not defined
at Client.client.on.message (C:\Users\mythri.sathyan\Desktop\ra\folder\my bots\apptest\bot.js:30:21)
at Client.emit (events.js:203:15)
at MessageCreateHandler.handle (C:\Users\mythri.sathyan\Desktop\ra\folder\my bots\apptest\node_modules\discord.js\src\client\websocket\packets\handlers\MessageCreate.js:9:34)
at WebSocketPacketManager.handle (C:\Users\mythri.sathyan\Desktop\ra\folder\my bots\apptest\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:105:65)
at WebSocketConnection.onPacket (C:\Users\mythri.sathyan\Desktop\ra\folder\my bots\apptest\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\mythri.sathyan\Desktop\ra\folder\my bots\apptest\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users********\Desktop\ra\folder\my bots\apptest\node_modules\ws\lib\event-target.js:120:16)
at WebSocket.emit (events.js:198:13)
at Receiver.receiverOnMessage (C:\Users******\Desktop\ra\folder\my bots\apptest\node_modules\ws\lib\websocket.js:789:20)
at Receiver.emit (events.js:198:13)

#

why does it show me this error

#

d

#

because the embed is not defined

modest maple
#

legit when you get an error read the first line

earnest phoenix
#

f

#

i did

#

._.

#

just found it out

#

i hadnt created the embed variable

#

error continues so i decided to delete everything madman

restive furnace
#

Why this wont work? js const dbl = require('dblapi.js'); dbl.getVotes().then(votes => { if (votes.find(vote => vote.id == message.author.id)) message.channel.send('You have been voten!'); else message.channel.send('What? You have not voted me today, pleas evote here: https://top.gg/bot/.'); });

#

error: TypeError: dbl.getVotes is not a function

#

oh yeah lets move into api

earnest phoenix
#

who can send me "server stats" code please i so need :'|

modest maple
#

no spoon feed

#

what Programming langauge r u using

knotty steeple
earnest phoenix
#

i use glitch

#

what language?

modest maple
#

no

modest maple
#

@earnest phoenix what programming language

#

not what host

earnest phoenix
#

like what, I could not understand

#

Explain me what .py classes do and why is one used here

#

v

#

please

modest maple
#

read^

knotty steeple
#

they're a class

#

¯_(ツ)_/¯

#

lul

modest maple
#

@earnest phoenix what did you make your bot with?

earnest phoenix
#

fine

#

this can help you ?

modest maple
#

did you actually code any of that urself

earnest phoenix
#

no

#

ok

#

learn js before coding a bot in js

modest maple
#

learn how to use JS

earnest phoenix
#

this so hard

#

i use ready command

#

well you should've familiarized yourself with js before trying to make a whole project in the language

modest maple
#

^

#

not just C+P code

#

as for @earnest phoenix watch some tutorials about classes and the basics of python

earnest phoenix
#

):

modest maple
#

did tell you to learn the basics WELL

earnest phoenix
#

But, i, learnt, them with sites

modest maple
#

you clearly dont know the basics if you dont know what a class is

earnest phoenix
#

Where is W3 schools site

modest maple
#

what

earnest phoenix
#

who can help me ?

modest maple
#

LEARN JS THEN COME BACK TO US

#

weve told you this already]

#

you have no idea what your code is doing cuz its just copy and pasted

#

and we're not gonna spoon feed you

earnest phoenix
#

i don't have free time

modest maple
#

or baby sit your through learning the basics os JS

earnest phoenix
#

then don't make a bot lmao, you must not have time to make a bot too

i don't have free time

#

Ohh so classes redirect you to stuff or what

modest maple
#

functions and classes are used to break up code and so it can be called again

earnest phoenix
#

makes no sense to me

modest maple
#

say we have a function called find(User)

#

we use it as a function / subrutine

#

because we need it lots of time in the main code

#

and to save us writing out the same code

#

over and over again

#

we just call the subrutine again

earnest phoenix
#

can't i like assign the name and age on 2 variables

modest maple
#

what

earnest phoenix
#

or add

modest maple
#

your missing the point

earnest phoenix
#
user1 = ['Ralph', '15']
print('Hi my name is, ' + user1[0] + " and i'm " + user1[1] + ' years of age!')```
modest maple
#

you are completly missing the point

earnest phoenix
#

iuhhhhhhhhhh

modest maple
#

its not about making stuff into one string etc...

#

like i said

#

read up on the basics

earnest phoenix
#

I'm so dumb

modest maple
#

and watch tutorials

earnest phoenix
#

This is complicated than w3 school

modest maple
#

welcome to the basics of every programming language ever

earnest phoenix
#

Welcome to headache

modest maple
#

its rlly not that bad

earnest phoenix
#

Corey Schafer save me

#

Is this the right video

#

Confused

modest maple
#

watch all of them

earnest phoenix
#

Screams in agony

slender thistle
#

You don't learn programming by taking 5 minutes to read what X lang can do

modest maple
#

^

#

i mean he was warned

#

to learn the basics

#

and then got told what the 'basics' included

#

like OOP

rugged minnow
#

ok, quick question
i made my bot in a way that it searches inside a folder for .js files, how do i make my bot search for both .js files in that folder and .js files inside another folder on the same directory as the same files?
ex

|__command1.js
|__command2.js
|__music
|____play.js
|____stop.js```
rugged minnow
#

thanks

west spoke
#

that's why python is better for beginners

indigo geyser
restive furnace
#

How i can make this working const attachment = new Discord.MessageAttachment('../test.png'); its giving cannot read id of undefined on that line.

#

(it saves on local: but dont send it)

earnest phoenix
#

which version of d.js are you using

restive furnace
#

11.5.1

earnest phoenix
#

then you have to use Attachment

#

MessageAttachment is for entities returned from the api

restive furnace
#

kk

opaque eagle
amber fractal
#

Lmfao

opaque eagle
#

Why do I have 11 listeners?

#

I remove them in my code

#

but apparently they don't get removed

sudden geyser
#

Look at <Client>._events and see what you're listening to.

opaque eagle
#

Client._events: [Object: null prototype] { debug: [Function (anonymous)], error: [Function (anonymous)], guildBanAdd: [Function (anonymous)], guildBanRemove: [Function (anonymous)], guildCreate: [Function (anonymous)], guildMemberAdd: [Function (anonymous)], guildMemberRemove: [Function (anonymous)], messageCreate: [Array], messageDelete: [Function (anonymous)], messageDeleteBulk: [Function (anonymous)], messageUpdate: [Function (anonymous)], ready: [Function (anonymous)], warn: [Function (anonymous)] }

sudden geyser
#

For example, I'm pretty sure this will create two separate instances so it won't be able to remove it: this.client.removeListener("messageCreate", e => this.listener(e));

opaque eagle
#

Client._events.messageCreate: [ [Function (anonymous)], [Function (anonymous)], [Function (anonymous)], [Function (anonymous)], [Function (anonymous)], [Function (anonymous)], [Function (anonymous)], [Function (anonymous)], [Function (anonymous)], [Function (anonymous)], [Function (anonymous)], warned: true ]

#

oh

#

what can i do to make them the same function

sudden geyser
#

You could do a dummy like this.fn = (e) => {...} and do this.removeListener("messageCreate", this.fn) and it should be able to work.

#

but that's my guess from running into this same issue before

opaque eagle
#

trying that now

#

oh it works now, ty

opaque eagle
#

Do u guys know how some ppl have just a plain .eslintrc file? no .js, no .json, just .eslintrc... how does that work?

restive furnace
#

Its eslinter config file

teal river
#

hello i'm brazilian wanted to know how to make a discord bot

modest maple
ember atlas
#

If i wanted to check in a guild member add event if a certain member joined a circle guild to add a role how would i do that?

modest maple
#

@slender thistle is sending files with D.py still send_file or did they change it in rewrite?

slender thistle
#

file kwarg in .send iirc

#

or files

modest maple
#

ty ty

earnest phoenix
#

i need server stats code

modest maple
#

LEARN JS

#

weve told you this before

amber fractal
#

this isnt the place to be spoonfed code

modest maple
#

its the 3rd time hes asked

#

his bot is just C+P

west raptor
#

@earnest phoenix we cannot and will not spoonfeed you code for "server stats," asking again will result in a mute

jaunty stump
#
client.on('guildMemberAdd', member => {
      let channel = message.guild.channels.find(channel => channel.name === "welcome");
      let memberavatar = member.user.avatarURL
       if (!channel) return;
       const embed = new Discord.RichEmbed()
       .setColor('#00ffff')
       .setThumbnail(memberavatar)
       .addField('\:wave: / Welcome!', `${member}`)
       .addField('\:fox: / Here you go. A role for your stay', `New`)
       .setFooter(`Message sent by Aang`)
       .setTimestamp()
    
       channel.sendEmbed(embed);
    
    
       var role = member.guild.find(role => role.name == 'New');
    
      member.addRole(role)
    });

For some reason this code won't work. I have a friend join the server while the bot is online and has the right perms and role hierarchy. and it does nothing..no Error in console log, no message being sent to the welcome channel and no role being given to the new member. I am pulling my hair out trying to get this to work.

any help?

vital lark
#

seems like role and channel are undefined and can't be found by cache

jaunty stump
#

how would I go about fixing that?

wheat jolt
#

try to use channels.get('ID OF THE CHANNEL HERE')

#

instead of channels.find

jaunty stump
#

I have, same thing.

vital lark
#

get will return undefined if it's not in the cache

#

I think the channel and/or role isn't being added by the cache for some reason

jaunty stump
#

I don't get undefined errors is the thing

earnest phoenix
#

seems like role and channel are undefined and can't be found by cache
roles and channels will always be cached

#

learn how to debug

#

step through your code and see where it stops working

#

well they are trying to use a message object to find a channel but there is no message param in that event

jaunty stump
earnest phoenix
#

what are the errors

#

nice, i can read your mind and tell what the error is

late hill
#

That's not even his issue

#

@jaunty stump You're using message in a guildMemberAdd event

earnest phoenix
#

they changed that, see the link above

late hill
#

o

#

ok 🏃

jaunty stump
#

here the errors that I get with the code in the link I posted

(node:16660) DeprecationWarning: Collection#find: pass a function instead
(node:16660) DeprecationWarning: TextChannel#sendEmbed: use TextChannel#send instead
(node:16660) DeprecationWarning: Collection#find: pass a function instead

earnest phoenix
#

well, do what it says

#

???

#

Well your using deprecated methods lol

#

^^^

jaunty stump
#

So I used the other stuff in the original code I posted

earnest phoenix
#

also that's a warning not an error

vital lark
#

^

jaunty stump
#

back to the code I posted earlier that doesn't throw that shit at me in console log.
It still doesn't want to work no matter how much I "Fix" it

earnest phoenix
#

you got told two times what the issue is

jaunty stump
#

Sorry, I didn't see it with you and your corrections to the way I say things. I will look back through the chat to try and find it again

rustic axle
#
const spawn = require('child_process').spawn
let child = spawn(msg.content.split(" ").slice(1).join(" ")) // Spawn <command>

child.stdout.on('data', function(c) {
         msg.channel.send(c)
})

child.stderr.on( 'data', data => {
    msg.channel.send('ERR: ' + data);
})```
So I have this code above where if the user types `>sh <command>` it executes the command. However, I am having some issues. For any command, Windows, and Linux, I always get the issue of `spawn <command> ENOENT`. Anyone have some advice?
jaunty stump
#
client.on('guildMemberAdd', member => {
      let channel = member.guild.channels.find(channel => channel.name === "welcome");
      let memberavatar = member.user.avatarURL
       if (!channel) return;
       const embed = new Discord.RichEmbed()
       .setColor('#00ffff')
       .setThumbnail(memberavatar)
       .addField('\:wave: / Welcome!', `${member}`)
       .addField('\:fox: / Here you go. A role for your stay', `New`)
       .setFooter(`Message sent by Aang`)
       .setTimestamp()
    
       channel.sendEmbed(embed);
    
    
       var role = member.guild.find(role => role.name == 'New');
    
      member.addRole(role)
    });

changed the code and still nothing

earnest phoenix
#

step through your code and see what's going wrong

#

aka debug

vital lark
#

maybe console log the values

#

and see what's the problem

west raptor
#

console.log("GOT HERE ${maybe some value here idk}")

earnest phoenix
#

lol

#

i mean writing to console does it

#

but it's just not as effective when compared to actual debugging tools like breakpoints, inspecting a variable etc

west raptor
#

if im being honest ive never actually used a real debugger

jaunty stump
#

I give up with asking for help here
All I wanted was a fix and and not told next to meaningless stuff.
I am not an "Expert" and know everything. maybe some code written for me to look at and learn would have helped but nope. I get told things I don't even quite understand or how to implement

#

Sorry for asking

earnest phoenix
#

You can't expect people to spoonfeed either

rocky rover
#

guys i'm making a music bot and it's all good on it but there's a problem , when i left click on it and click disconnect , it keep working but not in the channel

#

is there's an event for the disconnect ?

earnest phoenix
#

your issue is that you expect to be spoonfed and make other people think for you, instead of us doing that we encourage you to use your own brain and learn how to do research for yourself and debug for yourself, @jaunty stump

#

@rocky rover in which library

rocky rover
#

discord.js

rocky rover
#

ty m8

#

ill try it now

#

@earnest phoenix doesn't work

earnest phoenix
#

what doesn't work

rocky rover
#

the point is , when i type /leave it leaves and clears the queue

#

but when i disconnect it manually

#

it leaves but doesn't join untill the queue ends

earnest phoenix
#

that's a problem with your code

rocky rover
#

Can you show me an example?

earnest phoenix
#

it's literally just an event subscription

#

on("disconnect", func)

#

try listening to the error event aswell

#

some libraries error out instead of firing the disconnect event

rocky rover
#

Aight m8

#

thanks for showing up the help

west raptor
#

@jaunty stump well here's some things you might want to put into consideration in your code:

  1. User#avatarURL can be undefined meaning if the person has no set avatar if will returned undefined, it shouldn't effect much but it's something to account for (to fix this refer to User#defaultAvatarURL)
  2. Channel#sendEmbed is deprecated as the warnings said, Channel#send(embed) should work fine
  3. role can be undefined, check if it exists first, also role.name == 'New' is case sensitive
#

also you gave little details of what isn't working

#

like is not adding the role? or does it not even send the embed? you have to tell us these things

rustic axle
#

So have any of you ever had a command for executing shell code or something?

west raptor
#

used to but they're dangerous running under root

#

typically they aren't needed unless you need some basic info or something of the sort

#

ive considered having a shell mode in my current bot but im not sure

rustic axle
#

Well I need it because my ISP blocks port forwarding so I cant ssh into my pc when I am not home to access pm2 and stuff

#

so I at least want to check on pm2

west raptor
#

yikes

valid frigate
#

shell mode on a bot, yikes

#

i honestly wonder why people do it

west raptor
#

with proper precautions ofc

#

im too lazy to setup ssh tbh

valid frigate
#

it just seems like a useless feature

west raptor
#

eh

valid frigate
#

eh indeed

#

your choice really

ember atlas
#

Any reason why this mute command does not work?
https://hastebin.com/danuyujuwo
The only part that works is the invalid member/no member, everything else does nothing without error

sudden geyser
#

const modrole = db.fetch(modrole_${message.guild.id}); if (!message.member.roles.has(modrole)) return;

Maybe try logging to see if this is true? It could really be anything after your three mod checks.

ember atlas
#

like console log it to see what?

#

Wait i think i found out the issue

#

Never set a mod role in the db

sudden geyser
#

that's what I was thinking

#

But you should alert the user if a mod role has not been set up or use normal permission checks.

wintry wing
#

I'm assuming this issue is due to my bot being sharded (cant leave it as 1 shard due to it having more than 2k guilds), but for some reason, when the bot tries reacting with a custom emote on shard 2, it says its unknown, though on shard 0, it doesn't say that. What confuses me though is that it shows the custom emote on the embed. Is there any way to fix this issue?

amber fractal
#

Because the guild with the emote isnt on shard 2

#

I'd guess

knotty steeple
#

yes that would make sense

amber fractal
#

Welcome to sharding.

#

Enjoy your stay

wintry wing
#

thank you

#

i dont like it

#

what is melting my brain right now is that it shows the custom emote in the embed

amber fractal
#

if it shows it, just catch the error and say nah we dont need that mmLol

wintry wing
#

thats what im doing

#

i replaced it with something else

#

im assuming then theres no way to react with a custom emote thats on another shard

#

unless i create guilds on each shard with the same custom emote

ember atlas
#

Every so often I keep getting this error
(node:17388) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of null at module.exprts (C:\Users\Aidyj418\desktop\boss-bot\boss-bot-v2\events\client\message.js:5:53) and I am really not sure why... here is the code:

const db = require('quick.db');

module.exports = async (client, message) => { 

let prefix = await db.fetch(`prefix_${message.guild.id}`)
if(!prefix) prefix = '!'
    if (message.author.bot) return; 
    if (!message.guild) return; 
    if (!message.content.startsWith(prefix)) return; 

    if (!message.member) message.member = await message.guild.fetchMember(message);

    const args = message.content.slice(prefix.length).trim().split(/ +/g); 
    const cmd = args.shift().toLowerCase(); 

    if (cmd.length === 0) return; 

    let command = client.commands.get(cmd); 
    if(!command) command = client.commands.get(client.aliases.get(cmd)); 

    if (command)
        command.run(client, message, args)
};
amber fractal
#

I'm not gonna look at the code, but I'm just gonna guess you allow messages from dms

#

dms dont have a guild property

#

something like message.guild.id wouldnt work in a dm

ember atlas
#

i dont allow messages from dms.

#

this line is for that: if (!message.guild) return;

#

and the error happens at ```let prefix = await db.fetch(prefix_${message.guild.id})

amber fractal
#

Yeah...

#

you check if no guild after

ember atlas
#

has always worked until i seperated my events today

amber fractal
#

I'm telling you what the error is telling you ¯_(ツ)_/¯

ember atlas
#

well how do i fix it..

#

Do i have to check for a guild before i define my prefix?

amber fractal
#

yes

sudden geyser
#

or you could just move the code where you fetch and replace the prefix below your check for the guild.

atomic quarry
#

Is it possible to host my Bot using my IP?

mossy vine
#

as in hosting a bot on your computer? yes

knotty steeple
#

invert the letters and its pi

#

a pi is decent as a host

mossy vine
#

uhm

outer niche
#

What would the verbal name of a bot like be

knotty steeple
#

what

outer niche
#

The verbal name of a bot I have no idea what that is

knotty steeple
#

the fuck

outer niche
#

varialbe name

knotty steeple
#

idk make it anything u want

mossy vine
#

variable names do not matter

#

as long as you can keep track of it

outer niche
#

Ok thx

knotty steeple
#

mine is just the bot name xd

outer niche
#

All right I have someone that's saying that you just don't make that stuff up

sudden geyser
#

that's fun until you change the bot name

outer niche
#

That you're supposed to get it from somewhere

mossy vine
#

are we talking about variables

outer niche
#

Yes

sudden geyser
#

like are you talking about in your source code or something else

outer niche
#
bot = discord.Client()

@bot.event
async def on_guild_join(server):
    await client.post_stats(jsonObject={
        "server_count": len(bot.guilds)
        })

@bot.event
async def on_guild_leave(server):
    await client.post_stats(jsonObject={
        "server_count": len(bot.guilds)
        })```
#

that

mossy vine
#

as long as you refer to your discord client as whatever you call the variable it doesnt matter

outer niche
#

I was told that the variables name goes somewhere in the first line

#

So I like I get it goes in the first line but I have no idea where and so I can just put anything

mossy vine
#

do you know programming basics

#

if so the concept of a variable and its name shouldnt be so foreign to you

outer niche
#

Yes I'm just confused cuz other people are trying to help me and they confuse me so much that I have no idea what I need to do to fix the code now

mossy vine
#

well what is the problem with the code

outer niche
#

I'm still missing the second requirement

#

And so I was told I needed the viriable name

#

That that was causing the problem

mossy vine
#

first argument has to be your discord client object

#

you are copying and pasting code without thinking about it arent you

outer niche
#

no I am thinking about it but my friend that told me that this worked said it would work that you just go ahead and put it in

muted ridge
#

is there a faster alternative to ytdl-core

#

i'm getting an issue that tells me that the stream isn't generating quickly enough although I have a fairly good download/upload speed

dusky marsh
#

Use lavalink

muted ridge
#

holy wow that looks useful

#

thanka yu\

earnest phoenix
#

lavalink is just bloat lol

muted ridge
#

srs?

earnest phoenix
#

way too heavy

#

it's java so it hogs ram and has bad garbage collector so it only keeps on growing in ram usage

muted ridge
#

christ

#

so should I not use it? if it has no bad gc then I fear that it'll suck up all of my 8gb

quartz kindle
#

Its still better than ytdl no?

muted ridge
#

if it's as bad as you say it is, over time I'd need to restart my bot, no?

quartz kindle
#

Anything java should be better than an equal js/node implementation

muted ridge
#

not necessarily, but generally yes assuming it's structured well

#

if i'm understanding what you're saying

quartz kindle
#

Yeah but afaik lavalink is actually a stream player server sort of thing, its completely different from ytdl

earnest phoenix
#

i haven't personally benchmarked any of node.js streaming libs so i wouldn't know

#

i just know that lavalink is incredibly slow

#

and i've only had bad experience with it

muted ridge
#

so, what do you recommend?

quartz kindle
#

Ive heard lots of people praising it lul, but ive never used it

muted ridge
#

I doubt I want to continue using ytdl-core if it keeps posing these kinds of problems because of a reason that I can't control

earnest phoenix
#

lavaplayer is still good but lavalink just fucks the implementation up and ruins the point of lavaplayer

muted ridge
#

oh boy; another question

#

whenever I try to install "ref", rather, anything that includes building via node-gyp (i presume), it always fails with error code 1, reinstalled visual studio 2017, installed windows build tools via npm and all that, no idea what to do now

outer niche
#

I have gone through everything I can find to figure out how to fix this but I still can't figure it out

opaque eagle
#

Is anyone here good with both JS and Golang? If so, would you say that "image" (official go package) is similar to the Web's Canvas API or no?

#

i currently have an image manipulation api written with express and node-canvas that I'd like to re-write in go

outer niche
#

Can someone help me with this

ember atlas
#

Can I use javascripts .replace method to replace multiple things?

knotty steeple
#

no

#

u replace 1 thing

ember atlas
#

well how can i store variables for say a welcome message then?

knotty steeple
#

you can just run a loop to replace stuff

outer niche
#

Can I get some help with the error above

hollow saddle
#

The error looks pretty self-explanatory

#

You're missing a parameter

outer niche
#

Yeah I know it's just the fact I cannot figure it out yeah I got that I'm missing a part of it except I can't figure out the exact what I'm missing and where It needs to go in that line

#

No I'm sorry I know where it goes in the line I just can't figure out the part I'm missing

hollow saddle
#

It says bot...

#

So your client is what you need

outer niche
#

Yeah I know it says bot but like what about it

hollow saddle
#

I believe but idk d.py or even like oython much soo

#

*python

outer niche
#

It's cool

#

Yeah I'm just like confused on what it actually is because I've been doing my research for about 2 hours now and I can't like actually figure it out

hollow saddle
#

pass the clieny

#

*client

outer niche
#

Ik but what is that

hollow saddle
#

Read the screenshot you sent above

#

Read it entirely and you'll figure it out

outer niche
#

So the client is the DBL

#

???

hollow saddle
#

Oh wait

#

Read that wrong

#

My apologies

#

It's what you defined as your bot

#

I don;t know what you called it though, probably bot

outer niche
#

Yeah I defined everything as bot

hollow saddle
#

Wdym everything?

#

Can you send your code in a pastebin or something

outer niche
#
bottoken = "token"

client = DBLClient(token=dbltoken)
bot = discord.Client()

@bot.event
async def on_guild_join(server):
    await client.post_stats(jsonObject={
        "server_count": len(bot.guilds)
        })

@bot.event
async def on_guild_leave(server):
    await client.post_stats(jsonObject={
        "server_count": len(bot.guilds)
        })```
hollow saddle
#

It's like I said

#

bot is what you should pass

outer niche
#

But like how

#

This is where I kept on getting confused

hollow saddle
#

Do you know how to pass an argument in a method?

outer niche
#

No

hollow saddle
#

That's like coding 101

#

You just put it in between the parenthesis

outer niche
#

That's what I thought so it just put the word bot in between it

hollow saddle
#

Mhm

outer niche
#

Yep that's like what like half the people said

hollow saddle
#

Then why didn't you listen to them

outer niche
#

No I mean the part with mhm

#

@hollow saddle so do I just put bot in between the ()

hollow saddle
#

That's what I said yeah

outer niche
#

So I just take out all the other stuff in it and put in bot

hollow saddle
#

What other stuff is in it

#

Your screenshot showed it completly empty

outer niche
#

that

hollow saddle
#

That's not it... 🤦

#

The error is with the init mehtod

#

So you want to put the parameter in that method

outer niche
#

There's only one () That's empty in the entire code

hollow saddle
#

Then where's the init method

#

Wait

#

Was that codeblock you sent your entire code?

outer niche
#

For that portion of the bot yeah

#

All the other code is for commands

hollow saddle
#

Where is that file

#

What's the code for that

#

Wait

#

Oh wow

#

The error is most likely with the DBLClient since you forgot to pass an argument

#

Probably

#

Just pass bot=bot with the token there

outer niche
#

That confuses me like where do I put it in the ()

hollow saddle
#

before the token

#

most likely

outer niche
#

Before the DBL token

hollow saddle
#

yes

outer niche
#

Ok

#

that