#development
1 messages ยท Page 1104 of 1
the file which is giving error
๐ ๐ ๐ค ๐ค ๐ค
it is of music.js
@nova dock move to a different channel dude
which folder is that in ?
oh i see the issue
what is that?
you are going 1 folder up in relative
../config is looking at music folder
go up 1 more folder
what do u mean
do you know node path?
i m noob
okay
ohk
so
so?
if i do 'config.json' where is it looking for that file?
dont be afraid, im teaching ya
anyway
@opal plank it will look for that file in the folder i guess?
what would happen with 'config.json'
technically yes, but it'll try to load it as module
ok
what happen if i do './config.json'
one folder up
same folder*
what if i do '../config.json'
one folder up
correct
or
now
okay
Error: Cannot find module '../config.json'
Require stack:
- /app/commands/music/music.js
- /app/handlers/command.js
- /app/server.js
from this i can see its 3 folders down the rabbit hole
app/commands/music/music.js
one folder up goes music
2 up goes commands
im betting you dont have your config inside your commands folder
then you need to go up 1 more folder
okk
so it looks in the proper place
one more .
correct
@opal plank U r great :^)
const { MessageEmbed } = require("discord.js");const { COLOR } = require("../config.json");module.exports = { name: "drop", description: "Drop The Song From Queue", execute(client, message, args) { let embed = new MessageEmbed().setColor(COLOR); const { channel } = message.member.voice; if (!channel) { embed.setAuthor("YOU ARE NOT IN VOICE CHANNEL"); return message.channe.send(embed); } const serverQueue = client.queue.get(message.guild.id); if (!serverQueue) { embed.setAuthor("The Queue is empty"); return message.channel.send(embed); } if(isNaN(args[0])) { embed.setAuthor("Please Use Numerical Values Only") return message.channel.send(embed) } if(args[0] > serverQueue.songs.length) { embed.setAuthor("Unable to find this song") return message.channel.send(embed) } serverQueue.songs.splice(args[0] - 1, 1) embed.setDescription("DROPED THE SONG FROM QUEUE") embed.setThumbnail(client.user.displayAvatarURL()) return message.channel.send(embed) }};


