#development

1 messages · Page 739 of 1

earnest phoenix
#

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

#

why

#

?

atomic quarry
#

What language is it and what's the code

earnest phoenix
#

python

#
    async def ping(ctx):
        await ctx.send('Pong!')```
atomic quarry
#

Ok hold on

trail reef
#

@earnest phoenix check your indentation

#

Is it inside another command

#

?

earnest phoenix
#

no

#

just ping

trail reef
#

Inside client.command()

#

Good practice is to specify the name in there so: client.command(name=“yeet”)

#

You can also specify command aliases in there

#

client.command(name=“yeet”, aliases=[“one”, “two”])

earnest phoenix
#

with

#

''?

trail reef
#

Btw, reading the docs is prob better

#

Wdym with “

earnest phoenix
#

ok

trail reef
#

Yes with “

earnest phoenix
#

ok

trail reef
#

You’re specifying the name of the command, not pointing it to a function.

#

The async function below the @client.command() will be run

earnest phoenix
#
    async def ping(ctx):
        await ctx.send('Pong!')```
#

dont work

trail reef
#

Send the error then

#

Like a screenshot of the console

earnest phoenix
#

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

#

^^

trail reef
#

And to be clear, you restarted the bot after you changed the code?

earnest phoenix
#

i start the ''file'' a again

trail reef
#

Ok

#

Are you using cogs?

#

Like where the commands are grouped together throughout a set of files

#

Doesn’t look like it, but just making sure

#

Yes

#

Docs

#

Read em

#

ctrl+f

#

reaction

#

what language are you using

#

sigh

#

google js docs

modest maple
#

discord.js docs*

#

Discord.js docs

mossy vine
#
modest maple
#

reactions

trail reef
#

Thanks for taking over chillfish

#

Sorry autocorrect

atomic quarry
#

@trail reef Wouldn't this code work for the person having a problem with the ping command

trail reef
#

What code?

atomic quarry
trail reef
#

Probably

#

I suspect he made a dumb mistake, like not restarting the bot or messing up indentation or disabling it in some other way

atomic quarry
#

Ok

modest maple
#

dont spoon feed

trail reef
#

the kind of mistake I make daily

modest maple
#

he hasnt learnt the basics of python

trail reef
#

^

modest maple
#

he has jumped straight into d.py with no prior knowledge

atomic quarry
#

So do you know how to do a linter in Node.js

trail reef
#

looks around nervously

#

sweats

atomic quarry
#

I can never get linter right

#

And I have this command that ruins the code since it requires a linter

#

So does anyone know how to do a linter if so I would kindly appreciate someone fixing the piece of code

mossy vine
#

install a linter

atomic quarry
#

I can't my computer doesn't have enough space

vivid vapor
#

Know somebody something about unity map create

mossy vine
#

you cant install code thats a few hundred kilobytes at most

#

yet you are trying to develop a bot

vivid vapor
#

No a game

mossy vine
#

im not talking to you

vivid vapor
#

O

quartz kindle
#

@atomic quarry "making" a linter is extremely hard and complex, you're most likely looking for how to install and use one

#

and i havent heard of a command that "requires" a linter, can you explain better?

mossy vine
#

lint code input?

trail kernel
#

yo guys please i really need help everytime i try to play a song using my bot it leaves the channel right after it joins what can i do?

earnest phoenix
trail kernel
#

@earnest phoenix i am using ffmpeg and all i tried is basically to !play a song and the bot joined and left right after

earnest phoenix
#

i still do not know what language or lib you're using

#

Also it's probably a issue with your command if ffmpeg and node-opus are both installed

#

So you might want to log your command and see where the issue is

quartz kindle
#

@uneven laurel try js setTimeout(function() { console.log(result[0].prefix) }, 100);

sudden geyser
#

the _id prop is not a string, are you using a db like mongo

trail kernel
#

@earnest phoenix C# and ffmpeg

ruby talon
#

Heyo

quartz kindle
#

@uneven laurel are you using mongoose or a database with a schema?

grim aspen
#

@trail kernel can you show your package.json?

trail kernel
#

ye sec

mossy vine
#

@grim aspen for C#?

quartz kindle
#

you need to define the fields in your schemas, else they wont be available

grim aspen
#

nvm then

trail kernel
#

?

grim aspen
#

wait are you using C# or js

earnest phoenix
#

@trail kernel do you have opus and sodium

trail kernel
#

@earnest phoenix yes

earnest phoenix
#

where did you place them

trail kernel
#

inside bin > debug

earnest phoenix
#

and you're running a debug build, yes?

trail kernel
#

yes i think

earnest phoenix
#

then you've got the binaries for the wrong arch

quartz kindle
#

@uneven laurel from Stackoverflow: ```When running console.log() on the whole object, all the document fields (as stored in the db) would show up. However some individual property accessors would return undefined, when others (including _id) worked fine.

Turned out that property accessors only works for those fields specified in my mongoose.Schema(...) definition, whereas console.log() and JSON.stringify() returns all fields stored in the db.```

earnest phoenix
trail kernel
#

i am kinda new in this sorry

earnest phoenix
#

if you're running on linux use your package manager to get the binaries

shy dune
#

pls give link on serve Big Games

earnest phoenix
#

no

shy dune
#

why

earnest phoenix
#

because i said so

shy dune
#

please i really need it if u can tell

earnest phoenix
#

nobody even knows what you're talking about and this isn't the channel for it

solar mauve
#

How I can add 2 reactions wo my own embed? (Discord JDA)

shy dune
#

please i really need it

#

I will no longer write this in this chat

solar mauve
#

What? @shy dune

mossy vine
#

just ignore him paradocx

solar mauve
#

Ok?

#

How I can add 2 reactions to my own embed? (Discord JDA)

grim aspen
#

oh

mossy vine
#

i dont use jda

solar mauve
#

😫

split hazel
#

nvm i found out how

#

had to look in api

trail kernel
#

