#development
1 messages · Page 1202 of 1
inb4 all event names are lowercase
even though you can just use guild.client
Someone knows how to fix this error?
the message content is probably empty
look in your embed for potential empty values
such as message content
But how can I fix it that he's not sending this in console?
you can use something like message.content || "Empty"
Good idea
idk its your code?
@lusty quest what it should be
depends on your code. Idk for what you used the key you get out the forEach loop
at Client.<anonymous> (E:\Thunder\server.js:118:38)
at Client.emit (events.js:315:20)
at Object.module.exports [as GUILD_CREATE] (E:\Thunder\node_modules\discord.js\src\client\websocket\handlers\GUILD_CREATE.js:33:14)
at WebSocketManager.handlePacket (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
at WebSocketShard.onPacket (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
at WebSocketShard.onMessage (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
at WebSocket.onMessage (E:\Thunder\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (E:\Thunder\node_modules\ws\lib\websocket.js:797:20)
at Receiver.emit (events.js:315:20)
(node:8592) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection,
use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8592) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Codeeeeeeee?
kk
ngl he’s tracking a nasty amount of data
error?
/storage/emulated/0/jarvis/commands/owner/restart.js:15
let embed = new MessageEmbed()
^^^
SyntaxError: Unexpected identifier
at wrapSafe (internal/modules/cjs/loader.js:1167:16)
at Module._compile (internal/modules/cjs/loader.js:1215:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1272:10)
at Module.load (internal/modules/cjs/loader.js:1100:32)
at Function.Module._load (internal/modules/cjs/loader.js:962:14)
at Module.require (internal/modules/cjs/loader.js:1140:19)
at require (internal/modules/cjs/helpers.js:75:18)
at /storage/emulated/0/jarvis/handlers/command.js:19:24
at Array.forEach (<anonymous>)
at module.exports (/storage/emulated/0/jarvis/handlers/command.js:11:32)
@lusty quest is there another way and easier to make timeout in forEach
this one is already easy AF there is probably one but i would need to use Google to find it
What is the solution to this problem?
for loops are basic Js idk what the issue is
this one is already easy AF there is probably one but i would need to use Google to find it
@lusty quest it's not easy?
lol just run a async loop and call a async function in it. idk how much easier you could make it
there is probably a way to do it in a foreach loop but i dont know the answer and would need to google it
i tried this but :
send 5 embed then wait 5sec but i need it send 1 embed then wait 5 sec
var items = document.querySelectorAll('.item'), i;
for (i = 0; i < items.length; ++i) {
// items[i] <--- your element
}
``` in your Stack overflow page. just add the sleep to it at the end
make the loop async and you can use the await sleep function i sended you
there are more ways to do it down the article
there is somewhere else an error
you still cant run async stuff inside a forEach loop
forEach iliterate over every item in the array without waiting
you still cant run async stuff inside a forEach loop
@lusty quest if move it sleepis not defined
What
Well
hmm
why wont my bot respond to commands
lib?
rary
???
So a jda bot?
No idea sorry
AYYYY intellij gang
;-;
yes
show code
the bot worked before
String raw = event.getMessage().getContentRaw();
if (raw.startsWith("S!")) {
if (raw.replace("S!", "").equals("ping")) {
if (event.getJDA().getGatewayPing() > 100) {
event.getChannel().sendMessage("My Ping is: " + event.getJDA().getGatewayPing() + "\n... Great!").queue();
} else {
event.getChannel().sendMessage("My Ping is: " + event.getJDA().getGatewayPing()).queue();
}
}
}```
ma code
the bot worked fine
just i forgot to turn it on one day
todya
it dead
hmmm
first args?
i mean
raw.replace("S!", "").equals("ping") return all the content
for example
S!gsdgsd sdiojgjeosg
the code will return
gsdgsd sdiojgjeosg
so you should split it into string[]
and get the first string[]
thats just the say command-
im not improving the code, im trying to fix the bot
its dead all the sudden ;-;
lemme try it
it worked befor
1 sec
1 second
no
let me type out everything
2020-08-28, The bot worked fine, it responded to commands and I didn't do anything with it.
2020-08-29, I forgot to run the bot.
2020-08-30, I wanted to run the bot, it worked but it didn't respond to commands
did you change anything with the code?
NOPE
0
i did nothing
i tried to run the code on a diffrent bot, it worked and it also sent what its logged in as
thats what it supouse to do
but
on my bot
gateway issue?

idk no errors
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
SLF4J: Defaulting to no-operation MDCAdapter implementation.
SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
[main] INFO JDA - Login Successful!
[JDA MainWS-ReadThread] INFO WebSocketClient - Connected to WebSocket
try make your caching policies different, since it might be this server, since yeah, 130 members here
what it sends
130k*
its supouse to send
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
SLF4J: Defaulting to no-operation MDCAdapter implementation.
SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
[main] INFO JDA - Login Successful!
[JDA MainWS-ReadThread] INFO WebSocketClient - Connected to WebSocket
<What its logged in as>
full code pls?
its looong
post to hastebin
package me.scorpion37.ahelpfulscorpionscorpion37;
import java.io.IOException;
import javax.security.auth.login.LoginException;
import net.dv8tion.jda.api.JDABuilder;
import net.dv8tion.jda.api.OnlineStatus;
import net.dv8tion.jda.api.entities.Activity;
import net.dv8tion.jda.api.requests.GatewayIntent;
import net.dv8tion.jda.api.utils.ChunkingFilter;
import net.dv8tion.jda.api.utils.cache.CacheFlag;
public class MainCode {
private MainCode() throws IOException{
try {
JDABuilder.createDefault("Token uwu").setStatus(OnlineStatus.ONLINE)
.setActivity(Activity.playing("Refusing To Boot Up... | S!help"))
.addEventListeners(new BotCode())
.enableIntents(GatewayIntent.GUILD_MEMBERS, GatewayIntent.GUILD_PRESENCES)
.enableCache(CacheFlag.ACTIVITY)
.setChunkingFilter(ChunkingFilter.ALL)
.build()
.awaitReady();
} catch (LoginException | InterruptedException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
try {
new MainCode();
} catch (IOException e) {
e.printStackTrace();
}
}
}```
hmm is there intent for guild messages or messages, scorpion? that might be the problem
is there a way to disable the command prompt sending a message when the bot failed to dm someone (because they have dm's closed)?
thing.catch(err => undefined) @tired gate
hmm is there intent for guild messages or messages, scorpion? that might be the problem
@restive furnace ok, BUT, why did it work on the other bot while on this bot it wont???
maybe because your bot is in so big server? ¯\_(ツ)_/¯
thing.catch(err => undefined)@tired gate
@restive furnace that disables the cmd error message?
yes
replace thing with the dm thing
yep
2020-08-28, The bot worked fine, it responded to commands and I didn't do anything with it.
2020-08-29, I forgot to run the bot.
2020-08-30, I wanted to run the bot, it worked but it didn't respond to commands.
;-;
nothing was changed, i just ran the bot
try with the "hello world" aka "ping example" code in JDA docs
i clicked the little green button
JDA's?
Java Discord API
system.Out.Print("e")
is System.out.println("thing");
@restive furnace your method worked, thanks!
@tired gate np
@knotty obsidian try this:
https://github.com/DV8FromTheWorld/JDA/wiki
Java wrapper for the popular chat & VOIP service: Discord https://discord.com - DV8FromTheWorld/JDA
public void onReady(ReadyEvent event) {
System.out.println("Logged in as " + event.getJDA().getSelfUser().getAsTag());
}
this
this line wont work
why

hey i've got a qestion
this gives me the info i want, but also shows undefined
betweene very addField
each field has a name and a value
you're just entering the name
you need to do .addField("name", "value")
Hm
k whats up?
it is not even replying
I was talking to 'ThunderDev'
Your not even saying the issue
this will already error
mfw people don't know how to use ! and else {}
cuz you arent checking

slice is a function
assuming they mentioned user first and then reason
also pls use OR operator
a lot of those IF's can be narrowed down
if if if if i fi if else if
you should have your help command point them towards the syntax
if(condition1 || condition2) {
//Code1
} else {
//Code 2
}
hm
indeed
i like this
i did the test
but
at Object.run (E:\Thunder\commands\moderation\warn.js:19:35)
at Client.<anonymous> (E:\Thunder\server.js:68:17)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (E:\Thunder\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
at Object.module.exports [as MESSAGE_CREATE] (E:\Thunder\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
at WebSocketManager.handlePacket (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketManager.js:386:31)
at WebSocketShard.onPacket (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketShard.js:436:22)
at WebSocketShard.onMessage (E:\Thunder\node_modules\discord.js\src\client\websocket\WebSocketShard.js:293:10)
at WebSocket.onMessage (E:\Thunder\node_modules\ws\lib\event-target.js:125:16)
at WebSocket.emit (events.js:315:20)
(node:11584) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11584) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
ah yes, data
return message.channel.send("I m sorry but You can not warn yourself")
}```

done that

either check or conditional chaining if there are mentions/users
'this doesnt work, i'll just delete code/command rather than fix"


weather.find({search: 'Germany', degreeType: 'C'}, function(err, result1) {
if (err) message.channel.send(err)
weather.find({search: 'California', degreeType: 'C'}, function(err, result2) {
if (err) message.channel.send(err);
weather.find({search: 'Union Square', degreeType: 'C'}, function(err, result3) {
if (err) message.channel.send(err);
weather.find({search: 'Union Square', degreeType: 'C'}, function(err, result4) {
if (err) message.channel.send(err);
if (result1 === undefined || result1.length === 0)
return message.channel.send("**Invalid** location")
});
});
})
}})```
for some reason i keep fucking around
with thee brackets
Do ppl only use discord.js
these*
Do ppl only use discord.js
@ripe kayak
???
yup
every new country is going through hell
promisify your shit dude
Anybody here using BDFD
bot designer
i am going to try it in a second
no u dont

@weak rain
i told you literally 4 days ago about this
Do u use
and you still havent fixed it
what?
no
Bot designer
you completely ignored what i said and continued
you told me yesterday about it
For discord
not 4 day?
@opal plank
check the dicord chat here
@ripe kayak ngl, its easier to learn to code instead of using bdfd
it was yesterday ;0-
@restive furnace thanks
@ripe kayak i have been using discord bot maker
@eternal osprey
i know

ok
say what now?
Bot maker??
i have been using discord bot maker
yeah
have you not been developing this whole time?
Can u send link

but i used this program
Bot designer or bot maker??
@eternal osprey
use dms for apps
Who???
Sorry
this i the program right?
Anybody need help with BDscript u can ask me
just use js
i know
JUST :4head:
can my bot be taken down by "low quality"
you can do way more with js
yes
then you fine
@opal plank how long will it take me to lean how to promisfy my functions, and then change my bot folder?
by using bot makers n such you arent developing anything, at least for public usage, dont use bot maker. if its for personal servers, might aswell if you dont want to learn a language
is it bad bot
I have only ussed it once when i tried to make a levelingsystem
but the function you can use are really limited
@earnest phoenix why would it be bad?
but
@eternal osprey likely a couple hours, cuz u need to learn sync/async, await, promisification and callback/promises
hmm yeah, i will have a look at it
i mean, what are the chances of someone writing that word?
probably really low
so i would add more filters
theres likely a database or dictionary that you can use
I've spent ages trying to fix this one ||god damn|| issue with my client, I've logged my client and everything is valid, But 'NaN' is the result of my ping, 'null' is the result of client.uptime and my servercount is '0' when its in several guilds (I've cached it, Still 0) Can someone help me please ;/
cOdE
Wdym 'ready'-
the ready event successfully triggered
The token and stuff is valid, The messages and embeds work, Just not ws ping etc
the ready event works 🤷♀️
should I change it to client.once?
no clue what client.once does, I use client.on, But idk
have you tried with a different bot token (different bot app) to see if the problem comes from discord or your code
.once only triggers... once
that looks like a problem with node
even if all those things are in the 'ready' event
think you could run a powershell in administrator and try it opening node?
spiderbot2: '1.0.0',
npm: '6.14.5',
ares: '1.16.0',
brotli: '1.0.7',
cldr: '37.0',
icu: '67.1',
llhttp: '2.0.4',
modules: '83',
napi: '6',
nghttp2: '1.41.0',
node: '14.4.0',
openssl: '1.1.1g',
tz: '2019c',
unicode: '13.0',
uv: '1.37.0',
v8: '8.1.307.31-node.33',
zlib: '1.2.11'
}```
node version, not package versions
14.8 is personally what i use and no problems
i cant see any reason it wouldnt be able to get websocket ping
what node -v returns
14.4.0
hm
have you tried with a different bot token (different bot app) to see if the problem comes from discord or your code
try that just to be sure
Okay
how do i organize these? So if i input $po mostly cloudly
it will return the countries only that have cloudy weather?
i was thinking about:
filter
i do it today
if you await them first you can properly parse them without a headache
welp
@spice oriole go dot elsewhere
oof he has been dotted
@sinful belfry -dotpost required
his method isnt a promise
ik
hence why i told em' to promisify it
-dotpost @spice oriole 
@spice oriole
Please do not post dots to clear your messages/get attention. It adds absolutely nothing to the conversation and just causes spam.
If you need to get attention, then say hello everyone. If you need to clear your messages, then press the Esc key. If you do not follow these instructions you will be muted.
sync is fine too
Should I make a hastebin of my code-
@still merlin welp
use promisify from util kthx
your code is bad ig
WHAHAHAHHA
talk here only to help/ask help please guys
gosh the spaghetti
it wasn't a shitpost what i've sent
this is the whole reason i told you to learn promisification
that is my actual code
but who asked
wait its not theoretically spaghetti is it 
it has nice indents
good syntax
@sinful belfry 👀
@opal plank i promise you, tomorrow i will know the promsify
at the very least stop working on yopur code till you elarn it
work on another command that dont use that
yeah
const {promisify} = require("util");
promisify(function).bind(args);```iirc
you'll just entangle yourself by conitnuing it
i am trying to work on filtering right now..
that was also my question, how do i filter my info so if i use $po sunny, it will only return countrie with sunny weather
https://hastebin.com/femufakizi.js I've made a hastebin-
how is the response set?
OMG
SETFIELDS()
plural

that starting to look ascii text
i like the vibes
thats... definition... of a... slow...
@still merlin lemme see
try with 10 addfields @opal plank
Cool, Thanks @tight plinth
i was thinking about: if ${current.skytext} == 'sunny'
and then return;
or something
put client.login at the end of your index k thx
Ok
client.ready does not take any args
i mean they are events
it shouldnt matter
if before or after those two will only be called after its emited
(ready) should be ()
i was thinking about: if ${current.skytext} == 'sunny'
@eternal osprey anyone
client.on("ready", () => undefined /* define urself */);
ALSO What
owh fuck
i was looking at the wrong line
client was undefined-
add your initial client in your execute function as an argument
my reponse being returned?
@still merlin
yes
hi i have made a level system and i have made a leaderboard but the leader board shows member in other servers
How can i fix it plese?
Here is the code:
const { MessageEmbed } = require("discord.js");
module.exports.run = async (client, message, args) => {
let data = client.db.all().filter(i => i.ID.startsWith("xp_")).sort((a, b) => b.data - a.data);
if (data.length < 1) return message.channel.send("No record");
let myrank = data.map(m => m.ID).indexOf(`xp_${message.author.id}`) + 1 || "N/A";
data.length = 20;
let lb = [];
for (let i in data) {
let id = data[i].ID.split("_")[1];
let user = await client.users.fetch(id);
user = user ? user.tag : "Unknown User#0000";
let rank = data.indexOf(data[i]) + 1;
let level = client.db.get(`level_${id}`);
let xp = data[i].data;
let xpreq = Math.floor(Math.pow(level / 0.1, 2));
lb.push({
user: { id, tag: user },
rank,
level,
xp,
xpreq
});
};
const embed = new MessageEmbed()
.setTitle("Level Leaderboard")
.setColor("RANDOM")
lb.forEach(d => {
embed.addField(`${d.rank}. ${d.user.tag}`, `**level** - ${d.level}\n**XP** - ${d.xp} / ${d.xpreq}`);
});
embed.setFooter(`This is where you are: ${myrank}`);
return message.channel.send(embed);
};
module.exports.help = {
name: "leaderboard"
};
message.channel.send({embed});
please use hastebin
@earnest phoenix fikter members to check if they are in message.guild

I removed the other defined clients now I get a 'client undefined' .-.
how to 🤔
@still merlin read what e said
I removed the other defined clients now I get a 'client undefined' .-.
@still merlin read what I said k thx
Ok
add your initial client in your execute function as an argument

whahahaah
still not what i mean awsome
okay
Thanks
<=no0b here
agreed
so
how is my weather bot response set?
learn how to code correctly kthx, just use message.client if you exported message into the command (amari)
how to🤔
CAN ANYONE DO IT FOR ME PLEASE?
no
no
we dont spoonfed code
no that'd be 
^
I USE BDFD brfore lol
learn js
trying
¯\_(ツ)_/¯
asking someone 'to do it for you' isnt trying
yeah ^
Should i do 'execute(client, message, args) {'
i have used console.log(result1)
when i learn new languages (programming langs), i just use google and the languages reference.
asking someone 'to do it for you' isnt trying
@opal plank got it
Should i do 'execute(client, message, args) {'
@still merlin yes
thankyou so much
@eternal osprey okay so its an array response, open the 0 one
and why even export client whike message#client exists ¯\_(ツ)_/¯
just edit the line that calls the execute command and ur good to go
okay
and why even export client whike
message#clientexists ¯\_(ツ)_/¯
@restive furnace no one uses it
for in
prob be your best bet tbh
you could deconstruct it but prob me more of a hassle
okay, i will have a look at it,. Thanks.
yeah i already saw that site
How can I download discord previous version 29.0 for iPhone ?
i dont think you can on ios
i have seen the examples, but have a hard time using it on my bot.
Sad
or maybe with itunes
i will serach up some tutorials,
or maybe with itunes
@tight plinth how ?
just checked, u sadly can't @summer carbon
:/
or maybe if you jailbreak your iPhone, then you're able to install app packages / install previous versions of an app
but idk a lot about iPhone since I'm an android guy
How can I jailbreak my iPhone
can't i just use an if statement to check if the skytext = 'clear'
currently you can jailbreak to get cydia
and it's probably not that legal so I don't think that, even if I know how to do, I can help you here
michael, if something happens with your iphone
afaik you can't hachban with v11
they won't help you anymore
Yes
as apple is highly against jailbreaking
also when you jailbreak guarantee goes poof
also, i have tried jailbreaking with the latest iphone version. It is really hard to find a working one.
Even I can’t able to send messages
most of them are scams or won't work
time to switch to a proper android it seems
@restive furnace no one uses it
@tight plinth i do, and why to pass it even, since it just takes more time, so basically you copy it 2 times, since message.client and client passed
Do you guys know any site or software that compresses javascript to 1 line?
nope
Why do you need it @surreal sage
Why do you need to know :)
Because there are different answers depending on your use case
What are your answers?
If it's for a website, go with webpack. For node/server apps webpack won't work (and neither should it, because why would you need to minify server-side code)
Not what i wanted
I want to make a full javascript file from multiple lines of code into 1
but why tho
^
I need to like compress it?
Why
Why not
Why do you need to compress it
¯_(ツ)_/¯
u can write js code on one line
I don't think you understand what a dumb idea that is
line breaks aren’t needed unless its an object iirc
commas
We do help
You're just too much of a dick
i mean, u can write ur code on one line anyways, js doesn’t care about indentation @surreal sage
setTimeout
setTimeout(function, time to wait before function)
in the function, delete the message with message.delete()
pass in 5000 for the time (5 seconds converted to milliseconds)
```.addField(User Status, `${message.author.status}````
presence
lol the order is messed up too
<user>.presence https://discord.js.org/#/docs/main/stable/class/Presence
wdym @opaque eagle
oh yea i messed up when typing here
just copy paste
Anyone help?
I want to make a msg and it will edited at 5 seconds
But how
message sendinf returns a promise
use await or use .then
example:
message.channel.send("lol").then(msg => {
msg.edit("edited the message");
});
or setTimeout like I suggested the last time you asked the same question lol
i need help
} else if (msg.content === '-embed') {
const exampleEmbed = new Discord.MessageEmbed()
.setColor('ffb3ba')
.setTitle('Commands')
.setAuthor('By: Sia (ALT)#9417')
.setDescription('Command used: -help\nHere is a list of all command groups!')
.setThumbnail('https://cdn.discordapp.com/attachments/749010415224356905/749056612181999676/image0.png')
.addFields(
{ name: 'Regular field title', value: 'Some value here' },
{ name: '\u200B', value: '\u200B' },
{ name: 'Utility', value: '-utility help', inline: true },
{ name: 'Moderation', value: '-moderation help', inline: true },
{ name: 'Fun', value: '-fun help', inline: true },
)
.addFields(
{ name: 'General', value: '-general help', inline: true },
{ name: 'More coming soon...', value: 'More Coming Soon', inline: true },
)
.setFooter('© 2020 - ✩May✩ - All rights reserved.', 'https://cdn.discordapp.com/attachments/749010415224356905/749056612181999676/image0.png');
}
});```
is this correct?
https://tryitands.ee
@misty sigil it didnt work
ok what error
its exacty why im asking
`Last login: Sat Aug 29 12:21:53 on ttys000
Susantas-iMac:~ SiaYT$ cd /Users/SiaYT/Desktop/MAY
Susantas-iMac:MAY SiaYT$ node index.js
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module './util/Util'
Require stack:
- /Users/SiaYT/Desktop/MAY/node_modules/discord.js/src/index.js
- /Users/SiaYT/Desktop/MAY/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/Users/SiaYT/Desktop/MAY/node_modules/discord.js/src/index.js:3:14)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [`
i want to make an embed
like
ok so 1
as a response
you arent sending it
:))
im very very new to embeds
message.channel.send({embed: embed})
where do i put that
below the embed code
like
} else if (msg.content === '-embed') {
const exampleEmbed = new Discord.MessageEmbed()
.setColor('ffb3ba')
.setTitle('Commands')
.setAuthor('By: Sia (ALT)#9417')
.setDescription('Command used: -help\nHere is a list of all command groups!')
.setThumbnail('https://cdn.discordapp.com/attachments/749010415224356905/749056612181999676/image0.png')
.addFields(
{ name: 'Regular field title', value: 'Some value here' },
{ name: '\u200B', value: '\u200B' },
{ name: 'Utility', value: '-utility help', inline: true },
{ name: 'Moderation', value: '-moderation help', inline: true },
{ name: 'Fun', value: '-fun help', inline: true },
)
.addFields(
{ name: 'General', value: '-general help', inline: true },
{ name: 'More coming soon...', value: 'More Coming Soon', inline: true },
)
.setFooter('© 2020 - ✩May✩ - All rights reserved.', 'https://cdn.discordapp.com/attachments/749010415224356905/749056612181999676/image0.png');
message.channel.send({embed: embed})
}```
like this?
oh ok
message.channel.send({embed: embed})
@misty sigil bruh u give wrong code
no?
} else if (msg.content === '-embed') {
const exampleEmbed = new Discord.MessageEmbed()
.setColor('ffb3ba')
.setTitle('Commands')
.setAuthor('By: Sia (ALT)#9417')
.setDescription('Command used: -help\nHere is a list of all command groups!')
.setThumbnail('https://cdn.discordapp.com/attachments/749010415224356905/749056612181999676/image0.png')
.addFields(
{ name: 'Regular field title', value: 'Some value here' },
{ name: '\u200B', value: '\u200B' },
{ name: 'Utility', value: '-utility help', inline: true },
{ name: 'Moderation', value: '-moderation help', inline: true },
{ name: 'Fun', value: '-fun help', inline: true },
)
.addFields(
{ name: 'General', value: '-general help', inline: true },
{ name: 'More coming soon...', value: 'More Coming Soon', inline: true },
)
.setFooter('© 2020 - ✩May✩ - All rights reserved.', 'https://cdn.discordapp.com/attachments/749010415224356905/749056612181999676/image0.png');
message.channel.send(exampleEmbed)
}```
yes
no i didn't
she defiene it as a variable
yes BUT it returns a json object
so message.channel.send({embed: exampleEmbed}) would work
ok
oh ok
message.channel.send(exampleEmbed) will work to and they are same
oh nvm
ok u gave a right code
ok
`Susantas-iMac:MAY SiaYT$ cd /Users/SiaYT/Desktop/MAY
Susantas-iMac:MAY SiaYT$ node index.js
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module './util/Util'
Require stack:
- /Users/SiaYT/Desktop/MAY/node_modules/discord.js/src/index.js
- /Users/SiaYT/Desktop/MAY/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/Users/SiaYT/Desktop/MAY/node_modules/discord.js/src/index.js:3:14)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/SiaYT/Desktop/MAY/node_modules/discord.js/src/index.js',
'/Users/SiaYT/Desktop/MAY/index.js'
]
}
Susantas-iMac:MAY SiaYT$ `
uh
idk why it wont work
npm i util
?
what is that
it inspects promises; commonly used in eval commands.
yes
ok
`Last login: Sun Aug 30 08:22:20 on ttys002
Susantas-iMac:~ SiaYT$ npm install util
npm WARN saveError ENOENT: no such file or directory, open '/Users/SiaYT/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/SiaYT/package.json'
npm WARN SiaYT No description
npm WARN SiaYT No repository field.
npm WARN SiaYT No README data
npm WARN SiaYT No license field.
- util@0.12.3
added 25 packages from 17 contributors and audited 40 packages in 4.378s
14 packages are looking for funding
run npm fund for details
found 0 vulnerabilities
Susantas-iMac:~ SiaYT$
`
did it work?
Matthew?
@misty sigil
yes
That's a discord.js error not a built in Node error. The first stack frame says it's coming from discord.js' index requiring discord.js' Util module. Try reinstalling discord.js
Well. How did you install it in the first place?
@sand skiff just send the first, sec lines of the error
npm install discord.js???
That would be correct
ok
Last login: Sun Aug 30 08:39:57 on ttys002
Susantas-iMac:~ SiaYT$ npm install discord.js
npm WARN saveError ENOENT: no such file or directory, open '/Users/SiaYT/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/SiaYT/package.json'
npm WARN SiaYT No description
npm WARN SiaYT No repository field.
npm WARN SiaYT No README data
npm WARN SiaYT No license field.
+ discord.js@12.3.1
updated 1 package, moved 14 packages and audited 54 packages in 2.945s
14 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
now try it again
ok
You don't event have a package.json???
@sand skiff type in terminal node -v
cuz discord.js v12 support only nodejs v12+
Last login: Sun Aug 30 08:46:08 on ttys003
Susantas-iMac:~ SiaYT$ node -v
v12.18.3
Susantas-iMac:~ SiaYT$
@sand skiff type in terminal npm init
Susantas-iMac:~ SiaYT$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See npm help init for definitive documentation on these fields
and exactly what they do.
Use npm install <pkg> afterwards to install a package and
save it as a dependency in the package.json file.
Press ^C at any time to quit.
package name: (siayt)
yes try ur name
huh
package name: UR PROJECT NAME
o-o
you can just hit enter for most of the prompts
yes
npm init -y
Would also work
unless you want to change properties
or just enter
most or all
ye do what batman said
you could hit enter for all but it's good to customize it
`package name: (siayt)
version: (1.0.0)
description:
entry point: (index.js)
test command:
git repository:
keywords:
author:
license: (ISC)
About to write to /Users/SiaYT/package.json:
{
"name": "siayt",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"discord.js": "^12.3.1",
"util": "^0.12.3"
},
"devDependencies": {},
"scripts": {
"test": "echo "Error: no test specified" && exit 1"
},
"author": "",
"license": "ISC"
}
Is this OK? (yes) yes`
huh
u done
yes
```
how long is an id ?
I thougth it was 8/9 digits
I thougth it was 8/9 digits
Nope its not
Mine is
``
But it can differ a bit
then intall discord.js
install
imma send u screeenshot @wary flame but i need to install flame shot
@wary flame
(only q.ping worked) ty discord
LoL
Yes, but it is not always 18
Pretty sure
Do not check ID lengths ever since IDs will never consistently be the same length. They will increase in length eventually and the developers can arbitrarily add IDs into the database and break your code
What papi said
then intall discord.js
@earnest phoenix again?
`Susantas-iMac:~ SiaYT$ npm instal discord.js
Usage: npm <command>
where <command> is one of:
access, adduser, audit, bin, bugs, c, cache, ci, cit,
clean-install, clean-install-test, completion, config,
create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
edit, explore, fund, get, help, help-search, hook, i, init,
install, install-ci-test, install-test, it, link, list, ln,
login, logout, ls, org, outdated, owner, pack, ping, prefix,
profile, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, token, tst, un,
uninstall, unpublish, unstar, up, update, v, version, view,
whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/Users/SiaYT/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@6.14.6 /usr/local/lib/node_modules/npm
Did you mean one of these?
install
unstar
init
Susantas-iMac:~ SiaYT$ `
STOP
you spelled install incorrectly
npm install discord.js
why u alway copy all terminal error
read it and find the most importain then send it
is there a server or site that shows/helps with vsc scrips?
i have a thing that sends a message when a role is updated
when a role is moved
all the roles get "updated"
how can i stop it from spamming it
and just sending the one that was updated
using python
It’s on the on role edit event
@strange mango ...
yes?
How i can get mongoose ping ?
I think you need to use findOne
yes but how
Idk, new Date() beforehand, new Date() afterwards and subtract them?
Take time (1)
Make DB call
Take time (2)
ping = time(2) - time(1)
Would that work
Yes
aye it does
thx
also the border is very.... THICC
@dire obsidian I cant change the border
I wish I could use iframe... but its not working
Top supports custom html and css so you can if that's what they're talking about
hmm, what is "not working" @strange mango ?
iFrames are not allowed on Top for non cert
idk but its blocked by nginx
iframes are fine
I saw a lot of bots using iframe
the content must follow the same rules as a normal bot page tho
really? Must be thinking of an other site then
yeah
but it doesnt work for me
Thanks for the clarification, then
I don't know why, but my bot isn't joining my voice channel and not playing anything. I'm using OpussScript and FFMPEG, however nothing seems to be working.
Code: https://hatebin.com/vbpqlutnnh
Errors: https://hatebin.com/thvqbcuisr
My goal is to make a music bot.
Oh hey, somethin i can help with
How can I get the guilds invite, the message was send? (discord.js v12)
i genuinely cannot see the music code
hi
help conecting my bot in channelvoice
https://mybot-team.github.io/documentacion/guia/introducion-bot-de-musica-audio.html
srry 4 my bad english
this example code dont work :c im in discord.js 12.3
is there a server or site that shows/helps with vsc scrips?
@earnest phoenix vsc is just an ide
Oop
text editor* not ide
advanced text editor 
There's nothing in discord TOS that forbids me giving nitro as a prize for winning the months trivia in my bot is there
not afaict
its just rewarding your users, giving them an incentive to use your bot and share it
Yeah that's what I thought
I just didn't want to get stung by any laws re gambling because nitro has a real world cash value, although they don't pay to participate so...
wait run this in terminal,
xcode-select --install
@crystal socket Sorry for late response, but I ended up doing the following:
- Deleting my old Xcode as I already had the beta.
- Updating the beta (Xcode 12 beta 6)
- Downloading the Command Line Tools directly from Apple's site (beta 5)
I got Homebrew working now 
Hmm does it encourage sharing though and grow user base or does it encourage people to keep the bot quiet so there's less competition and more chance of winning nitro
Right now there's perhaps 40 hardcore players that would vie for the prize and may make a lot of trash talk noise between each other trying to win
Lol perhaps yeah
I already have voter rewards
Hi does anyone know how to send hyperlinks on discord.py?
links are not library dependant
Meaning?
meaning they are just a piece of text that discord converts to links
Oh ok!
its the same in all libraries
But what about hyperlinks
the format is [text here](url here)
Discord takes care of the rest
ok thanks
ping it
that wont work but ok
what do you mean
use uptime services
Ok
Let's not encourage that ty
It was a joke...
and is this a channel for jokes
Oh
So basically every bit i run it again
Every X minutes, your uptime service will send a request to your project URL
Oh Ok
which, therefore, will keep it running for another Y minutes
Ok where do i see uptime service
UptimeRobot is one of those
Ok
Yeah, point it at your project's public URL and done
Ok
can't you use the project to ping itself or does repl check for those?
Huh, an interesting idea
I can try deploying a small script and see
Oh, it's repl.run
i did that for an org and it seems to be working just fine
do you mean URL by where it says something about creative dark magenta download repl.co https:// thing?
it has 1 down monitor
let guilds = member.guild.cache
let memberadd = guilds.members
.filter(member => member.cache.hasPermission('MANAGE_GUILD'))
.filter(member => !member.user.bot)
.map(m => ">" + m.user + ` (TAG : \`${m.user.tag}\`, ID : \`${m.user.id}\`)`).join('\n')```
```(node:5592) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'members' of undefined
at Client.bot.on (C:\Users\Utilisateur\Desktop\Détente [FR]\bot juzoo bot v12\main.js:212:32)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:5592) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5592) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.``` 
member.guild.cache?
what are you trying to access
the members? that would be member.guild.members.cache
oof I'm new to v12 I'm updating my code, thank you "
english only here
you can just remove guilds as it's unneeded and change memberadd to member.guild.members.cache
so that grabs the guild of the member and gets the members of the guild and accesses the cache
from there you can just do normal filter operation
what (node:13040) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function
let embedSendBot = new MessageEmbed()
.setTitle("Un membre vient d'ajouter un bot")
.setDescription(`
> Bot : \n > ${member.user}
(TAG : \`${member.user.tag}\`, ID : \`${member.user.id}\`)
> **Source a vérifier**, \n > Les logs me dise que l'utilisateur qui a ajouter le bot peut être : \n > ${UserGet} (TAG : \`${UserGet.tag}\`, ID : \`${UserGet.id}\`)
> Les membres qui a les permissions d'ajouter des bots \n\n` + memberadd)
return bot.channels.cache.get("706979372145442917").send(embedSendBot)```
update your node
npm install node.js
no lol
update my node ?
oof
okay okay
Thz ^^
@crystal stream what happened
They add my bot ^^
I started on v11, and at that time it was this version, simply recommend it and since then I have not updated
Soon i will change prefix)
.map(m => ">" + m.user + ` (TAG : \`${m.user.tag}\`, ID : \`${m.user.id}\`)`).join('\n')```
in v11 it gives the mention but in v12 it gives the id how to change this ?
you want the id to be a mention?
I want m.user = a mention
m.user is a mention iirc
m.user.toString() is a mention
or just <@${m.user.id}>
thx
`import discord
client = discord.Client()
@client.event
async def on_message(message):
if message.content.startswith('example'):
await message.delete()
await message.channel.send('{} stop using that word'.format(message.author.mention))`
any way to make it search for example in entire message?
Use the in operator
Hello, how do I put nitro emojis in a discord bot?
bots have access to all emojis from guilds they are in
if you want to add it,. put it on a server that the bot is in
just create a secret server with those emojis
I put the nitro emojis on the server on which the bot is but instead of putting the animated emojis on me it puts me for example :emojis:
saving your bot files on github is good, useful when something went wrong with the local storage that the bot is in
It's already done I'm testing my bot locally now
There is a specific writing for nitro emojis or you just have to put :nameemojis: ?
your bot must be in the same server where the emoji is from, and your bot must have "use external emojis" permission
ok i will test this
it puts me this
at RequestHandler.execute (C:\Users\Kylian\Desktop\Kaelya BOT\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:8696) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8696) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
that means a message was not found
But it's only been doing this since I put the animated emojis in the code
lets say i have 18 shards. how many shards should i be running in a single docker container?
as many as you want
Depends on process CPU load ig.
cause i'm trying to think of possibilities on why my cpu is shitting itself with a load of 18 shards
idk if i need to split containers up, do a deep dive on the process
cause i'm trying to think of possibilities on why my cpu is shitting itself with a load of 18 shards
@stark terrace if you have 18 shards, you should cluster your bot
your bot is divided in multiple processes instead of a big one
So i have two collections in mongodb, one that stores the settings of each server and one that stores only a single document containing the defaults. I want it so that if I change the defaults each server document is merged with the new defaults, except for the fields that were changed from the defaults
how do i go about accomplishing this?
i have never used internal sharding
djs shard handler ew
well then u need to cluster ur bot
btw quick question with shoukaku and sharding: how am i supposed to handle it? shards > shoukaku > client or shoukaku > shards > client?
is it a music bot?
its not @quartz kindle
4 cores, 8 threads (cpu started shitting itself within the past week) 18 shards, 17.7k guilds. could it be time to upgrade the cpu? other processes running on this machine are super lightweight
Might want to look at optimizations first
Are there any resource-intensive operations you perform?
your cpu shouldnt be even close to shitting itself
unless you do intensive operations like music or image processing
well what Ghzs are the cores running at?
no music or image processing with this bot
considering my bot averages at 2-3% cpu on a single core at 4500 guilds
and db calls either cause im caching guild settings
In mongodb how do I check if a collection exists?
considering my bot averages at 2-3% cpu on a single core at 4500 guilds
@quartz kindle HOLY SHEET
In mongodb how do I check if a collection exists?
@earnest phoenix Make a call for it. If it returns null, it doesn't exist
okay my mom is sitting beside me so i can't swear
well what Ghzs are the cores running at?
?
well what Ghzs are the cores running at?
@faint prism 3.4GHz
lol your cpu is plenty powerful enough
@earnest phoenix Make a call for it. If it returns null, it doesn't exist
@faint prism but then I can just do normal methods on it like it existed and mongodb will create the collection anyways
which i don't want to happen
yeah that's why im curious on what could be wrong
@faint prism 3.4GHz
@stark terrace You should check your code for areas you can optimize
Reduce file I/O operations, unnecessary sorting, etc
Tim might know a few ways
i assume you're using discord.js's sharding manager?









