#development
1 messages ยท Page 1224 of 1
at least u didnt say json
json is overrated
yeah
though im thinking about moving even that to my database
and not keep anything locally
just a model to be imported
so it knows if something is missing
database
don't bonk me


I sure will
how do i upload images?
cassandra isnt too bad either
will a cloud database work?
as long as its persistent, yeah
alright
though you can always just open a ssh port or something on your pc

and then you can access your database even outside
that's some high lvl shit I'd rather not attempt lol, I'll just stick to the clould database for now since they're pretty easy to manage
yeah
how long do you think this issue will resolve:
This application has been enlarged by suspicious means. That's why we are currently unable to accept a verification request. Please try again after a few weeks after seeing normal, ad-free growth.
it says right in there
a few weeks
Please try again after a few week
help commands:
ping
I read it but y'know I wanted to read something better

we arent discord staff, we can only re-phrase it or read it to you again
not sure what you were expecting
moderation, maybe auto-moderation but not really, utils, entertainmemt, manipulation, economy, music, config commamds in total I have about 250 commands
how is that a bad thing?
as long as you have everything organized, i dont see an issue
I'm not saying it's a bad thing at all, I'm just saying that sometimes it causes a really bad ping
it doesnt affect ping

unless you made a giant ass index mess
any ping is either: bad code or bad specs
yeah..... about that.....
... I'm sorry

that'll take ages
doesnt matter
do it
rn
i dont wanna see questions unrelated to that till you finish

I wanted to do it even before it got to 100 commands but I was too lazy lol
I know I gotta do it someday
not someday
it can't stay like that
can't now

alright Imma start cleaning the indexjs up tommorow cause it's a middle of the night


alright, have a good night, lol

I hate having un organized code to be honest but for some stupid reason I let that one thing slide
for really long
i need to see if i can find mine, one sec
alrighty
how do i send an image
found it
wow
at the very first few days i used to be An idiot who didnt know better stubborn like that too
you gonna love my startup then
i dont have the terminal interface handy on the main bot
cuz nodemon
no comments? me saddo

uhhh
have you tried reading the docs
lol
yea
oh wait you are the py guy
i can't help you sorry
you should read the docs
Yes Erwin
what a nice way to remember shiv lol
the py guy
shiv is just the py guy
No, not me
@opal plank sorry I kinda almost went to sleep
0Exe
not an amazing person altogether that knows way more than just py
but yesh it looks hella neat

0Exe is the py guy
Baka
he always asks py questions so i cant help
my py stuff is beyond basic
hlep pls
like, toddler level entry
Either I'm fucking stupid or setting headers in HttpClient is hard (C#)
alright Imma head out to sleep again
just use axios
good night y'all

in CS?
hey. iยดm new here.... i did not understand how to input a dice roller bot on my server. can you help me?
nah, i was kidding, im looking at it rn and it does seem like a pain
Might just ping cry at this point because I'm shit outta clue
omg wtf is this
this? https://docs.microsoft.com/en-us/dotnet/api/system.net.httpwebrequest.headers?view=netcore-3.1
Most solutions I've tried didn't storm
work
I'm using HttpClient
Which doesn't seem applicable
im assuming you saw the stackoverflow one?
I saw a lot of SO ones
none worked?
DefaultRequestHeaders property on your httpclient
then just call .Add()
either it's my internet or discord is having a stroke again
find out what's null, it's probably the httpclient though
what have you tried @drifting wedge
everything lol
that's not an answer
Finally Finished my new Console startup
im using PIL
Not really sure if var client = new HttpClient(); might return null
and it creates a file called "1.png"
@sweet ruin isnt that the template people use for glitch/heroku?
how can i send it?

euh i dont know who that is?
@sweet ruin what is the suicide module for?
if you think i stole it i can guarantee i did not
I will try null coalescing operator though, thanks for the heads up
where did you find set_image @drifting wedge
Basically the module is a <kill and it displays a gif
where did you find set_image @drifting wedge
@earnest phoenix i tried like attacgment
the docs straight up say there's an argument for a file
or <kill without anything will display a funny kms gif
and all that ditnt work
yeah against tos
suicide != funny
Suicide glorification is against tos @sweet ruin
@cursive dagger your best bet is to actually find out what's null via debugger breakpoints (vs has one)
not glorified
ctx.send.files('1.png')?
glorification/promotion of suicide
0Exe, literally read the doc link i sent you
I hope Rider has those. And if not... I guess I'm going Console.WriteLine ๐
but is it
ctx.send.files('1.png')?
@drifting wedge ?
Hi
ctx.send(file=discord.File('path_to_file'))
ctx.send(file=discord.File('path_to_file'))
@slender thistle i dont have the path
thats the issue
yes you do
there. i updated it to <kill. happy @opal plank

