#development
1 messages · Page 1114 of 1
ye
i was running my postgres on docker and when i restarted my vps and restarted postgres it has now database now
so
broadcastEval(const embed = ${theembedyoubuilt} rest of code) didnt work for ya?
no*
did you set a persistant storage?
oh i haven't tried that
hold on i'm going to try both of these
i'll get back to you
docker are container. with no persistent storage everything is gone if the container restarts
Tfw this dude is running Docker & I still haven't messed with it
how do i set persistant storage?
Yet he doesn't seem the brightest
ive yet to play around with docker either
What does that say about me
commandline or dockerfile?
:pepehands:
both
v- /path/on/host/os:/path/in/container
I really need to stop fucking around & learn Docker, since I'm running multiple origin servers for my site

yea then?
Having to manually setup each one is fucking AIDs
if (!channel.name) return "what you want to return";
?
or if (!yourchannelfindcode) return "what you want to return";
if(!leaveChannel) return
@plucky harness https://stackoverflow.com/questions/18496940/how-to-deal-with-persistent-storage-e-g-databases-in-docker
@solemn latch ReferenceError: broadcastEval is not defined
how are you doing broadcastEval?
wdym how am i doing it
i see
The website for my bot is starting to look good
undefined.forEach doesnt work
i didnt use that
your variable is
TypeError: Cannot read property 'forEach' of undefined
the property .forEach cant be read from undefined
const discord = require("discord.js")
const prefix = "!"
const client = new discord.Client()
client.commands = new discord.Collection()
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('js'))
client.aliases = new discord.Collection()
for (const file of commandFiles) {
const command = require(`./commands/${file}`)
command.aliases.forEach(alias => client.aliases.set(alias, command.name))
client.commands.set(command.name, command)
}
client.on("ready", () => {
console.log("Im online")
client.user.setPresence({
activity: {
name: client.users.cache.size + " members | !help for commands!",
type: "WATCHING"
}
});
});
client.on('message', message => {
if(message.mentions.users.first()===client.user){
message.reply("Hi there, The prefix is '!' ")
};
});
client.on("message" , async message => {
if(message.author.bot) return
if(!message.content.startsWith(prefix)) return
if(!message.member) message.member = await message.guild.fetchMember(message);
const args = message.content.slice(prefix.length).split(/ +/)
const command = args.shift().toLowerCase()
const cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command))
if(cmd === null ) return
if(cmd) cmd.run(client, message, args)
if(!cmd) return
})
client.login("token") ```
command.aliases.forEach
one of your commands doesnt have the property
.aliases
so its undefined
so undefined.forEach
errors
so what i have to do?
give all commands aliases
#development literally became a place for people to ask questions after they just forked GuideBot
define aliases in each command, or check if its undefined before doing .foreach
#development literally became a place for people to ask questions after they just forked GuideBot
@vestal star lmao ikr
^
its the same thing we discussed before 🤷♂️

your code expects ALL your commands to have aliases
if a single command for some reason doesnt have aliases, it will error
oh
Add an if statement
in your domains dns settings
edit its DNS records
Idk how to port
DNS bro
you cant do port, only ip
^
if(typeof command.allias === "undefined") {
// add allias
}
port is defined by the user
O
ie domain.com:5000 = yourip:5000
DNS just resolves a domain name -> IP address
You could use a reverse proxy or tunnel
How do I make it automatically do the thing
You could bind the port to serve on port 80
I dont do invite member count in my discord help me please
User a reverse proxy or iptables rule
@quartz kindle thanks worked
Are you serving a website?
i had an empty file 
I dont do invite member count in my discord help me please
???
Binding directly to 80 is sometimes a bad idea
Yeah
???

theres nothing against running a server on port 80, all major webservers do it, nginx, apache, etc... its not recommended for node specifically because other webservers do a better job at it
dm ads
/s
x)
did you
Dm me for join ou discord
@earnest phoenix why
@quartz kindle that's exactly what I meant, my earlier message said to use a reverse proxy
ping marco ig
How do i get the bot developer role
By making a bot
and by having it approved
Yeah
yes but you sounded a bit overdramatic when you said to never do it lmao
O
@opaque barn no ads
What do I do with cert and chain in terms of SSL?
then set it up first, then configure its SSL settings to point to your cert and chail files
Alright
whats the OS on your vps?
Debian 10
you can install it on your vps using its built in package manager
So in the default dir
yeah
lol
if(reaction.emoji.name === "🔗") {
if (reaction.message.content.includes("https://")) {
global.link1 = reaction.message.content.split("https://")[1]
global.link = link1.split(" ")[1]
}
if(reaction.message.content.includes("http://")) {
global.link1 = reaction.message.content.split("http://")[1]
global.link = link1.split(" ")[1]
}
console.log(link);```
link keeps coming out as undefined and im not sure why
What are you trying to do?
[1] would be the second thing in the array
link1.split(" ")[1] will be undefined if there are no spaces
iirc
Tim ver 1.14.2
why are you using global variables?
Me when the const
@pure lion well current stable is 1.18 and latest is 1.19
Ah shit
module.exports = {
name:"test",
run(message){
const embed = new Discord.MessageEmbed()
.setColor('RED')
.setDescription('Text')
.setFooter('page 1')
const embed2 = new Discord.MessageEmbed()
.setColor('RED')
.setDescription('text 2')
.setFooter('page 2')
message.channel.send(embed).then(msg => {
setTimeout(function () {
msg.react("◀")
}, 500)
setTimeout(function () {
msg.react("▶")
}, 600)
const collector = msg.createReactionCollector((r, u) => (r.emoji.name === "◀", "▶"))
collector.on("collect", r => {
r.users.remove(message.author.id)
switch (r.emoji.name) {
case "◀":
msg.edit(embed)
break
case "▶":
msg.edit(embed2)
}
})
})
}
}``` can someone maybe tell me how i can add more pages??
youd need to do things differently with more pages
since your just doing ▶ is the second page
you'd need it in an array
Hh
also, dont add reactions like that
make use of async await
....then(async msg => {
await msg.react("<");
await msg.react(">");
const collector = ...
Tim what does an object with ... at the start mean?
E.g {...[probably an array or something]}
... is a spread operator
it attempts to deconstructure the object or array into items
Oh that's actually easy cool
.flat™️
these tests you do, its just in browser console?
yes lol
how do you live without dark mode in console
woo get out
*dies*
no light
my wallpaper determines my desktops theme
module.exports = {
name:"test",
run(message){
const embed = new Discord.MessageEmbed()
.setColor('RED')
.setDescription('Text')
.setFooter('page 1')
const embed2 = new Discord.MessageEmbed()
.setColor('RED')
.setDescription('text 2')
.setFooter('page 2')
message.channel.send(embed).then(async msg => {
setTimeout(function () {
msg.react("◀")
}, 500)
setTimeout(function () {
msg.react("▶")
}, 600)
const collector = msg.createReactionCollector((r, u) => (r.emoji.name === "◀", "▶"))
collector.on("collect", r => {
r.users.remove(message.author.id)
switch (r.emoji.name) {
case "◀":
msg.edit(embed)
break
case "▶":
msg.edit(embed2)
}
})
})
}
}``` i tried using async msg but im getting a lil confused
and it changes wallpapers randomly
you can just
await msg.react();
await msg.react();
^ will do the first one, wait till the promise resolves, then do the second
the collector is also wrong
you cant do comparisons like this r.emoji.name === "◀", "▶"
@pure lion @solemn latch im trying to pull a link out of a message when a user reacts with 🔗
ah the basement is flooding
if you shut off the water in time not at all
That comparison is better like this
["<Symbol>", "<Another symbol>"].some(e => e === r.reaction.name)```
if (reaction.message.content.includes("https://")) {
global.link1 = reaction.message.content.split("https://")[0]
global.link = link1.split(" ")[0]
}
if(reaction.message.content.includes("http://")) {
global.link1 = reaction.message.content.split("http://")[0]
global.link = link1.split(" ")[0]
}
console.log(link);```
changed the 1s to zeros and I either get nothing if the message is just a link or the first word
i think these lines should be [1]
global.link1 = reaction.message.content.split("https://")[0]
firewalls are generally a good idea
Mkay
also fail2ban
it doesnt come preinstalled?
Nope
Good for ubantu
took me a while to configure it for nginx tho
:d
ubantu best os
my nginx was being spammed with requests from a minecraft launcher
*o-opens 5th instance of putty*
why are you opening so many instances lmao
Because yes
i only have a single ssh connection lmao
Ok wooMer
only time i use more than one is if im watching htop or something
Oop.
how to fix this
Try catch
check if you have the perm before doing it
no permissions to react on a message
Epic I can still ssh
const offline = message.guild.emojis.cache.find(emoji => emoji.name === 'UndefinedOffline');
const dnd = message.guild.emojis.cache.find(emoji => emoji.name === 'UndefinedDnd');
const idle = message.guild.emojis.cache.find(emoji => emoji.name === 'UndefinedIdle');
let status;
switch (user.presence.status) {
case "online":
status = `${online} online`;
break;
case "dnd":
status = `${dnd} dnd`;
break;
case "idle":
status = `${idle} idle`;
break;
case "offline":
status = `${offline} offline`;
break;
}```
that is my code but the emojis only work in my server how do I make it on all the servers
lmao
Yooo nginx is working
gg 
you can also get the emoji from your own server
your currently getting them from the message's guild
I have some questions about quick db, anyone ever tried it out?
oh yeah, non whitenames can post discord links
@misty sigil so like this right
const online = message.guild.emojis.cache.find(emoji => emoji.name === ':UndefinedOnline:');
const offline = message.guild.emojis.cache.find(emoji => emoji.name === ':UndefinedOffline:');
const dnd = message.guild.emojis.cache.find(emoji => emoji.name === ':UndefinedDnd:');
const idle = message.guild.emojis.cache.find(emoji => emoji.name === ':UndefinedIdle:');
```
yo why is it like that
whatever
no?
Can anyone give me a example how i get the Reputation etc from discordrep from a user with @aero/drep in discord.js?
in djs?
yes in djs
@misty sigil Like this?
wait
at all
you can just use the <:name:id>
youd have to make an api request, without djs. @sterile minnow https://docs.discordrep.com/
@sterile minnow you mean this? https://www.npmjs.com/package/@aero/drep
yes
according to the docs, it should be
const { DRepClient } = require('@aero/drep');
const drep = new DRepClient('your-fancy-token');
drep.rep(id) / drep.infractions(id)
ty
just console.log it and you should see what type it is and what it returns
Tim after I install nginx how can I make it use my express app?
reverse proxy
Who
first check some guides on how to configure your nginx.conf files
for example mozilla even has a nginx configuration generator
I set it up to my ale-bot.xyz domain
you will need to edit your nginx.conf as well as your website.conf in the sites-available and sites-enabled folders
Alright
then in your website's cont file, you will have a server {} block and inside it a location {} block
inside the location block, you can set a proxy_pass directive
pointing it to localhost:3000 for example
check this out https://www.digitalocean.com/community/tools/nginx
Okay I'll have a look before saying I'm confused
Okay so i'm trying it with axios
Does anyone know how i like get the stuff from a axios request?
like axios.get(url).then(dat =>{})
But that doesnt work
nvm i have it i think
just console log the response and see what it contains
Tim what is document root?
And why is everything turning orange when I touch it :D
I mean on the site woo
Smh
html, css, js, images
I know what static means I'm just confused in that
Okay
I have a dir called apps where I'm keeping my web apps and a dir inside called diceRTC for rtc
I set it up like a normal node express project there and I feel like I did it wrong now because this happened :D
doesnt matter, you can keep it like that
Okay cool
point the root directory to it
/apps/diceRTC
for example, if you use static files in node, you define a folder for them
It went orange
point nginx to the same folder
The config dir?
if you didnt define any static file, then just put it in the project folder, doesnt matter
Wait confirming, the field NGINX config dir goes to apps/diceRTC
Also idk if it's too late to ask but does peer work by default on nginx
is the command being run in a server?
Lol shiv qt
what config dir? are you still talking about webroot directory or something else?
in which living hell's name did you find my message being related to you 
lmao
this?
thats the folder for static content
for example
if you ever use images or css files that are not gonna be generated by nodejs
you put them inside a folder
Ah got it
for example /app/diceRTC/public
hahaha fuck
like the default option suggests
Oh I already have a public folder with a js file
Just a js file
I forgot what it does brb
lol
Oh it's for peer stuff
H o w s t a t i c
Lmao I literally wanted to just set up nginx so I can access the navigators mic and camera
hello gamers
Hello found
heya mom
See what I did there it's funny because your name is lost and yet I called you found ha ha ha ha ha I deserve the death sentence
oh ic ic ic ic ic veri funi
today i learnt
you can have curly brackets in the case thing
You can what
:O
use message.client
or define client in your eval command
?
Y'all better be unit testing your code
How does unit testing actually work?
Dependency Inversion
What's the actual difference between manual testing and unit tests?
I can click "Test" and it runs tests instantly to see if a code change I made broke something
why isnt this working? ive tried so many things and i cant get it do do anything! it just deletes the message and doesnt respond
@commands.command(aliases=['si', 'sinfo', 'guildinfo'])
async def serverinfo(self, ctx):
await ctx.message.delete()
embed = discord.Embed(colour=ctx.author.colour)
embed.set_author(name=ctx.author.name, icon_url=ctx.author.avatar_url)
embed.add_field(name='Guild Info', value=f'**Guild Owner:** {ctx.guild.owner}\n**Guild Name:** {ctx.guild.name}\n**Guild ID:** {ctx.guild.id}\n**Server Creation Date:** {ctx.guild.created_at.strftime("%a %b %d %Y at %I:%M %p")}', inline=False)
embed.add_field(name='Members', value=f'**Total Members:** {len(ctx.guild.members)}', inline=True)
embed.add_field(name='Role Info', value=f'**Top Role:** {ctx.guild.top_role.mention}', inline=False)
embed.set_footer(text=f'Requested by: {ctx.author.name}')
embed.set_thumbnail(url=ctx.author.avatar_url)
await ctx.send(embed=embed)```
i *think* one of the values is wrong or incorrect but idk which one
pls tag or dm me if u have a response
@slender thistle
Notice how fast Unit Tests are
It directly tests the logic in your code (without hitting a database or api)
Instantly telling you if you broke something somewhere else when you make a new code change
me?
But, to make it work, you have to write your code a certain way
You have to adhere to SOLID
https://en.wikipedia.org/wiki/SOLID
In object-oriented computer programming, SOLID is a mnemonic acronym for five design principles intended to make software designs more understandable, flexible and maintainable. It is not related to the GRASP software design principles. The principles are a subset of many prin...
@restive lily are you running the command in a server
yes
Slap a try-except in the command and print the exception when one occurs
wdym
Wrap everything in the command under try-except
Yeah I didn't realise it was py
If your new, it helps to have a go to resource for things you don't know
)/
hi
Hi
f
Hello
Me again
I have a lil npm issue:
If i try to run npm i canvas canvas-constructor
It says sh: 1: node-pre-gyp: Permission denied
But i'm on a root acc
(sudo not usable since i'm on root)
OS:Debian
npm --build-from-source install canvas canvas-constructor --unsafe-perm
Doesnt work too
try installing the node-pre-gyp module first
dued tii
dies too*
now i get this: https://pastebin.com/JkyzhWXt
Pastebin
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 if i try to install normaly it just gets stuck there: node-pre-gyp WARN Using needle for node-pre-gyp https download
how i can do a input() py but in js?
create your own handler listening to the process.stdin data event
or use a handy dandy package from npm like https://www.npmjs.com/package/prompts
Hey, I have a bunch of organized arrays that are labeled a1-a27 and all have the same info, (their name, their age, their origin, and a picture of them in a link form in order.) I want to create a card for every user based off the info in the arrays, is there any simple way to transfer this info onto a card?
Yo how exactly does d.js(or any good await message collector) with timer work?
does it just passes message emitted events to a handler while its active?
trying to make a message collector but mine seems to inefficient
https://github.com/discordjs/discord.js/blob/master/src/structures/interfaces/Collector.js https://github.com/discordjs/discord.js/blob/master/src/structures/MessageCollector.js
You mean the actual code?
//create collector map with filter
collectors = new Map()
//set channel name + query filter and timer object
message emitted => route it to collector.js
if(!map.has(channel name)) return;
while (date.now() > timer) {
obj.push message object
}
when done => push object with messages back to client
does it just passes message emitted events to a handler while its active?
yes
thats a gist of what im doing
but it looks so inefficient
also doesnt allow me to have more than 1 collector per channel
im doing something barebones, doesnt need to be super efficient
though it definetly looks like im doing a terrible job at it
function collector(channel,filter,timer) {
return new Promise(resolve => {
let collection = new Map();
let handler = message => {
if(filter(message)) { collection.set(message.id,message) }
}
channel.client.on("message",handler)
setTimeout(() => {
channel.client.removeEventListener("message",handler)
resolve(collection);
},timer)
})
}
``` something like that i guess
<help
hmmmm that looks way better than im doing already tbh
your idea of a global map of collections is also not bad
just dont use a while loop for this
Message Collector only collects the IDs of messages?
https://github.com/discordjs/discord.js/blob/master/src/structures/MessageCollector.js#L68
well yeah the while does seem out of place
but adding a map like that really screws me over with quantity(even though i still need a 1 limit per channel)
i'll try that route you sent @quartz kindle , seems much better than what i had in mind
@solemn latch it extends the base collector
the message event calls this
the collect() function is basically checking if the id of the channel matches and then the returned message id is used as the key in the collection
is there any way of getting the animated emojis count in the guild? i was trying to filter it with the type but it's not working js message.guild.emojis.cache.filter(e => e.type === "animated").size
It took me a minute but I understand now
@uneven crypt
I need to spend more time looking over djs github. Theres a lot i don't understand still.
the more you look at it, the more wtf it gets
You can manually collect/dispose things?
https://discord.js.org/#/docs/main/stable/class/MessageCollector?scrollTo=handleCollect
Also didn't know you could reset the timer
djs has a handy timer thingy
well not all timeouts use it tho
but there are a few timers that have a .refresh() function attached to them for example
The reaction timer reset and idle timer seems useful.
My reaction collectors are hardcoded to 2 minutes.
Didn't realise I could have reset it every time the user interacts
I didn't do much research into it.
Heyo, anyone here expert at these language?
I need help with making hello world bot
I have done these so far
The CS is DiscordUnity
why
you want to make a hello world bot in all languages?
why
Yes
I currently need help with C# as its too difficult to me
I would love to learn C# but its too hard
there are infinite amount of libraries
there's no possible way you can cover it all
I only pick a popular one
that's dumv
dumb
Nuh
because the popular libs already have a sample in their docs, a proper one
I just wanna do it okie? Thanks chu
what did i even expect, should've looked at the avatar first
TIL node.js's version of setTimeout has a .refresh() method
i thought it was a thing djs added, but apparently its built in lul
what is
@zinc condor looks good. mine was very similar, but i moved to numbered emojis because it had too many pages so it took too long to find things
thank
wtf did you use for compression because the vid on android discord is just a bunch of stars lmfaoo
it works on vlc though
lmfao
if your talking about my video my screenrecorder is in a really werid codec and i cant change it
on linux
so yeh
why do linux guis look so shit
that particular one is gnome
its installed by default in Pop OS and i dont really care enough to change it
works well
laptop gui is much much better
uses Plasma
ngl that looks better than what windows forms gives us
tru
also im on a laptop, its a gaming laptop but still a laptop.
shit works slow on windows so yeh
i've never used windows langs but windows's native gui elements are ugly af
prefer to just have them dualboot for when i play games
I miss the old style of ui.
Basic, and just menus
GTK(gnome UI framework) runs on windows
you can compile GTK for windows and it looks like gtk on windows
disorienting
i always disliked gtk
i still dislike it
qt is nicer
even though slower
actually at this point they might be equal
gtk is bloated now especially with glade
and then there's the modern era
✨ everything is electron ✨ @solemn latch @solemn latch
xD
i hate electron 
i like nw.js better than electron, although its mostly the same thing
nothing still rivals electron in features unfortunately, think transparency etc
all my apps use Qt and are made in C++ or the Go wrapper for Qt
the only time i use electron is when i gotta deal with MANY async operations
like multiple things on ui changing at once
in Qt that is absolute hell
actually its nicer in Go cuz goroutine and the app runs on many threads and communicates
but still bleh
Cutie
i recently worked with ultralight which is a html based renderer in cpp, nice alternative to electron and it's extremely lightweight - still doesn't rival electron, the renderer runs 30fps max and no transparency support :/
there are many attempts at relying on the OS's native gui elements instead of something like chromium
everyone and their grandmother are trying to make gui's for node.js lol
tfw i dont like JS or even TS and avoid it for everything but frontend
same with python actually, i only use it for like AI stuff
or simple scripting
i use js for everything because why not :^)
i use Go for everything i can and C++/Rust for gamedev or lower level shit
Vue for frontend
they all look so bloated tho
every website out there that uses react or whatever the shit they use feels slow af
anything i wrote in js for backend
i might rewrite it into go
dynos site uses react, i think its pretty fast
i like vue
i dont like jsx
its horrible in my opinion
vue and svelte are my favorite frameworks
@zinc condor qt license is aids
i wanna actually learn vue or nuxt
where do u recommend learning vue @zinc condor ?
i like react
@digital ibex i learned Vue from my dev friend who does it alot, also a few simple tutorials, in theory its really simple
I think it's a 3kb or 4kb gzip
vuex is complicated somewhat tho
but i think react is kinda dying tho, so i dont wanna fully learn it
In this crash course you will learn all about Vue.js including what it is, Vue-CLI, components, data, events, directives, etc
Sponsor:
http://www.netlify.com
Code For Turorial:
https://github.com/bradtraversy/vue_crash_todolist
Deploy Sites With Netlify (Video):
https://www...
oo thanks :)
react is killing other frameworks mmLol
o
e.g. angular and shit
ok angular is absolute trash
lol
vue, react, svelte. doesnt matter, we all hate angular
but yes preact is lit
ive found it does
its better with scripting
for example you can bind an array with data to basically always foreach
its weird
but yeah bind an array to an element
but how does that like
but that's for UI updating
make the design look better?
cuz if it changes it, im watching that rn instead of sleeping
mmm it doesnt unless you use frameworks built ontop of vue
like this
i don't use a css framework
but for some reasno, i made it shit
https://turtl.codes is made without one
an older version doe but yeah
noice
css frameworks are useless to me
https://officially-lost.me uses bulma
i really like bulma
its really simple for a retard like me
i didn't know how to do it without one
before
I just decided to do it because I wasn't getting what I wanted with one
oh
tfw yall ignored my screenshot of status page
i said "noice"
oh lmao
it's nice but the purple header is too bright
how did u make it responsive and add a hamburger menu if ur on mobile?
right click the gear and hover over apperance
and just a navbar on pc
fast light mode
guys why error? tag afk system
i find bug (i think) in ur website
if u click on the turtle it shows the menu when ur on mobile
I like bulma
@digital ibex not a bug
turtle image routes to /
whenever I route I close the menu
hello, if someone can ping me i need help with this. i need to figure out inside a discord.py embed how to ping a user
just like this please DM @gleaming zephyr
sorry for the ping mak, but can someone help out
<@userid>
In the screenshot its the description, but you can do it in a field too I believe
How do I fix this? js TypeError: fields.flat is not a function at Function.normalizeFields (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:443:8) at MessageEmbed.addFields (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:259:42) at MessageEmbed.addField (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:250:17) at /home/ubuntu/index.js:97:38 at process._tickCallback (internal/process/next_tick.js:68:7) TypeError: fields.flat is not a function at Function.normalizeFields (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:443:8) at MessageEmbed.addFields (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:259:42) at MessageEmbed.addField (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:250:17) at /home/ubuntu/index.js:97:38 at process._tickCallback (internal/process/next_tick.js:68:7) 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(). The promise rejected with the reason: TypeError: fields.flat is not a function at Function.normalizeFields (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:443:8) at MessageEmbed.addFields (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:259:42) at MessageEmbed.addField (/home/ubuntu/node_modules/discord.js/src/structures/MessageEmbed.js:250:17) at /home/ubuntu/index.js:97:38 at process._tickCallback (internal/process/next_tick.js:68:7)
the api have a portuguese support ?
ummm idk

