#development
1 messages · Page 1082 of 1
i understood that reference tho
I think it’s Tim’s patreon
^^
and?
guess what??
I don't understand why err0|Bd Radio | DiscordAPIError: Cannot execute action on a DM channel 0|Bd Radio | at RequestHandler.execute (/Bots/Bd Radio/node_modules/discord.js/src/rest/RequestHandler.js:170:25) 0|Bd Radio | at processTicksAndRejections (internal/process/task_queues.js:97:5) { 0|Bd Radio | method: 'delete', 0|Bd Radio | path: '/channels/681158011342946305/messages/736214269208690788', 0|Bd Radio | code: 50003, 0|Bd Radio | httpStatus: 403 0|Bd Radio | }
Cannot execute action on a DM channel
lol
Error says it all
Whatever you're doing can't be done on a dm Channel
I've defined member as
const member = message.mentions.members.first();```
ok
bye
its 7 pm here
Isn’t it message.members.mentions.first()?
no
no...
message mentions
no
o.o
Cannot execute action on a DM channel
@opal plank but other commands run in DM perfectly
look in your code
message.mentions
a dm can't have a member
Well there's things can't be done on a dm channel, so you're doing something that can't be done @robust moth
quick question if anyone knows.. i've set up dragory/modmailbot and im trying to get the website logs, am i like allowed to ask this here?
is this the correct channel to ask?*
Ask in their support server???
no i mean, i forked the bot, im not using the actual bot
@pale vessel i waited whole 150 seconds just to see a man saying H word 😭
cuz ur json/whatever the fuck youre parsing is incorrect
im gonna pretend you didnt just absolutely leak your token
can you help me in it?
I will give you the project edit thing in glitch
mot only your token, your yw api token and yt credentials
cool token
just send the code where its erroring lol
they're very well redacted
@pale vessel i waited whole 150 seconds just to see a man saying H word 😭
10/10 censoring
this is #development uno
God lvl censoring
@scenic grotto
@delicate shore yes?
delete the pic
i did

@opal plank can you help me in solving it ?
i will give you the project in glitch link
the code is there i just want to let it work online
of course you can
is it spoonfeeding?
omg
Can send me your embed?
@earnest phoenix
is it spoonfeeding
and youre sending ME the token?:
so, let me get this right, you are willingly sending me tokens?


you shouldn't send tokens or give access to your tokens to anyone
you didn't understand 🤦♂️
:facepalm:
@opal plank he will share link
links allowed
spoonfeeding is a no no zone 
will know his tokens
links ARE allowed, just dont post tokens
and all the codes
your linter is saying your indents are incorrect
Well there's things can't be done on a dm channel, so you're doing something that can't be done @robust moth
@earnest phoenix when I use pm2 console show err but when I use nodemon or node Command run perfectly .. what can I do now??
@delicate shore Can send me your embed?
@earnest phoenix .addField("Poop",My Exclsuive poop pic)
why are you requiring modules that you don't use
what is wrong in it?
i took the text on top from another bot server.js
hastebin
and added the code i want down
hastebin
@scenic grotto i Suspect that very last }) is not needed
@scenic grotto delete the link you sent me
And for the love of god, use async/await
when you make a bot application you agree not to share tokens
be ToS compliant
revoke the link you sent me
@opal plank ok
@scenic grotto https://www.pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
and don't use var 
and if you're gonna use glitch, use .env 
^^
@scenic grotto can you try removing that very last })?
ok@earnest phoenix
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
if u want help i can
@scenic grotto js client.on('message', async (message) => { if (message.content === prefix + 'اقتراح') { //الامر var shopc = message.guild.channels.find('name', '☭・الاقترحات'); if (!shopc) return message.reply('ليس موجود روم بي اسم ☭・الاقترحات'); let shop = ''; let fillter = (m) => m.author.id === message.author.id; message.delete(); await message.channel.send('** اكتب الان اقترحك **').then((e) => { message.channel .awaitMessages(fillter, { time: 60000, max: 1 }) .then((co) => { shop = co.first().content; co.first().delete(); // 90 + 40 + 20 + 20 + 10 + 20 = 200 let desc = ''; let nord = new Discord.RichEmbed() .setColor('#b42323') .addField('اقتراح جديد :', shop) .setTimestamp(); e.edit(`** ${message.author} , تم ارسال اقترحاك**`).then((e) => { shopc .send('**تم ارسال الا قتراح من : ** ' + message.author) .then(() => { shopc.sendEmbed(nord); }); }); }); }); } });
replace that
you just had 2 wrong brackets
that indentaion you had gave me cancer btw
@opal plank i replace everything from top?
no, replace that event only
done
shopc.send('**تم ارسال الا قتراح من : ** ' + message.author).then(() => {
shopc.sendEmbed(nord)
})
})
})
})
}
});``` Before btw
i sure hope whatever the f that lang is, its not curse words
cuz i have no idea what it means
not curse
These kind of issues wouldn't happen mostly if you used async/await
ok
your liter TOLD you about the error though
Chaining .then() many times is a bad practice
uh
what should i write in package.json?
chaining .then is quite useful
No it's not
Unless you are illiterate
i am doe 
that's it now the bot should work or anything left?
you shoundnt touch packages unless you know what you're doing
im assuming you INSTALLED npm
npm init
@scenic grotto if no errors you see, then try it and see... If it works
I'll try now on my vps
Hi guys I have an npm package but if I try this it says application.getTautorial() is not a function
Why?
Tautorial
Misspell
Wdym
also, @scenic grotto who'd you copy all that code from?
Hi
@earnest phoenix try
application.getTutorial()
@opal plank from someone made the code for me (:
Misspelling in programming is a big no no
I want to but my
your bot wont work Sad
@earnest phoenix yea and bots can only use emojis that they have access to
Can u help me with that? @earnest phoenix
What are you even using tho I'm confused
@earnest phoenix Application.js
It’s my package
@earnest phoenix i see a question mark
Lol
@scenic grotto there are so many things wrong with your 'bot' i dont even know where to start. First learn NPM https://docs.npmjs.com/cli/init , then learn js https://www.w3schools.com/js/ , THEN use this https://discordjs.guide/ , and then finally read this whenever you need https://discord.js.org/#/docs/main/stable/general/welcome
@earnest phoenix i mean what you're trying to do... Is what I'm asking
@earnest phoenix
Love Me ${client.emojis.get("id")}
Use This
@earnest phoenix I have a package and i try it and it says me application.get(thing)() it not a function
In all the commands
why do you have that many
not mine
@earnest phoenix as you are showing
get(thing)()... You're doing double function... Which will never work
ik
Sad is the one who yoinked this code
im deleting the code cuz i dont wanna have anything to do with his tokens
@earnest phoenix try
application.getTutorial()
@earnest phoenix same error
i did not realize there were tokens
who made this code
i blurred them of course
but bruh
Canvas, canvas
3 instances requiring discord.js
vars
90% unused
nice
that legit gave me cancer
flaz can you ejs?
no
Can anyone help me?
dont ask to ask, just ask
htittyps://dontasktoask
Error: Failed to lookup view "app.ejs" in views directory
this is my error btw please send help
ive tried with and without ./ before app.ejs but it doesnt work
You have somewhere that states app.set("views"...) and points to a folder?
path comes with nodejs
oh cool
Yo what's up
(node:19136) UnhandledPromiseRejectionWarning: Error: Cannot find module 'js'
UM
e
why are you trying to require js
I'm not
code?
if you read the error, you are
he's probably not
It is not in my code anywhere
you've probably got an app.set('view engine', 'js') which is causing the error, you need ejs instead of js
can folders even contain .s?
its whatever the folder is called
then it should work
I'll test once more
Then send the thing
Okay it didn't work
const express = require('express')
const app = express()
const port = 3000
const fs = require('fs')
const url = require('url')
const fetch = require('node-fetch')
const path = require('path')
let content = String(fs.readFileSync('./alebot website/index2.html'))
app.set('app.ejs', path.join(__dirname, 'app.ejs'));
app.get('/', (req, res) => {
const urlObj = url.parse(req.url, true)
if (urlObj.query.code) {
const accessCode = urlObj.query.code;
console.log(`The access code is: ${accessCode}`);
const data = {
client_id: '718932190112776203',
client_secret: 'j r r token',
grant_type: 'authorization_code',
redirect_uri: 'http://localhost:3000/?',
code: accessCode,
scope: 'identify guilds',
};
fetch('https://discord.com/api/oauth2/token', {
method: 'POST',
body: new URLSearchParams(data),
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
.then((e) => e.json())
.then(info => fetch('https://discord.com/api/users/@me/guilds', {
headers: {
authorization: `${info.token_type} ${info.access_token}`,
},
}))
.then(e => e.json())
.then((e) => res.render('app.ejs', { responseFromAPI: e }))
}
if (urlObj.pathname === '/') {
responseCode = 200;
content = String(fs.readFileSync('./alebot website/index2.html'));
}
console.log(urlObj)
res.send(content)})
app.listen(port, () => console.log(`app listening at http://localhost:${port}`))
send a screenshot of the file tree
thats the folder name
e
i am moyaing so hard rn
oh no
u said app.ejs was a folder
Can I have some help please, How do I get a message.authors highest role? I tried message.author.roles.highest but its undefined o.o
It needs to be on a guild member instance.
well of course
message.author is a User instance.
o h y e a h i d i d d i d n t i o h w e l l x_ )
Oh thanks
How do I get a member instance though without having a mention in the message
If you want to target the person who sent the message, use message.member
dice, make a folder called views
oKaY
and in that folder put the app.ejs file
doned
and change app.set('app.ejs', path.join(__dirname, 'app.ejs')) to app.set("views", path.join(__dirname, "views"));
it should work now
@still merlin this would work if you want
let member = message.mentions.members.first() || message.member
Thats a mention right?
how can I edit a message so that the image attached to it get removed??
@still merlin first is a mention, if it doesn't exist, it would be automatically message.member
I couldn't remove any attachments the message have
attachments can't be removed once it's attached
are you sure?
Unless you literally delete the whole message
*crab rave starts playing*
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
:D
I've tried everything, but couldn't figure out any method to do so
Would this interfere with my existing code putting a [message.member]?
@rocky hearth as i said, you can't
Users don't have roles.
i know
If you try message.member, to get user properties like username or tag or such
You have to do
message.member.user
Which message.member is defined as member in there so
member.user.username for example
I'm getting a bit confused, Do I have to have a mention in the command to get a message authors highest role
No
Message author is a user
@earnest phoenix So what should I do? I want to keep a message undeleted and what to add and remove images from it constantly.
just do const member = message.member;.
You don't need the mention part.
or just use message.member if you don't want to use a shorthand variable.
i need help with ejs (again)
Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
@rocky hearth well there's nothing you can do about it unless you delete the message that attached an image and send another message with whatever was provided in the previous message but without the attachment
let highestRole = <GuildMember>.roles.highest;
Why not just use the member variable
That's if it weren't defined.
member.roles.highest and ik, but that you showed doesn't apply to the mentioned member
I'm pretty sure they don't want mentioned members.
you cannot change attached images, but you can change image urls
Anyone here who is expert of discord commando framework??
if you host your images elsewhere instead of attaching them, then you can swap them
@quartz kindle thanks for the tip! I have a list of buffer images, and want to show them one by one, on the same message
*sad dice noises*
@quartz kindle @earnest phoenix can you do anything with my last message
@cobalt eagle use discord commando
const Discord = require("discord.js")
do i need to place the const { Client, MessageEmbed } = require('discord.js'); line in every file ?
follow the guide https://discordjs.guide
yeah
but the data.push thing
seems really annoying
don't get me wrong
my bot is working well and all, embeds are working and all
i'm just asking if i need this line in all my files :
const { Client, MessageEmbed } = require('discord.js');
or if i can do it either way
you don’t need client
client is passed through via module.exports
afaik on my handler
@cobalt eagle u do need to require discord.js everytime u required MesageEmbed or anything else,
as well as the client ?
nope, u can access the client(bot) via , message.client! Also the Client is used only one time the bot is initially initialized.
s!eval const muted = new Discord.MessageEmbed()
.setTitle("You Are Muted")
.setDescription("Well You are Muted!
Congratulations! You have the @Muted role
isn't it so cool?
Anyways, if you think your punishment was unjustified either contact modmail with @ModMail#5460 or contact @Higher Support and @earnest phoenixmin (Don't ping)
Else, Just wait ")
.addField("Till that check out my socials", "and drop a sub and follow")
.addField("My Youtube Channel", PGamerX)
.addField("My Twitter", @ytPGamerX)
.addField("Our Reddit Page", r/PGamerX)
.addField("Black Sheep Bot", Black Sheep
.setFooter("s!invite")
msg.channel.send(muted)
i tried to eval that
it says unexpceed token
It's probably due to your .setDescription and multi-line string.
Consider using template strings if you want it to span multiple lines, or \n with +.
ok
i did like this
s!eval const muted = new Discord.MessageEmbed()
.setTitle("You Are Muted")
.setDescription("Well You are Muted! Congratulations! You have the @Muted role isn't it so cool?Anyways, if you think your punishment was unjustified either contact modmail with @(dm) ModMail 📬 or contact @Higher Support and @Admin (Don't ping) Else, Just wait ")
.addField("Till that check out my socials", "and drop a sub and follow")
.addField("My Youtube Channel", [PGamerX](https://www.youtube.com/))
.addField("My Twitter", [@ytPGamerX](https://www.twitter.com/))
.addField("Our Reddit Page", [r/PGamerX](https://www.reddit.com/r/))
.addField("Black Sheep Bot", [Black Sheep](https:/))
.setFooter("s!invite")
msg.channel.send(muted)```
and now it says
but i don't think so

using multiline template strings causes the indentation to be also included
use common-tags
there's a severe lack of stringing here
you can do things like ```js
setDescription(stripIndentshello hello);
how do i get a discord avatar from this? b2a2dc63de66ce66c9310e8d7f6a9cd1
not sure where to plug it in in terms of the discord website
https://cdn.discordapp.com/avatars/<user id>/<avatar hash>.ext?size=size
Tanx
no
the problem is
in your fields
when you use links
every text you want to display needs to be a string
like this : ```js
s!eval const muted = new Discord.MessageEmbed()
.setTitle("You Are Muted")
.setDescription("Well You are Muted! Congratulations! You have the @Muted role isn't it so cool?Anyways, if you think your punishment was unjustified either contact modmail with @(dm) ModMail 📬 or contact @Higher Support and @Admin (Don't ping) Else, Just wait ")
.addField("Till that check out my socials", "and drop a sub and follow")
.addField("My Youtube Channel", 'PGamerX)'
.addField("My Twitter", '@ytPGamerX)'
.addField("Our Reddit Page", 'r/PGamerX)'
.addField("Black Sheep Bot", 'Black Sheep)'
.setFooter("s!invite")
msg.channel.send(muted)
or at least the link
i just need help with making my discord bot go online so when i type in node . it says module not found what am i missing
@open storm do npm install
@open storm do
npm install
@rocky hearth that doesnt do anything if it isnt in his package.json and i doubt if it is
yeah, he also hvnt clarified his query
And he still hasnt...
Why do people ask for help and dont respond if people try to help
@misty sigil I have a list of buffer images, and I want to show them one by one, in a same message. How do I do that.
Edit your message?
I got to know that I cant edit image attachments
Delete your message and create a new one? Also ^
I dont think you can show them one by one in the same message, your best bet would be to delete the previous message and send a new one, you can add those reactions again after
Or have your reactions control panel in a separate message
Any help me? I make an welcome image, using Pillow library in python3, but when rendering the usernames with unicode chars, it's bugging and render an square
Any help me? I make an welcome image, using Pillow library in python3, but when rendering the usernames with unicode chars, it's bugging and render an square
@sharp citrus you already asked, be patient
So you meant to say that, I can have a set of reactions saved, and add all those again instantly?
?
https://cdn.discordapp.com/avatars/<%- JSON.stringify(responseFromAPI.id) %>/<%- JSON.stringify(responseFromAPI.avatar) %>.jpg
i wanna encode the things as uri elements of the src but how?
Not instantly but fairly fast (fast enough)
encodeURIComponents()?
in a not js situation
you dont need JSON.stringify either
but the url requires the params of user ID and the hash
its received from the discord api via oauth scope

<img src="https://cdn.discordapp.com/avatars/<%- responseFromAPI.id %>/<%- responseFromAPI.avatar %>.jpg">
png is recommended though
@clever crane brief description and detailed description are two different things
RedMarsh Bot! Fun, where you can have fun with friends, Moderation, where you can use use your power on trollers/abusers, games, where you can play !bal,!crime,!work,!deposit,!withdraw,Global, Where you can check server information and many things,!serverinfo,!avatar,!help.This bot 24/7 Online And Very Fast + DM When ban,warn,unwarn,unban. Powered By [R]edMarsh#9999, If you found any bug DM me in Discord And i will fix it! @quartz kindle Can you fix it?
lol
what...
Like it say too long so fix for me
STOP SHOUTING AT ME
I mean edit it
there are two different fields in the form
...
a brief description, which is a short description
then you have detailed description, where you have to write all that
** IF I WANT GET ALL EMOJI FROM ALL SERVER THEN RANDOM AND GET ONLY 1 AND SENT HOW I DO? **
if(message.content === prefix+"emol"){
client.guilds.cache.forEach(guild => {
var guildemo = client.guilds.cache.get(guild.id);
guildemo.emojis.cache.forEach(emoji => {
});
});
}
});
the detailed description is written in the black text area
How could I use a buffer image to be shown in setImage() in embeds? NO ATTACHMENTS
Ah
buffers need to be attached via addFiles
the docs have an example on how to do that ^
you cant without attachments
** IF I WANT GET ALL EMOJI FROM ALL SERVER THEN RANDOM AND GET ONLY 1 AND SENT HOW I DO? **
if(message.content === prefix+"emol"){ client.guilds.cache.forEach(guild => { var guildemo = client.guilds.cache.get(guild.id); guildemo.emojis.cache.forEach(emoji => { }); }); } });
@earnest phoenix client.guilds.cache.random().emojis.cache.random()
a buffer is an image file, files cannot be added to messages without an attachment
you need to host the image elsewhere
like imgur
and take only the url for it
I'm getting the buffer image from a canvas
then you cant
unless you wanna do a full roundtrip and upload it to an image hosting service via an api
I want the canvas drawing to be shown on embeds without attachments.
or host the images yourself in a webserver
there a way for me to fetch foo and bar and have them both be accessible without having to re render the page?
@earnest phoenix client.guilds.cache.random().emojis.cache.random()
@wary flame Can show all of code I'm newbie
No
there is a client.emojis btw
Oh?
so you can literally do client.emojis.cache.random()
epiccc
so a client could have its own set of emojies that can be used in any server (it has joined in)?
client.emojis is a getter for all guild emojis
same as joining all emojis from all guilds
bots can use any emoji from any server they are in, as long as they have permissions to do so
that do be true doe
how to get my bot status like this?
like Streaming s!help
like dm used to do streaming pls help
@delicate shore client.user.setActivity('ONLY FOR STATUS!');
that ik
but we need to tell type also
and if i do type:STREAMING
it does nothing
just saays Black sheep is streaming
client.user.setActivity('ONLY FOR STATUS!', { type: 'STREAMING' });
default is PLAYING
I remember it is something related to Oath2, I dont know much about that
oh yes Tim is here, I wanted to ask you something. For my bot I need the amount of members in a role, but it doesn't work properly when I'm disabling the guild presences intent. How would I solve this? Enabling fetchAllMembers or trying to get guild_presences enabled when it reaches 100 servers?
and it is {} also
@delicate shore https://discord.js.org/#/docs/main/stable/typedef/PresenceData
pretty sure you can set it through that
client.user.setActivity("activity here", {type: "STREAMING", url: "https://twitch.tv/discord"})
^
the other one works too
``` bot.user.setActivity(in ${bot.guilds.cache.size} servers, {type: "STREAMING", url: "https://blacksheep.glitch.me/"})
this is my code
@nocturne grove to see how many members a certain role has you need them all available, therefore the only option is to use fetchAllMembers
Syntax error missing a ) in your code
error says it all mate
okay thanks Tim. There won't be a way to only fetch members for specific guilds, @quartz kindle?
syntax errors can't be fixed here
there is guild.members.fetch()
you need the GUILD_MEMBERS intent to fetch all members with it
Tim have you used discord commando?
nope
hmm okay that one is really handy I think. Saves, I guess, a lot of memory for large guilds like this one where my bot won't get used for that. Thanks for your advice
i use a mysql database
and i can't access it in the command files
it says "con" is undefined
you have to pass con
@delicate shore discord does some sort of verification to see if the url provided is an actual stream. There is probably a way to fool it, but you'd need to know how discord does it in the first place
you need to make it available by passing it through some function, for example
or attaching it to some variable that is already available, like client
how ?
oh
@delicate shore discord does some sort of verification to see if the url provided is an actual stream. There is probably a way to fool it, but you'd need to know how discord does it in the first place
it is not working
not even the status
bot.on(
"ready",
() =>
bot.user.setActivity(`in ${bot.guilds.cache.size} servers`, {type: "STREAMING", url: "https://blacksheep.glitch.me/"}))
@quartz kindle
i basically explained why
yeah but
atleast it should say
streaming
i mean streaming sign
and how does dad bot does it ?
i already explained why
btw, you showed how dank memer is doing it
well, if you check its status you'll see that its actually streaming a twitch url, which is a valid stream
https://www.twitch.tv/dankmemerdiscord
yes
@quartz kindle I just got banned from youtube (429 redirects on all videos)
In order to fix this is I assume youtube is changing things again but should I just use a VPN or should I use the official youtube API?
oof
I use LavaLinkServer at the moment to pull youtube vids
is your bot on your home network?
technically, one way is legal, the other way is illegal
They dont support adding a youtube API key tho
lol
well they have this
#ratelimit:
#ipBlocks: ["1.0.0.0/8", "..."] # list of ip blocks
#excludedIps: ["...", "..."] # ips which should be explicit excluded from usage by lavalink
#strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch
#searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing
#retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times```
yes
ok @quartz kindle now i have this
i passed it with the function that already pass other things
for some reasons it is not
yes
@magic jackal
imagine using fs or path for command handler
wut
how can I learn to add database to my bot? Any video suggetions?
@fresh hatch imagine criticizing other peoples code
@quartz kindle you were talking about fetch(). Can I ask you something, I am kinda trying to "practice" how to get the values from all kinds of information that are included in all of those elements. So I was able to get what I want, but I remember that people told me that the way I am doing is not good(for some reasons). If you would have to get the same information, how would you change this command? I have used it for my eval command.
message.guild.members.fetch().then(msg => msg.map(msg=>message.channel.send(Object.values(msg.user)[0])))
Don't watch yt videos to learn how to code discord bots
^
so what should I do?
Check official guides
the official guides are so limited
traversy media is good
here's where the error's from
watch his videos, he explains things well
"limited" in terms of what
and here is where is the error
not much informations
What kind of information exactly
False
i cannot set my bot status as idle
it does provide info
They are very rich
An official documentation is supposed to provide information for everything a product provides
I mean discord.js.org doesn't have all the examples for each properties
They're not required to
I mean
Most of them are pretty self-explanatory
documentations shouldn't even have detailed examples the way d.js' does imo
@midnight blaze that code is basically sending a separate message for every single member that you fetch
@quartz kindle Here are the code parts that you should need
https://discordapp.com/channels/264445053596991498/272764566411149314/736256037983617104
https://discordapp.com/channels/264445053596991498/272764566411149314/736256516436262982
https://discordapp.com/channels/264445053596991498/272764566411149314/736256672900710460
https://discordapp.com/channels/264445053596991498/272764566411149314/736256787484770354
@quartz kindleI know, I have made it^^ it doesnt really matter if it sends message or console messages. I am only wondering, How would you access the same information
depends what you want to do with it
@cobalt eagle not enough information, everything looks fine from only looking at that
for now actually nothing
I am just want to be able to open objects, handling promises
what else would you need ?
just being able to access what I want
Using my eval command for getting information while being on discord
still, it depends what kind of information and what you wanna do with it
for example guild.members.fetch() returns a collection of members
i cannot set my bot status as idle
what do you want to do with it? remap it to users? members.map(member => member.user)
it gives no error
imagine using fs or path for command handler
@fresh hatch i wonder what else you could do
but does nothing
remap it to usernames? members.map(member => member.displayName)
usually I console.log it first and so I am able to see what they all include
and inside the boundle they have again more objects/boundles^^
statuses are bugged, they randomly work or dont work
but anyway, I guess you would have done it in the same way, like I have done
otherwise you would have commented it
i woudlnt use map for sending, no
@quartz kindle here's the error message
i don't know what else i can show you
show the entire language.js file
@quartz kindle let us assume it was console.log
ok
because I have just changed it in the last second for a test, it was console.log
would you have used map?
if i wanted to log the entire members collection, i would jsut log it directly, no need for anything
console.log(members)
it always depends on what you want to do with it
find a single value in it? .find
find multiple values in it? .filter
transform all values into a different value? .map
etc
it was a single value
if you would have checked it out. I could post a console.log then it makes more sense
is your database connected? did you do con.connect()?
async function fetchMany() {
let authy = await fetch('https://discord.com/api/oauth2/token', {
method: 'POST',
body: new URLSearchParams(data),
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
})
let auth = authy.json()
let usery = await fetch('https://discord.com/api/users/@me', {
headers: {
authorization: `${auth.token_type} ${auth.access_token}`,
},
})
let user = usery.json()
let guildsy = await fetch('https://discord.com/api/users/@me/guilds', {
headers: {
authorization: `${auth.token_type} ${auth.access_token}`,
},
})
let guilds = guildsy.json()
res.render('app.ejs', { userObj: user, userGuilds: guilds })
console.log(auth)
console.log(user)
console.log(guilds)
}
i want to fetch multiple things at once but its not working :(
nothing after this but closing brackets
returns 401
all Ids of the fetched members
this is probably better than simply console.log(members)
guild.members.fetch().then(members => console.log(members.map(member => member.id)))
or
foreach
all I wanted to know 🙂
when forEach tho and when map?
I feel like they do the same lol
guild.members.fetch().then(members => members.forEach(member => console.log(member.id)))
how can i make a createReactionCollector with a infine time limit?
use onreaction
the difference is that forEach doesnt return anything, while map returns the transformed array/collection
forEach is for doing something to every item
map is for doing something to every item and place the result in the list again, and in the end return the transformed list
I like galaxygate 🤷♂️
@solemn latch linux...
what?
(generally)
map: one log/message or whatever
forEach: many messages or logs
why do you need windows
windows is typically worse for server stuff
anyway, gg offers windows
@cobalt eagle #development message
just $10 plan or higher, since windows requires more resources to work
oh sorry
Need a .net dev, trying to modifyasync a message id
Not by direct calling, by id only
@quartz kindle con.connect() is done at the end of the main file before the bot starts running
I need help figuring out how to get my bot Online, it is appearing offline and ive tried different ways to get it online and it will not work.
Idk how to use linux
well, they offer windows
@cobalt eagle console.log(con) in your command
ok
@dusky cradle do you have any experience with programming/coding? when you say you tried many things, what exactly did you try?
@solemn latch link in dms ? Pls
like messing with other bots to see if they interfered with the bot and seeing if anything important was turned off
so you basically have no idea how a bot works?
wich is the language of the current server
wait so, its not your bot you're talking about
its just some random bot you're trying to use?
no it's my bot
taking to regis
oh ok sorry
yeah, i got this support discord from there website
@solemn latch what do you mean ?
the bot is called invitemanager
well this is the wrong place
-wrongserver @dusky cradle
@dusky cradle
Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Support Server" button on the bot's page, not the "Join Discord" button at the top of our website. If there isn't a button that says Join Support Server, then we can't help you. Sorry :(
thanks
Hello ! who could tell me how to develop an anti-insults surbot disigner ?
@cobalt eagle
if you execute
(message, language, etc...)
and your command file does
(message, con)
con will be language.
oooh
ok
i'm dumb
err
no
still the same error
it's (message, con, languages) anyway
show your main file
client.on('message', message => {
if (message.author.bot) return;
if (!message.guild) return;
const args = message.content.slice(prefix.length).split(' ');
const command = args.shift().toLowerCase();
con.query("SELECT language FROM serveurs WHERE serverid = '" + message.guild.id + "'", function (err, result) {
if (result[0].language == 'fr') {
const language = 'fr'
if (!client.commands.has(command)) return;
try {
client.commands.get(command).execute(message, con, language, args);
} catch (error) {
console.error(error);
message.reply('Je n\'ai pas réussi à exécuter cette commande !');
}
} else {
const language = 'en'
if (!client.commands.has(command)) return;
try {
client.commands.get(command).execute(message, language, args);
} catch (error) {
console.error(error);
message.reply('Je n\'ai pas réussi à exécuter cette commande !');
}
}
})
});
rzoheifqsdjpo
i modified it for french and not for english
i'm dumb
thx
yeah working fine now
sorry for making you both loose your time
psh im just procrastinating
ok
🤔

not too much sunlight, water them atleast once a day
write that down
describe what your bot is About, Maybe some Instructions for more Complex stuff
How to execute code using exec() function using discord.py?
The command should be like this:
!exec ctx.send("Hai")
And the bot response the command and will send a message "Hai"
lol
im more likely to respond if you at least ping me in my server lol
🤔
tim if ur server had a code channel, there would be no one talking here lmfao
okay i still need help
Hey does anyone use OneProvider? I just bought a few IPs from the host and I need some help assigning them to the interface
what do u need?
webjs?
oh indeed
funy
is it this https://www.npmjs.com/package/webjs ?
wdym how to forEach? its literally the same?
idk how to make tags
whats a tag?
what tags
option
the <p> <h1> kinda tags?
just
is that not the name for them
document.createElement('tag')
oh fuck
?
wdym?
<select id="plumbus">
// create option tags here
yeah, like
const div = document.createElement('div');
div.innerHTML = 'html';
``` ?
get element by id, for each some item in array, create element, append child
*nooby frontend noises*
im not good with frontend either
Illegal
what
Hey what's this formatting called, I want to integrate it into my WebStorm setup but I don't know what to search for... I thought it was Prettier doing it but I guess it doesn't do this on WebStorm
in WebStorm, it's all in one line.
you can configure the prettier extension to show it on multiple lines
if thats what ur saying?
also dice, hows oauth2 going?
im gonna learn web development
I can teach ya
@misty sigil that is the best website to learn js and html and css and stuff
you can configure the prettier extension to show it on multiple lines
@digital ibex yeah, how?
go to the settings of the extension
yea it is
traversy media is pretty good
@misty sigil that is the best website to learn js and html and css and stuff
@earnest phoenix
they're both good 
thats your opinion tho
Lmao
True
They're basically 1% awesome of all the cool people reading this message combined
🥰
Mozilla hosts more content for learning the web (and JS) than w3schools, but I think the only plus to using w3schools is ita explained in simple terms by removing all the difficulty you usually see which is easy to trip on as a beginner
setInterval(function(){
bot.channels.get("264445053596991498").send("spam");
},1000)
y no arow function tho
Because....
yes
yes
yes
@quartz kindle someone told me to ping you when in doubt so... How do I detect if a user has a role with id X in guild Y
.>
lol
like
change it from localhost to not localhost
say i had a node vps
<user>.status
its an object
did you bind it to localhost or something @pure lion ?
by default webservers are not really bound to any ip unless you make it
like
where would i listen, what ports, how would i access the server through a url from anywhere
port 80 for http
port 443 for https(youll need a cert for that)
How tf did you get the badge it takes to long lmao @quartz kindle
took 3 weeks for me
Not bad
okay port 80 but how do i actually access?
You need sudo or admin terminal
ip:port
in the browser
In browser 80 is auto
if its local you can use 127
i always put :80 still when its an ip 🤷♂️ force of habit
No
dont do it if you dont wanna :/
i do need to tho
gotta juice all that content
whats discord limit file/ size for gifs again?
8MB or something dumb right?
yeah
256kb iirc
256 qwerpjwqeoithw
yeah
128x128 i assume?
yes
throwback to when the limit used to be in mbs
😞
With?
@.Tim#2373 someone told me to ping you when in doubt so... How do I detect if a user has a role with id X in guild Y
@pure lion
get the user in the guild y and check if they have a role with the id x
yeah
one sec
//i know i should try it and see but not on my pc rn
bot.guilds.members.get("userID").hasRole("ROLEID which idk how to get and fuck autocorrect");
you should fetch btw
hey @everyone
will this work?
lol
it's not guaranteed the user will be cached
lol
@pure lion if your webserver is online, listening to port 80, without a firewall, you can just put the ip in your browser, and itll request the webserver.
you can then take your domain, tell it to point to the ip of your webserver, and itll do the same thing
I think he is just learning rn 🤔
better to learn right from the beginning
:c
i did
or rather, rent them
i have one
then you need to point its DNS to your server ip
in the control panel of the website where you bought it
tldr reverse proxying is a "middleware" that allows you "intercept" the request to your webserver and forward it to some other webserver hosted on the same machine which is listening locally
it's great for when you need to handle SSL easily
how do i remove the firewall
Depends on what your firewall is
if your on macos do ps -ux | firewall | firewalll.apple.core.com > disable
your server is on your home pc?

I'm confused