Wdym you don't have the path
you were literally using it
File(fp, filename='1.png', *, spoiler=False)
im using heroku
so i wont have the path
@sweet ruin you dont seem to be getting whats wrong with a command that sends stuff related to suicide

Then just specify relative path
i removed that part mate
wdym?
not the command NAMe
As to what it's relative to, I have zero fucking idea
its legit just <kill (mention user)
the command ITSELF is against tos
oh then its fnie
Just use the file name as the path
is what im trying to say
i though u just renamted it

tw: to clarify for the argument above, the TOS does not state anything about talking about suicide however what is against the TOS is promoting gore (provocative images like slit wrists etc.)
koaftwem
thats what the ending part of my logger looks like
looks good, i personally prefer just catching errors rather than the whole list
it spams your console after a certain amount of commands
is there somthing called this?
in discord.py
or is it like bot.add_cog(music(bot))?
module.exports = {
createUser(user, db, bot){
db.set(user.id, {
credits:0,
rep:0,
level:0,
xp:0,
desc:"unknow",
ani:"unknow",
premium:"false",
registeredAt:require("./functions.js").printDate(new Date(Date.now()))
});
// Log in the console
console.log("\x1b[32m","[DB]","\x1b[0m", "User \""+user.username+"\" registered ! ID : \""+user.id+"\"");
// Return user data
return db.get(user.id);
}
}``` rn it register not only users but bots too any idea no how to make it where doesn't register bots
just check if the user is a bot...?
if it isn't -> register, if it is -> do whatever
how can i add more args
like i have a clyde command
how can i make it send more than one word if i dont have quotes
euhh okay
all you do is this
#1 for future reference describe your command so i dont have to assume
#2 im assuming you want Clyde bot to get all args?
var clydesend = args.slice(0).join(' ')```
that gets all args after the original command
@drifting wedge
@sweet ruin its not working
async def clyde(self, ctx, args):
clydearg = args.slice(0).join(' ')```
this is the beggining
begining
Please giving on_vote event example.
Why do people often make bots admins on their servers?
It's easier than managing the permissions.
How to get denied on any botlist 101
so i'm an absolute idiot with music bots and i tried making one but it starts then instantly stops playing, never plays the music
what do i do
eris, node, no lavalink
What is no lavalink
@sick cloud what're the errors and shit
No music at all?
Tip: :run debugger and see where it stops
it doesn't "stop" anywhere
Even with the code its hard to find where music is stopping
Does it join?
And are you not ip banned
Strange
That's why I like lavalink, very detailed error logs
connection.play(ytdl(item.source, { quality: 'highestaudio', filter: 'audioonly' }));
queue.state.channel.createMessage(`Now playing ${item.source}`);
connection.once('end', () => {
queue.state.channel.createMessage(`Finished playing`);
bot.leaveVoiceChannel(queue.state.voiceID);
});
i don't want to use it
Try debugging like i said
Never used but it seems like it is from the docs and shit

lavalink is trash
@earnest phoenix no u
Use ffmpeg for true 69 big pp epicness 420 blazing
Step debugging you can see whats going on
also
correct me if im wrong
but you need to use ffmpeg if you're working with youtube in order to convert to stereo 48khz PCM
Shits about to go down when cry starts typing for more than 5 seconds
i don't see how debugging helps when the code works fine and it's obviously ytdl or something dumb
im on phone :(
because it plays fine with local files
Thats what i mean
but if i add ytdl it doesn't work
but you need to use ffmpeg if you're working with youtube in order to convert to stereo 48khz PCM
@earnest phoenix
Debugging can go to yrdl too
Use next rather than step over
Step over goes on ur own code
But u can follow it to ytdl
And see inside whats going on
LmaO ffmpeg best streeeeem uwuwuwuwuw
Eris, a NodeJS Discord library
eris takes a readablestream
ytdl provides a readablestream
fent said so
Use step in and it'll go over to ytbl
Step over goes in the running code
Step in follows the operation
(node:7376) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'awaitReactions' of undefined
what ?
let MessageSend = await bot.channels.cache.get('534738699628576780').send('Random gift').then(async(msg) => {
await msg.react("๐")
})
let filter = (reaction, user) => {
return ['๐'].includes(reaction.emoji.name) && !user.bot
};
MessageSend.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })```
@wicked pivot await it in a channel and filter by the message
I did not understand ?
thanks
@heavy flame its not about the errors, its about debugging lol
does anyone know how I could make a discord bot that can detect when a person changes their Minecraft name
I would be using js
Then the simplest thing u could do is check every couple minutes
SetInterval and rhen function fecth every user
yeah, just gotta find an api that I can use
I need an api to check if the person changed their name
You could see if one exists
you will not be able to detect it realtime
Otherwise you can do it with an interval
Thats what i do with my stream cachd
Though you likely can do it more often
where can i download visual studio for linux
Depening on whats the ratelimit of the endpoint and the api you touching
I would loop a command that checks everyone on the list to see if the name was changed
it doesn't exist, vs is windows only @near veldt
what do you need it for
everything
@manic badger precisely, yeah
to write programs n such
ok, ty
no, i mean, which languages are you working with
use sublime text or smth @near veldt
javascript, html, and python
use visual studio code
i cant
why not
u said its only available for windows and i told u my windows laptop has no charger
visual studio is not visual studio code
?
@opal plank exactly
visual studio and visual studio code are two completely separate piece of software
imma store the uuid with the current username, then use the uuid to check if the username changed
"Microsoft Visual Studio is an integrated development environment from Microsoft. It is used to develop computer programs, as well as websites, web apps, web services and mobile apps"
I just wish there was an api somewhere that knew when someone on the list of people changed there name, not running a loop
you could prolly create one urself by throwing some lines of code together
no you could not
yeah
why not?
mojang does not offer that ability, therefore you can't make it happen
yup
couldn't you just create one thats connected to the xbox database through a website or some where every users uuid and username is stored?
a, what the fuck
b, that's not what they asked for
which of these is the right/better way to delete a key from an object
im using java edition
they want to detect realtime username changes
@sick cloud delete syntax is more preferred
okay then sweet
setting it to undefined leaves holes
You'd need to constantly check if the user uuid name changed @manic badger
Like i said, wtih cache
Apologize in advance for syntax
Kinda in the middle of a party
you can probably scrape namemc
however namemc is heavily backed by cloudflare so good luck with that
hello
please guys i have a problem here
if (message.content === prefix + "ls") {
var list_all = [];
message.guild.members.forEach(bb => {
if (!bb.user.bot) return;
list_all.push(`<@${bb.user.id}>`);
});
message.channel.send(list_all.join(", "));
}
});```
.members is a manager. You need to call it on the manager cache (.cache)
that doesn't look like mass dm
yeah i know
because they aren't messaging everyone
they're adding the user's mention to an array
then pinging them all in a message
which would be annoying af
and almost as bad as mass dm
Equally as bad
yeah, imma cache the users, then every 10 minutes or so, check to see if the name corresponsing to the uuid has changed, and if it has, change their nickname or smth
this reminds me how mojang still doesn't have oauth for minecraft
mindblowing
having said that their entire auth system is a piece of trash
yeah but they're not tracking a single user
good point
maybe once every hour of smth
im only tracking about 200 players at once
Hello, can anyone help me???
I'm trying to programing a bot that play music, but i dunno how to make him enter in a channel
what library
discord.js
I think there's a method on VoiceChannel called .join() which joins the voice channel then returns a VoiceConnection
Do you now where i can find this method???
yikes
YIKES
You may want to wrap that in template strings to make it mutli-line
though that face is going to give me nightmares
i would not enjoy scrolling past that face
would you scroll up with the 50% chance of there being another face
Can JS eval commands declare classes or functions
Want to repro this eval? :)
https://discordapp.com/channels/264445053596991498/265156286406983680/752692169361457274
sorry I've divorced javascript for the time being
@faint prism I have no idea if this works but it's the general idea around it (https://hatebin.com/qlytfhblqe)
it can use a lot of improvements
Ts ftw
divorce ts for bat files
I'm new to developing bots, and while studying how to make a bot in Discord.js, i was having trouble understanding the embed guide, to be more specific ive been having trouble making it work in my bot
any help?
Yes
I don't get the part exampleEmbed
and you can create one by doing new MessageEmbed()
.your(properties)
.here()
itโs just an example of what you can do
Yes, but what is it suppose to actually be...
here:
https://discordjs.guide/popular-topics/embeds.html#using-the-richembedmessageembed-constructor
divorce ts for bat files
@thick gull laughs in unix
exampleEmbed is just the name of the embed
ah, thought i was supposed to make a new file, or some shiz
if i have ```json
{ "success":true,
"profiles":{
"dsfjksdfljsdflkjsdf":{
"things":"YES",
"name":"1"
},
"sdfkljsdfsf":{
"things":"OKAY",
"name":"2"
}
}
}
how do i get "things" by getting "name" instead of just the profile section "sdafkljsdflkjsdfk"?
like if i entered 2 it would return OKAY
What language are you using
Consider using Object.values(obj) to convert it to an array of objects from each key's value
If you need the key as well consider using Object.entries
what if i just put the code
const Discord = require('discord.js');`
const exampleEmbed = new Discord.MessageEmbed()
.setColor('#0099ff')
.setTitle('Some title')
.setURL('https://discord.js.org/')
.setAuthor('Some name', 'https://i.imgur.com/wSTFkRM.png', 'https://discord.js.org')
.setDescription('Some description here')
.setThumbnail('https://i.imgur.com/wSTFkRM.png')
.addFields(
{ name: 'Regular field title', value: 'Some value here' },
{ name: '\u200B', value: '\u200B' },
{ name: 'Inline field title', value: 'Some value here', inline: true },
{ name: 'Inline field title', value: 'Some value here', inline: true },
)
.addField('Inline field title', 'Some value here', true)
.setImage('https://i.imgur.com/wSTFkRM.png')
.setTimestamp()
.setFooter('Some footer text here', 'https://i.imgur.com/wSTFkRM.png');
channel.send(exampleEmbed);
it sends that
nah
embeds are something that is fun to mess around with:$
channel.send({embed:exapleEmbed})
When i run it, it doesnt send it
channel.send({embed:exapleEmbed})
@karmic compass no
you donโt need to lol
i believe you do in v12
How do i even check what version im on
check your package.json file
[
true,
[
{
profile_id: '6d6e972ccd5144059291e6eed478ca22',
members: [Object],
cute_name: 'Pomegranate'
},
{
profile_id: '07caf144982342dabdeacf9f239180d9',
members: [Object],
cute_name: 'Pineapple',
banking: [Object]
},
{
profile_id: '88ed5079c5e44d4d8ac19ef78aa89a0d',
members: [Object],
cute_name: 'Raspberry'
},
{
profile_id: 'c531ad68a12a428e9593a4f65b3b3b83',
members: [Object],
cute_name: 'Lime',
banking: [Object]
}
]
]
``` it returns with this now
@earnest phoenix works for me
im on version 1.0.0

