#development
1 messages ยท Page 854 of 1
Hello
moved to a manager in v12
so @finite bough do you think i should just not the do the guild.channels.cache.first() thing or not
don't
don't
@finite bough Library
discord.js
Version
v12.16.1
it will probably give u errors most of the time
do msg.member.voice.channel
voiceChannel is for 11v
yes
the max u can do is send an embed to the server owner
its also a bad idea but thats the max
the max you do is nothing
and sometimes it's not even the owner that added the bot
yea but still
no just don't
Can anyone help me to create a bot
its not a good idea coz
Please
most of the owners have dms off
you're just ruining the bot
@knotty steeple yes
well
-faq 3 @frail prism
@frail prism
might as well pay for a vps and code your own bot
Anyone else having this issue with the SQL modules?
throw err;
Error: Cannot find module '/rbd/pnpm-volume/28798193-514e-4918-bd8e-d1fef507e28f/node_modules/.registry.npmjs.org/sqlite3/4.1.1/node_modules/sqlite3/lib/binding/node-v67-linux-x64/node_sqlite3.node'
sqlite3
sqlite3
LOL
Sounds like something from glitch ngl
is that the windows thingy
Are you using glitch
because pnpm
Ye
i tried sqlite on glitch it works fine
did you try installing sqlite3? have you tried re-installing?
oh yea tru
try uninstall and re-install it ?
For this bot ngl yes I am, was working fine but randomly crashed bout an hour ago
try uninstall and re-install it ?
@earnest phoenix just tried that same error
on glitch its not crashing its called project shutdown 
well time to switch
on glitch its not crashing its called project shutdown
@finite bough no I have a plan
I have the always on features
Yeah released it a few days ago
u wasted 8$ on glitch...
well its good
kinda
a good vps costs 5$...
is a vps hosting service or ?
yes
virtual private _ ?
Virtual private server
even tho my bot deserve better haha
Glitch isn't good
ik
This bot does to honestly been debating switching to digital ocean
i have nothing else
but contabo-
DO Is good
why glitch
free vps 
nooo
no free vps unless you post some stuff on some forum
why glitch
@pale vessel was just a small bot at first didn't really need it online all the time
But it grew fast
but you paid $8
Yes I know
I use vultr
@pale vessel your pfp describe how u look rn
best vps you know ?
waist waste of time too
i want a good vps
pay money
YEAH IM ASKING
good vps -> gonna cost
IF U KNOW
Glitch was made as a testing sandbox
contabo is cheap n pretty decent
@modest maple who said im not going to?
And like that's what it's good at
@earnest phoenix what error in console
Galaxy gate is what alot of bots use
i asked if there are any suggestions,
i think this can go #memes-and-media
look at pins
You can talk about development in here
cya
someone said u cant but ok
it literally called development
i mean it's about bot development
WAIT OMG DISCORD IS LOADING IMAGES
YES
Now that ^ is an example of what should go in #memes-and-media
lmao
ken no shitposting in development
@finite bough ?
what even is the error
I donts like the discord ss codes 
why are you suddenly sending us your code
For phone
Connected to database!
Yo this ready!
Collection [Map] {
'696075071474761748' => Message {
channel: TextChannel {
type: 'text',
deleted: false,
id: '671783138485075977',
name: 'test2-nfsw',
rawPosition: 1,
parentID: '665282871505977364',
permissionOverwrites: Collection [Map] {},
topic: '',
nsfw: true,
lastMessageID: '696075071474761748',
rateLimitPerUser: 0,
lastPinTimestamp: null,
guild: [Guild],
messages: [MessageManager],
_typing: Map {}
},
deleted: false,
id: '696075071474761748',
type: 'DEFAULT',
content: '2',
author: User {
id: '389453494911893508',
bot: false,
username: 'Hedi',
discriminator: '5455',
avatar: '0442e2f470eca8c82532e033f83d856e',
lastMessageID: '696075071474761748',
lastMessageChannelID: '671783138485075977'
},
pinned: false,
tts: false,
nonce: '696075070749016064',
system: false,
embeds: [],
attachments: Collection [Map] {},
createdTimestamp: 1586027629489,
editedTimestamp: null,
reactions: ReactionManager {
cacheType: [Function: Collection],
cache: Collection [Map] {},
message: [Circular]
},
mentions: MessageMentions {
everyone: false,
users: Collection [Map] {},
roles: Collection [Map] {},
_members: null,
_channels: null,
crosspostedChannels: Collection [Map] {}
},
webhookID: null,
application: null,
activity: null,
_edits: [],
flags: MessageFlags { bitfield: 0 },
reference: null
}
}

