#development
1 messages · Page 853 of 1
idk msg.client looks weird
client.channels.cache.get
i got it on heroku
what library are you using
yee
sammy: asks for lib
white name: heroku
i asked for lib but ok
How would I set platform in discord.js like @cedar kite
(on mobile)
Im gessuing Presence
.clientStatus?
wtf you can do that?
@red hollow You're a legend Im quite stumped lol
yep
but idk about setting it
stupido question
how do i get shard id
you cant easily, you basically just have to use fetchClientValues
on d.js sharding manager?
internal sharding
and then each object in the array is the shards in order
that works for guild
idk i use shardingmanager
msg.guild.shard.id works
yea
im messing with shard stuff
yea

there is no easy way to get the shard idea from client anymore
its stupid
which is why im making my own lib
speaking of sharding
do you know why i cant use it ?
i get (node:15046) UnhandledPromiseRejectionWarning: Error: Shard 0's Client took too long to become ready. error
with all shards
with every tokens i try
change timeout
discord only allows 1 connection per 5 seconds
it can be caused by server not being available too @twin iron
and thats why bots with lots of shards take forever to boot up
and how i change it ? x)
yeah it sucks
@twin iron get a better connection if your problem is bad connection
well
client.ws.ping = average from all shards
wait really
so if the sum of the shard pings is uneven you get .5
i thought client.ws.ping == client.ping (like avg for current shard)
hm
im talking about internal sharding
oh
client.ws.shards = collection of shards
i did msg.guild.shard.ping
https://nmw03.is-inside.me/iO2mnqd7.png
I want to connect my server via vscode but I get this error
Well what command did you do
this is remote development extension
ah no idea what that is. Sorry
error is right there
I get such a mistake in glitch suddenly
Error ; const Discord = require('discord.js');
You dont have the package installed
11.4.2 is old
So i have a command that pulls and fetches random memes from subreddits... And it works fine but when i do it to fetch (other stuff) commands that can only be used in nsfw channels from their own subreddits...
It hits me up with this...
What's the issue here?
404 not found
It didn't find the page, it seems like.
Hmm but the all the subreddits and and pages i stored are completely correct tho...
Maybe it makes a prompt which disallows for it to find what you're looking for? because it's nsfw
debug
step through your code, log at every closure, inspect your variables; debug - find where the issue is occuring
we can't magically know
Hmm... It's suspicious when it works fine for memes but for nsfw stuff that can only be used in nsfw channels...
Welp... Wanna see the code anyways?
it wouldn't really be of use
Hmm...
the most i can tell you from your code is around where the error is happening
It happens because it can't find the page i stored it... But why when the pages are correct and i can access from a browser...
Welp time to figure out what's wrong...
add a catch to the html request and log the exact url being requested
K lemme try that
@quartz kindle hmm... Suspicious + the command was requested by 10+ ppl so i decided to make it... Don't worry about it...
@quartz kindle also... I can show you the code if you want...
that url gives me 404
@quartz kindle all of them gives me 404
https://hastebin.com/otiqotopan.js
i dont know what is wrong but the duration and author wont work
Oh you mean those links? @quartz kindle
You mean the subreddits or the json file paths or something?
Also
No luck
Idk like how the meme ones works flawlessly but these... They don't work no matter what...
are you intentionally fetching subreddit urls from imgur?
Hmm idk... Lemme show you something real quick...
like imgur.com/r/whatever
that doesnt sound valid, but idk how imgur works with their urls
@quartz kindle top one is meme one which works flawlessly but bottom one is nsfw one which is the one that doesn't work... Hmm...
whats randomPuppy?
It's a module that fetches random images from the stored subreddits...
@quartz kindle it's actually called random-puppy but i did:
const randomPuppy = require('random-puppy');
i looked at the source code and made some tests
looks like the nsfw subreddits are blocked by imgur
so nothing you can do about it
Hmm... That would make sense
But hmm... Then no luck on fetching and pulling nsfw random images...
Welp rip...
use a different api
Hmm... I might try... But anyways... Thx for the help... @quartz kindle
Anyone know what I could do to get the bot to DM multiple people the reportEmbed? I have it set to one id and I have tried multiple things with no success. Thanks
@unborn fulcrum could just send the client.users.get twice then return
over returning on that line
So in the footer i set my bot to show the time when the command was used...
But shouldn't the time should be as same as my time in top left?
(Footer time in the bottom right)
var time = today.getHours();
var timeM = today.getMinutes();```
And the code that was used in the footer was this:
```Today at ${time + ":" + timeM}```
instead, do .setTimestamp because that will change every minute and day where a text based one will not
@crimson vapor what should be inside the .setTimestamp()?
well you can use a date or just leave it blank
how can I set probability for random items? for example: green - 49 %, black 49 %, white - 1%
and the leftover 1% is the chance of getting swallowed by thanos
the easiest dirty way would be to fill your array with the n amount of items that matches the probability
3:36 am brain no work help
if (collected.first().content === channel.type('text')) {
ok so
i am trying to make it so that users can
aaaa i'm not even motivated to explain my problem nevermind
hoister what is problem
for a feature that has to keep track of users that has reacted to reactions, do you think its better to have the users in a collection, or
hhhh nevermind im just getting frustrated lol
Someone pls help
@earnest phoenix channel.type is not a function
@copper cradle im new to vps
channel.type is a string
oh and hoister id recommend you remove the channel.type since you dont need it
it creates (or is) a collector in only that channel
LOL
is it possible to send Embedded messages across shard?
broadcastEval i guess
yeah I figured it out
I am having a small problem starting up my bot...
I get this error
2020-04-04T03:31:23.428788+00:00 app[worker.1]: internal/modules/cjs/loader.js:985
2020-04-04T03:31:23.428822+00:00 app[worker.1]: throw err;
2020-04-04T03:31:23.428822+00:00 app[worker.1]: ^
2020-04-04T03:31:23.428823+00:00 app[worker.1]:
2020-04-04T03:31:23.428823+00:00 app[worker.1]: Error: Cannot find module './BitField'
2020-04-04T03:31:23.428823+00:00 app[worker.1]: Require stack:
2020-04-04T03:31:23.428824+00:00 app[worker.1]: - /app/node_modules/discord.js/src/util/Permissions.js
2020-04-04T03:31:23.428824+00:00 app[worker.1]: - /app/node_modules/discord.js/src/client/Client.js
2020-04-04T03:31:23.428825+00:00 app[worker.1]: - /app/node_modules/discord.js/src/index.js
2020-04-04T03:31:23.428825+00:00 app[worker.1]: - /app/jonin.js
I've already reinstalled my node_modules, and i am on discord.js v11.6.2, I want to stay on v11 until i can fully convert my code to v12
I probably am an idiot for asking this, but are there any good databases to use with Python?
Hi can someone help me with meta tags please
I'm trying to do the thumbnail part like in the above link
But ended up like this
@undone carbon code?
yo
<% if(guilds.length == 0){ %>
<h2>No Servers to show.</h2>
<% } %>
<% else{ %>
<% guilds.forEach(function(guild){ %>
<h2><%= guild.name %> </h2> <img src="<%= guild.icon %>">
<% }) %>
<% } %>```
Error is `SyntaxError: Unexpected token else in D:\Moto Moto\Web Dashboard\views\profile.ejs while compiling ejs`
ejs, any idea why its not working?
How do you guys handle 502? Should I just ignore it?
2020/04/03 07:25:59 Reason: Exceeded Max retries HTTP 502 Bad Gateway,
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>502 Server Error</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Server Error</h1>
<h2>The server encountered a temporary error and could not complete your request.<p>Please try again in 30 seconds.</h2>
<h2></h2>
</body></html>
How to convert hex ????
toString the number it with the value of 16.
You can also just do <MessageEmbed>.hexColor
Btw, @tight plinth thanks for yesterday, I migrated to Google Cloud as well because glitch has some*** issues***. My brother literally complained like heck on glitch support XD.
https://support.glitch.com/t/installing-issues-for-discord-bot-in-npm/21444/11
wow
lol
is it possible to get info about what timezone a given user is in?
maybe google can
Can you elaborate
Hey! @pale vessel I'm not an idiot!
we need output
@high bough noone said you are?
use eval with args, clean this string and send the output, done
Would this work?
module.exports = {
name: "eval", //command name
async execute(client, message, args, Discord, config, eco, leveling, db, avatarURL, footer, clientname, NL3Embed, DevEmbed) {
///Command Starts Here
function clean(text) {
if (typeof text === "string")
return text
.replace(/`/g, "`" + String.fromCharCode(8203))
.replace(/@/g, "@" + String.fromCharCode(8203));
else return text;
}
if (message.author.id !== config.ownerID) return;
try {
const code = args.join(" ");
let evaled = eval(message.content);
if (typeof evaled !== "string") evaled = require("util").inspect(evaled);
message.channel.send(clean(evaled), { code: "xl" });
} catch (err) {
message.channel.send(`\`ERROR\` \`\`\`xl\n${clean(err)}\n\`\`\``);
}
}
};
try it and see
🤔
Yeah, well, sorry?
make an object and destructure it
that's what i do
const { embed } = require("functions.js")
that is a mess
i just attach certain things to my client
i just "activate" my functions in another file
-bots
<Client>.ping was removed in v12
You can check the API Latency with <Client>.ws.ping
@twilit rapids done
how to make bot leave voicechannel if no one on vc except the client on voiceStateUpdate
😅
i am not able to do it
Language?
discord.js
Version?
v12
Ok
Hi all, I have a really quick question about the practicality of idea I have, would it be possible for a bot to look at the membership of a voice channel and put that into a array. I believe I'd have to hardcode the name of the channel into the bot but i'm fine with that. Was thinking about using Discord.js but open to suggestions if there's a easier way.
Hey
ctx.arc(520, 960, 100, 0, Math.PI * 2, true);```
what 100 and 0 are ?
3rd and 4th values
Found this: context.arc(x,y,r,sAngle,eAngle,counterclockwise); on this https://www.w3schools.com/tags/canvas_arc.asp
same
its the image radious
i got it but i have another problem now
how to make bot leave voicechannel if no one on vc except the client on voiceStateUpdate
on discord.js v12 pls help
i got a picture which is 1040, 1920 and i created the canvas but the picture is sideways
Hi all, I have a really quick question about the practicality of idea I have, would it be possible for a bot to look at the membership of a voice channel and put that into a array. I believe I'd have to hardcode the name of the channel into the bot but i'm fine with that. Was thinking about using Discord.js but open to suggestions if there's a easier way.
@lofty jolt nvm found the .members property that's what I was looking for
anyone know why the canvas is sideways?
how to make bot leave voicechannel if no one on vc except the client on voiceStateUpdate
on discord.js v12 pls help
@earnest phoenix
what if you use the old state from the voiceStateUpdate event. then from it, u can access the voice channel, then check the members and see if the bot is the only one left
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 => r.user !== client.user.id);
if(newState.channel.members.has(`${client.user.id}`)) {
setTimeout(async() => {
if(Before.size < Now.size) {
const player = await client.music.players.get(newState.guild.id);
if(!player) return;
if(!player.playing) 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);
}
});
will this work?
try it and see
hey, does any1 knows how can i toggle on a checkbox by default in html?
<input type="checkbox" value="On"/>
``` and its still off. any idea why?
@earnest phoenix some file types don’t hold orientation data so for that file type you could just rotate the canvas
@pallid marsh
<input type="checkbox" value="On" checked/>```
ok
@compact tundra how do i rotate?
angle is not defined
so after that rotate back
bro angle is angle you’re rotating the canvas by
ctx.rotate(20 * Math.PI / 180);
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
ctx.rotate(angle * Math.PI / 180);
i will use 20 then
isnt the canvas supposed to be the size i used?
1040 1920
oh got it
it s 1920 1040
Generally for discord bot websites, is bootstrap used?
I don't mean DBL, I mean like websites which you can use to control bots
ie. the UI of the bot
heyo, if any sysadmins here can find me where I can get nginx ngx_mail_auth_http_module.so it would be greatly appreciated
So i have a serverinfo command but if you see the verification lvl...
How can i change the names of the verification lvls:
NONE
LOW
MEDIUM
HIGH
VERY_HIGH
To something else?
you'd need to check what it is like
if(verification === "NONE") {
verstring = "No verification";
}```
Hi
yo, if i make my invite link like that: https://discordapp.com/oauth2/authorize?client_id=691584715513266256&permissions=473033847&redirect_uri=https://motomoto.fun/thanks&response_type=code&scope=bot
with the response type, but i just redirect to a page without a code after adding the bot, is it ok? cuz without the response type its not redirecting. is it ok?
Is this your bot invite
yes but like i just asked something i dont wanna advertise my bot lol
just asking a question
any one knows if its ok?
ok
if it doesnt redirect to nsfw or illegal
no its just a thanks for adding the bot
@spiral mural https://top.gg/newbot
its fine then
ok
Thanks
^oof
oh well
2020-04-04 02:55:28.970+0000 INFO org.javacord.core.util.gateway.DiscordWebSocketAdapter Websocket closed with reason 'Discord commanded a reconnect (Received opcode 7)' and code COMMANDED_RECONNECT (4999) by client! {shard=0}
the new stuff with the opcode eh?
@earnest phoenix yup #discord-news
i'm like "why is my bot going offline everytime" 
then i remembered the opcode stuff
Hey. I've got a question about Discord JS. As others (and I) have experienced, the guildDelete (and directly after that the guildCreate) events sometimes got emitted randomly. Someone suggested to make a data file with all guild id's in it, because the event itself is not fully trustworthy. So now, I have a piece of code that's checking joined and left guilds each two seconds. But does anyone of you know if something like this solves the bug too? (I can't check it, as the bug is very random.)
client.on('guildCreate', function(guild) {
// if the bot is already longer than 1 sec in the guild (it's a fake guildCreate), return
if (Date.now() - guild.joinedTimestamp > 1000) return;
// ...
});
client.on('guildDelete', function(guild) {
// if the guild is still available for the client, return
if (client.guilds.get(guild.id)) return;
// ...
});```
Would this work? I suspect the last one doesn't.
Always console.log print Leave
youre also not checking if oldChannel = newChannel
Hello does anyone know how I can run a nodeJS file using nodeJS but without using "require()"? The file I want to run has module.exports but I want to just run the entire file regardless of those
right so i got this error and i'm not sure why as i didnt touch the code to this bot for a very long time and it was working fine?
ETIMEDOUT literally means that the node script timed out while waiting for a response. Maybe you should just handle that case and retry.
Thats what the error means
wdym
this is odd since this has never happened
so why happen now
so suddenly
did i do something incorrect
Pretty much is asking for a request to the IP and was not receiving one
well try and diagnose where the error is coming from
i cant do that since it literally is coming from nowhere
bump because I still can't figure it out and every google search just comes up with how to run a nodeJS file in batch

Hello does anyone know how I can run a nodeJS file using nodeJS but without using "require()"? The file I want to run has module.exports but I want to just run the entire file regardless of those
you use require.
require('myfile.js')
just don't assign it to a variable
@earnest phoenix ^
if it has module.exports though then it just returns those
what about them?
it still runs everything
can't get module.exports without running the whole file 
so
doing ```js
variable = require('path')
**won't** run the file,
but
```js
require('path')
will run the whole thing?
it won't
because you can only run a whole javascript file if you aren't using module.exports
require does that
why not just placing it between module.exports things and execute() {}?
then you have line 3 to the end
If you want to do it without require, you can use the exec function in the child-process module
it will run in a separate process tho, not sure if you want that
can anyone look at this? https://discordapp.com/channels/264445053596991498/272764566411149314/695957709618413628 (message above)
try if (!guild) return;
Do you really think that will work? If it emits the event, I guess the guild is defined then
lol. You didn't even read what I said, did you? 😂
Well you can't really know until you wait and see tho, Menno.
of
but I'm hoping to see if someone of you already tried it, or had another way
because I can't afford latency for that, but it shouldn't contain bugs too
Hm
It seems to work if I am emitting the events by myself, but I don't know what that bug exactly does
Can someone help me with this error? https://discordapp.com/channels/264445053596991498/272764566411149314/695838769957437512
@visual sandal show code
But did you install that module too? (or is it a node module)
Error: Cannot find module './BitField'
of what? It doesn't show a source error in my code
it's part of the disocrd.js, so multiple files
./ means the project root though
best solution is to update
So why are you trying to load that in the project root shouldn't that already be loaded with your lib?
yea, const Discord = require("discord.js");
What are your other requires? also maybe try uninstall and reinstall discord.js with node package manager
Most of my files have this
const config = require(`../config.json`);
const Discord = require(`discord.js`);
const send = require(`../send.js`);
what about the files that need other modules, i assume you require them at the top too?
there is no better way to do that tbf
yea
?
can someone help me?
??
just state your question
it dont say nothing
aight not my language 
now work
i fix it
❤️
thanks
how can i use canvas with a gif?
What do you mean?
like i have a gif
i can that canvas procces it?
i want to do this
but with the logos
i do the logos
but idk how do it animated
anyone?
historically I've always done
client.emojis.get(botconfig.loading_emote);
but with recent discord-js changes (I'm now on version 12.x) they're requesting that we use
client.emojis.cache.get(botconfig.loading_emote);
which just returns undefined
I've found nothing helpful online about it yet
using the emoji id directly gives DiscordAPIError: Unknown Emoji
what is the emoji

as the api suggests, I'm literally just calling message.react('504515210455941120')
prob with <a:504515210455941120>
@late plank
one moment
im stupid
:emoji_45:
<:emojiname:emojID>
use it
replace emojiname to the emoji name
and emoji id replace it for the emoji id
and try it
but idk how do it animated
? can someone help me
@earnest phoenix yeah... that didn't do much
DiscordAPIError: Invalid Form Body emoji_id: Value "504515210455941120>" is not snowflake
what you put?
:compiler_loading:
discord makes it impossible to type exactly because they suck at formatting
@late plank are you trying to react with an emoji using the bot from a different server?
Like is your bot on that server?
@earnest phoenix thanks for making me realize
the beta version of my bot isnt in the server that has this emote
Stupidity +2
thanks
I was losing faith in discord.js there for a minute
btw quick lifehack
Yea... Always keep that in mind that your bot can't react with the stored emoji if the bot isn't in that server...
use a \ infront of an custom emoji to get its mentiontag
made my life so much easier
@earnest phoenix you can use :- before a custom emoji to do it too...
:-
nope
Huh?
: -
They need to be close :- not : -
:-
there
doesnt work
?
welp for android only then
\ is for pc
I think it's only Visible on mobile lmao
And yea
Boooooo
how do you convert a json object into a string that can be sent by post request
jquery at the moment just refuses to add the array containing a json string
can someone help me?
const embed111 = new RichEmbed()
.setColor(`#5780cd`)
.setAuthor(`Uhh, that Hurt`)
.setTimestamp()
.setThumbnail(attachment)
message.channel.send(embed111)```
idk what is wrong
scroll up and show the error
this is the most that i can scroll
not helpful
i think is this the error
ok
@sick cloud
but when i remove .setThumbnail(attachment) it work (but without the attachment) and when i do that it send it like a message and not like a embed it work
but i want it like a embed
because you can't set an embeds thumbnail as an attachment because its not a url
you can use attachfile though iirc
ok
should help you
.attachFiles([AttachmentObject]) possibly
show the new code
const embed111 = new RichEmbed()
.setColor(`#5780cd`)
.setAuthor(`Uhh, that Hurt`)
.setTimestamp()
.attachFiles([attachment]);
message.channel.send(embed111)```
isnt there a thing called setimage?
instead of attachfiles?
yep
but it was for links
welp, i have to js experience, only a little bit

ok
anyone?
You should be setting the thumbnail
Discord allows you to use attachment://filename in embeds
Wait what
needs to be attached first
Reading the docs would also help, first thing I saw is https://i.imgur.com/2QzHFRE.png
yeah, it works
?
Embed#setImage('...')
so I have a decoded dxt5 image buffer (decoded with dxt-js) and I'm trying to encode the buffer into a .png file. I tried many packages but no luck
Does someone know a package which can help me?
@spice pier
Embeds only use image urls not attachment://
Send a new snippet of your current code
I'm having an issue with the config.js
You're missing a comma
No i had everything right. But kept showing an error
You're missing a comma
add that comma and show the error
@prime cliff it works with those attachment urls too
Not attachment://
.-.
No
.-.
const embed111 = new RichEmbed()
.setColor(`#5780cd`)
.setAuthor(`Uhh, that Hurt`)
.setTimestamp()
.setImage('attachment://welcome-image.png');
message.channel.send(embed111)
return;
}```
Builderb, have you even tried it, so you're sure it doesn't work?
?
You aren't even sending the picture to discord
^
how do you want them to display it
into the embed
Also those are the Discord docs not lib docs
You are sending no images
.-.
They can't display something they dont have
and what i do?
you add the attachment to message.channel.send's options
Embed#attachFiles([...])
message.channel.send(embed111, {files:[attachment111]})
or that^
That's for the actual message not embeds
Embeds can't have attachments only image urls
@wheat jolt if i do it it looks like this
then its what alexander sent
K i went too far
Now you're missing a bracket
Nope I have it in, still an error
@raven urchin forgot } at the very end
Yea you did go a bit too far alex also i was correcting this
You can't use attachment:// in that
@raven urchin hmm that's strange...
It shouldn't give an error at all...
const embed111 = new RichEmbed() .setColor(`#5780cd`) .setAuthor(`Uhh, that Hurt`) .setTimestamp() .setImage('attachment://welcome-image.png'); message.channel.send(embed111) return; }```
@earnest phoenix you didn't attach the file
i attach it
const attachment111 = new Discord.Attachment(canvas.toBuffer(), 'welcome-image.png');
You didnt...
{
"token": "",
"prefix": ""
}```@raven urchin
no. you need to use attachFiles()
You need to send it as an attachment not in an embed
but i want the image inside the embed
@raven urchin wait... What does the error say?
yes you can
how?
Now it's working for some reason. @earnest phoenix
By using attachment://filename.png
yes
This is how I do it in GO
@raven urchin hmm... Did you forgot the comma at the first?
@earnest phoenix Read the Discordjs someone sent earlier
@earnest phoenix nope
Hmm @raven urchin that's a miracle or magic or something...
But it works then GG
i read all
that only happens to me when I put the wrong file extension
I'ma see if it comes online..
Wait you can actually
ye
I cant figure how I can get boosters list of a server
i used it with my qr buffer
(member list)
i've never seen anyone do that at all, attachments are normally seperate from embeds hmm
Intresting
@tight plinth See discord.js.org
@tight plinth You can check if the member has a non-null premium_since value
hmmm ok
Anyone had experience with mongoose/mongodb?
@pale vessel @spice pier how i can do it?
nice two pings man
sorry
i can't really help
anyone know?
@tight plinth which lib
There may be a special property for Guild to get the boosters
is there a way in mongodb to add new things from a schema to an existing document
apparently not, disregard my words
const embed111 = new RichEmbed()
.setColor(`#5780cd`)
.setAuthor(`Uhh, that Hurt`)
.setTimestamp()
.setImage('attachment://welcome-image.png');
message.channel.send({ files: [attachment111],embed: embed111})
return;
}```
did you try this?
yep
try attachFiles({ name: "welcome-image.png", attachment: attachment111 })
now work
to the embed object
well that's fine ig
thanks
@earnest phoenix it's not turning on, do I use the terminal to set it on?
Wdym to use the terminal? @raven urchin
glitch terminal
Like I put the token in and everything but doesn't turn on
i mean you can try
Hmm... That's extremely strange...
What do you type to get the bot online? @raven urchin
i can do a gif with canvas?
with avatars?
I don't know what to type in the terminal, still kinda learning
probably not grayald but you can grab a static version of their avatar
Hmm... Idk if you should use node or not... I'm confused about the glitch website's terminal... @raven urchin
static version?
1st frame
It's basically the same thing for discord.js
But I don't know what to type in for it to turn on
can we see the package.json
@raven urchin ik... But type node ....
What happens?
In the console/terminal it just shows black and then I type it doesn't show anything
@earnest phoenix
What the... What kind of terminal is that?
I don't know.
:/
Hmm so... Did you write your codes in files and save it inside a folder in your phone? @raven urchin
It's all on glitch. But I don't know why it just doesn't appear online
Welp... Then rip... You need to rewrite them maybe and save it inside a folder then use the app called Termux and install nodejs and discord.js and stuff to get started with... Rip @raven urchin
Rip, thank you for your help though
Np
@earnest phoenix canvas does not support animated gifs
I feel you bro... Gl on it @raven urchin
you need other libraries for that
@raven urchin you're using glitch right? show your glitch files
look for gif generation libraries
@quartz kindle he is saying the glitch's terminal is not working... Scroll up
@quartz kindle ok
yeah but glitch doesnt require the terminal to start a process
its autorun by package.json
Hmm... Nice but he says none of them is working... Let's see where this goes...
i think i can use this? https://www.npmjs.com/package/gifencoder
Heres my package.json
how about you don't code on a phone using a web platform lol
do you have an index.js file?
Yep
i think i can use this? https://www.npmjs.com/package/gifencoder
?
where is it? i dont see it
https://tryitands.ee/ @earnest phoenix
@sick cloud kinda...
Termux is better to code on than using a website to do so on a phone...
@raven urchin wait a second...
Why is your index.js is named index.json?
Hmm
I changed it
K now try then @raven urchin
Still not coming online.
check the logs
Error: Could not locate the bindings file. Tried:
→ /rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/build/node-opus.node
→ /rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/build/Debug/node-opus.node
→ /rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/build/Release/node-opus.node
→ /rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/out/Debug/node-opus.node
→ /rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/Debug/node-opus.node
→ /rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/out/Release/node-opus.node
→ /rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/Release/node-opus.node
→ /rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/build/default/node-opus.node
→ /rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/node-opus/0.3.3/node_modules/node-opus/compiled/12.0.0/linux/x64/node-opus.node
at bindings (/rbd/pnpm-volume/034599ea-c1c3-422b-9783-c3b2bb2163b1/node_modules/.registry.npmjs.org/bindings/1.2.1/node_modules/bindings/bindings.js:88:9)
^??
[Confused screaming]
@finite bough run enable-pnpm in your glitch console
@raven urchin add "scripts": { "start": "node index.js" } to your package.json
Which part?
wdym which part?
in package.json
ye
Yea but where did that 2 } go under there? @raven urchin
Oh i see
@earnest phoenix yeah it's there
else he will get errors
K try
Now I'm checking my logs it just says Resolving: total 132, reused 132, downloaded 0
Screenshot?
@raven urchin wait... Edit:
"node index.js"
To
"node ."
@raven urchin in json the order doesn't matter
K
@earnest phoenix both works
Hmm ik
how can i store the unique object returned from a settimeout as a string?
Wtf...
should work
@raven urchin is the bot online?
No :/
Its not a dependency...
Bring what out of dependencies?
It should be its own field just like author or license
@spice pier you mean to the very bottom or something?
the scripts field
Hmm
it doesnt need to be at the bottom
Ik
it needs to be in the root of the object
just tried the pm2 on my stick can i fix that with the pm2 start stick then i can see the console?
So where would dependencies go?
put the scripts thingy out side of dependencies
@raven urchin dependencies are in the middle...
scripts shouldn't be in the dependencies object
Yes, but how do I put the scripts part outside of dependencies
by putting it outside of it...
@spice pier so he should create a new class for it?
Like "scripts": {
That's confusing...
they aren't called classes
Oh i forgot...
{
"dependencies"" {
...
},
"scripts": { "start": "node index.js" }
}```
just tried the pm2 on my stick can i fix that with the pm2 start stick then i can see the console?
thats how it should be
@spice pier hmm that should work...
@raven urchin try that as @spice pier said...
This is how it is atm
{
"dependencies"" {
...
"scripts": { "start": "node index.js" }
}
}```
Ok
@spice pier u forgot a coma
{
"dependencies"" {
...
},
"scripts": {
"start": "node index.js"
}
}
still
then you should've pointed that "..." on the middle of the file
I'm so confused, where do I put that part.
It should be like this https://i.imgur.com/k6vRC7E.png
Umm... Here: @raven urchin
"scripts": {
"start": "node index.js"
}```
@raven urchin
congrats you managed to show nothing relevant
@raven urchin hmm... What's the actual error? Scroll up in the logs...
@raven urchin learn to read errors
can you show us the actual package.json file (the entire thing)? What is the error message?
also don't code on mobile
@sudden geyser keep that in mind that coding on mobile isn't so bad and not everyone has a desktop, pc or laptop...
(but coding on mobile is harder than expected... Cuz i code on mobile)
Is there a way to merge pm2 error & normal logs together when doing pm2 logs ID
it's a nightmare debugging anything
what i did was set both log files to the same file
but thats only for future logging, idk for past logging
you can probably do something with grep
Would this work for the guildMemberRemove event?
const hoursJoined = new Date().getTime() - member.joinedAt.getTime()```
To see how long they were in the server they just left
it's the amount of milliseconds
yes
yes
how to send dm? in discordjs
user.send()
("HEY")
How can i strech it over the painting
https://cdn.discordapp.com/attachments/695319481609879585/696009711551774720/rip.png
?
what are you using to do that?
canvas
lemme test something
I'm not sure
thx that works @earnest phoenix
try to change it's width and height values lol
ik
I said that bc you wanted to stretch it
console.log the image and see its properties
then what
so
you have an image object somewhere
[Image:183x183 complete]
console.log that image
yeah here
show
hmm
do you mean the background ?
no
are you using the dom canvas or the npm module
ok
yeah ok
How do I "mention" a channel from it's ID in djs v12 - before I just used the channel object but that isn't a thing anymore
anyone know a module that makes settimeout returns numerical id's instead of objects?
you can use the object
Really? Okay thank you
I think I might have explain it wrong
I have the ID and I want something like #development
oof lol
@true ravine what are you trying to do ?
@true ravine also what is it you want or is it fixed
(node:19788) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'joinCount' of null
at C:\Users\jnsho\Desktop\Flexilink Discord Bot\Flexilink\src\commands\find.js:30:16
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:19788) 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: 181)```
No idea why this is happening tbh
have you tried reading the error
Please provide code, so that we can help.
i am bot programing 😛
talk to me when you get to 300
When you never hear from LoseJoe again
how do i make it so when someone invites my bot it sends a message like this https://gyazo.com/2b04c752c008f503876150f70b1ebb23
Is someone able to get in vc to help me out?
Testing 2
what is an acceptable rate of activity changing?
and @earnest phoenix by checking if the bot joined a new server
😎
@earnest phoenix using guildCreate event
@true ravine what are you trying to do ?
Don't worry I worked it out
@earnest phoenix u buffer the song before playing it right?
while playing it
the song starts buffering and playing at the same time
the buffering overtakes the speed and completes first
what do you mean by save
it's entirely all in memory
@finite bough so this?
message.channel.send("blabla")
``` ?
@earnest phoenix you didn't close your brackets :')
oh yea lmao
and message ain't defined
i forgot to put that part
So channel ain't defined either
i said that ;w;
oop
bulli
@earnest phoenix can u tell me how u do it
i can figure out a way to buffer out the song
well any other idea how i can reduce the latency of vids
@finite bough so how can i define it?
either by choosing a random channel [bad idea]
or finding a channel by its name content [which is also a bad idea]
is it possible to make it send in the channel it was invited to?
^
So you can try using the first channel that's in the cache ig
Like
guild.channels.cache.first() or some crap
^
yeah its annoying when bots do that
^
just like reee
"Ive added you to try your commands and see how they go and to keep you or not, dont freaking start messaging my channels telling me what i know you can do"
ya like channel.name.toLowerCase().includes('general')
How do I see the amount of things in a Collection
length
limit
nvm me
oh nm
LOL
that's for fetch or something
I tried that
I am trying to see how many aliases there are
with
Discord.Collection()
Like
i mean define it a value and aliases.size? no?
aren't your aliases an array
Your commands is a collection, but your ALIASES is an array. So you should be fetching the command from the collection then checking command.aliases.length most likely
Honestly depends on what your collection looks like
Hey, how can i get this picture in the frame behind it ?
I don't know the frame cords (the canvas xy) so I can't really do anything.
https://cdn.discordapp.com/attachments/695319481609879585/696040798453497987/paint.png
@earnest phoenix u have to get used to getting the cods
there are many apps that get the cods for u
really, example?
i kinda use photoshop so idk xD
do it
how can i see cords? is it visible or should i use a setting?
check at the borders
i dont see it?
help me music bot not working js if (command === 'play') { const voiceChannel = msg.member.voiceChannel; if (!voiceChannel) return msg.channel.send('I\'m sorry but you need to be in a voice channel to play music!'); const permissions = voiceChannel.permissionsFor(msg.client.user); if (!permissions.has('CONNECT')) { return msg.channel.send('I cannot connect to your voice channel, make sure I have the proper permissions!'); } if (!permissions.has('SPEAK')) { return msg.channel.send('I cannot speak in this voice channel, make sure I have the proper permissions!'); }