I have a new error now
Missing permissions just means your bot tried doing something it didn't have permissions to do
wait until @hallow frigate realizes that me, Tim and a bunch of others speak Hue-Hue
Hi, does anyone know how to keep lavalink / jar file up 24/7?
Keep up?
When a user have muted role and I use cmd ,unmute user it shows mssg the user doesn't have a muted role and when I take the role from user it shows the user is unmuted.
what library and where in your code is it not working, as it's probably a logical error
Discord.js and let me share codes
@sudden geyser
name: "unmute",
category: "moderation",
run: async (client, message, args) => {
if (!message.member.hasPermission("MANAGE_ROLES")) {
return message.channel.send(
"Sorry but you do not have permission to unmute anyone"
);
}
if (!message.guild.me.hasPermission("MANAGE_ROLES")) {
return message.channel.send("I do not have permission to manage roles.");
}
const user = message.mentions.members.first();
if (!user) {
return message.channel.send(
"Please mention the member to who you want to unmute"
);
}
let muterole = message.guild.roles.cache.find(x => x.name === "Muted")
if(user.roles.cache.has(muterole.id)) {
return message.channel.send("Given User do not have mute role so what i am suppose to take")
}
user.roles.remove(muterole.id)
await message.channel.send(`**${message.mentions.users.first().username}** is unmuted`)
user.send(`You are now unmuted from **${message.guild.name}**`)
}
};```
😐
So it's responding with "Given User do not have mute role so what i am suppose to take"? Weird, it looks correct at first glance.
oh wait im dumb
Why
user.roles.cache.has(muterole.id) returns true if the role id is in the guild members roles collection
therefore it is
so it's running that block of code
use the ! operator before it to say "if it's not in the collection"
If it is blocking the code then I will put it in last lol
confused. you just need to negate it with a ! before it
But my bot has to have perms or the checker will msg that It needs admin 😐
@harsh moon u want that checker of sign on admin while inviting bot?
sure
idk how to do that
@surreal notch
https://discord.com/api/oauth2/authorize?client_id=634090973344956446&permissions=8&scope=bot how do I set this link to do that?
.
What are the main naming differences between eris and discord.js
like the class names and function names
nice token leak
Hey, I can't figure out what I did wrong but this isn't responding correctly
screenshot: https://gyazo.com/93177345d6e3beb81ff15dfda8f6b211
Me too, I have many different commands using that exact code and I just replaced the input and the output and now it doesn't work
@harsh moon if u want that link u need to setup oath2
Maybe because the input is a baritone
What’s the max nickname length?
Variable
Ohhh, maybe
That is my auth2
advertising 
Is that what you mean?
It still doesn't work @harsh moon 😕
Oof
@harsh moon Go to auth2 in portal and select bot there and then select perms of your bot at admin and copy the link
gm
I did so like this https://discord.com/api/oauth2/authorize?client_id=634090973344956446&permissions=8&scope=bot ?
Hey, I can't figure out what I did wrong but this isn't responding correctly
screenshot: https://gyazo.com/93177345d6e3beb81ff15dfda8f6b211
Idk then
Yeah that is how you use it it’s just not working

👌 \
Locale Rip
clientUser#setStatus("idle"); on ready event.
already
i was hoping to code a discord bot that will be able to identify if someones online on hypixel or another minecraft server. I do know that minecraft is coded in java and discord bots can be too but since i know nothing about java is there anyway i could make a bot like this in js or py
thats not bot.user.setStatus("dnd");
i was hoping to code a discord bot that will be able to identify if someones online on hypixel or another minecraft server. I do know that minecraft is coded in java and discord bots can be too but since i know nothing about java is there anyway i could make a bot like this in js or py
yes, but you would still need to code the server-side stuff in java, like the identify command or what ever
@restive furnace not work ;/
oof
also i would somehow have to code it without using a plugin
i just saw a bot do this in the past
@blazing ravine use that snippet i sent you, and wait some time...
and i was wondering if i could do it to
k
@still lily use a plugin if you don't want to die/potentially be ratelimited to hell
Hm
@pure lion im trying to have it tell me if certin people are on hypixel
so i can check my phone insted of my pc
@surreal notch some people actually learn coding languages instead of using a bot builder app, what do you hope to achieve by saying that?
Also hmmm
i saw someone do this in a video
😐 😬
Does the hypixel server hold activity statuses?
I also have a ques is there any difference b/w java and javascript
Yes
Js is interpreted and a lower level than java (I believe)
Oh
JS is interpreted, and java is interpreted and compiled while java is lower-level one.
but they dont have anything for when someone logs in
@still lily good that's good
so i would have to do a lot of work
An API is the best thing you can get rn
You wanna make a request with the username and get the activity status? Piece of cake
It depends on how good the API is
u dont need to with APIs
Even so, any API is better than none
Yes
yes
I made my own api
How
those are basic programming questions..
i found it:
https://api.hypixel.net/
To interact with my mongodb
oh nice they have a help form
Yeah good luck, if you need help reading the docs we're here to help

Or send link
wait im slow
It's fine I'm tired
im just blind
hypixel api is cool and all but why do you still have access to games that were removed through the api 🙃
Because develop
I hve one ques
Sup
how to make bot when me mention the bot then the bot reply
message.reply()
Check if the mention has the client user
Oh.
Idk what lib you're using
wdym
k
I used the bot's id and regex for that.
Hard to explain while I'm on my phone though.
if (message.mentions.has(client.user))
alright i found a tutorial for how to find a players stats using python so im gonna start there
oh i also need to get a API key
so i got to start tomarow
good night everyone
How can we attach our discord bot with our website means if we use this cmd then this happens in website
Etc.
if (message.mentions.has(client.user))
@pure lion ty very much man
@sinful sorrel
if Client.user in message.mentions: return 'something'
@wanton anvil tysm
@sinful sorrel did it work
@wanton anvil if (message.mentions.has(client.user))
i realy epriciate it
aa
icant type good
rip ing
If your bot gets approved
By reading the #502193464054644737
thanks
@surreal notch is that website your's ??
Which ones@wanton anvil
that which you want to run commands one you give certain instructions to your discord bot
Yeah I m working on a site
which language are you using for backend
Ok site?
Actually I didn't have done yet for backend
I m working on frontend then backend
I m not that much good at backend
do you know python
Nope
create a api for you site, let your bot send a http request to your site and create a program for giving client information in frontend
I hope that works
happy coding!!
Ok
try the mentions for that command instead of ids
to set welcome channel by db i have done db.set() and what to do to remove welcome?
guess
there are many ways. one easy way is using a defined number / string you can check if its set to it or not
my bot is reacting to member's msgs but some mebers can't see the reaction, why is that so ?
custom emoji?
i dont think there is a permission for seeing reactions. wired
ok
but some members can't
ok
client.guilds.cache.map(x=>x.memberCount)
i wanna limit respond to only top 5
i know a stupid way, where i dont know if it works
ok
filter
console.log(topGuilds);``` thats how you would do it
and basically this isnt spoonfeeding since he had code like that
mehh just do some math
what kind of guild doesn't have memberCount, unavailable guilds?
i aint doing that math
Who piged ne
piged you??
Someone piged me
did u mean pinged
@pure lion Findy pinged you
@wanton anvil stop poging me
it's ping dude chill out I'll not Ping you
how to setup that whenever my bot catches error instead of showing it in console it will send message in that channel
try this
promise.catch(() => m.channel.send())
discord.js?
try:
your code
except:
message.chanel.send('message') @surreal notch
ok
thats python
lol
it's not even valid python
just saying @pale vessel
promise.catch(() => m.channel.send())
@restive furnace this works on any js library what uses promises
this not a compiler
you do realize he'd copy paste anything people say
Find channel in guild
this is .py I am telling you this because you'll get a idea CLient.get_guild(ID).get_channel(ID)
what is BOT_GUILD
read docs
@pale vessel do you know BOT_GUILD ??
no
hmmmmm sad
client.guilds.cache.find(guild=>guild.id===YOURGUILDID).channels.cache.find(ch=>ch.id===CHANNELID)
@earnest phoenix
Maybe
You don't have to do that
@jolly quail do you know anything about BOT_GUILD
Nope
@golden condor ??
client.guilds.cache.get(GUILD ID).channels.cache.get(CHANNEL ID)
Oh ya get works
Makes it less complicated
@umbral pollen are you saying about Client.get_guild()