@earnest phoenix yo i got the right binaries but i think the problem is that my ffmpeg is not installed correctly cause when i type in cmd ffmpeg -version it doesnt find anything

#

any idea what could be the problem?

earnest phoenix
#

ffmpeg is not what you install

#

it's an executable

#

run the command in the same dir where you have ffmpeg

solar mauve
#

Is anybody good in Discord JDA?

earnest phoenix
#

hi im trying to make an giveaway command but i run on this error somone knows how to fix? ```
E:\Nieuwe map (2)\DODA\discord\2.discord bots\dodabotv2\Commands\ModerationCommands\giveaway.js:49
var peopleReacted = embedSend.reactions.get("�🎉").users.array();
^

TypeError: Cannot read property 'users' of undefined
at Timeout._onTimeout (E:\Nieuwe map (2)\DODA\discord\2.discord bots\dodabotv2\Commands\ModerationCommands\giveaway.js:49:58)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)```

modest maple
#

read the error

trail kernel
#

@earnest phoenix any chance u can send a link to what i need to install please?

vital lark
#

didn't you install it already?

earnest phoenix
#

again

#

there is nothing to install

#

anyone knows why im getting tht error?

#

it's just drag and drop into working directory

vital lark
#

@earnest phoenix users is undefined, which means no one reacted with the reaction you're trying to get

trail kernel
#

but drag what lol

earnest phoenix
#

the bot should need to react itself but it doesnt do it var embedSend = await message.channel.send(giveawayEmbed); embedSend.react("🎉");
is this good?

vital lark
#

try it

earnest phoenix
#

yh its not working

short siren
#

Error

modest maple
#

what do you always have todo

#

when you do somthing with the discord api

earnest phoenix
#
        .setTitle("🎉**GIVEAWAY**🎉")
        .setFooter(`Vervalt: ${dateTime}`)
        .setDescription(item);
 
    var embedSend = await message.channel.send(giveawayEmbed);
    embedSend.react("🎉");
vital lark
#

what @modest maple

#

also ur awaiting the message

short siren
#

Thats the code not the error

modest maple
#

await

#

you did it for message

#

not reactions

#

even tho they require the same treatment akkoShrug

sudden geyser
#

well only embedSend needs to be awaited if they don't do anything with the reaction or care about the order later on

earnest phoenix
#

so i hve to remove await?

trail kernel
#

@earnest phoenix drag and drop what?

earnest phoenix
#

binaries and ffmpeg

trail kernel
#

@earnest phoenix is there any chance youll allow me to dm you some screenshots?

earnest phoenix
#

found fix thnx guys

trail kernel
#

i have those in the right folder

#

i dont understand whats wrong

earnest phoenix
#

try catch your command and see what throws i guess

knotty steeple
#

tf is ffprobe

trail kernel
#

ehhh how do i catch my command what does that mean

knotty steeple
#

c#

#

thonk

earnest phoenix
#

...yes?

trail kernel
#

Arguments = $@"/C C:\Users\yuval\OneDrive\Desktop\ssss\youtube-dl.exe --no-check -certificate -f bestaudio -o - {url} | ffmpeg -i pipe:0 -f s16le -ar 48000 -ac 2 pipe:1", maybe there is a problem in this line cause it wont let me find ffmpeg in cmd when i try to type "ffmpeg -version"

earnest phoenix
#

don't guess

#

i told you to try catch and see where is the problem

#

and i also told you

#

that ffmpeg is an executable

#

not a program

#

and that you have to run ffmpeg in the same directory it is located in

trail kernel
#

but i am retarded i dont know what all that means

earnest phoenix
#

you maybe shouldn't jump into programming so forcefully then

#

because these are basic computer science terms

earnest phoenix
#

IndentationError: unindent does not match any outer indentation level

sterile minnow
#

Code?

earnest phoenix
#

@client.event
async def on_ready():
    print(discord.__version__)


@client.event 
async def on_ready ():
    await client.change_presence(activity=discord.Game(name='-help'))
    print('Listo.')

 @client.command()
 async def ping(ctx):
    await send('Pong!{round(client.latency * 1000)}ms.')