what
how do i get "banking" if i said "lime"
@earnest phoenix works for me
It doesnt work for me ;-;
You'd iterate over the array until you find what you need. The current way it's structured doesn't look ideal for navigating. Can you show your code and what the plain object is, because that's not similar to what was up here: https://canary.discordapp.com/channels/264445053596991498/272764566411149314/752703157339160596
that was an example
const fetch = require('node-fetch')
async function doTheThing() {
const obj = await fetch('https://api.hypixel.net/skyblock/profiles?uuid=6d6e972ccd5144059291e6eed478ca22&key=secret').then(x => x.json())
const thing = Object.values(obj)
console.log(thing)
}
doTheThing()
@earnest phoenix are you on v12, latest
@earnest phoenix are you on v12, latest
@thick gull on discord.js?
yes
You may want to omit your key
Im testing the embeds out, so there is no other coding inside of the bot, except for that exampleEmbed code
is there an error?
checking
const Discord = require('discord.js');
client.on('ready', () => {
console.log("READY!")
})
client.on("message", (message) => {
if(message.content == "!exembed") {
const exampleEmbed = new Discord.MessageEmbed()
.setColor('#0099ff')
.setTitle('Some title')
.setAuthor('Some name', 'https://i.imgur.com/wSTFkRM.png', 'https://discord.js.org/%27')
.setDescription('Some description here')
.setThumbnail('https://i.imgur.com/wSTFkRM.png')
.addField("Un inline field title", "A")
.addField('Inline field title', 'Some value here', true)
.setImage('https://i.imgur.com/wSTFkRM.png')
.setTimestamp()
.setFooter('Some footer text here', 'https://i.imgur.com/wSTFkRM.png');
message.channel.send(exampleEmbed);
}
})
@thick gull
Discord.MessageEmbed()
huh-
if you donโt do const { Discord, MessageEmbed } = require('discord.js') iirc you do Discord.MessageEmbed() or whatever your discord is called
What?
you need to either require MessageEmbed from the package (I donโt do this so Iโm not sure) or do Discord.MessageEmbed() instead of just MessageEmbed() @earnest phoenix
Can anyone help me with how to have 2 or more prefixes for your bot?
I want it to be p- and P-
Anyone know how to make a webhook on heroku that works with dbl?
@supple oriole why not just make it case-intensive
h0w :D
and if you want to support multiple prefixes, keep an array/list of the prefixes then iterate over it checking if the message starts with the prefix
wait Ill send u the cript
*script
statusURL: 'https://srhpyqt94yxb.statuspage.io/api/v2/status.json',
prefix: 'p-',
botGuildID: '732859345561190510',
ownerID: '570522126734327833',
ad: {
desc: {
min_length: 10,
max_length: 255
}
},```
let's imagine there's a key called prefixes and a value of an array of strings
on a string that will be the user's message content
We'll loop over it with .find (<Array>.find) and check if the string .startsWith() the prefix
Use it as explained: js let prefix = prefixes.find((prefix) => { /* message.content.startsWith(...) */ })
Alr
Anyone know how to make a webhook on heroku that works with dbl?
@sharp thicket
@radiant kraken
how can we do it like if someone send pic to bot in dm bot send it to specific channel (which we had mentioned)
return```
this is in a cog
how the commands.self doesnt work
and i tried user
what would work?
Error?
@drifting wedge error?
fetch them as a user
in discord.js, we have client#users#cache and client#users#fetch()
Found this abomination when scrolling through my first ever Github commits from years back
https://mystb.in/SapEmbeddedImpression.python