this is-, why?
you're not making sense here boi
try {
var response = await msg.channel.awaitMessages(msg2 => msg2.content > 0 && msg2.content < 11, {
maxMatches: 1,
time: 10000,
errors: ['time']
});
} catch (err) {
console.error(err);
return msg.channel.send('No or invalid value entered, cancelling video selection.');```
Ota-chan-DEVELOPINGBOTma 21:13-kor
Song selection:
1 - Nico-Nico-Nii! [BEATSTEP REMIX]
2 - Yazawa Niko - niko niko nii~
3 - Love Live Nico Nico Nii Compilation
4 - (Weekly Idol EP.261) TWICE Momo imitate character 'Nico Nico Ni'
5 - Nico Nico Nii
6 - KPOP Idols doing "Nico Nico Nii- Love Live" (BTS, TWICE, EXO, ZICO,RED VELVET, SUPER JUNIOR, IZ*ONE)
7 - Nico Nico Nii in 10+ Different Languages/Dub
8 - Google Translate Says 'Nico Nico Nii' In 50 Languages
9 - Yazawa Nico Waifu | Nico Nico Nii Compilation
10 - Nico Nico Nii! vs PIKA PIKA CHU!
Please provide a value to select one of the search results ranging from 1-10.
Hedima 21:13-kor
2
Ota-chan-DEVELOPINGBOTma 21:13-kor
No or invalid value entered, cancelling video selection.```
nor that
it may or may have something to do with that last paragraph
you're not telling us what's wrong
so much is returned by the console
so we can't help
problem not playing song
not console error
error message js return msg.channel.send('No or invalid value entered, cancelling video selection.');
@earnest phoenix the message you await is a string
You need to parse it into an integere
I don't think maxMatches is a thing, try just max
message.content is defined as "2" in that case
It probably times out
You must parse it such as using parseInt(message.content)
yes await
@earnest phoenix no random emojis in development
K
there's probably a hastebin wrapper you can find
tru
@spare goblet and @finite bough https://pastebin.com/E52FEzqh hmm?
@earnest phoenix I already responded to you, check above. :) and please do not ping me when I'm already in the channel.
or instead of wasting space on a module, do a post request
That if your using nodejs
A post request isn't hard to do so might be easier that way
just post hastebin.com/documents
A question, lets say i buy DigitalOcean vps, will i be able to move my code from glitch to it without errors?
no need for a module
Lol
Pretty sure glitch has some extra crap you can remove
mm
And if you use .env you have to install dotenv
Yep Glitch bad
if a message if 2000+ any idea how to send it?
lmao
And add dotenv.config() in index.js
in a hastebin ?
@finite bough embed
you can use split option
Split it into multiple parts and send multiple messages
it sends another message
wait embeds can go 2000+?
@finite bough why is it so big though
OwO
embed could go up to 2048 on the description and 1024 on fields
O
correct me if I'm wrong
I don't think so
no?
Or even I am wrong 
I could've sworn I remembered correctly
Yah bc I don't remember embed support up to 6k
It does, in total.
interesting
Embed titles are limited to 256 characters
Embed descriptions are limited to 2048 characters
There can be up to 25 fields
A field's name is limited to 256 characters and its value to 1024 characters
The footer text is limited to 2048 characters
The author name is limited to 256 characters
In addition, the sum of all characters in an embed structure must not exceed 6000 characters
A bot can have 1 embed per message
A webhook can have 10 embeds per message
Got that from the discord.js tutorial
Oof
ah nice
You got too much text in your description. ICanseeYourPixels
So yeah it's 2048
i was right
@elder vine i can see that
Both of you are right
@finite bough just split it then
25 fields tho
iara said u can get upto 6k words in an embed
You can (not in words)
thats like all total
well ok
it involves everything
ima just split
yes
coz hastebin gay
split: true
.addField('hastebin gay', true)
hastebin is good
so like
split doesn't work on embed btw
let embedtext1 = message.split(prefix.length, 2000).join
let embedtext2 = message.split(embedtext1 , 2000).join
hmm
yes
that's a pain
ikr
what I do is make a regex expression that splits it every 2048 characters
LOL
anyone ran into issues with having to shard, and using cache storage?
or have any ideas for being able to continue using cache storage with shards, versus having to switch everything do a database?
are you using discord.js? If so there are functions like broadcastEval which get stuff from all shards, though I've never had the chance to use it
yeah, we're on discord.js, I've got a dev working with me, I'll mention that too him. He's pretty sure we're going to have to re-work the entire storage structure, but that's going to be probably weeks of work I'd like to avoid
@earnest phoenix i made a global cache system with veza
ohh, nice, mind giving a short summary on how it works?
or have a link to veza @mossy vine
Not sure if that's better than broadcasteval but it's an option
depends on your use case
if you want a global cache its better
in fact, how would you create a global cache with broadcastEval
I'm not sure why you'd want that, to my understanding broadcastEval is just a fuction which evals a bunch of code in every process and returns everything in an array
so you can get whatever you need
But then aren't you just wasting memory cause then objects will be cached twice?
say in my use case you want to keep a list of all the current users of your bot
how do you do that with broadcastEval?
you send the data to the global cache nd fetch it there
how am i caching twice
caching it in the global cache in the same place where my shardingmanager is and request data from there when i need it
could also use something like Redis
fair point, would probably be more efficient
but does it feel good wasting hours on a barely working cache system that you wrote all by yourself?
yes
lol
I'll look into Redis as well
we're basically at a standstill at the moment
what are you hosting your bot on
didn't know about having to shard, until we hit 2500 guilds lol
rip
what kind of data are you caching?
it's on a DigitalOcean VPS
linux right?
also, are you on djs? v11 or v12?
yeah, Ubuntu
then you can just install redis and set it up with systemctl or something
on djs v11.5 at the moment
ah
if you were on v12 you could use internal sharding
which would let you keep using your existing caching
hmmmmmmmmm console log ```js
I could not join the voice channel: TypeError: serverQueue.connection.playStream is not a function
events.js:288
throw er; // Unhandled 'error' event
^
Error: Error parsing config: Unexpected token ; in JSON at position 58858
at gotConfig (/home/dc/chino-chan/node_modules/ytdl-core/lib/info.js:123:21)
at /home/dc/chino-chan/node_modules/ytdl-core/lib/info.js:74:7
at PassThrough.<anonymous> (/home/dc/chino-chan/node_modules/miniget/dist/index.js:196:32)
at PassThrough.emit (events.js:311:20)
at endReadableNT (_stream_readable.js:1204:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on PassThrough instance at:
at /home/dc/chino-chan/node_modules/ytdl-core/lib/index.js:19:14
at /home/dc/chino-chan/node_modules/ytdl-core/lib/info.js:335:25
at /home/dc/chino-chan/node_modules/ytdl-core/lib/info.js:190:21
at /home/dc/chino-chan/node_modules/ytdl-core/lib/info.js:335:25
at gotConfig (/home/dc/chino-chan/node_modules/ytdl-core/lib/info.js:123:12)
at /home/dc/chino-chan/node_modules/ytdl-core/lib/info.js:74:7
[... lines matching original stack trace ...]
at processTicksAndRejections (internal/process/task_queues.js:84:21)
oo hi @quartz kindle
that makes sense
ohh, so it sounds like if we could move to v12 that'd maybe solve a lot
you'll have to see what will be more painful for you
moving to v12 or to a caching db
lmao
oof lol
@quartz kindle once he helped me do my musicbot, wouldn't he have done it now?
@earnest phoenix connection.playStream is not a function
there are other problems
if you're using discord.js v12, then use connection.play
yes discord.jsv12
Cyber, can you please elaborate? Wouldn't the separate processes cache the guilds/users/everything else their shards "handle"? I have no experience with sharding, I am not quite sure how things work
elaborate on what
how am i caching twice
caching it in the global cache in the same place where my shardingmanager is and request data from there when i need it
@quartz kindle okay the link music works but the other commands are not good and the music selection interface is not good either
i thought you were talking about my global caching solution
No or invalid value entered, cancelling video selection.```
yes you are offloading data to a separate process, but you dont necessarily need to cache entire guild/user objects
^
ie you can have a full copy of a user object in a shard, and only the user id and username in the cache process
@earnest phoenix invalid value entered. make sure you're using your libraries correctly
check the documentation on their npm pages
tim
aha yes that makes sense, thanks
is there an easy way to buffer a stream?
and then you can fetch the object with the id, that clears things up
in the bot's cache/memory
you can convert a stream into a buffer, which will contain the entire stream
not sure about buffering a part of the stream tho
@quartz kindle i see right i wouldn't be able to view it https://pastebin.com/HNM6QqZn
the the whole stream
i want to buffer the whole stream in the memory so the stream does not lagg
you should be able to do something like js let array = [] stream.on("data", d => { array.push(d); }); stream.on("end", () => { let buffer = Buffer.concat(array); })
i havent tested it tho
@quartz kindle ??
not enough information for me to help you
@quartz kindle what to give?
That ping wont work.
You need to give tim informations about your Bot
Command / Code
"No or invalid value entered, cancelling video selection."
where does this come from?
show full error
Tim, how you doing btw?
doing good lul
"fun" >.>
@quartz kindle https://youtu.be/xGvgQVZmHNI
Is that @surreal cedar's profile pic smh
@earnest phoenix why dont you just Copy + Paste your Error?
Its a bit easier for Tim then 
stop adn skip command error console
(node:23251) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'end' of null
at Query.<anonymous> (/home/dc/chino-chan/muscibot.js:113:43)
at Query.<anonymous> (/home/dc/chino-chan/node_modules/mysql/lib/Connection.js:526:10)
at Query._callback (/home/dc/chino-chan/node_modules/mysql/lib/Connection.js:488:16)
at Query.Sequence.end (/home/dc/chino-chan/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query._handleFinalResultPacket (/home/dc/chino-chan/node_modules/mysql/lib/protocol/sequences/Query.js:149:8)
at Query.EofPacket (/home/dc/chino-chan/node_modules/mysql/lib/protocol/sequences/Query.js:133:8)
at Protocol._parsePacket (/home/dc/chino-chan/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/home/dc/chino-chan/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/home/dc/chino-chan/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/home/dc/chino-chan/node_modules/mysql/lib/protocol/Protocol.js:38:16)
(node:23251) 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: 2)
(node:23251) [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.
Thank you 
and play shearc error code nothing
serverQueue.connection.dispatcher.end('Stop command has been used!');```
Js right?
Never used Music commands...cant help you there.
Maybe Tim or other people will help you out 
๐ข
well then there is nothing to do just wait so good to come in this v12 v11 in it works perfectly all
Maybe its because it got changed?
v12 is different from v11
i know very well that it changed just i can't find a solution to it

here is the full code to see if anyone needs or might fix it https://pastebin.com/HNM6QqZn
Did you already tryed to search for the error in web?
yes but everyone is looking for the FFMPEG error
if you checked the documentation for v12 and list of changes, you would see that there is no dispatcher.end()
there is dispatcher.pause() or connection.disconnect()
okey and play shearc??
@earnest phoenix
Tim thank shearch working and
(node:24368) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'destroy' of null
at Query.<anonymous> (/home/dc/chino-chan/muscibot.js:107:43)
serverQueue.connection.dispatcher.destroy('Skip command has been used!');```
dispatcher is null
https://oliy.is-just-a.dev/yyetiw_3438.png the? means it may return null
You should always check if it is existent or not
that too 
skiped song and stopid ?

well i don't understand this alone the skip set stop command is not good
whatever i do
yeah if i put more music i don't go to the next one and it says i put it on the playlist
these 3 things are not good the rest are perfect
My shards constantly reconnect, every once a while, a shard reconnects (about every 30 mins to an hour) should I be worried? Or is this normal
Running on around 15 shards
its normal as long as its not a predictable pattern
please help to stop and skip the command and the playlist system is not good
it's just a 3 piece error
skip and stop command js } else if (command === 'skip') { if (!msg.member.voice.channel) return msg.channel.send('You are not in a voice channel!'); if (!serverQueue) return msg.channel.send('There is nothing playing that I could skip for you.'); serverQueue.connection.dispatcher.destroy('Skip command has been used!'); return undefined; } else if (command === 'stop') { if (!msg.member.voice.channel) return msg.channel.send('You are not in a voice channel!'); if (!serverQueue) return msg.channel.send('There is nothing playing that I could stop for you.'); serverQueue.songs = []; serverQueue.connection.dispatcher.destroy('Stop command has been used!'); return undefined;
handle video ```js
async function handleVideo(video, msg, voiceChannel, playlist = false) {
const serverQueue = queue.get(msg.guild.id);
console.log(video);
const song = {
id: video.id,
title: Util.escapeMarkdown(video.title),
url: https://www.youtube.com/watch?v=${video.id}
};
if (!serverQueue) {
const queueConstruct = {
textChannel: msg.channel,
voiceChannel: voiceChannel,
connection: null,
songs: [],
volume: 100,
playing: true
};
queue.set(msg.guild.id, queueConstruct);
queueConstruct.songs.push(song);
try {
var connection = await voiceChannel.join();
queueConstruct.connection = connection;
play(msg.guild, queueConstruct.songs[0]);
} catch (error) {
console.error(`I could not join the voice channel: ${error}`);
queue.delete(msg.guild.id);
return msg.channel.send(`I could not join the voice channel: ${error}`);
}
} else {
serverQueue.songs.push(song);
console.log(serverQueue.songs);
if (playlist) return undefined;
else return msg.channel.send(`โ
**${song.title}** has been added to the queue!`);
}
return undefined;
}```
function play(guild, song) {
const serverQueue = queue.get(guild.id);
if (!song) {
serverQueue.voiceChannel.leave();
queue.delete(guild.id);
return;
}
console.log(serverQueue.songs);
const dispatcher = serverQueue.connection.play(ytdl(song.url))
.on('end', reason => {
if (reason === 'Stream is not generating quickly enough.') console.log('Song ended.');
else console.log(reason);
serverQueue.songs.shift();
play(guild, serverQueue.songs[0]);
})
.on('error', error => console.error(error));
dispatcher.setVolumeLogarithmic(serverQueue.volume / 100);
serverQueue.textChannel.send(`๐ถ Start playing: **${song.title}**`);
}```
please
What is the error?
stop command and skip command console erro```js
(node:25032) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'destroy' of undefined
at Query.<anonymous> (/home/dc/chino-chan/muscibot.js:113:49)
at Query.<anonymous> (/home/dc/chino-chan/node_modules/mysql/lib/Connection.js:526:10)
at Query._callback (/home/dc/chino-chan/node_modules/mysql/lib/Connection.js:488:16)
at Query.Sequence.end (/home/dc/chino-chan/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query._handleFinalResultPacket (/home/dc/chino-chan/node_modules/mysql/lib/protocol/sequences/Query.js:149:8)
at Query.EofPacket (/home/dc/chino-chan/node_modules/mysql/lib/protocol/sequences/Query.js:133:8)
at Protocol._parsePacket (/home/dc/chino-chan/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/home/dc/chino-chan/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/home/dc/chino-chan/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/home/dc/chino-chan/node_modules/mysql/lib/protocol/Protocol.js:38:16)
(node:25032) 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: 3)
(node:25032) [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.
its still destroy
pause not working
u r using v12?
yes

i don't see anything here that is related to a skip or a stop command
I dont get it at all.
Where did you get the Information from to put destroy instead of end?
stupid question, but do you import Discord.js?

There are no stupid questions
i have the latest version discord.js node.js
My code doesn't work :
const DBL = require('dblapi.js');
const = new dbl(nnkkkkc, { webhookPort: 5000, webhookAuth: 'myPassword'});
dbl.webhook.on('vote', vote => {
message.channel.send(`${vote.user} a votรฉ pour BryXou | +1`);
});```
Why
yes
But do you import it into your Command?
@regal saddle yes
How do you import it?
CTRL+C CTRL+V ๐

im confused
Me ?
@earnest phoenix please go to #topgg-api and ask your question again ๐
Hedi, 2 Questions.
- Did you own that Code, like did you wrote it? Or is it just Copy Paste?
- You are trolling.
- I wrote in V11
2 i am not trol
how can i make jsdoc global objects to their mdn link?
i want the problem solved
Why are you trying to use a v11 written code in v12?
i say i wrote at v11 and i want to rewrite it to v12 because i don't want to rewrite it from scratch
i am only stuck in this part and i don't know how to solve it so please ask for help
@earnest phoenix are you blind?
go and learn the basics of any language and then make a bot
message isn't defined in that scope
this is the problem of copying code
@slim heart https://jsdoc.app/tags-external.html
Identifies an external class, namespace, or module.
is there a repo or something that i can copy and paste like all of them lol
Assuming javascript, go here https://learn.to.code.lmao.cx
So I have the code ready for my bot to be having a rotating status, but it is erroring out under "Cannot access 'status' before initialization'. I am not sure why, could I get a little assistance?
Can you show some code.
It means you tried using the variable before it was initialized.
client.on('ready', () => {
console.log('Ready to RP!')setInterval(function() { client.user.setActivity(status, {type: "WATCHING"}) let status = [ `${client.guilds.size} Servers!`, `RP Commands for realism!`, '/help', `Owned and Coded by Cody!` ] }, 5000);});
This is my code, but I am not using the variable before its ready however.
Show error
Interesting, can you go to the line where the error is occurring, as it doesn't seem that would be where it's happening.
@earnest phoenix is that directed at me?
Well since you said "copy paste" pretty much yes, also directed to Twixty
I think I see why, I have my console.log('ready') before that code.
Here is the error.
if you read one message above it you'd see it's about jsdoc and it's really just because i've been documenting for the past 2 hours and dont want to do repeated mish mash if it's already out on the internet.
also posting "learn to code lmao" is literally the most useless thing especially if you don't even pay mind to the conversation and not know if they are or not, not to mention literally 50 minutes later for the other guy
all you're doing is taking mind from the help so how about you just don't
How about you stop wasting your time with that message and just ignore it if it doesnt suit you
you were literally talking to me lmao, and again, you're just adding more space between someone looking for answers with useless links
"Useless"
literally links guides to code for people
dms
Bruh hes literally dming me over one goddamn message smh
why dont you both just stop?
Because you said 1 Thing and vim is tilted about that?
Be civil guys, let's not get heated.
My question has been resolved.
let web = message.channel.createWebhook(message.author.tag, "")
web.send("Test")
This isn't working. Can someone give me an idea why?
nvm lol
i just removed let and used .then
you can either let web = await or do a .then
because it returns a promise you need to wait for it to return or once it returns you can execute code
you should know that await pauses execution of the next code, if there is any, but .then will run through it like normal going back to the function in the .then when the promise is resolved
it says RichEmbed is not a constructor? why?
RichEmbed was deprecated and removed in favor of MessageEmbed in v12
it's basically the same
I got the error that (node:15140) UnhandledPromiseRejectionWarning: TypeError: message.author.displayAvatarURL is not a function
What's the correct function for 11.6.1
What should I update it to?
1 sec
@amber fractal so does that mean all RichEmbeds should be switched to MessageEmbed?
Yes
@astral yoke instead of it being a function it's just a property, so .displayAvatarURL and not .displayAvatarURL(...)
I have:
message.author.displayAvatarURL(...)
And it says that ) is unexpected.
@amber fractal
remove (...)
^
You said you're on 11.6.1?
do you have message.author.displayAvatarURL(...) or message.author.displayAvatarURL()
it should be neither on 11.6.1
Whoops
Thanks.
I get the same error.
Unhandled rejection TypeError: message.author.displayAvatarURL is not a function```
description:
`You did not provide the \`username\` argument.\n` +
`\n` +
`Usage: ${client.config.prefix}getinfo <username>`,
author: {
name: message.author.tag,
icon_url: message.author.displayAvatarURL
},```
did you save
either you didnt save the code
is that the correct line?
or the error is coming from somewhere else
I have autosave on.
Still need to restart the bot
at C:\Users\Cools\Downloads\qbot-master\commands\getinfo.js:31:44
show error stack
or reload the command
Coming from the command. @quartz kindle
Unhandled rejection TypeError: message.author.displayAvatarURL is not a function
at C:\Users\Cools\Downloads\qbot-master\commands\getinfo.js:31:44
at tryCatcher (C:\Users\Cools\Downloads\qbot-master\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\Users\Cools\Downloads\qbot-master\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (C:\Users\Cools\Downloads\qbot-master\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (C:\Users\Cools\Downloads\qbot-master\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (C:\Users\Cools\Downloads\qbot-master\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (C:\Users\Cools\Downloads\qbot-master\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (C:\Users\Cools\Downloads\qbot-master\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (C:\Users\Cools\Downloads\qbot-master\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (C:\Users\Cools\Downloads\qbot-master\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (internal/timers.js:444:21)
did you restart the bot?
Mhm.
can you send more of the code, maybe 1-40 line
That's some of it.
learn the basics of programming scltxn
and then make a bot
A question Is there a way to make audio processing fats using the ytdl-core
I came here for help not to get told I need to do some type stuff, I'll worry about it on my own. Thanks.
the error says that on line 31 of getinfo.js you have a displayAvatarURL() when you're not supposed to
errors dont lie, so either you didnt save the file, or the bot is still running on an older file
What do you mean by "type stuff"?
you do you scltxn
I fixed it. Thanks.
https://nmw03.is-inside.me/0aPSLcHC.png
how can I get ping for twitter like this. hrtime() ?
make a request to it and measure the time it takes i guess
hrtime(), yes?
there are many ways to measure time
hrtime(), console.time(), performance.now(), Date.now()
ty
if(message.content.toLowerCase().includes(swear)){
Is there a method i can use instead of includes? I have a swear list, and when I say bypass it will delete the message for swears. Can I get a swear word alone or prevent this from happening all the time?
to match only words, first split the message by spaces
then for each element, check if it exists in the swears array
^
how to make it so my ban command will only go through if they have permission kick members
which lib
ok
@still lily that's javascript not java
OK
@summer torrent but how do i check the permisions of who sent the message
https://gyazo.com/740a47d90933710cd14d835c975a6f36
@still lilymessage.member.hasPermission()
thank
not message.author
how might one get an update for their bot on the website
for changes have been made
just edit the website
kickUser(id) {
return this.client.guilds.cache.get("538582970752172034").members.cache.get(id).kick();
}``` error ```(node:711) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'kick' of undefined
Did I did something wrong
have you tried reading the error
nvm fixed it
Hello.
Hello
I have a problem with bloxlink.
Is it possible making a custom welcome message? Like a command where the people can customize the message etc etc
yes
hey anyone knows how to use async in this
module.exports = {
name: 'ping',
description: 'Ping!',
execute (message, args) {
const m = await reply("Pong!");
m.edit(`*${m.createdTimestamp - message.createdTimestamp}ms*`);
};```
I know it's a noob question
@earnest phoenix if you want to make the execute property in the module a function, do:
execute: async function(message, args) {
// code
}
async execute
you also need a }, to handle the execute
^
or you can do it separately
module.exports.execute = async function(message, args) {
// boring stuff
}
if you hate doing it in json format
เคฐเคเคค เคฎเคฟเคถเฅเคฐเคพ#8573 learn the basics of oop
Can someone fetch the owner of this guild??
538361750651797504
oh no, unless someone's bot is in there bots don't have access to all guilds
My bot is in
you can then
var guild = await client.guilds.cache.get("538361750651797504")
console.log(guild.owner.user.username)
Ah okay thanks
well you'd have to tell us more info
@amber fractal
Discord.js@12.1.1
Node@13.x
guild.owner can return null btw
check if guild is available
use the ownerID property, which will return the id of the owner regardless of cache https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=ownerID then fetch from that using <Guild>.members.fetch(theId) which will also, by default, cache it
I believe fetch internally looks through cache first
I'll have to look
so fetch will return cached result if possible but if not, fetches it from discord and then caches it (by default)
Okay, NVM, that would be breach of privacy
Well I am trying out MongoDB for Python and I've been reading docs on it and whatnot but I am getting the error pymongo.errors.ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused Is there a certain port that I have to connect to that is specific to my system or what am I doing wrong. The error is basically telling me that the connection times out and refuses to connect.
Guys, how do I call a file outside of a folder?
e.g.
My command is in app/cmd/*.js
and I want to call app/db.json
.. folder
ie ../../db.json should work
Guys, I am making a reaction ticket system w/ multiple departments but when I click on one option, the bot creates a lot of tickets
Any solution?
Ping me if you need more info. or have the solution
something is running recursively (in a loop)
i assume the channel names don't have suffixes so i'd say go back to your reaction code and check to make sure you aren't creating a channel more than once
ok so currently i have configurable prefixes for servers
when you send a message it checks to see if there is a value for a key of the guild ID exists in an object
if it doesnt it checks the database and if it finds it it adds it to the object and if it still doesnt exist it creates it from a template and then adds it to the object before running the message
is this efficient?
too many guilds will use up too much memory or am i just worrying myself here?
the way I do it is when a message gets sent I would check if the guild is in the database for custom prefixes if not it will use the bots default prefix
and then you just check the other stuff like
startswith prefix and so on
all the basic stuff
how do you guys approach coding commands with optional parameters? like prefix+command+(optional)
async def commandname(ctx, required, optional = None)
if you use the superior language
:p
That's possible in most languages tho. Zerp I'd check if the parameter exists and if it do something
undefined is the default value anyways /shrug
notice: do shrug at the beginning of your message it appends it
client.on("voiceStateUpdate", async(oldState, newState) => {
if(!oldState.channel || !newState.channel) {
return;
}
let Before = oldState.channel.members.filter(r => { return r.user !== client.user});
let Now = newState.channel.members.filter(r => {return r.user !== client.user});
if(newState.channel.members.has(client.user)) {
setTimeout(async() => {
if(Before.size <= Now.size) {
console.log("hi")
const player = await client.music.players.get(newState.guild.id);
if(!player) return;
player.textChannel.send(`The queue has been cleared and leaving channel due to no one listening.`);
client.music.players.destroy(message.guild.id);
}
}, 1000);
}
});
help idk why it isn't working OOF
what is error i cant read
just showing the code won't help
well no error it doesn't work
(most of the time)
hmm
anybody Know how to get 24/7 free hosting
excuse me
you can use glitch or heroku but its not recommended if you actually pay a few dollars a month for a vps you will notice the difference @charred cargo
there's botghost though
thank you
i don't use it but i've heard of it
botghost is a bot designer
i use bdfd
mhm
@woven sundial jeu[0].title
The object is inside an array
gplay.search is a promise
if you use async you can get the results in a variable
but in sync you can just do the function and then use then to get the value instead
my explenations are shit but I think you understand what I mean
yes
wh
this confuses me
why areyou trying to .then the promise when you're already in async
:')
what you did
const jeu = await gplay.search({
term: args,
num: 1
}).then(console.log, console.log);```
what you should do
```js
const jeu = await gplay.search({
term: args,
num: 1
})
console.log(jeu[0].title)```
oh and if you use .then ever again in another command just put one console.log please
Also
(async () => {
try {
const jeu = await gplay.search({
term: args,
num: 1
})
}catch (error) {
return message.channel.send(":arminerror: ERREUR : Je n'ai pas trouvรฉ "+args+" sur le Play Store"); }
})
``` Will never execute I think
Because you wrap the code inside a function which you never call
why the uncalled iife
It's unnecessary, but if you want to keep it put () at the end so you call it
At the end of the function ๐
idk why you're wrapping it in a separate function but yeh
iara
when you're done here, couldnt by any chance help in #topgg-api i dont know enough js to help with the 400 error
how could i investigate why my bot goes down randomly every now and then
is d.js v11 the problem?
Make sure you listen for errors and disconnect events
fair
Shards keep disconnecting without any error message since this https://discordapp.com/channels/264445053596991498/637358847543214080/695381286281281568
I mean
In Eris it'll put the error as null
Might be handled differently in discord.js
It broke my disconnect handler cuz I wasn't expecting it to be null
ill probably just take it as maintenance as im updating constantly
hope it doesnt shut down during testing though
my bot is not sharded and the issue has been going on for far longer than that
have you gotten any errors in that time
Is secure to generate random password, add this to bot's and backend REST API .env and then in API check equality for authentication?
error messages*
ill just check the docs to see if there's any way to catch ยฏ_(ใ)_/ยฏ
do you have something like this in your code just to check
you can probably get a code from it
make it right now!!!!
btw you dont need to update to v12 for that, but you can if youd like
i know i dont
"Ratings":[{"Source":"Internet Movie Database","Value":"7.3/10"},{"Source":"Metacritic","Value":"71/100"}],
So Ratings[0].?
If i wanna get both
[0] will get the first one
yes
use something like https://jsonformatter.curiousconcept.com/ if you don't understand the structure
how do we allow the last line?
you dont lol, its a discord joke
^
it would be very concerning if you went to bed and a bot starts reading you a story
Audible bot when
this message was sponsored by audible
an amazon company
Lol
if I do require('./src/events/vote.js')(vote,client) in my index.js it returns "require is not a function". here is the full content of vote.js : https://lumap.is-inside.me/kdATlegE.png
with or without async
show code in index.js
wtf
(of course its a different file with message)
console.log what the require returns
so i started my discord server after not using it for a couple months
it randomly wont connect to discord servers
Then I realised none of mine would start
I will post the code below of the most simple bot that wont connect
it gets past the two console.log at the beginning
it shows up on discord but thats it
nothing happens in client.on
discordjs version?
discord.js 12.1.1
npm 6.14.4
nodejs 13.12.0
no errors or anything?
no errors
just the two console.log at the beginning and the active bot on discord without the .setActivity
i know its in a few
try this
client.on("raw", r => {
if(r.t !== "PRESENCE_UPDATE") { console.log(r.t); }
})```
it just randomly started working...
Can I change text colour in an embed?
no
yeah ik its annoying
Rip
thank u discord for making TITLES UNREADABLE
Thank you discord, very cool
epic
just post your question
and he never posted it.
for some reason when I restart my bot or my bot crashes, it doesn't turn back on, and I would have to wait 5-10 minutes of it being off just to turn it back on, is there a way to fix this? (discord.js)
Well
after like, some minutes
it tells me "Something took too long to do"
I do catch the error though, so it doesn't just restart
check if the process id is valid?
or, try to get the exe and if it can't find it, there
I don't know a whole lot about C# even though I use that in Unity
is there any more efficient way of doing this?
tmp = []
message.channel.send("Finding Servers...").then(m => {
message.client.guilds.cache.map(async (g) => {
guildDB = await message.client.db.fetch(`guild-${g.id}`)
if(!guildDB) guildDB = {"joinCount":0}
if(guildDB.joinCount > 0) {
console.log("Server elligible")
if(!g.members.cache.has(message.author.id)) {
console.log("Not In Server")
channel = getDefaultChannel(g)
channel.createInvite().then(invite => {
console.log("Creating an invite for " + g.name)
tmp.push({"invite":invite.url, "name":g.name})
})
}
}
})
setTimeout(() => {
embed = new Discord.MessageEmbed()
temp = tmp.length > 0 ? tmp : "You've Joined All The Servers On The List! Please Wait A Day For More Servers To Be Added!"
if(!Array.isArray(temp)) return message.channel.send(temp)
console.log(temp)
temp.map(invite => {
embed.addField(`${invite.name}`, `${invite.invite}`)
})
message.channel.send({embed})
}, 1000)
})
}```
basically any guild with a database joinCount of over 1
will get in the list of invites
does djsv11 have raw events too?
oNly oNE waY To FInd OuT
docs smh
@mystic violet yes, for starters dont use .map, thats not what its designed to do, also dont declare tmp outside if you're only using it inside the block
I don't think you can do anything before a file is opened
@grizzled raven yes it does
oh ok
okay Tim thank you
Because an antivirus is running in a background
you would need another program running in the background to check the files you open
Hi I have problem adding a stream username, I did it several times with no problem both this specific username there's a problem with
You should visit the Live Bot support server then
That's not my bot I'm not a coder just try to plug and play it
then you're in the wrong server
-botinfo @high forge
334870738257444865
Live Bot
5263
Notify your Discord when a Streamer goes live
@Live Bot
54
2
3279 Servers
@cinder vigil
Invite | Website | GitHub | Support Server
Click support server ^
Ok thx
264811613708746752
Luca
1375
Luca is a bot for managing and informing members of the server
discord.js
- or @Luca#1375
262
1
2 Servers
@fossil oxide

@languid dragon 
@bitter sundial 
Invite | Website | GitHub | Support Server
yep, we want people to use it.
wrong channel sorry
I get discord.richembed is not a constructor. Pls help
what version of discord.js are you
using?
12.1.1
you can use Discord.MessageEmbed
Ok
I'm trying to add roles with member.edit(roles=rolesToAdd) with rolesToAdd an array of roles, but it says "DiscordAPIError: Invalid Form Body"
Anyone know what this means?
you did something wrong with the embed
Huh, which embed?
Are you sure that's where the error is coming from
uhh pretty sure its cause member.edit is like member.edit({ roles: something })
I'm pretty sure
But I just thought of using member.roles.add instead
And that seems to work fine
yea do that
Email Logo:
<svg width="24" height="18" viewBox="0 0 100 75">
<path d="M100 62.5c0 2.2-.6 4.2-1.6 6L66.8 33.2 98.1 5.9c1.2 1.9 1.9 4.2 1.9 6.6v50zM50 39.6l43.5-38c-1.8-1-3.8-1.6-6-1.6h-75c-2.2 0-4.2.6-6 1.6l43.5 38zm12.1-2.3L52 46.1c-.6.5-1.3.8-2.1.8-.7 0-1.5-.3-2.1-.8l-10.1-8.8-32 35.8c1.9 1.2 4.2 1.9 6.6 1.9h75c2.4 0 4.7-.7 6.6-1.9L62.1 37.3zM1.9 5.9C.7 7.8 0 10.1 0 12.5v50c0 2.2.6 4.2 1.6 6l31.6-35.3L1.9 5.9z"></path></svg>
Twitter Logo:
<svg width="24" height="19.4976" viewBox="0 0 250 203.1">
<path d="M78.6 203.1c94.3 0 145.9-78.2 145.9-145.9 0-2.2 0-4.4-.1-6.6 10-7.3 18.7-16.3 25.6-26.5-9.4 4.1-19.3 6.9-29.5 8.1 10.7-6.4 18.7-16.5 22.5-28.4-10.1 6-21.1 10.2-32.6 12.4C191-4.5 158.5-5.5 137.8 14c-13.3 12.5-19 31.2-14.8 49C81.9 60.9 43.4 41.4 17.4 9.4 3.8 32.8 10.7 62.8 33.3 77.8c-8.2-.2-16.1-2.4-23.3-6.4v.6c0 24.4 17.2 45.4 41.2 50.3-7.6 2.1-15.5 2.4-23.2.9 6.7 20.9 26 35.2 47.9 35.6-18.2 14.3-40.6 22-63.7 22-4.1 0-8.2-.3-12.2-.7 23.5 15.1 50.7 23 78.6 23"></path>
</svg>
ok?
Bruh why post the svg when you could have just posted the image
@prime cliff Twitter is the Normal twitter logo from twitter xD
but wai
In Discord bot list long description, how do you do a newline? Everything is on 1 line for me
-bots
@earnest phoenix if you're using MD, do a double new line
if you're using HTML, then do <br>
Ok thx
-bot info @gilded plank
Can i set bot Avatar per guild?
no
I saw a bot like this
Bots are users and users can only have one avatar
?membercount
!membercount
.membercount
.serverinfo
No testing here @earnest phoenix
It probably used a webhook @charred jetty
@charred jetty they are probably different bots with same name
Most likely a webhook
@finite bough it can be possible?
But the description was saying that it is the only bot which can set Avatars and names per guild
Then it's lying
can u tell me the bot name
It can either be done by all bots or by none
And it's probably just using a webhook to make it seem like it's changing pfp and name
anyone have a good bot creation youtube video i can watch :)
Im trying to create a auction bot on my server
Threebow does good ones
๐ thanks!
I'm going to be honest with you, any discord.js on yt is outdated or has bad practices.
Best you just follow the guide https://discordjs.guide/
@drowsy sentinel that's true...
If you go on yt on search for a good discord.js tutorial... All of them are outdated...
Threebow has good examples though, they helped me learn the basics before I went off on my own
Ofc they would be outdated if a big version release such as v12 comes out
I disagree, I have seen Threebow and there are quite a few poor choices.
Discord.js has also been updated so his videos are marked OUTDATED.
Oh yeah I'm not saying the code is good, I've changed up most of the code I came up with from his videos
They were helpful in their own way tho lol
The guide is more helpful, tbh.
Yeah I agree
It shows you how to setup an effective bot with room for growth.
hmmm true i just need to learn the basics and go from there, like all i need to do is make a bot that can set auctions on my server. somehow posts an item for auction for like 24hr timer, and people can bid on it etc
im hoping its not terribly hard to do hahah




you should be awaiting it