bot.run('token')```
#

@sterile minnow ^^

#

is python

sterile minnow
#

Okay i'm js sorry

earnest phoenix
#

oh ;u

#

nvm

quartz kindle
#

do you know what "indentation" means?

grim aspen
#

@earnest phoenix one of the lines is indented too much

#

or too little

earnest phoenix
#

i say

#

nvm

late latch
#

Guys, help. I don’t understand how to make the bot write in the chat discord that "The user voted for your bot."
I looked at the documentation, but did not understand.

lavish shuttle
#

What language?

vital lark
#

@late latch you need to create a webhook server and make a POST endpoint so top.gg can request to it and send you a payload of the user who voted

late latch
#

I just haven't worked with webhooks before

late latch
earnest phoenix
#

yes

vital lark
#

well, you'll need to build a webhook server to do that heheXD

earnest phoenix
#

@vital lark me?

late latch
#

maybe space?

earnest phoenix
#

yes

vital lark
#

no

earnest phoenix
#

the space xd

late latch
#

xD

#

I created webhook

late latch
#

and

#

I created in a text channel, webhook.
Now I have a link to webhook. And nothing more

earnest phoenix
#

discord webhooks =/= dbl webhooks

late latch
#

Apparently I really don't understand something.

earnest phoenix
#

click on the message link i posted to get a brief explanation on how webhooks work

#

you need to set up your own webserver where you can receive webhook requests

#

you can then do whatever with that data you get, forward it through your bot, through a discord webhook, log it...

outer niche
#

Does anyone use digital ocean as a VPS

late latch
#

too complicated for me.

quartz kindle
#
  1. go to your bot's edit page in the website
  2. fill up your webhook url (this url must be the address where your bot is reachable, ie your vps's ip address and your bot's port, your glitch project address, etc...)
  3. set up a webserver and listen to requests made through item 2 (dbl's libraries can do that for you)
late latch
#

test

#

Where can I raise my web server?

quartz kindle
#

where is your bot hosted? your computer? a vps? glitch/heroku?

late latch
#

glitch

quartz kindle
#

you can use the dbl library then

late latch
#

Example of posting server count with supported libraries (Discord.js and Eris) <= work

#

Example of using webhooks to receive vote updates <= not work

quartz kindle
#

change webhookPort from 5000 to process.env.PORT

#

go to your bot's edit page and put in the webhook url your glitch project

#

https://YOURGLITCHPROJECTNAME.glitch.me/dblwebhook

#

and in the webhook password put the same password you have in webhookAuth

#

and the one in the website

#

have to be the same thing

#

but they can be whatever you want

late latch
#

yourDBLTokenHere?

quartz kindle
#

your bot's dbl token

earnest phoenix
#

@quartz kindle u are osass?

late latch
#

ok

quartz kindle
#

you also get it from the bot's edit page

earnest phoenix
#

uvuvwevwevwe onyetenyevwe ugwemubwem ossas

trail reef
#

@earnest phoenix

#

You don't need a diy webserver

late latch
trail reef
#

I just got it to work

#

Since it took forever for me to get it, ik it's spoonfeeding, but what the heqq

#

i'ma send over my code

#

or rather an edited version of it

#

I'm using cogs btw

late latch
#

cool

trail reef
#
from discord.ext import commands
import discord
import dbl

class Thing(commands.Cog):
    def __init__(self, bot):
        self.bot = bot
        self.token = json.load(open("keys.json", "r"))["dblpy"]
        self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path="/dblwebhook", webhook_auth="JoeWhoJoeMama", webhook_port=5000, autoupdate=True)
        
    @commands.Cog.listener()
    async def on_dbl_vote(self, data):
        print("========== PERSON VOTED PERSON VOTED PERSON VOTED ==========")
        userID = data["user"]
        user = self.bot.get_user(userID)
        await user.send(embed=discord.Embed(color=discord.Color.green(), description="blah BLAH blah BLAH BLah!"))

    @commands.Cog.listener()
    async def on_dbl_test(data):
        print("========== DBL WEBHOOK TEST ==========")
        
def setup(bot):
    bot.add_cog(Thing(bot))
#

So that's a cog

late latch
#

so sorry

#

i'm use discord.js

trail reef
#

oh

late latch
#

(

quartz kindle
#

you didnt change the webhook port

#

glitch doesnt work with port 5000

unkempt arch
#

Yall gitlab or github?

trail reef
#

Github

unkempt arch
#

For what reasons?

trail reef
#

Seems more popular, better supported, more features (I think), more content on it

#

Also my robotics team uses it, that's another factor for me ig

unkempt arch
#

hmm. Okay.

trail reef
#

What do you prefer?

unkempt arch
#

im currently checking out both

trail reef
#

cool

#

I'm interested what other people think

unkempt arch
#

For such reason. Gitlab has Self Hosting

#

but buggy

#

While Github Runners(Self Hosted) is alot more buggy

trail reef
#

I've never heard of either service before

#

I assume they're paid hosting?

unkempt arch
#

Its still under free

trail reef
#

wow

#

Is it like a free full on vps or more like an online interpreter type thingy

unkempt arch
#

Free Full on vps

trail reef
#

heqq

unkempt arch
#

you can set it up using docker

trail reef
#

cool

#

boutta google this more

#

I'll probably just stay with my raspberry pi tho

#

idk

unkempt arch
#

UI Wise, GitLab. Feature Wise, Github.

trail reef
#

cool

unkempt arch
#

One thing that gitlab did is to make the CI/DI better than github's actions

#

Which is nice

trail reef
#

hrmmm

#

any significant performance differences?

unkempt arch
#

So by production, github actions is slower.

#

A l o t s l o w e r

trail reef
#

I guess gitlab might be better then

#

But then again

#

features....

unkempt arch
#

Currently This is happening on my github

trail reef
#

f

unkempt arch
#

And im not liking it

trail reef
#

Yeah I wouldn't either

unkempt arch
trail reef
#

reminds me of the almost 1 minute getting ready period that my bot likes to pull

#

nice

unkempt arch
#

One thing nice on github's side even on cloud is that its fast resonding to pushes and pulls

#

Instantly it sends the webhook to deploy the bots lmao

trail reef
#

cool

#

I'm definitely going to look into that

unkempt arch
#

with the current paas i have rn. git production should work smooth

#

CI/DL is something every developer should look at when using git i think

trail reef
#

laughs in no backups of my current bot running on a raspberry pi off a cheap generic 16gb micro sd card off amazon and using wifi

unkempt arch
#

Ey you can run docker with it

#

RPI Docker

trail reef
#

But it would be unbearably slow

#

It's a 3b

unkempt arch
#

Ooh

trail reef
#

sad wanting 4b noises

#

that extra ram will help my memory leak problems

unkempt arch
#

AHHAH okay same

trail reef
#

lol

#

Speaking of stupid shit I do

unkempt arch
#

is your rpi 1GB ram? or just the 600mb one?

trail reef
#

1gb pretty sure

#

planning on eventually getting the 4b with 4gb ram

unkempt arch
#

Then why not run CapRover? or any low requirement PaAS

trail reef
#

I'm cheap af, and I prefer self hosting cause the device is right there, need I unplug if it becomes sentient

unkempt arch
#

Yeah

#

Caprover is self hosted

#

i use it for prod and alpha builds of my things

#

Its dev friendly

trail reef
#

wait you use alpha builds?

unkempt arch
#

YeEt yes

trail reef
#

lmao laughs in publishing bot in unfinished state

unkempt arch
#

I have 2 branches in my git. one prod and alpha

trail reef
#

I have 0 branches in my git for my bot

#

I should probably do that rn

#

brb

unkempt arch
#

Okay nIcE

#

ci/dl can do eslint without the need of doing it on the main server/system

trail reef
#

laughs in python

unkempt arch
#

cries i forgot what lib you are

trail reef
#

hA yOu PuNy nOn PyThOn UsEr U hAvE tO cOmPiLe HA

unkempt arch
#

not rlly

#

i automate my stuff

trail reef
#

You haven't compiled till you've compiled a 400+ line crap text based java game using jframe made using jgrasp on a 50 dollar school laptop with the files on onedrive

unkempt arch
#

We did. On a sChool ComPuter. AnD itS ExPenSive af its not 50 Dollars im sure and the files are saved in GoOglE DrIve

#

We did java sometime

#

but forgot abt it

trail reef
#

ok boomR

unkempt arch
#

okAy zoomer

trail reef
#

lol

unkempt arch
#

Frik markdown hell

trail reef
#

lol

#

IS THAT A CHALLENGE

unkempt arch
#

Waht

trail reef
#

DISC```ORD
MARK