kk
thd
thx
wait ooof
let users = new Map();
const filter = m => m.author.id
const collector = message.channel.createMessageCollector(filter, { time: 15000, max: 4 });
message.channel.send("Type `ready` to enter the game");
collector.on("collect", async m => {
if (m.content === "ready" && m.author.id) {
m.author.send("You have readied up!")
console.log(m.author.username)
/*users.set(m.author.username, 1)
.then(() => users.set(m.author.username, 2))
.then(() => users.set(m.author.username, 3))
.then(() => users.set(m.author.username, 4))*/
await users.set(m.author.id, 1)
await users.set(m.author.id, 2)
await users.set(m.author.id, 3)
await users.set(m.author.id, 4)
}})
collector.on('end', collected => {
message.channel.send("Collected messages from all 4 players")
console.log(users)
});
can i even dm each person here
in another collector
each m.author
actually nvm
lol
you need to either require MessageEmbed from the package (I donโt do this so Iโm not sure) or do Discord.MessageEmbed() instead of just MessageEmbed() @earnest phoenix
@thick gull Thats what it is
How do I put a discord.py bot that writes a message to a channel every day at 8:00 AM? I did so, but I'm not sure it works, as soon as I start it gives me the message, but how do I get it to send only at 8:00 ??
Pls help me
but why would you want to do that 
How to put animated emojis
@clever vector if animated <a:(emoji-name):(emoji-id)> if not animated <(emoji-name):(emoji-id)>
you can get emoji but puting a / in front of it like this
/
then edit the message
/
oh, whatever works, works ig

