#development
1 messages · Page 739 of 1
What language is it and what's the code
Ok hold on
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”])
ok
Yes with “
ok
You’re specifying the name of the command, not pointing it to a function.
The async function below the @client.command() will be run
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "ping" is not found
^^
And to be clear, you restarted the bot after you changed the code?
i start the ''file'' a again
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
reactions
@trail reef Wouldn't this code work for the person having a problem with the ping command
What code?
Probably
I suspect he made a dumb mistake, like not restarting the bot or messing up indentation or disabling it in some other way
Ok
dont spoon feed
the kind of mistake I make daily
he hasnt learnt the basics of python
^
So do you know how to do a linter in Node.js
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
install a linter
I can't my computer doesn't have enough space
Know somebody something about unity map create
you cant install code thats a few hundred kilobytes at most
yet you are trying to develop a bot
No a game
im not talking to you
O
@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?
lint code input?
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?
How to properly ask technical questions, and demonstrate that you've done your research and are willing to learn on your own.
@earnest phoenix i am using ffmpeg and all i tried is basically to !play a song and the bot joined and left right after
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
@uneven laurel try js setTimeout(function() { console.log(result[0].prefix) }, 100);
the _id prop is not a string, are you using a db like mongo
Heyo
@uneven laurel are you using mongoose or a database with a schema?
@trail kernel can you show your package.json?
ye sec
@grim aspen for C#?
you need to define the fields in your schemas, else they wont be available
nvm then
?
wait are you using C# or js
@trail kernel do you have opus and sodium
@earnest phoenix yes
where did you place them
inside bin > debug
and you're running a debug build, yes?
yes i think
then you've got the binaries for the wrong arch
@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.```
follow this flowchart https://i.imgur.com/735xmZA.png
i am kinda new in this sorry
https://discord.foxbot.me/binaries/ download binaries from here
if you're running on linux use your package manager to get the binaries
pls give link on serve Big Games
no
why
because i said so
please i really need it if u can tell
nobody even knows what you're talking about and this isn't the channel for it
How I can add 2 reactions wo my own embed? (Discord JDA)
What? @shy dune
just ignore him paradocx
i dont use jda
😫
@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?
ffmpeg is not what you install
it's an executable
run the command in the same dir where you have ffmpeg
Is anybody good in Discord JDA?
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)```
read the error
@earnest phoenix any chance u can send a link to what i need to install please?
didn't you install it already?
again
there is nothing to install
anyone knows why im getting tht error?
it's just drag and drop into working directory
@earnest phoenix users is undefined, which means no one reacted with the reaction you're trying to get
but drag what lol
the bot should need to react itself but it doesnt do it var embedSend = await message.channel.send(giveawayEmbed); embedSend.react("🎉");
is this good?
try it
yh its not working
Error
.setTitle("🎉**GIVEAWAY**🎉")
.setFooter(`Vervalt: ${dateTime}`)
.setDescription(item);
var embedSend = await message.channel.send(giveawayEmbed);
embedSend.react("🎉");
Thats the code not the error
await
you did it for message
not reactions
even tho they require the same treatment 
well only embedSend needs to be awaited if they don't do anything with the reaction or care about the order later on
so i hve to remove await?
@earnest phoenix drag and drop what?
binaries and ffmpeg
@earnest phoenix is there any chance youll allow me to dm you some screenshots?
found fix thnx guys
try catch your command and see what throws i guess
tf is ffprobe
ehhh how do i catch my command what does that mean
...yes?
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"
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
but i am retarded i dont know what all that means
you maybe shouldn't jump into programming so forcefully then
because these are basic computer science terms
IndentationError: unindent does not match any outer indentation level
Code?
@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
Okay i'm js sorry
do you know what "indentation" means?
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.
What language?
@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
I just haven't worked with webhooks before
look my error xd
yes
well, you'll need to build a webhook server to do that 
@vital lark me?
maybe space?
yes
no
the space xd
and
I created in a text channel, webhook.
Now I have a link to webhook. And nothing more
discord webhooks =/= dbl webhooks
Apparently I really don't understand something.
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...
Does anyone use digital ocean as a VPS
too complicated for me.
- go to your bot's edit page in the website
- 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...)
- set up a webserver and listen to requests made through item 2 (dbl's libraries can do that for you)
where is your bot hosted? your computer? a vps? glitch/heroku?
glitch
you can use the dbl library then
Example of posting server count with supported libraries (Discord.js and Eris) <= work
Example of using webhooks to receive vote updates <= not work
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
ie: this
and the one in the website
have to be the same thing
but they can be whatever you want
yourDBLTokenHere?
your bot's dbl token
@quartz kindle u are osass?
ok
you also get it from the bot's edit page
uvuvwevwevwe onyetenyevwe ugwemubwem ossas
maybe
https://github.com/DiscordBotList/DBL-Python-Library very helpful
A simple API wrapper for discordbots.org written in Python - DiscordBotList/DBL-Python-Library
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
cool
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
oh
(
Yall gitlab or github?
Github
For what reasons?
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
hmm. Okay.
What do you prefer?
im currently checking out both
For such reason. Gitlab has Self Hosting
but buggy
While Github Runners(Self Hosted) is alot more buggy
Its still under free
Free Full on vps
heqq
you can set it up using docker
cool
boutta google this more
I'll probably just stay with my raspberry pi tho
idk
UI Wise, GitLab. Feature Wise, Github.
cool
One thing that gitlab did is to make the CI/DI better than github's actions
Which is nice
f
And im not liking it
Yeah I wouldn't either
Compare that to this ui(Gitlab)
reminds me of the almost 1 minute getting ready period that my bot likes to pull
nice
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
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
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
Ooh
AHHAH okay same
is your rpi 1GB ram? or just the 600mb one?
Then why not run CapRover? or any low requirement PaAS
I'm cheap af, and I prefer self hosting cause the device is right there, need I unplug if it becomes sentient
Yeah
Caprover is self hosted
i use it for prod and alpha builds of my things
Its dev friendly
wait you use alpha builds?
YeEt yes
lmao laughs in publishing bot in unfinished state
I have 2 branches in my git. one prod and alpha
Okay nIcE
ci/dl can do eslint without the need of doing it on the main server/system
laughs in python
cries i forgot what lib you are
hA yOu PuNy nOn PyThOn UsEr U hAvE tO cOmPiLe HA
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
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
ok boomR
okAy zoomer
lol
Frik markdown hell
Waht
DISC```ORD
MARK
>>> **dO**
||Wn||
Seems like someone friked up Their Life with Markdown
let l = “friked up”
let w = “Markdown”
console.log(l + w) // Fricked up Markdown
GrEaT
if(life == “Limited”){
return console.log(“Dream Infinite”)
} else {
return console.log(“You already died.”)
}
im bored now
docker is updating
Nervously looks at quotes
^
Please use actual quote characters. Your smart quotes are bothering me.
aren't those just apple quotes
Pretty much
how i do ''addreactions'' in python
ok
thanks
Click on it and search for reactions
ok
ctrl+f is life
10/10 quality bot hosting 24/7 service
xd
that just looks like "hosting" with extra steps
bUt It'S qUaLiTy
Can I see all of your code?
are you getting an error? what's specifically not working?
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
ok
🤦
because it has a token
oh
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)```
First thing
Get rid of the space between on_ready and ()
And the f command
Get rid of the extra ,
And bot.command() won’t work because bot doesn’t exist yet
You would need to use client.command() in your case
I doubt space between names and parentheses matter
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
Java complains at anything not correct
Python is okay with it
Cool
Still would be good practice to make your code neat, and in the process get rid of those spaces
That'd be correct
That’s a shiny role you got right there, what libraries have you contributed to?
dblpy, the role is for people who maintain official DBL libraries
How would I change this to Online? https://i.imgur.com/qnAQl72.png
Also how would one get a certified bot dev role?
What does that bot do?
How would I get it added here?
-kickedbot @tiny fable
@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:
How does it go about preventing suicides?
^^
Fair enough.
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
oof
we just dont want non-prefixed responses here
Anyway it can be restricted from channels?
uh i guess so?
So DBL can have access to it's status?
I could give it the common prefix role i guess
locks it away from any channel
bot id pls
Thank you
FeelsSadMan
didn't you have to send a letter to fat man
or are both the letter and digital parts closed
sending the letter would get you the same outcome if you sent a letter to the actual fat man
I believe that's still open
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
doesnt it always reconnect on error
I guess maybe in other libraries the error will just show up as a reconnect
discord uses cloudflare so yuh everything is proxied ¯_(ツ)_/¯
makes sense
also iirc error codes for ws are 4 digits
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
You probably meant 1001 as error code? I get them too.
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
Doesn't discord.py's bot.run(reconnect: bool) handle that
Huh
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
You replaced discord's message with the api's message
Also you cant download an image as json
it gives a link that gives a json that has an image in it
Ah ok
You replaced discord's message with the api's message
so, how do i fix this?
Rename your variables
because on the other command, that is really similar, it works
Using the same variable names for different things is not a good idea
well, i'll try something else
You can rename a destructured variable as well
but since the json has the propriety "message" i can't change it
You can
In 2 different ways
1 ```js
const response = await fetch(...);
console.log(response.message)
2 ```js
const {message:responsemsg} = await fetch(...)
console.log(responsemsg)
The first one gets the full object
With all properties
The second one is destructuring the object and extracting a single property
thanks again
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.
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
Reloading
I suppose that is possible?
https://www.npmjs.com/package/file-system, also known as fs, it will read a file and use it when the bot is triggered
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?
I know this, and i know i must require this, BUT i must get bot variable to file using require.
yes
so by right your modules should still work whether you are using djs or eris
just that the api usage is a little different
Ok thx
Use some shit bot designer. If your going to do that DON'T publish it.
Give me details
are you sure you followed the instructions
I also want to know
For human verify
@rough hemlock how does the human verification look
time to make discord bot maker M
Send a screenshot
oh really?
dbm but only templates
way less customization
and dbl doesnt allow bots made with it on the site
yeah oof
DBM by itself has customizations
I was joking bruh
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
member.id is my id, ownerID too
How I can add Reactions(2+) to my embed? (JDA)
message.react('[emoji]')
@earnest phoenix Discord JDA?
discord.js
I need JDA
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)
What do you define member as
const member = message.mentions.members.first();
Are you mentioning a member when you run the command
of course
I'm mentionning myself using a second account
I've created a test server
with my second account
and it don't detect member.id
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
what is the problem
whats the problem
okay i immedeatly see 2 problems
me2
logging messages
unclosed string
const ruolodagivvare = "
you need 2 " at least
Is that really logging messages
@slender thistle
console.log("t!ruolo" , message)
What does exports.run do
Ehh I know jack shit in d.js so I'll stay away
Did I ever say I learned js 
and this is a js question so why do you care
Yes
I need help putting a linter in a line of code but I need help getting the linter
You can’t develop a bot on a computer with less than a gigabyte of storage left
Invest in more storage
I can't its a damn school computer
lapetus be a bit nicer pls
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
Code?
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 ?
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
hey i have a question how do i get custom font on NPM canvas-constructor ?
.
dotpost nice
Yep
.
stahp
ugh
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
Depends on the font size
Font
Weight
Theres so many variables that play into the width of a text
but how would i make the rect follow the amount of letters
I haven't used canvas for anything like that before, but you could just mess around with numbers 
i can host a bot with python? ||in glitch||
no
oh ;v
python != node.js
what?
programmers should understand that.
Hosting python bot in glitch? thats not possible, because glitch is node.js based.
it is possible
so?
oh yeah forgot that...
it has python installed so you can edit your npm start script to run python
I do not recommend using Glitch or Heroku for Discord Bot Hosting
so? @unique nimbus
its more complex than using repl.it (not recommended) or heroku (not recommended) or simply pay few bucks a month for a vps (recommended)
My VPS is 5 euros a month and is decent
mines 2€/mo (512mb ram, 1 shared cpu, 10gb memory)
0/mo Bv
I mean I use mine for a lot of reasons
seriously, you can get something good enough for 2€/month, thats like the price of a slice of pizza
ye
help me?
On what?
With what
;v
you can, we just told you how
ye
Then ask him how he done it
It is possible, but its too complex, so either find someone who is doing same or use heroku, repl.it or vps
It is just not recommended
have you tried asking him how he did it
i can use this video?
Hosting website - https://uptimerobot.com/ Join our discord server- https://discord.gg/2WWfRpj Our second channel-https://www.youtube.com/channel/UCqaHMwVQZ1...
Arthur I had dark reader enabled so I almost got scared when I saw dark dots falling
looks nice though
yes it work with py
How can I put the webhook timestamp at when I sent the webhook?
(I am using json)
guys i get this error message in my console whenever i try to put a song on my bot
what does it mean?
is this a lib in java or c#?
C#
don't know how to read c# errors, but it doesn't look like its giving any useful information
then what to do ;-;
somebody probably knows c# and can help you, id advise just waiting
Have you tried Googling it
yes i couldnt find anything helpful
@amber fractal ok ty i fixed that
do u have any idea what can cause the error above?
so how do i fix that error?
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
but now its working fine
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
okay yeah, do you have your command runmode set to async?
where do i check that
in your code
uh what
wait are u talking about the play command
yes
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
i am pretty sure i did tho can you send it again please ill do that again
ty
https://discord.foxbot.me/binaries/ download from here
so if i am using 64 bit i basically download those 2?
follow the flowchart, and yes
then you place them in the directory where you're working in
which is my bot's directory in the debug folder right?
if you're running from vs debug yeah
yes
which means...? XD
oh and do u have maybe any idea on what it could be or where? or i have to search it
it says it in the error
in program.cs?
ah ok i see, run straight from vs
run an actual debug build
because right now it's running a compiled build
how do i change that
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
pressing f5
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
i dont really know how to use try catch but sec
i've linked you to the docs
[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? ❤️
why don't you want to read the documentation link
it thoroughly explains how and where to use try catch
because its long and i probably wont use it any time in the future i just want to finish this god damn bot lol
if you can't be bothered to learn, we can't really help you much 🤷♂️
try catch is basic c#
i learn basic c# in school and i never heard of try catch
x doubt
i am serious
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
so ur not gonna tell me where to put the try catch in the code i send you?
i sent you the docs link which i keep telling you to read
which you could have done by now
lol
you could've literally logically made a connection where to put it just by reading the first two paragraphs
?
yes, you're missing a bit more in the catch part
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
like this?
yup
thank you very much kind sir
like this yea?
you can just use e
it will ToString it which includes the source, stacktrace and the message
correct
you've got the wrong architecture dlls
the opus and sodium?
but i downloaded the 64 bit
you probably didn't follow the flowchart correctly
gonna do that again then gimme a few minutes please
the 32 bit?
yes
what's the error
the dlls are not there
you have opus(1)
not opus
yes yes
i think that might have been the problem this whole time
and if it is imma kms
ah
and it still didnt work
and thats prob because
the name
should be fine now
running it
it says the same for some reason
even though its correct now
you have opus space .dll
oh right
ok thank god
its not leaving the channel now but
its not playing the song either
i'm pretty sure you've got the url in the wrong place in your arguments when creating the process
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
ehhh like this?
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
ok
ill try catch it
wait in this case am i suppose to trycatch only that line or the whole thing
the whole method
where do i add a return
you can return null for debug's sake
nah
can you post your entire module where you have the play command to https://paste.mod.gg
can you also post your AudioService?
ah i see now
remove the try catch from CreateYoutubeStream and add a try catch to Stream
it's probably where the exception occurs
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
and just remove this part
what does your CreateYoutubeStream method look like now
remove the /C and the spaces
the filename should be the youtube dl file name
and change the C:\ffmpeg... to just ffmpeg.exe
correct?
no
the FileName property of the object should be set to the youtube dl's filename
i mean the property is literally called FileName
500 means discord server side error
what's your code
for the create stream process
you're missing .exe
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
now what
what's your code
you can't do that
sec
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
oh i thought the files that contain it
not themselves
now everything is inside
what could be the problem now
@earnest phoenix
is it outputting audio?
if you try to run that in cmd, does it output ytdl logs and then ffmpeg a bunch of nonsense?
the whole line of code?