>>> **dO**
||Wn||
unkempt arch
#

Seems like someone friked up Their Life with Markdown

trail reef
unkempt arch
#
let l = “friked up”
let w = “Markdownconsole.log(l + w) // Fricked up Markdown
#

GrEaT

trail reef
#

pRiNt()

#

friked upMarkdown

unkempt arch
#
if(life == “Limited”){
    return console.log(“Dream Infinite”)
} else {
    return console.log(“You already died.”)
}
#

im bored now

#

docker is updating

sudden geyser
#

Nervously looks at quotes

quartz kindle
#

^

cosmic cairn
#

Please use actual quote characters. Your smart quotes are bothering me.

earnest phoenix
#

aren't those just apple quotes

slender thistle
#

Pretty much

earnest phoenix
#

how i do ''addreactions'' in python

trail reef
#

Bruh

#

@earnest phoenix it’s called look at the docs

earnest phoenix
#

ok

trail reef
earnest phoenix
#

thanks

trail reef
#

Click on it and search for reactions

earnest phoenix
#

ok

trail reef
#

ctrl+f is life

earnest phoenix
#

:u

#

ok

#

xd

trail reef
earnest phoenix
#

xd

sudden geyser
#

that just looks like "hosting" with extra steps

trail reef
#

bUt It'S qUaLiTy

earnest phoenix
#

why this dont work?

#
async def test(ctx, arg):
    await ctx.send(arg)```
trail reef
#

Can I see all of your code?

sudden geyser
#

are you getting an error? what's specifically not working?

trail reef
#

iirc, the error was saying the command wasn't found

#

I don't think it's a problem with that part of the code

#

I think it's something in the rest of the code

#

@earnest phoenix give us all your code

earnest phoenix
#

ok

sudden geyser
#

oh well there's your token

#

might want to reset that

earnest phoenix
#

;v

#

ok

loud salmon
#

🤦

earnest phoenix
#

already

#

@loud salmon why you delete the msg

#

i edited the token

loud salmon
#

because it has a token

earnest phoenix
#

oh

loud salmon
#

even if its not active

#

still not something to have

earnest phoenix
#

ok

#
from discord.ext import commands

client = commands.Bot(command_prefix = '-')


@client.event 
async def on_ready ():
    await client.change_presence(activity=discord.Game(name='-help'))
    print('Listo.')
    

@client.command()
async def ping(ctx,):
    await ctx.send(f'Pong! :ping_pong:   {round(client.latency * 1000)}ms.')


@client.command()
async def F(ctx,):
    await ctx.send( 'Press f to pay respect ')

@bot.command()
async def test(ctx, arg):
    await ctx.send(arg)```
trail reef
#

First thing

#

Get rid of the space between on_ready and ()

#

And the f command

#

Get rid of the extra ,

sudden geyser
#

well

#

you don't have bot defined

#

so that may be your issue

trail reef
#

And bot.command() won’t work because bot doesn’t exist yet

#

You would need to use client.command() in your case

slender thistle
#

I doubt space between names and parentheses matter

trail reef
#

In java it does, never tried in python

#

pretty sure if the parentheses aren’t right next to it it thinks it’s a variable rather than a function

sudden geyser
#

Java complains at anything not correct

slender thistle
#

Python is okay with it

trail reef
#

Cool

#

Still would be good practice to make your code neat, and in the process get rid of those spaces

slender thistle
#

That'd be correct

trail reef
#

That’s a shiny role you got right there, what libraries have you contributed to?

slender thistle
#

dblpy, the role is for people who maintain official DBL libraries

tiny fable
#

Also how would one get a certified bot dev role?

earnest phoenix
#

What does that bot do?

trail reef
#

Polar, the bot has to be on the server so @gilded plank can talk to top.gg

#

About it

tiny fable
#

How would I get it added here?

loud salmon
#

-kickedbot @tiny fable

gilded plankBOT
#

@tiny fable

Your bot was likely kicked because it broke one of the "bot rules" listed in #rules-and-info.

To find out why your bot was kicked and by who, use the search feature in #mod-logs:

earnest phoenix
#

How does it go about preventing suicides?

loud salmon
#

@earnest phoenix it links to prevention hotlines

#

iirc

tiny fable
#

^^

earnest phoenix
#

Fair enough.

tiny fable
#

Once it detects suicidal thoughts

#

Also

#

We have a system where it connects you to volunteers

#

Hold on

#

Thats the point of the bot?

#

It's in the name

loud salmon
#

yea

#

but just as a general rule

tiny fable
#

oof

loud salmon
#

we just dont want non-prefixed responses here

tiny fable
#

Anyway it can be restricted from channels?

loud salmon
#

uh i guess so?

tiny fable
#

So DBL can have access to it's status?

loud salmon
#

I could give it the common prefix role i guess

#

locks it away from any channel

#

bot id pls

tiny fable
#

649535694145847301

#

Also how would I get Certified Developer?

loud salmon
#

@earnest phoenix

#

kk done

tiny fable
#

Thank you

loud salmon
#

the certified program is currently frozen

#

no eta on when it will reopen

tiny fable
#

FeelsSadMan

hoary helm
#