Guys
Something strange happen to me
idk you guys too or no
My bot applied at July
now Sept
not yet approved too
I applied last year and was approved this week
so it can be super long @clever vector
oh
actually
Spark bot
its been a while
also they're are more bot lists i know that accept faster, but im not sure if that's advertising or not
Other bot lists dont have the magnitude of bots this one does
you'll reep more benefits from this list
yes, but it doesnt hurt to get on to multiple lists
it does when all the other lists do are try to be like this list
and fail miserably
anyway this isnt development talk we should move to #general
Can some give me a link of where i can learn html/css for description of adding in my bot
@hasty ginkgo

๐
You can pass me the memory usage command in python language here or in private, please, it's that I've been looking for it everywhere and I can't find it, please, it would be helpful if you wrote it to me please
no
We dont spoonfeed here
Please
We donโt spoonfeed unfortunately
Can some give me a link of where i can learn html/css for description of adding in my bot
@rough lodge can i get this?
@hasty ginkgo
@gentle oxide i mean, why did you ping me randomly out of 130k+ members?
because I saw that you put ping with your bot and I saw that you have inside the command ping memory uses: and that's why I asked you
xD
because I saw that you put ping with your bot and I saw that you have inside the command ping memory uses: and that's why I asked you
@gentle oxide no one here will spoon feed you
so stop
Can some give me a link of where i can learn html/css for description of adding in my bot
ajaj con ese cรณdigo tampoco es que sirva mucho es solo por estรฉtica pero si me quieren ayudar se los agradecerรญa mucho
y no es nada diferente pedir un trozo de cรณdigo a otro
Can some give me a link of where i can learn html/css for description of adding in my bot
@rough lodge w3schools
que no te vea yo haciendo una camiseta de tela porque lo estas copiando de otro
Ok thank you ๐
ajaj with that code it is not that it works a lot it is only for aesthetics but if you want to help me I would appreciate it very much
that I do not see you making a fabric shirt because you are copying it from another
Am I just supposed to list like what vps I use orr?
wrong server to ask in, ask in https://discord.gg/discord-developers
ok so i am having a problem, does anyone know how to create a custom help command that uses decorators in python. i can do all the embeds and all the other stuff, just setting up a decorator to use so i can dynamically retrieve the commands for the help command?
hi
let users = new Map([])
const filter = m => m.author.id
const collector = message.channel.createMessageCollector(filter, { time: 15000, max: 4 });
message.channel.send("Type `ready` to enter the game");
collector.on("collect", async m => {
if (m.content === "ready" && m.author.id) {
m.author.send("You have readied up!")
//console.log(m.author.username)
/*users.set(m.author.username, 1)
.then(() => users.set(m.author.username, 2))
.then(() => users.set(m.author.username, 3))
.then(() => users.set(m.author.username, 4))*/
users = [
[1, m.author.id],
[2, m.author.id],
[3, m.author.id],
[4, m.author.id]
]
}})
collector.on('end', collected => {
message.channel.send("Collected messages from all 4 players")
console.log(users)
console.log(users.get(1))
it says users.get is not a function
how is that possible
actually i fixed it
forget about the question lmao
so i'm mapping out a config file and i get raw values which is ok, it works. but if i want to say await and fetch a val in .map, it fails and returns [object Promise]. what's the best way to "await" the map somehow so i can await promises/funcs to resolve in the .map?
ok wtf i have another problem
let users = new Map([])
const filter = m => m.author.id
const collector = message.channel.createMessageCollector(filter, { time: 15000, max: 4 });
message.channel.send("Type `ready` to enter the game");
collector.on("collect", async m => {
if (m.content === "ready" && m.author.id) {
m.author.send("You have readied up!")
//console.log(m.author.username)
/*users.set(m.author.username, 1)
.then(() => users.set(m.author.username, 2))
.then(() => users.set(m.author.username, 3))
.then(() => users.set(m.author.username, 4))*/
await users.set(1, m.author.id)
await users.set(2, m.author.id)
await users.set(3, m.author.id)
await users.set(4, m.author.id)
}})
collector.on('end', collected => {
message.channel.send("Collected messages from all 4 players")
console.log(users)
//console.log(users.get(1))
let a = (users.get(1))
let b = (users.get(2))
let c = (users.get(3))
let d = (users.get(4))
});
so here in m.author.id it only displays the id of one guy
which i did not mean to do
how do i fix this without adding more collectors?
will this work? ```<html>
<body>
<h1>EcoBot</h1>
<p>This is a paragraph.</p>
</body>
</html>```
the bot description?
Dumb that is not a bot
use common sense
dude
You don't, html isn't a programming lamguage
That is for bot description as i said
I have question @cinder patio.. How do set an image
like an ss of the bot. using an cmd
Use the img tag, but you will have to host he images somewhere
@cinder patio how
Its local image and i want in the description
I host mine on imgur. Get the raw imgur link and use it in the src attribute of the img tag
K
does anyone know how to collect from 4 dif people in one collector
and get their ids
cuz when i did it i only got the id of the first person
I have discord.js and i use a basic-ish cooldown without a DB. How do i use it to count each time its triggered so that i can blacklist spammers that send 5 commands in x time?
talkedRecently.add(message.author.id);
setTimeout(() => {
// Removes the user from the set after a minute
talkedRecently.delete(message.author.id);
}, 3000);```
thanks
hi. i'm having this issue hours after i run the bot, always causes my server to crash. my code is this:
bot.on('message', (message) => {
if (message.author.bot) return;
let prefix = 'smthn';
if ((message.channel.name).includes("smthn")) {
if (String(message.content.toLowerCase()) == 'smthn') {
console.log(`${message.author.tag} honked!`)
return message.channel.send('smthn');
} else {
message.delete();
}
}
here's the log:
if ((message.channels.cache.get).includes("honk")) {
^
TypeError: Cannot read property 'cache' of undefined
at Client.<anonymous> (/home/container/honk.js:32:27)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:125:16)
thanks for any help
djs 12
message.content is already a string
just telling you
hi
if (args[1].isInteger === false) {
message.channel.send("Enter an actual number lol")
}
this is a part of my command
but it has no effect on it
if i enter a string it still does the command normally
and then messes up at the calculation part and shows an error
what do i do
What's args[1]? A string?
args is always a string
then how does it also work as a number
strings have no isInteger property
@misty sigil
/home/container/honk.js:32
if ((client.channels.name).includes("honk")) {
ReferenceError: client is not defined
at Client.<anonymous> (/home/container/honk.js:32:5)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:384:31)
at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)
at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)
at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:125:16)
you should use isNaN() since Number.isInteger() needs to be converted first since strings won't work
my code should be
bot.on('message', (message) => {
if (message.author.bot) return;
let prefix = 'honk';
if ((client.channels.name).includes("honk")) {
if (String(message.content.toLowerCase()) == 'honk') {
console.log(`${message.author.tag} honked!`)
return message.channel.send('honk');
} else {
message.delete();
}
}
right?
define client
huh
i made a variable which parses it into an int
you can just use isNaN
I have discord.js and i use a basic-ish cooldown without a DB. How do i use it to count each time its triggered so that i can blacklist spammers that send 5 commands in x time?
talkedRecently.add(message.author.id); setTimeout(() => { // Removes the user from the set after a minute talkedRecently.delete(message.author.id); }, 3000);```
@earnest phoenix No one have a solution?
I would be willing to use mongo db if needed
ok so
shouldnt this work
let one = parseInt(args[1])
if (one.isNan) {
message.channel.send("Enter a proper number lol")
}
cuz it isnt working
Stop making things up and learn to read the documentation
um
let one = parseInt(args[1])
if (isNan(one)) {
message.channel.send("Enter a proper number lol")
}
NaN
isNaN
Case sensitive
and also, isNaN(one) will always return false
wait what
because it's parsing the string as a number
actually, it will work
parseInt can return NaN
but it'll try to parse the string and get a number from it
idk what you said
Oh I thought it returned null
you should just remove that
it's okay
it would work. plus less lines of code. 
plus something like parseInt("11a") would return 11
so you have to use one instead of args[1]
parsing integers, yes.
what does parseInt() do
lmao
it's not funny anymore when you don't know how to google 
remove return
yes
it turned into undefined
ohh
you're doing it inside an eval
const prefixEmbed = ;
message.channel.send(embed);
yes ik quoting ain't ment for code block substitute
cuz
the code never ran
@clever vector you're literally doing PREFIX-EVAL and not mentioning the bot LMFAO
so it doesn't run
try putting it in your normal code then try pinging the bot
Ohh
message.content = "mention"; if (message.content.startsWith()) 
Message is undefined
what the fu
I am trying to add a meme command with the random-image-js module but im not sure how to get the variables from the response.
Code
const Discord = require("discord.js");
var randomImageJs = require("random-image-js");
module.exports = {
name: "meme",
description: "check out these memes!",
execute(client, message, args) {
randomImageJs
.getMemes({
get: 1,
removeAllSubReddit: true,
addSubReddit: ["memes", "dankmemes"]
})
.then(response => {
const randomColor = Math.floor(Math.random() * 16777215).toString(16);
const memeEmbed = new Discord.MessageEmbed()
.setTitle("[" + response.title + "]" + "(" + response.postLink + ")")
.setColor(randomColor)
.setFooter("r/" + response.subreddit)
.setImage(response.image);
message.channel.send(memeEmbed);
console.log(response)
});
}
};
Example Response
{
id: 'ionzun',
title: 'how does that even happen?',
postLink: 'https://redd.it/ionzun',
image: 'https://i.redd.it/3v0j8b4n1vl51.jpg',
thumbnail: 'https://b.thumbs.redditmedia.com/R43YhUTulKqZIPGWI5aVb5SqAnAC9Yquobta0ZMX5Mc.jpg',
subreddit: 'memes',
NSFW: false,
spoiler: false,
createdUtc: 1599543335
}
]```
hey message is not defined
wtf
sorry i dont really understand do u mean response[1].image
sorry i dont really understand do u mean response[1].image
@wicked plover the.imagepart meansget property image from the object
also response[1] won't work
@clever vector Show command handler
The stuff starting with bot.on("message");
screenshot the first few lines of code
i have many handler
wtf
The command handler
yeah
Hi, so I'm trying to make a message deleted log. I've got it to work, but it only logs messages that have just been sent, any message above thee lastest one doesnt work. I'm currently using the audit log method
The stuff starting with
bot.on("message");
screenshot the first few lines of code
Hi, so I'm trying to make a message deleted log. I've got it to work, but it only logs messages that have just been sent, any message above thee lastest one doesnt work. I'm currently using the audit log method
@forest drift show code
client.on('messageDelete', async msg => {
let logs = await msg.guild.fetchAuditLogs({
limit: 1,
type: 'MESSAGE_DELETE',
});
let entry = logs.entries.first();
here is index.js
const Discord = require("discord.js");
const config = require("./config.json")
const blobcord = require("./handler/ClientBuilder.js");
const client = new blobcord();
require("./handler/module.js")(client);
require("./handler/Event.js")(client);
client.package = require("./package.json");
client.on("warn", console.warn);
client.on("error", console.error);
client.login(config.token).catch(console.error);
then in an embed im just refering to; msg.content, msg.channel, msg.author.id, ect
here is index.js
@clever vector you just confirmed that you seriously don't know anything about bot development and programming
๐ฆ
common atleast be nice
virak just experiment until you get the hang of it
everyone starts knowing nothing
virak just experiment until you get the hang of it
@forest drift that's half terrible advice
eh works for me
he seriously ain't getting anything about his code how will he experiment
ok fair point...
I remember when I have a problem, I google it and then try understand how they're solving it. Then I end up remembering the code longer than if I were to just read it
I remember when I have a problem, I google it and then try understand how they're solving it. Then I end up remembering the code longer than if I were to just read it
@forest drift after you google you still read so
god please don't use w3schools to learn js
w3schools is complete garbage
I mean, I then have to code it, and since I only google what I need, that strat works for me
I'm just throwing in links from places where i learnt programming
@clever vector
Read those tutorials
Completely ignore w3schools if you want
@woeful pike
w3schools is complete garbage
@woeful pike w3schools is atleast simple and easy to understand?
Can i ask 1 more
pinging a fucking dev teammate to ask for permission to ask a question 
w3schools is old and crusty, at best it has outdated information and at worst it teaches discouraged bad practices like float layouts and var
pinging a
fucking devteammate to ask for permission to ask a question :bigbrain:
@earnest phoenix Yo
k
Me is newbie
if u ping me again I'm moving it to the back of the queue
sorry auto-correct typed the word dick
just be patient, we're bombarded with new bots every single day
w3schools is old and crusty, at best it has outdated information and at worst it teaches discouraged bad practices like float layouts and
var
@woeful pike mkay very true point... i tried learning mongodb on there and got enough errors to fill a database
Last time my bot was added and its reply after 1month
@clever vector we're getting #general
@hollow mango mkay very true point... i tried learning mongodb on there and got enough errors to fill a database
@forest drift uhhh what
mongodb? the database?
is it possible to use those variable in coding block ?
is it possible to use those variable in coding block ?
@cerulean salmon wdym??
๐ i an new
oh you mean get the property inside the object itsekf
yes
what did it output
undefined
wait
since it's inside a function it refernces ti the function
@Tim
@quartz kindle how do you get the object to which a methid belongs to
*method
that's because you cannot use this inside arrow functions
replace () => { with function() {
@cerulean salmon
@cinder patio @earnest phoenix thanks for the response .
so guys im running a discord server that basically needs an account registration to access my features , people now manually tell me what they want as their user, pw , email , is there a bot / website where i can send them and they write it there and the bot/website keeps the database? thanks in advanced hope i explained it right
is microsoft azure the best option for hosting the bot?
Hello I write an create role cmd, but it make the role and it adds at the role all permissions, I want only selected perms
so guys im running a discord server that basically needs an account registration to access my features , people now manually tell me what they want as their user, pw , email , is there a bot / website where i can send them and they write it there and the bot/website keeps the database? thanks in advanced hope i explained it right
@earnest phoenix why should a bot have account registration, isnt Discord OAuth not giving enough trusted information about the user?
@earnest phoenix How to do that
How can i add this in MessageEmbed
ok