what is that code suppose to be?
Uhm
give context
use bin services pls
@opal plank i am
Idk
{
"token": "",
"PREFIX": "tr!",
"YOUTUBE_API_KEY": "",
"QUEUE_LIMIT": "5"
}
I jist posted it here
I can fix that
bro you leaked your token
nope
{
"PREFIX": "tr!",
"TOKEN": "TOKEN",
"YOUTUBE_API_KEY": "YOUTUBE API"
"QUEUE_LIMIT": "5"
}
@weak rain
On token add ur own token
what in the living nightmare is this
Lol
@broken crow That is for music bot
Im on mobile
made by DBD i guess
also pls
const { MessageEmbed } = require("discord.js");
const { COLOR } = require("../config.json");
module.exports = {
name: "drop",
description: "Drop The Song From Queue",
execute(client, message, args) {
let embed = new MessageEmbed().setColor(COLOR);
const { channel } = message.member.voice;
if (!channel) {
embed.setAuthor("YOU ARE NOT IN VOICE CHANNEL");
return message.channe.send(embed);
} const serverQueue = client.queue.get(message.guild.id);
if (!serverQueue) {
embed.setAuthor("The Queue is empty");
return message.channel.send(embed);
} if (isNaN(args[0])) {
embed.setAuthor("Please Use Numerical Values Only")
return message.channel.send(embed)
} if (args[0] > serverQueue.songs.length) {
embed.setAuthor("Unable to find this song")
return message.channel.send(embed)
} serverQueue.songs.splice(args[0] - 1, 1)
embed.setDescription("DROPED THE SONG FROM QUEUE")
embed.setThumbnail(client.user.displayAvatarURL())
return message.channel.send(embed)
}
};```
Dbd?
make it readable
@broken crow youtuber
????
my linter struggled to prettify that code ngl
again Micheal
context?
what is wrong with that?
you're just giving us code
Okay
and not telling whats the problem
The thing wrong with it
Is
When its on me boy
It doesnt work
I do =play Savage Love
uwotm8
any errors?
giving error
??
at Object.<anonymous> (/app/commands/music/music.js:4:26)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)
i dont see any problem with that command
I too
specially cuz this isnt the play export, its the drop export
Huh
not u thunder, micheal
kk
im willing to be this is the wrong command
if you get errors with =play
its on the play module
not the drop one lol
also
I m fucking confused
he's not speaking to u
Ok
return message.channe.send(embed); } const
where is the spacing
@opal plank You have a typo with channel btw
https://discordapp.com/channels/264445053596991498/272764566411149314/738764664044781568
what do you mean me?
its not my code
its Michaels https://ptb.discordapp.com/channels/264445053596991498/272764566411149314/738761575502184508 @faint prism
look at my link
i just made it readable in my linter
throw err;
^
Error: Cannot find module '.../config.json'
Require stack:
- /app/commands/music/music.js
- /app/handlers/command.js
- /app/server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
at Function.Module._load (internal/modules/cjs/loader.js:526:27)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/app/commands/music/music.js:4:26)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)
internal/modules/cjs/loader.js:613
throw err;
^
Error: Cannot find module '.../config.json'
Require stack:
- /app/commands/music/music.js
- /app/handlers/command.js
- /app/server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
at Function.Module._load (internal/modules/cjs/loader.js:526:27)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
at Object.<anonymous> (/app/commands/music/music.js:4:26)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)```
are you importing or requiring?
Me?
yes
see to be honest music isnt my code
.../config?
I got this
.../config lol
wt
Its ./config.json
lel
Not .../config.json
its 3 folders up
Get it right
how can i make this work?
https://i.imgur.com/wRD9tUn.png
Get approved
yeah that's about it
dbl api @rancid oriole
no
no
no?
pretty sure dbl api is just for server stats
it just needs approval
speaking about server stats they are approved
they have server stats and you can only get a token when approved
๐
see to be honest music isnt my code
@weak rain bruh imagine copying code
it needs to be approved
its working
the bot itself
aaah! ok. THX!
the bot is approved though
i can see it
no shit its working lol u got role
that's a rip
bruh
@torn zenith dont use such words in this server, ty
๐
that's a good boy
@modern sable
how can i make this work?
https://i.imgur.com/wRD9tUn.png
dbl api its works fine
hm\
๐
Nice! Thx @idle mountain
has anyone used pupeteer before?
No, but I've used selenium
#p hen zl bo parte
@opal plank hm can u help me fixing the code?
hm basically no
wb any other OOP?
then start with that
Oh boy
Object oriented Programing lang
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
:/
hm
You gotta know how to code, maintain a repo (how to use SCM), make classes and functions, know some good design patterns (like SOLID), etc
hm
anything till you reach classes should be fine
i read
*shitty full stack noises*
its saying to buy cources lol
Mozilla especially
Imagine paying to read a book
that gives you both the infomartion plus a snippet to play with
so you understand live whats going on
Mrdoob has a live html edito-
i will start that from tom
it gives you info + snippets to try yourself
Yes good smart
@opal plank please help me
@weak rain https://www.w3schools.com/js/default.asp
just for this time
How can i learn coding
you need to know js beforehand my dude
By myself
@warm sonnet https://www.w3schools.com/js/default.asp
The google
literally right there
@opal plank :/
Thank you
i have the code
Is that free @opal plank
i just have to fix it
For all those people who find it more convenient to bother you with their question rather than search it for themselves.
you have the 'COPIED code' that you dont know what it does
learn what it does
you NEED the basics before you start
hm
this would be like me saying
otherwise you'll go into a vampire loop
i'll use the alien technology
but i wont learn what's in it
and fuck it i'll just grab more tech
you'll copy code, see it doesnt work, and come here asking for us to fix it
and pile it on in weird ways
thats why you need to know basics first
right
k
https://discordapp.com/channels/264445053596991498/502193464054644737/555644686199422976
- You can ask for help in #development but do NOT expect to be spoon fed (for information on what spoon feeding is, see the top definitions on it here: https://www.collinsdictionary.com/dictionary/english/spoon-feed)
Vx how 2 mkae methodes?
w/o async?
awaiting without async isn't a d.js thing, it's a js thing and it's not possible
:(
Doesn't node 14 have global async :/
if you want to await you need an asynchronous function
welp
If you don't want to await an async function, then it isn't really async then, is it?
Just synchronous
if only there was a way to await reactions or messages without async :(
awaiting means waiting for an async to finish
You just call something like normal if you don't want it to be async
but then
how do i do the tingy where the bots wait for what you type
like
when you create a giveaway using giveway bot for example
// Async - Execution on this thread will continue
await MyFunctionAsync()
// Synchronous - Has to finish other function call before continuing
MyFunction()
await expression causes async function execution to pause until a Promise is settled (that is, fulfilled or rejected), and to resume execution of the async function after fulfillment
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/await#:~:text=not a Promise .-,Description,that of the fulfilled Promise .
there is a way to wait for messages without using await or collectors
but its a bit more complex
I think he just wants synchronous for some reason
how do i make these hyperlinks in embed
[text here](url here)
okie
x
congrats me for winning my mum tho
if (command === 'work') {
const worke = new Set();
if (worke.has(msg.author.id))
return msg.reply(
`**You are on cooldown you can work every 30 minutes!**`
);
//CODE
worke.add(msg.author.id);
setTimeout(() => {
worke.delete(msg.author.id);
}, 1800000);
}
my cooldown is not working
idk why
dude you gotta stop with this formatting
why
worke ?
yea
you create the Set inside the command
i did
so every time someone uses the command, you create a new empty set
hey there can anyone explain me what is ctx
context
kk
.setDescription(['Test']('https://discordapp.com/oauth2/authorize?client_id=728176491514298478&scope=bot&permissions=268954742'))
wut am i doing wrong
its string
how should i write it then
the entire thing
oh
.setDescription('[Test](link)') @mild flower
('Testing')
bruh
yes i saw it
k thankx
np
ok

Do any of you know an NPM Module or something like that which allows you to check if a song title (String) is from an Anime (Opening/Ending/OST/etc...)
how about a lookup
Download Anime Soundtracks or Anime OST, Anime Openings anime Endings - 600 Anime Series Soundtracks for free
e.g. from anilist api
You could query that website maybe?
i'm pretty sure anilist api stores openings
it's using graphql too so it's easy to use
Endings and OSTs as well flapeze?
let me check rq
@faint prism you know if that site has an api?
I don't. But scraping it shouldn't be too difficult
Never really got into web scraping but if there's nothing else I'll look into that
It's all about Web clients and regex
Can i add plaintext (a mention/ping) before an embed in the same .send command? or do i have to trigger two messages?
you might want to web scrape
Message.reply(embed)
the person getting pinged is not the author of a message
Can't you add it to the message options
Here is some psudocode
var animeList = regex.Match(siteData, someMagicQuery).split(something)
@viral spade .send("mention", embed)
Hmm interesting, I'll do some more searching for apis and if I can't find any I'll look more into scraping, thanks
yes sorry, i am not doing msg.send, but a channel.send
Np
Use the code NMW03 send
Thx ill try
Is there a thing on mongoose that allows me to automatically add and remove stuff from all documents in a collection at once?
deleteMany()?
so, I have a quite annoying issue, consider the following scenario:
User A has 0 XP
User A writes a message, giving him 10 XP and triggering UPDATE query
BUT
User A somehow writes another message before the previous transaction is complete, giving him 10 XP but without the previous XP added
User A sees his profile and notices that he has only 10 XP despite writing 2 messages
What can I do to prevent such race condition from happening?
module.exports = {
name: "purge",
category: "moderation",
description: "purge messages",
usage: "ban <@user> <reason>",
run: async (client, message, args) => { if (!message.member.hasPermission("MANAGE_MESSAGES"))
return message.reply(
":x: You don't have perms, sorry."
);
let delmsg = args[1];
if (!args[1])
return message.channel.send(
":white_check_mark: Please specify a number of messages to delete with the command."
);
message
.delete()
.then(
//message.channel.bulkDelete()
message.channel.bulkDelete(delmsg)
)
.catch(() => message.channel.send("Error when deleting messages"))
.then(() => {
message.channel
.send(
":ok~1: Deleted " +
delmsg +
" message(s)."
)
.then(msg => msg.delete(3000));
});
}
}```
This is my code this is saying -->โ
Please specify a number of messages to delete with the command. but it was working fine
previously
Anyone? -_-
dude, you didn't even wait a full minute
Did you learn js?
nvm

why are you panicked?
@opal plank hm i know little
did you LEARN js?
A crash?
think so
Do you have a logger?
@opal plank : )
catch errors.
@faint prism no
I'd make a logger, and implement more try/catches of sketchy areas
catch { logger.Log(exception) }
what should i do
i try/catch everything 
to make this work ๐
so, I have a quite annoying issue, consider the following scenario:
User A has 0 XP
User A writes a message, giving him 10 XP and triggering UPDATE queryBUT
User A somehow writes another message before the previous transaction is complete, giving him 10 XP but without the previous XP added
User A sees his profile and notices that he has only 10 XP despite writing 2 messages
make cooldown of getting xp
i try/catch everything :eyess:
not necessarily
Yeeet
quick @opal plank
it's not database's fault actually
update inserts are quick
i doubt without spamming you'd be able to catch the update event fired before the get rquest
I do some processing before calling the update, and in the fraction of millis sometimes it happens to have two instances of the same user running parallel to each other
if you adding exp on every message you just need author id and then insert + exp
if you can somehow spam within that 3ms time, good luck
ยฏ_(ใ)_/ยฏ
could get message events super close to each other
ik, that issue happens mostly when discord freaks out
Don't most databases handle that on their own anyways
still, an update call shouldnt take more than that
they do aswell Timo
unless they are fired at the same time i doubt you'll find issues with multi processes
Never had that issue with Mongo and I request very frequently (every 1-5ms)
one way is like kuu said, where you'd have some lenghty code processing message that ends up clogging
but even that isnt a big gap either
we talking 10ms max usually
spamming 2 messages in that gap of time is somewhat hard
I'll see if I find anything else that could be causing my issue then, maybe it isn't happening where I think
USUALLY
this is a big USUALLY IF
you'd only want to fire on message event to add exp
and the retrieve to be only a db call + an embed or something(i disencourage using embed builders, build the payload manually)
there isnt much need for code elsewhere unles you going extra fancy
i recommend sending the payload manually rather than wasting time building the object via d.js or other builders
saves even more processing power
actually, I think my issue is WHERE I'm adding the xp, which is at the end of the event
there's a lot of stuff before adding the xp, which could be clogging it
you'd need to be looping quite a bit of stuff to be impacting the code heavily though
well, then placement ain't the issue too
I'll try some kind of mutex to see if it works
aight
all this time i thought member was only a property of the user object but message.member is how you use it...
almost wrecked servers
i was adding moderation commands
message.member.user.client.guilds.cache.get(message.guild.id).channels.cache.get(message.channel.id).messages.cache.get(message.id).member
๐ค
wtf is this line
?. is really important on this one
^
how do i send image file along with embed data/meta tags?
you mean opengraph tags or...
And do you mean to upload a file? Or? Explain pls
wait nope i got it working
[Python] Why can't I declare point as an instance of Point in the same class? For the record, I know it's just a decorator and doesn't actually enforce it to be an instance of Point.
cant you do something like self.__class__? idk python
inb4 self
I can't seem to use self in that position (and yes inb4)
^ just found that in SO as well
that fixed the issue, ty
does .filter return a bool or an array
@trim saddle it returns an array with everything that passes the function
you can use some if you want a bool
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some
ts is fun
How i can check does String has same value to one of element of a array ?
let String = "a";
let array = ["a", "b", "c"]
using includes
if(array.includes(String)
?
yeah
ok
Change
categories.push(require(`../commands/${file}`))
to
categories.push((require(`../commands/${file}`)).category)
@jolly quail don't I have to remove something now?
and y'all said I don't need the slice cause it's already capitalized right? ๐น
wtf lol
For "client.on" is on a method of client object or event? cause on the the documentation i cant find on keyword under client
ohhh does it always accept a string as its first parameter and a function for its second?
they make sense
oh okay thankyou now everything makes more sense
M a k e s s e n s e t o m e
i had once the issue that i was unable to remove stuff from a object. this made no sense. to fix it i just set them to invalid
:o
What's sharding
running the bot on mutiple processes with the same instance
Does it take a lot of RAM and CPU
it can make it x2 (per shard) if it scales linear. but its only needed if you reach 2500 Guilds
Can you set up sharding in a way to run off of several machines?
yes
:o
start the bot on Server A with Shard ID 1 and on Server B with shard ID 2
Ohhhh makes sense
thats called clustering
cool
or nvm
me broke so me needs donations (and a bank account) to buy a good vps or just upgrade my repl.it account as they're fine with bots and ping services
get a Job?
I still don't get why Karens use glitch
get a Job?
In quarantine and the only thing I am good at is annoying people and coding
when i was 12 i made money with newspapers
like once per week i went to every single house in the village and delivered newspaper
got me about 20โฌ/month
Hello i have an question
If i add if (message.author.bot) return;
My bot ignore all of the bot or only my bot?
all bots
@lusty quest omg thanks you now i will save a lot of times because i just see that
everyone needs to start somewhere. over time you will encounter challenges and will develop solutions for it
having a bit of trouble with my code
I'm trying to setup my bot so that when it gets mentioned it will send a message with help and prefix info
and I was testing things on my embed and found something that works
but then putting it into execution, it didn't work as intended
check if the message mentioned user is your Bot user?
yup
like if(message.mentions.users.first() == client.user)
message.content is a property
How do code discord bots
usually you get a cat to walk across your keyboard
and you get a generic mod bot
and then your cat learns turkish
How do I make regexes
does anyone know how to make regexes
Yeah
ty
i need to figure out look ahead/behind with regex.
For instance, this is to match a phone number:
[0-9]{?}-[0-9]{3}-[0-9]{3}-[0-9]{4}
Would match if 1-123-456-7890 or 123-456-7890
I was actually just doing that ๐
([0-9]?)(-?)([0-9]{3})(-?)([0-9]{3})(-?)([0-9]{4})
I usually use regex with scraping, so wildcards are where it's at for me
can you group the numbers together, without grouping the optional -'s
oo
or, if you just want one big match, you can do that to all of them
it makes it perform better, but regex will always be slow
https://oliy.is-just-a.dev/ae0bs_5334.png see, when you have them all grouped you gain access to each individual section of numbers, if you don't want this functionality, it's more performant to just have all of them in non-capture groups
https://oliy.is-just-a.dev/mkst3h_5335.png one match with no groups
Any light-weight db's for a web app, no quick.db
like quick.db only for a website
quick.db is not web-based
it has to be a signle .js nothing else
no npm
One message removed from a suspended account.
One message removed from a suspended account.
you want to run a database in a webapp?
One message removed from a suspended account.
it has to be local tho
One message removed from a suspended account.
it is a uhh
mysql wouldnt run like that
youd have to build something yourself
One message removed from a suspended account.
since this is very unique
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
yes lol
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
hippity hoppity lokijs is now my property
how does it work lol
What are you trying to make

lol
Lot of whitespace but that's besides the point. Why do you need a database for that?
do you know discord bot controls
well its like discord bot maker
but cheaper and other stuff
im making a plugin for it
(and no this is not a token stealer)
Suspicion levels +1000
lol
but ok
how to like write
i want to add a content for 'token' and a content for 'prefix'
One message removed from a suspended account.
Like a text area?
well
i am adding the db to store content
(token and prefix)
but how to add a content to a like
yeah
You'd probably do that with an API call to your API
Why
That doesn't make sense
so users get their own data and store it themselves?
You make an API call and save it in the backend
to who ru talking
You
Then make one 
make the user install a local db?
no
Serialize to a file
these kids that do stuff dont know what they are doing
What sort of data are you storing?
your asking to do something abnormal
What sort of data are you storing?
@faint prism im making a dashboard where they can see some stuff
and i want it to able to let the user make a new token or prefix
and it has to safe it ofc
i also have a dashboard
Does everyone have a dashboard?
pretty much
For what purpose? @solemn latch
idc lol
dont ask
im asking something lol
how to store
locally
var db = new loki('sandbox.db');
<how to store now>```
yes but
stringify and throw it into a file
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
Then parse it back into an object
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse
The JSON.stringify() method converts a JavaScript object or value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified.
You could make one
wouldnt be hard
What's it supposed to do?
api for a comman
Or web scrape
d
Or web scrape
@strange trout can u teach me
Google it
I have a dashboard
Don't bother comparing booleans. If statements handle that
It took me 3 days of pain but I have a dashboard
wouldnt be a database, but he could store data in cookies no?
https://sabe.io/classes/javascript/cookies#creating-a-cookie
hey, how can i make a pay command?
Yeah or localstorage
localstorage ftw
Not very safe or good though lol
He needs to make an API
just have your service serialize data to a file
He's trying to make a service like DBM
dBm (sometimes dBmW or decibel-milliwatts) is unit of level used to indicate that a power ratio is expressed in decibels (dB) with reference to one milliwatt (mW). It is used in radio, microwave and fiber-optical communication networks as a convenient measure of absolute power...

Discord Bot Maker is an app though right?
yeah
Hey, how can i make a pay command for a currency bot?
Looks like he's doing it online so it's probably more similar to botghost
like moving money to someone else? or buying something?
moving to to someone else
like %pay @solemn latch 10
and it takes $10 from you and gives you it
Alexis that db is bad btw works real bad
remove the amount from the transferrer, and then after thats successful give it to the mentioned user
yeah i tried that and i get tons of errors
like?
TypeError: message.guild.members.get is not a function
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
you shouldnt need to get the user, its already in the mentions
Well yeah it's an in-memory/embedded data solution @surreal sage
It's good for what it's meant to do which in my case is to store temporary variables that get deleted on runtime
@fleet hornet dont use if else, use switch, or you ll get haters
if else is fine, if you have only a few if else's
Anyone know a "never have I ever" API or command?
PING ME
How do I send a message to a certain channel when someone votes for the bot?
do you have a webhook setup?
No
Ok thanks
dbl.webhook.on('vote', vote => {
const channel = bot.guilds.channels.cache.get("738863158994927637")
channel.send(`User with ID ${vote.user} just voted!`);
});
@solemn latch Is this how?
ye
Ok thanks
How??
on your bots edit page, at the bottom
http://vps.ip.address.here:port/dblwebhook stop autoslasshing ffs
Also
bot.on("ready", () => {
console.log(
`${bot.user.username} is online on ${bot.guilds.cache.size} servers!`
);
bot.user.setActivity(`Orcoid Beta`, { type: "PLAYING" });
setInterval(() => {
dbl.postStats(bot.guilds.cache.size);
}, 1800000);
});
This would post my bot's server size to the website right?
http://ip:port/dblwebhook
Post that there?
ip would be your bots servers pub ip
port and path would be whatever you set
I'm so confused
your bots public ip.
if its on a vps, it would be the vps's ip.
if its on your home network its your ip
if its on your home network, you will need to port forward
anyone but it's got a password
So how would I port forward?
usually tcp
And I can make it ANY port?
typically over 1000, but yeah any available port
Okay
I've port porwarded
Okay so now
Authorization?
http://ip:port/dblwebhook
its whatever you set in the auth
webhookAuth: 'password'
dblwebhook is the default path
So I keep it?
yeah, unless you change it with "webhookPath"
So authorization is my private password?
yeah, can be whatever
And now save?
yeah, just make sure you set the auth in your code aswell
How??
in the options, like the example shows
"webhookAuth: 'password'"
Okay so
const dbl = new DBL(yourDBLTokenHere, { webhookPort: 5000, webhookAuth: 'password' }, client);
const dbl = new DBL('token', { webhookPort: port, wekhookAuth: 'pass' }, bot);
yep
@solemn latch
dbl.webhook.on('vote', vote => {
const channel = bot.guilds.channels.cache.get("738863158994927637")
channel.send(`User with ID ${vote.user} just voted!`);
});
Why didn't this send any message?
Oh it's bot.channels isn't it
yeah
hai, in python pillow, how would you overlay a gif on another gif? so far i have for frame in ImageSequence.Iterator(gif): but i do Not know how id phrase it so that the frames of my two gifs overlay each time... :(
yeah
@solemn latch It still didn't send any message
channel may not be in the cache, you might have to fetch it
for get
So for fetch there is no .cache?
Ok
Thanks
dbl.webhook.on('vote', vote => {
const channel = bot.channels.fetch("738863158994927637")
channel.send(`User with ID ${vote.user} just voted!`);
});
Like this?
youll have to await, or .then
Ok
dbl.webhook.on('vote', vote => {
const channel = bot.channels.fetch("738863158994927637")
await channel.send(`User with ID ${vote.user} just voted!`);
});
And vote.user returns their ID?
make it async
How
Lol
Anย async functionย is a function declared with theย async keyword. Async functions are instances of the AsyncFunction constructor, andย the await keyword is permitted within them.ย The async and await keywordsย enableย asynchronous, promise-based behavior to be written in a cleanerย ...
learn that, at the very least

I'm confused
hello
I'm trying to create something in Express, and for some reason the first if statement in my code doesn't appear to work...
router.get('/captcha', (req, res) => { // Captcha generator, takes a size param
let size = parseInt(req.query.size);
let imgOnly = req.query.imgonly;
console.log(`size BEFORE if statement: ${size} (Type: ${typeof size})`)
if (size == null || size == NaN) {
console.log('if statement runs'); // doesn't run
size = 4;
}
console.log(`size AFTER if statement: ${size} (Type: ${typeof size})`)
if (size > 5 || size < 1) {
res.status(400).json({success: false, message: 'The size field must be an integer between 1 and 5.'});
return;
}
let captchaGenned = new Captcha(200, 100, size);
if (imgOnly == 'true') {
res.send(`<img src="${captchaGenned.canvas.toDataURL('image/png', .25)}"/>`);
return;
}
res.json({success: true, text: captchaGenned.value, data: captchaGenned.canvas.toDataURL('image/png', .25)});
});
If I try to visit this endpoint in my browser the if statement doesn't appear to work and curl just freezes.
Console output:
size BEFORE if statement: NaN (Type: number)
size AFTER if statement: NaN (Type: number)
Urls tried:
localhost/gen/captcha (if statement doesn't work, intended behavior is that size should be set to 4 in this scenario)
Could someone tell me what I'm doing wrong?
try if (!size)
dbl.webhook.on('vote', vote => {
bot.channels.cache.get("738863158994927637").send(`User with ID ${vote.user} just voted!`);
});
@tight plinth could you tell me why the other one didn't work?
Maybe it's an issue with dbl.webhook.on('vote', vote => {
Maybe the webhook doesn't work?
learn js
No like
webhook works fine
Hm
oh
we told you to use async and you just reverted back rather than learning async which i linked you to
ยฏ_(ใ)_/ยฏ
its hard coded to 0.0.0.0
if you don't understand async/await should you be making a bot 
i'll awnser that one
it's a very good idea to get knowledge of the base language
no
the problem isnt even learning or not
its unwillingness to
i did link him async doc
ah
he just reverted his code back
you're right
v. big smart
why do y'alls
text like this
have all the different colors and like actually looks like code and mine is just grey and ugly??
like this
Okay so
I tried console logging when someone votes
no
That doesn't work either
oh so if you put js it'll make it look like js when you type the code?
if you are using js, yeah
client.on('ready', ready => {
console.log('boobs')
}```
bruh
I'm a magician
I don't even think that code is correct anyway
lol
wrote it off the top of my head
my 2 in cs isnt working
asciidoc
bash
autohotkey
coffeescript
cpp (C++)
diff
ini
json
py
xml
those are the ones i remember
coffeescript
i dont remember the rest, but i think there are others
client.on('ready', ready => {
console.log('boobs')
}) //here```
@bright dove you were almost right, but you forgot a )
@bright dove
client.on('ready', () => {
console.log('boobs')
})
I can't find streaming option for a bot in my library or the discord api docs.
Does it exist?
I do see mention of RPC here
https://discord.com/developers/docs/topics/rpc
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
it does
Ik they use WebRPC, but not sure if this page makes me think it's available or I'm looking in the wrong area
@tranquil patrol Do you have a link to the api docs?
what is your library
Discord.NET
But, I can do direct API calls if i have to