didn't you have to send a letter to fat man

#

or are both the letter and digital parts closed

sudden geyser
#

sending the letter would get you the same outcome if you sent a letter to the actual fat man

radiant jay
#

I believe that's still open

valid frigate
#

anyone know the reason why shards will close with code 10001 but immediately reconnect after in jda? the error code says "cloudflare load balancing" and just wanted to know why other libs don't have the same message/disconnect reason

#

from what im implying rn it's that either the maintainer of jda is the only one aware of how shards disconnect like this/is wrong

bitter sundial
#

doesnt it always reconnect on error

valid frigate
#

yeah it does

#

not a high priority question

#

honestly just curious

fluid basin
#

I guess maybe in other libraries the error will just show up as a reconnect

valid frigate
#

guess so

#

cloudflare load balancing as a reason sounds goofy ngl

fluid basin
#

discord uses cloudflare so yuh everything is proxied ¯_(ツ)_/¯

valid frigate
#

makes sense

fluid basin
#

also iirc error codes for ws are 4 digits

green kestrel
#

what kind of cpu usage would i expect from a node.js bot sitting on a single pretty quiet server?

#

i know thats a very open ended question

#

just trying to figure out if 5% cpu for someones bot that im self-hosting is a lot, or expected for node, as i dont use node myself

late hill
#

You probably meant 1001 as error code? I get them too.

modest maple
#
Task exception was never retrieved
future: <Task finished coro=<My_Activity() done, defined at C:/Users/ChillFish8/Documents/The_Innkeeper_Database/TheInnkeeper.py:51> exception=ConnectionClosed('WebSocket connection is closed: code = 1001 (going away), no reason')>
Traceback (most recent call last):
  File "C:/Users/ChillFish8/Documents/The_Innkeeper_Database/TheInnkeeper.py", line 58, in My_Activity
    await client.change_presence(activity=discord.Game(name='theinnkeeper.online | ?Help'))
  File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\discord\client.py", line 874, in change_presence
    await self.ws.change_presence(activity=activity, status=status, afk=afk)
  File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\discord\gateway.py", line 510, in change_presence
    await self.send(sent)
  File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\discord\gateway.py", line 480, in send
    await super().send(data)
  File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\websockets\protocol.py", line 361, in send
    yield from self.ensure_open()
  File "C:\Users\ChillFish8\AppData\Roaming\Python\Python37\site-packages\websockets\protocol.py", line 501, in ensure_open
    self.close_code, self.close_reason) from self.transfer_data_exc
websockets.exceptions.ConnectionClosed: WebSocket connection is closed: code = 1001 (going away), no reason
``` i take it this is just a shard dying
fluid basin
#

yeah 1001 means server going down

#

so yuh switching server and load balancing

slender thistle
#

Doesn't discord.py's bot.run(reconnect: bool) handle that

modest maple
#

Apparently not anymore

#

XD

slender thistle
#

Huh

rugged minnow
#

quick question, i'm trying to fetch a dog image from an api, everything works, everything but the sending of the message

    const Discord = require("discord.js");
const fetch = require('node-fetch');

module.exports = {
  name: "randomdog",
  description: "woof",
  guildOnly: false,
  aliases: [
  "dog",
  "getdog",
  "woof",
  "dogpic"
  ],

  execute(message, args){
    async function getDog(){
    try{
    const {message,status} = await fetch('https://dog.ceo/api/breeds/image/random').then(response => response.json());
       console.log(message);
    console.log(status);
      const dogemb = new Discord.RichEmbed()
      .setTitle("Woof! :dog:")
      .setImage(message)
      .setTimestamp()
      .setFooter("Party! x dog.ceo", "https://i.imgur.com/B6QKBgC.png")
    message.channel.send(dogemb);  
    } catch (error)
  }
    }
    
    getDog();
  }
};```

it outputs the following error
TypeError: Cannot read property 'send' of undefined

i've tried everything, but nothing seems to work
quartz kindle
#

You replaced discord's message with the api's message

#

Also you cant download an image as json

rugged minnow
#

it gives a link that gives a json that has an image in it

quartz kindle
#

Ah ok

rugged minnow
#

You replaced discord's message with the api's message
so, how do i fix this?

quartz kindle
#

Rename your variables

rugged minnow
#

because on the other command, that is really similar, it works

quartz kindle
#

Using the same variable names for different things is not a good idea

rugged minnow
#

well, i'll try something else

quartz kindle
#

You can rename a destructured variable as well

rugged minnow
#

but since the json has the propriety "message" i can't change it

quartz kindle
#

You can

rugged minnow
quartz kindle
#

In 2 different ways

#

1 ```js
const response = await fetch(...);
console.log(response.message)


2 ```js
const {message:responsemsg} = await fetch(...)
console.log(responsemsg)
rugged minnow
#

oh

#

thanks

#

so the first one gets both the proprieties

#

no wait

quartz kindle
#

The first one gets the full object

#

With all properties

#

The second one is destructuring the object and extracting a single property

rugged minnow
#

thanks again

broken jay
#

Is there any way to add commands to different files in Eris? This is easily possible in djs, but i cant find data about this for Eris.

fluid basin
#

in what sense for a different file

#

afaik the usage is similar and it is possible to break it up into many files by command etc

broken jay
#

Reloading

fluid basin
#

I suppose that is possible?

grim aspen
fluid basin
#

if you are using node modules then its the same??

#

since command/file loading is done by nodeJS and has nothing to do with the library?

broken jay
#

I know this, and i know i must require this, BUT i must get bot variable to file using require.

fluid basin
#

yeah ofc

#

doesn't eris also have a bot variable

grim aspen
#

yes

fluid basin
#

so by right your modules should still work whether you are using djs or eris

#

just that the api usage is a little different

broken jay
#

Ok thx

rough hemlock
#

How can i make bot without coding

#

I have only phone

radiant jay
#

Use some shit bot designer. If your going to do that DON'T publish it.

rough hemlock
#

I used online bot making

#

