#development
1 messages · Page 1607 of 1
i do
Friendly reminder to follow rule 1 and be respectful to other people.
he's right though
@solemn latch
You can be helpful without calling someones code garbage.
sorry for the ping
np
but do you know anoything about sailsjs?
it is garbage though
objectively it's garbage
not even subjectively
im trying to pipe 2 files from react next to sails server 1 to sails server 2
And you can say "hey that isnt the best way to do this. Here is a more optimized way to do so:
Instead of just calling it garbage.
if its a single file i can get it in req.file("")
nope, I know nothing about it
no docs? 👀
i didn't just call it garbage and i very clearly gave examples on how to refactor it above
there's no explanation for pipes and multiple files
not like they're going to listen regardless
The word garbage or any other demeaning word towards a user or a users code is not appropriate and you can be helpful without using that kind of descriptor
ok
Thank you
ok
if anyone could help out with this, ive taken a look at the docs and wasnt able to find something on it, is there any way for me to find the system messages channel of a guild so that my bot knows where to send join/leave messages? (discord.py rewrite)
no worries
since when did system channels become a thing 👀
since ageeeeees
oh
I have a try, and I want to have the same output for my IndexError error, and for an else. How can I do ?
Without copy / paste my code
f.e : I search in a 2d tab if all values are the same. If the values are not the same or if I got an IndexError error, I want to continue my code
python btw
join leave is system channels?
ah
also nitro boosting messages
pretty much any message that doesn't have an author is a system message
i never knew it was called that
yep i wanted to send join leave messages there for simplicity's sake
i really wish discord didn't remove default channels
since default channels and system channels have different uses
In my messageDelete event, there is a message that gets deleted but I don't know what message, and it's resulting to this error, (node:21) UnhandledPromiseRejectionWarning: RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty.
.addField(`**Message**`, `${message}`)
Not sure what message is getting deleted to cause this error.
Are you sure that message has a value?
Yes, it does.
I delete a message like Test
It logs it.
Did I accidently advertise. no mute pls
Show how you setup your event please
module.exports = async (bot, message) => {
// We need to check if the actual message is a blank message, so it can return.
if(message.content.includes(["_ _"])) return;
// If the bot was offline or restarting and the bot could not cache the message, it will return so it can not return as "undefined".
if(message.partial) return;
// If the message was from a bot, it would return.
if(message.author.bot) return;
Server.findOne({
serverID: message.guild.id
}, async (err, server) => {
if(err) console.log(err);
if(!server) {
return;
} else {
if(server.messageDelete === null) return;
const time = new Time(message.createdTimestamp);
const embed = new MessageEmbed()
.setColor(cyan)
.setTitle("Message Deleted")
.setThumbnail(message.author.avatarURL())
.setDescription(`A message was deleted!`)
.addField(`**Message**`, `${message}`) // <--- Error part. "(node:21) UnhandledPromiseRejectionWarning: RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty."
.addField(`**Sent By**`, `${message.author.tag}`)
.addField(`**Deleted In**`, `${message.channel}`)
.setFooter(`Deleted after ${time.getHumanizedElapsedTime()}`, setTimeout)
.setTimestamp()
if(!server.messageDelete) return;
let channel = bot.channels.cache.get(server.messageDelete);
if(!channel) return;
channel.send(embed);
};
});
};
What happens if someone deletes an embedded message?
the message might still be empty
I think message.content would be better, rather than just message?
does the same
I need to quickly edit this if(message.author.bot) return; and add message.channel.type === dm
That errored.
also you don't need to use backticks if you're just gonna insert a single variable in them
and since your function is async, you can just do const server = await Server.findOne({...})
(that's mongoose right?
)
ever wondered what happens if you dont catch a rejection inside an interval?
spain without the s
How do I do this in grafana / influxDB dashboard?
everytime a command is run, save it somewhere
or if you using a database, just dump it into it
I have influxDB
and query via grafana
I save it there already
(i havent used influx) but i assume its just another db
anyway
just query from it in grafana
add a source
and then query it, it should have a query builder to help you set it
I did everythin, I just don't know how to query it well with grafana
I checked, didn't error.
Right now it looks like that and it's bad
I did everything already
I just need to understand the code o the query itself
from(bucket: "astro-logs")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "vc")
|> aggregateWindow(every: 3m, fn: count)
That's what I'm doing rn
I think that the aggregate function is the issue
Luke might be able to help you with influx
he uses it for his microservices too
specially because it looks like your panel itself is wrong
it seems like you're querying the wrong type for a graph
yeah I don't have any numeric value I just have the timestamp and discord IDs, so I just need the sum of logs overtime to be displayed
(node:10828) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'bind' of undefined
what does this mean?
This means you have to share some code for us to know :)
its on this await this.initializeModules()
(node:10828) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'bind' of undefined
at PrestigeClient.initializeModules (C:\Updated Bots\Prestige Main\src\base\PrestigeClient.js:47:22)
at PrestigeClient.initialize (C:\Updated Bots\Prestige Main\src\base\PrestigeClient.js:31:23)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:10828) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:10828) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
Cannot read property 'bind' of undefined <-- this means you tried to do undefined.bind()
in PrestigeClient.js line 47
tim.bind()
how can i make my bot leave a server again?
when i do message.guild.leave("id") it leaves my server lol
@_@
...because you're calling it on the guild the message was sent in
what does .bind do anyway
guild.leave()
^ --- leaves this guild
guild.leave()
^ not this one
wait oh yh makes sense now
sets a function's default arguments and the this variable
ah ok
code
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'C:\Users\igoro\OneDrive\Bureaublad\DezorBot\ticket.js'
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:725:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m {
code: ←[32m'MODULE_NOT_FOUND'←[39m,
requireStack: []
}
Date.now() is type number, but how do I convert it to a timestamp?
error
Does anyone know how you get a data uri from a discord emoji link?
data uri?
I think I do.
wdym
@wind kayak Post the emoji link.
it says "i can't find ticket.js in DezorBot folder"
thnxx
what kind of data uri?
the base64 one?
you mean in ISO string format?
const date = new Date();
date.toLocaleString();
pretty sure that should do it
if you only want the date then do date.toLocaleDateString();
tim, i did it
Yes
when I save to firebase, the key type is converted to timestamp
I think it's the way firebase does things
man
meh, not a problem working with it
Is it in the node-fetch response headers?
you can load it with canvas and use canvas.toDataURL()
Oh really?
Geen files gevonden...```
its said: "don't have find the files"
Hello, I want to add nitro emoji to my bot. Which ones can I put?
this?
Merhaba bana botuma ekleye bileceğim niteolu emojiler vere bilirmisin top gg dede kabul edilecek
wtf?
english
Okay
who can help?
Hello, I can add niteolu emojis that I can add to my bot. Do you know top gg grandpa will be accepted?
But what about gifs?
top gg grandpa
change it to image/gif lol
actually no
lmfao i'm retarded
Sorry, English translation error
Geen files gevonden...````
its said: "don't find the files"£
(this is from github pls help i need this for me server and i dont know what i must install..
Yes 
dede means grandpa 
just make sure it is not rainbow/seizure
Can you help me out as soon as it's accepted
niiiiiice

nice
i will bet money on that
@wind kayak like this? not sure if there's a better way to do it
no need for double await
1 await also awaits all chained thens
await a.then().then().then().then(x => 10) // 10
async/await was introduced to make the whole promise system more readable
synatactic sugar
Can you say which ones are accepted 1 2 3 4?
I'm aware, yeah but I only use .then() if I want to chain .catch() instead of a try catch
but otherwise await is just nicer to use
well i prefer to use await a.then(b) than await (await a).b
std::move(std::promise<T>) 
Thanks @pale vessel 
c++ promises?
xD
yup
truly a nightmare
you might need a therapist after first working with them
rust has little to no concept of promises
i have a C lib that basically has some configuration switches
and they are applied process-wide
what would be the way to isolate it into instances, so that one could use it concurrently with different settings?
put it in different threads?
i guess so? that would also be what i would try to do at the top of my head, i'm not sure if synchronization would be a problem in this context
worth a shot
trial and error ig
yeah i figured as much
im not gonna do it rn tho
its fast enough to allow always resetting configs before calling a function
the lib is over 20 years old and fully written in functional programming
there is 0 concept of oop in it
~~zlib
~~
well thats alot of C in general
who can help?
How do you make the bank or storage for a economy bot?
Like how +Work gets you 200 points, how do I make something like it
get a contract with your government and get a banking license
haha funny
first you need a database, or a way to store information about a user
@modest maple is it worth having static content served from nginx rather than my python webserver (I'm assuming you can do that)
Is the performance benefit noticeable
for a small scale site, i personally wouldn't notice really any difference
nginx is useful for scaling, i.e. lets say you have thousands of visitors and you have to modify something; you don't have to kill nginx and restart it to apply changes
instead nginx will handle all of the old connections and handle new ones with the changes at the same time
it has more uses than that obvs
but for serving static content just use whatever you prefer
well im assuming cutting off the middleman will be beneficial to the entire system
less cpu wasting
nginx does add a lot of functionality
Is MySQL what you were talking about? or something similar?
that is one option yes
ok
did you install on your computer or on another?
on my server
oof
Who's Luke?
sqlite is good for small applications like discord bots because it doesnt require installing a database server
For Luke then: I've got a bunch of logs, for example, every time a command is used I save a point in my influxDB with the command_name, the user_id of who used it and the timestamp obv. Now, how do I turn all these logs in a nice graph in the influx dashboard, I would like for example to have a graph that showed the total number of commands used that grows through time.
ill download that instead.
(influxDB dashboard or grafana too)
how can i directly push the data into the json.sqlite file?
(quick.db)
is it db.push()
?
what is this error
(node:4) DeprecationWarning: Collection#find: pass a function instead
keeps ruining my bot 😦
that's not an error but a warning
you should use functions inside find, not pass a value
how do i fix it i really don't know, its really messing with my bot
^
i did npm i enmap
wdym by this tho
functions inside find
exactly that
how do i do that tho
() => this is a function
oh
help
what the pass a value then
install visual studio
the function
VScode?
k
so should i replace all of it with () =>
no
then how do i fix that error
O método find() retorna o valor do primeiro elemento do array que satisfizer a função de teste provida. Caso contrario, undefined é retornado.
im really sorry im not a good bot developer
that's not regarding bot development, but basic js
I mean maybe he's not an ES6 Javascript guy
Just learned how to use mongodb, now... time to implement it into my discord bot! (previously just used JSON)
the green part is what I now have to rewrite!
i dont wanna study it at this time, i just really really want to fix this.
no, that's a wrong line of thinking
fixing it will not solve the main issue
it's like giving a fish to someone starving instead of teaching how to fish
The main issue in this case is between the monitor and the chair
Take some time and study ES6 Javascript
It's essential
Yes i do understand lol
we do understand
you do understand
short-term fix will not help long-term issues
but you do not understand that many people are spamming me to fix the bot
and i seriously dont know how to
just close ur dms then
and i am not bothered to look at a paraghraph at 1AM
If you don't get urself to learn arrow functions, u Will get into the same issue dozens of times while developing ur bot
Honestly if u want the quick fix then read this link kuuhaku sent
do note however that when u fix one bug two new will appear
not bothered, thanks for the help.
ouch
4K
yes Python is incredibly slow for serving that sort of content and cant do it asyncronously like nginx
its also very RAM intensive due to Python's memory allocation style
serving lots of small static files will often lead to ram not being released in the runtime
cool thank you
you dont
Doesn't work
kind of piping
Trying to send a file
piping is generally not one of them
Between 2 servers
and i have VS
or do you mean two processes on the same machine
It's a req, red thing
Yeah
2 processes
2 servers nodejs (sailsjs) actually, but it's all same
why do they need to be connected?
normally thats a bad idea
/ not something you really want endgame
Well there's an Api server which is mainly used for Auth purposes
And then there's a main backend which stores data etc
Kinda microservices architecture
Thats not really microservice
or atleast thats not the sort of microservice you should be aiming for
i mean you can but its a really bad idea for your application in all honesty
How so
having a single server just for authorization and then another server do everything else is fairly pointless when the main server needs that info in the first place
Well all in trying to do, is whatever the files are in req.file,just stream/pipe it to another server
I mean, this api server can be exposed to other stuff as well, like if a 3rd party wants access
piping it is just gonna be slower
It's fine. I'm not aiming for speed here
again though, you dont wanna use piping
so what do I use
in reality its going to be easier and better to use an internal request
This is an internal server lel
Doesnt change anything
guys I have a question, I'm new to using databases (other than a basic .json file)
If I'm using MongoDB, should I connect to the database at the start of the code and never end the connection with the db or should I connect/disconnect after every read/write?
Or a diff way to send it to server
bro
Should do
start it and never end it
1 connection many operations not 1 connection 1 operation
gotchu, thanks
Aight. But what if I still wanted to use external endpoints xD
thats not how that works
internal and external just refer to who's accessing it really
if its external then having your 2nd server is pointless and a dead idea
Well, all I'm trying to understand is how to send a file between 2 servers
because it might aswell be done by the main server since anyone can access it
im telling you how
just another endpoint
Ik
Wait
or an authentication of some sort
what is your obsession with pipes
but dont use them for things that dont need it or want it 
I wanna try it out for knowledge purposes
you cant just slap pipes on anything and everything
and you cant expect everything and anything to accept a pipe or being piped to
...
......
@modest maple thank you, its way faster to embed into discord now
and just in general
though it was quite a task to set it up

That'S working perfectly as expected
it's asking for a channel, you didn't provide a channel.
but
If you mean it didn't give you both errors
it says you cant use that
it'S beacuse you didn't use return
async load () {
try{
await this.initializeEvents()
return true
} catch(e) { this.client.logger.error(e)}
return false
}
/**
* @param {string} dirPath
*/
initializeEvents (dirPath = 'src/events') {
return FileUtils.requireDirectory(dirPath, (NewEvent) => {
if (Object.getPrototypeOf(NewEvent) !== EventListener) return
this.addEvent(new NewEvent(this.client)) ? success++ : failed++
}, this.client.logger.log.bind(this)).then(() => {
if (failed) this.client.logger.log(`${success} events loaded, ${failed} failed.`)
else this.client.logger.log(`All ${success} events loaded without errors.`)
})
}```
what am i doing wrong? no error though?
Well you have a few places where you return stuff so maybe you should, like, log things and figure it out?
i try logging stuff, and nothing logs
maybe Object.getPrototypeOf(NewEvent) !== EventListener returns trueso it just returns
dosent even get to that point
if nothing at all happens it means that code isn't running
which means the problem isn't in this code.
initializeEvents (dirPath = 'src/events') {
this.client.logger.log("test")
return FileUtils.requireDirectory(dirPath, (NewEvent) => {
if (Object.getPrototypeOf(NewEvent) !== EventListener) return
this.addEvent(new NewEvent(this.client)) ? success++ : failed++
}, this.client.logger.log.bind(this)).then(() => {
if (failed) this.client.logger.log(`${success} events loaded, ${failed} failed.`)
else this.client.logger.log(`All ${success} events loaded without errors.`)
})
}```
that logs
Also you might wanna rething this "random unreadable syntax" thing you got going on
wdym?
I mean the random indentation, the absolute lack of semicolons, the horrible failure to use proper line returns
this is a mess of unreadable code
oh sorry
Already this is easier to read ```js
async load() {
try {
await this.initializeEvents();
return true;
} catch (e) {
this.client.logger.error(e);
}
return false;
}
/**
- @param {string} dirPath
*/
initializeEvents(dirPath = "src/events") {
return FileUtils.requireDirectory(
dirPath,
(NewEvent) => {
if (Object.getPrototypeOf(NewEvent) !== EventListener) return;
this.addEvent(new NewEvent(this.client)) ? success++ : failed++;
},
this.client.logger.log.bind(this)
).then(() => {
if (failed)
this.client.logger.log(${success} events loaded, ${failed} failed.);
else
this.client.logger.log(All ${success} events loaded without errors.);
});
}
I mean, semicolons are kinda optionally obrigatory in js
No, they're not optional in all cases and unless you can quote the rules of ASI you shouldn't consider them optional
Why does someone always feel the need to start the damn debate every time I mention semicolons
not starting one
sure, ok. fine.
then add more console logs
maybe Object.getPrototypeOf(NewEvent) !== EventListener returns true so the entire thing returns and nothing else runs
Honestly I completely and absolutely fail to see the point of using an async function you're awaiting just to call a function that's not async/await. So weird.
yo can someone help
this is my command
and yet its throwing this error
and the role var is showing up as None
oh wait
nvm i feel like ik the answer
you never defined "role" outside of that try scope
Try statements don't create new scopes though, so it should be fine (I think?)
afaik they do create new scopes, never heard of a lang where it didn't
I feel like PyCharm would definitely underline that though
ain't that pycharm?
like, only paid intellij has python stuff
hey guys. I want to add an error to my D.py bot that doesnt allow commands in DM's. can someone help?
do you have any prototype code?
oh ok
well no. because i cant find anything to start on
well nvm
wait
async def on_command_error(ctx, error):
print(str(error))
if "HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body" in str(error):
embed = discord.Embed(title="Error", color=0xff0000, description="Enter a valid ID")
elif "object has no attribute 'name'" in str(error):
embed = discord.Embed(title="Error", color=0xff0000, description="Enter a valid name or ID")
elif "UnboundLocalError: local variable 'member' referenced before assignment" in str(error):
embed = discord.Embed(title="Error", color=0xff0000, description="Enter a valid name or ID")
else:
embed = discord.Embed(title="Error", color=0xff0000, description=str(error))
await ctx.channel.send(embed=embed)
i have that
You should probably use isinstance() to check those errors instead
Also, you could add a check in the on_message event and check if the channel is a DM channel
ok.
something like
if isinstance(ctx.channel, discord.channel.DMChannel):
ok
This seemed to work, so idk 
elif if isinstance(ctx.channel, discord.channel.DMChannel):
embed = discord.Embed(title="Error", color=0xff0000, description="no commands in DM's")
that?
Yeah, something like that.
ok cool
thx
@dusky sundial its an invalid syntax
im guessing DMchannel isnt a channel type
What is?
elif if isinstance(ctx.channel, discord.channel.DMChannel):
^
SyntaxError: invalid syntax
that only works because test being in try passes a boolean True statement
wait nvm
i messed up lol. my B
it worked but it didnt work. imma try to diagnose. thx for the help
It might be just discord.DMChannel
lemme try that
ty lol
Variables defined inside try except work fine outside of it
you can also use discord.PrivateChannel
Python is a chad
Python is very special in his own little way
No worries! Just ask if there's anything else
also question
ok!
are bot reviews being paused because of the website migration atm?
thx
Im pretty sure you can make It so scope variables only work for that scope as well
i haven't seen a single bot declined or approved since
Just like most langs
if you put it in an inline function of another func
i think so
then it's forced as scope-only
as long as you call that function afterward declaration
main all the way
master :^)
Hi Tim
app.js 
py.js
Bot.ts
c.cpp.rs.go.jar.py.yaml.json.ts.js
mycutebot.txt
uvuvwevwevwe_onyetenyevwe_ugwemubwem.ossas
Hi, I have a problem. Can someone help me?
are you okay tim? do you need me to call a doctor?
@icy skiff is that a server rule?
yes.
why
It doesn't help when you say "I need help" with no context.
We don't want to ask "with what..?"
It's exactly the same.
I think people asking for permission to ask a question is more of being courteous/nice
This channel and others are litterally designed for questions
instead of blatantly asking for that permission itself
well that's fair
that's if people read the channel description though
and ngl not many do that as a generality
That's their fault.
i suppose
What's the question tho
what is the best language or program or tool idk to use to code a discord bot?
There isn't a best one
easiest
Python and discord.py probably
Python is easy to learn, but I'd recommend either Python or JavaScript
Np
you got any like video tutorials dat are good?
Sure ill dm them to you
I wouldn't watch those ones that are like 6 hours long as they easily get boring
Yes
I sent a playlist to him
The one that I used at least
And its the rewrite branch
It might be good to get some basics down before delving into bot development though
Oh well
Dont generalize
Much better just going straight on
They're a good way to get started, but I wouldn't rely fully on them no
So in Discord.js v12.5.1
I am trying to get a value if no args
I am not getting it ... - songName
let songName;
songName = args.join(` `);
if(!songName) {
let Stream = data.guild.stream_link.alpha;
internetradio.getStationInfo(Stream, function(error, station) {
let Info = station;
try {
const StationInfo_Raw = Info.title.split(" - ")[1].split('" ').map(x => { let s = x.split('="'); return {[s[0]]: s[1]} });
let StationInfo = StationInfo_Raw.reduce(((r, c) => Object.assign(r, c)), {});
songName = StationInfo.text;
} catch (e) {
return client.tools.errorcdm(` **Song can not be found!**\n**To get the lyrics of a diffrent song use \`${data.guild.prefix}lyrics [song name]\`**`, message.channel);
}
})
}
Exactly
for dpy I wouldn't watch any videos
because of how dpy changes tutorials become outdated quickly
Get some basic python knowledge before tho
Like
At least the basic
No
Completely different
Not at all
Python is the near the farthest u can go from java actually
If you have some understanding of basic programming terms it can help, but Java is very different
Several people are typing
can u code bots with java?
help
Yeah, the JDA library
If you do know java, I'd advise to go with it
alright i will code in java den
i kinda know java
Learning New languages is good tho
But stick with which u prefer
How do I get that money from the page?
It is, but making a bot in java will teach a metric ton of concepts and upgrade ur knowledge
Like, you'll become more proficient over time
object oriented ftw
I can not pass it to my paypal or something like that?
And java is one of the main business langs
ALRIGHT THANK YOU GENTLEMEN FOR YOUR HELP
pretty sure not
pff
Nope you can not. This is only for auctions.
makes sense
Auctions of what?
still really pog that you can get money for auctions
Basically advertising
You buy a space to advertise
However it's auctions system
And how I do it?
Spice up your Discord experience with our diverse range of Discord bots
And another question, how do I make top.gg in my bot show how many servers is it? They go to
Is it an api?
Sent wrong thing / read your message wrong.
Or you can use this:
https://www.npmjs.com/package/topgg-autoposter
Bumping this up: #development message
is npm i topgg-autoposter?
Yes
the thing is that it explains it as if it were Discord.js and I use another language
Ahh, I'm not too sure then sorry
😦
You could probably just look up how to use the topgg autoposter for your language
my language is dbd.js
That's a wrapper of Discord.js though, no?
why do people keep asking to buy my account
The dev badge, i get that all the time too
There are a number of possible errors that could have occurred:
getStationInfodoesn't updatesongNamein time.getStationInfo'scallbackfunction is not called.- The statements in the
tryblock cause an error and leave the scope beforesongNameis updated. songNameis updated to some value that is also a blank string.
You'll probably want to use a debugger to step through and see why the value isn't being updated.
I got offered 2.5k bucks today
How to get it?
nice
You can't anymore
f
You needed a verified bot before Oct 17 2020 I think
I've been offered at most $800 for the early supporter badge
it's good money, it's just that the offer is from a random stranger on Discord which instantly breaks the deal for me lol
They accepted it in November:v
yeah exactly
Is it normal that having installed npm i topgg-autoposter, in the package-lock folder, .json so many things have been installed?
if(!songName) {
let Stream = data.guild.stream_link.alpha;
internetradio.getStationInfo(Stream, async function(error, station) {
let Info = station;
try {
const StationInfo_Raw = Info.title.split(" - ")[1].split('" ').map(x => { let s = x.split('="'); return {[s[0]]: s[1]} });
let StationInfo = StationInfo_Raw.reduce(((r, c) => Object.assign(r, c)), {});
songName = await StationInfo.text;
console.log(songName) //Givees a value
} catch (e) {
return client.tools.errorcdm(` **Song can not be found!**\n**To get the lyrics of a diffrent song use \`${data.guild.prefix}lyrics [song name]\`**`, message.channel);
}
})
}
console.log(songName) //Nothing
Is there a New badge or smth or there's no badge at all anymore
topgg-autoposter what is it? a number or something?
Never used it, so I don't know sorry
Pretty sure there isn't one, you can still verify your bot, you just won't get a badge from it
And what exactly am I looking for?
Use #topgg-api for api related questions
im trying to do a command that plays an audio file in the voice channel
client.on('message', async msg => {
if (msg.content.toLowerCase() === 'play me some tunes') {
if (msg.member.voice.channel) {
const connection = await msg.member.voice.channel.join();
const dispatcher = connection.play('rickroll.mp3');
dispatcher.on('start', () => {
console.log('audio playing');
});
dispatcher.on('finish', () => {
console.log('audio not playing');
});
}
}});
the bot joins the channel fine, but it doesnt play the audio
damn, so sad, i didnt know that, i am on the verifying process rn and thought i would get the badge
rip me ig
I mean, they might bring a badge back in the future. Who knows 
hope so
same
Do you get any sort of error
yeah hold on
events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn ffmpeg ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn ffmpeg',
path: 'ffmpeg',
spawnargs: [
'-i', 'rr.mp3',
'-analyzeduration', '0',
'-loglevel', '0',
'-f', 's16le',
'-ar', '48000',
'-ac', '2',
'pipe:1'
]
}
Could be why
What if you do something like this
msg.member.voice.channel.join().then(con => {
con.play('./rickroll.mp3');
})```
thats a banger
I've done something like that before with radio links and it worked for me
yes iirc radio links work
$600 for me to add me to my bots application as admin.
so
if (msg.content.toLowerCase() === 'play me some tunes') {
if (msg.member.voice.channel) {
msg.member.voice.channel.join().then(con => {
con.play('./rickroll.mp3');
})
[......]
is that the right place to put it
Should be
Logged in as The Worst Bot In Existence#1697!
(node:829) UnhandledPromiseRejectionWarning: ReferenceError: dispatcher is not defined
(node:829) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:829) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn ffmpeg ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn ffmpeg',
path: 'ffmpeg',
spawnargs: [
'-i', './rickroll.mp3',
'-analyzeduration', '0',
'-loglevel', '0',
'-f', 's16le',
'-ar', '48000',
'-ac', '2',
'pipe:1'
]
}
basically the same but slightly longer
that's what it was originally
e.e so it crashed again
What if you try on your PC while hosting locally
my internet's super slow and it would be like a 2 second ping
but
i mean i could try it
i am using @fortawesome/fontawesome-free but the font is not loaded.
registerFont(path.join(__dirname, '..', 'node_modules', '@fortawesome', 'fontawesome-free', 'webfonts', 'fa-brands-400.ttf'), {
family: 'Font-Awesome-Brands',
});
(process:16572): Pango-WARNING **: 03:47:03.280: couldn't load font "Font Awesome 5 Brands Not-Rotated 50px", falling back to "Sans Not-Rotated 50px", expect ugly output.
@spare geode this channel
How do I make it a function?
my full code is this:
const activities_list = [
"For Rule Breakers | ++help",
"The purple names | ++help",
"#general | ++help",
"The mods do their job | ++help",
" for ++help",
"cats | ++help",
"dogs | ++help",
`${client.guilds.cache.size} servers | ++help`
`${client.channels.cache.size} channels | ++help`
];
client.on("ready", () => {
console.log(`${client.guilds.cache.reduce((a, b) => a + b.memberCount, 0)} users \n${client.channels.cache.size} channels \n${client.guilds.cache.size} guilds.`)
setInterval(() => {
const index = Math.floor(Math.random() * (activities_list.length - 1) + 1);
client.user.setActivity(activities_list[index], { type: 'WATCHING' }); // sets bot's activities to one of the phrases in the arraylist.
}, 15000); // Runs this every 10 seconds.
});```
you're missing a comma
np
alright so in continuance with my previous issue about the audio file not playing
apparently when i uploaded the audio file it corrupted
so it turned to a 0 byte file
a direct link to the audio file on a different site should work right
whats the error?
yes
is that okay?
whats the underline?
Why This Error?
It Has Just Begun to Appear.
it's deprecated
So is no one going to help?
How can I print a 100 million digit number?
you have to use JDABuilder.createDefault("TOKEN") @silver mauve
there are other create methods too
How can I print a "1" with 100 million 0's after it?
following bot tutorials with no java experience isn't going to work well for you.
That's good then if you have some.
welp that isnt really helping me rn
just want to fix this
thats it
i already told you
use JDABuilder.createDefault("<TOKEN>")
math powers are your friends
and String.repeat
and it's probably a bad idea since it just crashed my terminal
so uhh don't do it
i dont get why is his working but not mine?
thats his and mine just does not work
Anybody know why foo() in index.js is returning undefined? ```js
// module.js
module.exports = () => {return this.foo};
module.exports.foo = 'a string';
// index.js
const foo = require('./module.js');
console.log(foo()); // undefined
console.log(foo.foo); // a string
this is the global node context by default
i'm not really sure, but i think that would work it if wasn't an arrow function
I'll try it without a module
Oh, I think I figured it out
this.foo.foo seems to work
well k
but only when it's not a module which is interesting
Nice job
Why tho
Do u want to just print it to the terminal or send it on a discord chat
Cause If its the second option u just cant
I got it
K
It's for a contest
What kinda contest asks u to print that
It's complicated
Yeah haha
Good thing files are also limited to 2000 bytes
hi
hi !
how are you all?
This is the wrong channel for smalltalk
echo "I'm fine, thank you";
Lets smalltalk in PHP
i forgot
To circumvent the rules
sorry man.
I'm obviously coding my bot in PHP, before anyone asks
can someone help idk whats the problem lol
rate the complexity of this code between 1 and 10
akaneko.nsfw.ass() apparently doesnt return with an image URL
2-3
ah yes, lolify
how does loli-encrypted text look
vMXIBKGVW
lmfao
using ternary operations doesn't make code complex 
yeah
base64 = bool
alright mate
Math.random() doesn't return 0
the only way for it to be false is for any of those variables to be 0
im still trying to decipher what the fuck that code even does
or another falsy value
if you actually read the npm package you would see how to get the imageURL so you can use .setImage()
you see, it's hard for people to read docs
the function returns a promise
just await it
and that's it
convert your function into an async func, and then just await it
and that's basically it
How do I make a bot that logs activity tracking, points, and can update roles and moderate
With code and database
first, learn japanese, and then cook in a carpeted kitchen
and then have your bot buried because it’s multipurpose
then you can summon a bot that logs activity, points, and can update roles and moderate
I agree
no reading docs bro
lmao star
g r e a s e
not allowed
or oil
im psure like
oml
half of the d.py helpers lose their shit when people don't ass themselves to read the docs
and i understand so well why
still dont understand the problems :3
refresh your brain and read the code again
in the d.py server?
hmm
ok this is an example of a random output -> 1010.1020.12
1110.3120.00
d.js server dont seem too bad lol
well tbf i think a lot of API wrapper support servers are chill
but you always get idiots who go "code is broken help guys" and never give context
(not directed at you JAGUAR)
lmao
wtf is that even supposed to do
ReferenceError: primordials is not defined``` any idea how to fix
I just was being safe and sorry and removing some things off of here and I'm about to log off and charge my phone I just don't trust certain things right now especially when I'm going through I don't want to b
I've been hacked sorry you have a good one
but im not using them anywhere
show your code
its a node error so the stack?
@old cliff what is that even supposed to do
All I can get from it is some kind of shuffle system
yes
what do you use the strategy that gets generated afterwards for
its not always true
its smaller than
not greater
lol
so the output will not always be 1111, but what is it being used for tho
I just asked whether it was complex or not and I started a debate
read the function name
yeah but what is that strategy being used for
I can't tell that
the real shit is when you code a bot for web scraping
alright
it would be open source after 3 weeks tho
hmm
good sir
didn't you come in here yesterday saying like
"if your code isn't messy it isn't code"
yes

memes
@copper cradle if i remove this theres no error ```js
const { APIWrapper } = require('../')
const Crowdin = require('crowdin-without-vulnerability')
const config = require('../data/config')
module.exports = class CrowdinAPI extends APIWrapper {
constructor () {
super({
name: 'crowdin'
})
}
load () {
return new Crowdin({
apiKey: config.CROWDIN_API_KEY,
endpointUrl: https://api.crowdin.net/api/project/${config.CROWDIN_PROJECT_ID}
})
}
}```
the file
what is this in TS?
const { Object } = require(FILE_PATH as String)
the { Object } thing
i always see it passed like that but i don't get why
don't you know what object destructuring is?
its not code... its CODE then
ts is a superset of js
ik what TS is
so it has all js features
it's the same
that way you don't import the entire lib
if you only import the sections your are using the compiled code is smaller. Probably other memory benefits also.
on a normal node project it makes little diff
JS does get compiled down to bytecode
I thought js runs on run time 