It not work help

radiant jay
#

Give me details

rough hemlock
#

Like

#

I look at tutoriol

#

It no work

#

Pithon3 mobile no work

vital lark
#

are you sure you followed the instructions

rough hemlock
#

Yes

#

It ask

floral thistle
#

I also want to know

rough hemlock
#

For human verify

radiant jay
#

@rough hemlock how does the human verification look

fluid basin
#

time to make discord bot maker M

radiant jay
#

Send a screenshot

mossy vine
#

@fluid basin it exists

#

but its garbage

fluid basin
#

oh really?

mossy vine
#

dbm but only templates

#

way less customization

#

and dbl doesnt allow bots made with it on the site

fluid basin
#

yeah oof

slender thistle
#

DBM by itself has customizations

rough hemlock
#

I was joking bruh

earnest phoenix
#

if I do message.channel.send(member.id === ownerID) in a command (just for testing) the output is false even if the ownerID and my id are the same wtf

solar mauve
#

How I can add Reactions(2+) to my embed? (JDA)

earnest phoenix
#

message.react('[emoji]')

solar mauve
#

@earnest phoenix Discord JDA?

earnest phoenix
#

discord.js

solar mauve
#

I need JDA

earnest phoenix
#

I'm trying to fix the problem but idk why member.id is 'null'

#

I tried to send ownerID and member.id and he can't send an empty message

#

(ownerID is sent)

hollow saddle
#

What do you define member as

earnest phoenix
#

const member = message.mentions.members.first();

hollow saddle
#

Are you mentioning a member when you run the command

earnest phoenix
#

of course

#

I'm mentionning myself using a second account

#

I've created a test server

#

with my second account

#

bruh it works on other command

#

bot broken

#

ye bot really broken

#

wait

#

ik what's the problem

#

member

#

changing member to user solve the problem

mossy vine
#

what is the problem

earnest phoenix
#

whats the problem

mossy vine
#

okay i immedeatly see 2 problems

earnest phoenix
#

me2

mossy vine
#

logging messages
unclosed string

earnest phoenix
#

const ruolodagivvare = "

mossy vine
#

also dont log messages

#

its against tos

earnest phoenix
#

you need 2 " at least

slender thistle
#

Is that really logging messages

mossy vine
#

@slender thistle

console.log("t!ruolo" , message)

slender thistle
#

What does exports.run do

mossy vine
#

exports a variable called run

#

which in this case in an asynchronous function

slender thistle
#

Ehh I know jack shit in d.js so I'll stay away

mossy vine
#

this is basic js bloblul

#

do what

slender thistle
#

Did I ever say I learned js HYPERMEGAULTRAOMEGAGODLUL

mossy vine
#

yes

#

I learned js

slender thistle
#

With pleasure cyber, fck u

#

That's not how it works

modest maple
#

Yh

#

Me and shiv both r python

#

Mostly

mossy vine
#

and this is a js question so why do you care

slender thistle
#

Yes

atomic quarry
#

I need help putting a linter in a line of code but I need help getting the linter

trail reef
#

You can’t develop a bot on a computer with less than a gigabyte of storage left

#

Invest in more storage

atomic quarry
#

I can't its a damn school computer

loud salmon
#

lapetus be a bit nicer pls

floral stone
#

Maybe use something like codeanywhere?

#

Don't they allow cloud storage...

trail kernel
#

hey guys i have a problem with my bot that everytime i try to put music with him he joins the channel and leaves right after.... anyone knows what might be the issue? i am using C# and ffmpeg

radiant jay
#

Code?

earnest phoenix
#

i told you yesterday to try catch

#

and see the exception

#

hey i have a question how do i get custom font on NPM canvas-constructor ?

gentle blade
#

Welcome
I have a question
How do I take out
Number of servers inside the bot wt

earnest phoenix
#

I used that a while ago but cant be bothered to remember because that was like 3 years ago

#

@gentle blade <client>.guilds.size

#

on discord.js

gentle blade
#

nice

#

thx bro

earnest phoenix
#

hey i have a question how do i get custom font on NPM canvas-constructor ?

#

.

#

dotpost nice

#

Yep

#

.

loud salmon
#

stahp

earnest phoenix
#

G?msg

[Link](https://lampi.tk)
loud salmon
#

ugh

earnest phoenix
#

i am using canvas constructor , i need some help . So basically say if my username has 4 letters how do i make a rect go the same length as my name

amber fractal
#

Depends on the font size

#

Font

#

Weight

#

Theres so many variables that play into the width of a text

earnest phoenix
#

but how would i make the rect follow the amount of letters

amber fractal
#

I haven't used canvas for anything like that before, but you could just mess around with numbers mmulu

earnest phoenix
#

i can host a bot with python? ||in glitch||

mossy vine
#

no

earnest phoenix
#

oh ;v

restive furnace
#

python != node.js

earnest phoenix
#

what?

sudden geyser
#

I mean, you can

#

but not recommended

restive furnace
#

programmers should understand that.

#

Hosting python bot in glitch? thats not possible, because glitch is node.js based.

mossy vine
#

it is possible

sudden geyser
#

it is possible

#

just use your console

earnest phoenix
#

so?

restive furnace
#

oh yeah forgot that...

mossy vine
#

it has python installed so you can edit your npm start script to run python

unique nimbus
#

I do not recommend using Glitch or Heroku for Discord Bot Hosting

earnest phoenix
#

so? @unique nimbus

restive furnace
#

its more complex than using repl.it (not recommended) or heroku (not recommended) or simply pay few bucks a month for a vps (recommended)

unique nimbus
#

My VPS is 5 euros a month and is decent

restive furnace
#

mines 2€/mo (512mb ram, 1 shared cpu, 10gb memory)

earnest phoenix
#

0/mo Bv

unique nimbus
#

I mean I use mine for a lot of reasons

mossy vine
#

seriously, you can get something good enough for 2€/month, thats like the price of a slice of pizza

unique nimbus
#

ye

earnest phoenix
#

help me?

restive furnace
#

On what?

unique nimbus
#

With what

earnest phoenix
#

host a bot in glitch

#

im python

unique nimbus
#

You can't host a python bot on Glitch

#

due to Glitch being node.js I think

earnest phoenix
#

;v

sudden geyser
#

you can peter

#

just not recommended like you said

mossy vine
#

you can, we just told you how

unique nimbus
#

ye

earnest phoenix
#

my friend host a bot in glitch, he is python

#

;v

unique nimbus
#

Then ask him how he done it

restive furnace
#

It is possible, but its too complex, so either find someone who is doing same or use heroku, repl.it or vps

unique nimbus
#

It is just not recommended

sudden geyser
#

have you tried asking him how he did it

ruby talon
#

XD

restive furnace
#

it wont work on python

#

i think

earnest phoenix
#

yes

#

work on python

#

and js

#

i confused

sudden geyser
#

Arthur I had dark reader enabled so I almost got scared when I saw dark dots falling

#

looks nice though

ruby talon
#

haha

#

ty ❤️

indigo geyser
#

yes it work with py

#

How can I put the webhook timestamp at when I sent the webhook?

#

(I am using json)

trail kernel
#

guys i get this error message in my console whenever i try to put a song on my bot

#

what does it mean?

valid frigate
#

is this a lib in java or c#?

trail kernel
#

C#

valid frigate
#

don't know how to read c# errors, but it doesn't look like its giving any useful information

trail kernel
#

then what to do ;-;

valid frigate
#

somebody probably knows c# and can help you, id advise just waiting

trail kernel
#

ok

#

also for some reason it cant find ffmpeg version even though i downlaoded it

unique nimbus
#

Have you tried Googling it

trail kernel
#

yes i couldnt find anything helpful

amber fractal
trail kernel
#

@amber fractal ok ty i fixed that

#

do u have any idea what can cause the error above?

vital lark
#

ffmpeg isn't a command

#

it's a binary, not an executable file

trail kernel
#

so how do i fix that error?

trail kernel
#

@vital lark

earnest phoenix
#

also for some reason it cant find ffmpeg version even though i downlaoded it
how many times do i have to tell you

#

that ffmpeg is a damn executable

#

and not a program

trail kernel
#

but now its working fine

earnest phoenix
#

if you want to run it anywhere from the console you have to add its directory to your PATH variable

#

if you're still getting that error, is your command's runmode set to async?

#

also you need to provide the whole stacktrace

#

i'm just guessing from the slight part you posted

trail kernel
#

are u talking about this?

earnest phoenix
#

okay yeah, do you have your command runmode set to async?

trail kernel
#

where do i check that

earnest phoenix
#

in your code

trail kernel
earnest phoenix
#

uh what

trail kernel
#

wait are u talking about the play command

earnest phoenix
#

yes

trail kernel
#

oh sorry 1 sec

earnest phoenix
#

okay, you do

#

which means it's timing out because you have the binaries for the wrong architechture

#

which also means you didn't follow the flowchart i posted

trail kernel
#

i am pretty sure i did tho can you send it again please ill do that again

earnest phoenix
trail kernel
#

ty

earnest phoenix
trail kernel
earnest phoenix
#

follow the flowchart, and yes

#

then you place them in the directory where you're working in

trail kernel
#

which is my bot's directory in the debug folder right?

earnest phoenix
#

if you're running from vs debug yeah

trail kernel
#

so thats exactly what i did but ill do it again i guess

#

yup same erorr

#

error*

earnest phoenix
#

can you screenshot where you put them in

#

like the folder and the directory

trail kernel
earnest phoenix
#

hm that's weird

#

you're running from visual studio right?

trail kernel
#

yes

earnest phoenix
#

wait

#

this isn't the problem at all

#

you're getting a nullref

trail kernel
#

which means...? XD

earnest phoenix
#

something in your code is null

#

and you're attempting to use it

trail kernel
#

oh and do u have maybe any idea on what it could be or where? or i have to search it

earnest phoenix
#

it says it in the error

trail kernel
#

in program.cs?

earnest phoenix
#

yes

#

it also says the line

trail kernel
#

here somewhere?

earnest phoenix
#

ah ok i see, run straight from vs

#

run an actual debug build

#

because right now it's running a compiled build

trail kernel
#

how do i change that

earnest phoenix
#

and it doesn't tell you the actual source

#

are you running the .exe in the folder or actually clicking on the button in vs

trail kernel
#

pressing f5

earnest phoenix
#

ah ok

#

try catch in your play command because i'm pretty sure that something is null there

#

try catching will give you the whole exception

trail kernel
#

i dont really know how to use try catch but sec

earnest phoenix
#

i've linked you to the docs

trail kernel
#

where

earnest phoenix
#

cover the scope of your entire method

trail kernel
#

[Command("play", RunMode = RunMode.Async)]
[Summary("Youtube Player")]
[RequireContext(ContextType.Guild)]
public async Task Play(string url)
{

            var audioClient = await audio.CommandAudio(Context);
            if (audioClient == null)                    
            return;
        await audio.Stream(audioClient, url.Split('&')[0]);
    }
#

any chance u can help me with that? ❤️

earnest phoenix
#

why don't you want to read the documentation link

#

it thoroughly explains how and where to use try catch

trail kernel
#

because its long and i probably wont use it any time in the future i just want to finish this god damn bot lol

earnest phoenix
#

if you can't be bothered to learn, we can't really help you much 🤷‍♂️

unique nimbus
#

Coding is long

#

Nothing about coding is easy

earnest phoenix
#

try catch is basic c#

trail kernel
#

i learn basic c# in school and i never heard of try catch

earnest phoenix
#

x doubt

trail kernel
#

i am serious

earnest phoenix
#

you'll get to it

#

soon enough

trail kernel
#

no cause

#

its not part of the study program

earnest phoenix
#

it's still a basic part of c#

#

regardless whether your program follows it or not

#

because exceptions are also a basic and a core part of it

trail kernel
#

so ur not gonna tell me where to put the try catch in the code i send you?

earnest phoenix
#

i sent you the docs link which i keep telling you to read

#

which you could have done by now

trail kernel
#

lol

earnest phoenix
#

you could've literally logically made a connection where to put it just by reading the first two paragraphs

trail kernel
earnest phoenix
#

yes, you're missing a bit more in the catch part

trail kernel
#

or i need something inside the catch?

earnest phoenix
#

don't copy paste code

#

read the part above the code snippet

#

InvalidCastException is a class that derives from the Exception class, it's only used when you attempt to make an invalid cast

#

so that code would only catch invalid cast exceptions

#

if you want to catch all exceptions, you would just catch the base class which is Exception

trail kernel
earnest phoenix
#

yup

trail kernel
#

thank you very much kind sir

earnest phoenix
#

now you can console writeline the exception

#

and see where it went wrong

trail kernel
earnest phoenix
#

you can just use e

#

it will ToString it which includes the source, stacktrace and the message

trail kernel
#

oh ok

#

so now i can run the program and see whats the problem?

earnest phoenix
#

correct

trail kernel
#

ok now it shows me a lot of errors

#

thats it

earnest phoenix
#

you've got the wrong architecture dlls

trail kernel
#

the opus and sodium?

earnest phoenix
#

yup

trail kernel
#

but i downloaded the 64 bit

earnest phoenix
#

you probably didn't follow the flowchart correctly

trail kernel
#

gonna do that again then gimme a few minutes please

earnest phoenix
#

you don't need to follow it again

#

just download it for the other arch

trail kernel
#

the 32 bit?

earnest phoenix
#

yes

trail kernel
#

done

#

it shows less errors but still not working

earnest phoenix
#

what's the error

trail kernel
earnest phoenix
#

the dlls are not there

trail kernel
#

but they are

#

LOL

earnest phoenix
trail kernel
#

or

#

ok i get it

earnest phoenix
#

you have opus(1)

trail kernel
#

the name

#

yes

earnest phoenix
#

not opus

trail kernel
#

yes yes

#

i think that might have been the problem this whole time

#

and if it is imma kms

earnest phoenix
#

no

#

you had the wrong arch

trail kernel
#

but before

#

i tried with 32

earnest phoenix
#

ah

trail kernel
#

and it still didnt work

#

and thats prob because

#

the name

#

running it

#

even though its correct now

earnest phoenix
#

you have opus space .dll

trail kernel
#

oh right

#

ok thank god

#

its not leaving the channel now but

#

its not playing the song either

earnest phoenix
#

how are you running the command

#

like what do you type in

trail kernel
#

*play (url)

earnest phoenix
#

i'm pretty sure you've got the url in the wrong place in your arguments when creating the process

trail kernel
earnest phoenix
#

i haven't used ytdl in a while but i'm pretty sure the url goes after the format argument; -f bestaudio in your case

trail kernel
#

Arguments = $@"/C C:\YT\youtube-dl.exe --no-check-certificate -f bestaudio {url} -o - | C:\ffmpeg\bin\ffmpeg.exe -i pipe:0 -f s16le -ar 48000 -ac 2 pipe:1",

#

what should i change

earnest phoenix
#

yup like that

#

if it doesn't work i guess try catch that too

trail kernel
#

ok

#

ill try catch it

#

wait in this case am i suppose to trycatch only that line or the whole thing

earnest phoenix
#

the whole method

trail kernel
earnest phoenix
#

you can return null for debug's sake

trail kernel
#

right

#

its the same if im not wrong

earnest phoenix
#

what is line 52 in your code

#

in program.cs

trail kernel
#

lemme guess i will have to try catch that aswell? xD

earnest phoenix
#

nah

trail kernel
earnest phoenix
#

can you also post your AudioService?

trail kernel
earnest phoenix
#

ah i see now

#

remove the try catch from CreateYoutubeStream and add a try catch to Stream

#

it's probably where the exception occurs

trail kernel
#

ok sec

earnest phoenix
#

hm

#

i think something's wrong with your arguments

#

try placing ytdl and ffmpeg in the dir where you placed the dlls

#

and then set the FileName to the youtube dl file name

trail kernel
#

ok sec

earnest phoenix
#

what does your CreateYoutubeStream method look like now

trail kernel
#

i think i should remove the ffmpeg tho no?

earnest phoenix
#

remove the /C and the spaces

#

the filename should be the youtube dl file name

#

and change the C:\ffmpeg... to just ffmpeg.exe

trail kernel
trail kernel
#

oh

#

i didnt really understand

#

i need to edit my youtube dl file name>

#

?

earnest phoenix
#

no

#

the FileName property of the object should be set to the youtube dl's filename

trail kernel
#

ohhhh

#

i am retarded sorry

#

just the file name right? not the whole path

earnest phoenix
#

i mean the property is literally called FileName

trail kernel
#

😄

#

testing

#

ok now it shows a bunch of errors

earnest phoenix
#

500 means discord server side error

#

what's your code

#

for the create stream process

trail kernel
earnest phoenix
#

you're missing .exe

trail kernel
#

where

earnest phoenix
#

in the filename

#

you're telling your code "hey find a file called YT"

#

it can't guess that the file has an exe extension

trail kernel
earnest phoenix
#

what's your code

trail kernel
#

oh wait i might have

#

did something stupid

earnest phoenix
#

you can't do that

trail kernel
#

sec

earnest phoenix
#

i told you to put them in the same directory where you put the dlls

#

adding in another folder makes it not in the same directory

trail kernel
#

oh i thought the files that contain it

#

not themselves

#

what could be the problem now

#

@earnest phoenix

earnest phoenix
#

is it outputting audio?

trail kernel
#

nope

#

i really dont know what could be the problem now

earnest phoenix
#

if you try to run that in cmd, does it output ytdl logs and then ffmpeg a bunch of nonsense?

trail kernel
#

the whole line of code?