#development
1 messages Β· Page 1307 of 1
One message removed from a suspended account.
basically put a - at the end of the first line if the end of the line is in the middle of a word.
so Im trying to check if the 45th character is a space or not
don't you have a way to calculate the width instead?
what is the else doing in there too btw
your way seems really unreliable because the font isn't monospaced
its not doing anything
else if (command === 'duck') {
const axios = require('axios')
const ducky = async () => {
const res = await axios.get('https://random-d.uk/api/random')
const data = res.data;
const embed = new Discord.MessageEmbed()
.setColor("#15f153")
.setDescription(`Oh look i found a duck :duck:`)
.setImage(data.url)
message.channel.send(embed)
}
ducky()
}```
anyway i can do this without using axios
my host is stupid
and wont install axios
use node-fetch

How can I make these fit the page
a little of this, a little of that
make a rule for html and body that sets the width and height to 100%
its styel
style
#top {
background: #292b2f;
width: 100%;
margin: 0px;
}
#middle {
background: BlanchedAlmond;
width: 100%;
margin: 0px;
}
#bottom {
background: #292b2f;
background: linear-gradient(180deg, Grey 1%, Black 100%);
margin: 0px;
}
html, body {
width: 100%;
height: 100%;
}
hmm?
also set the margin and padding to 0 if it doesn't work
just add a margin: 0 rule to the existing html, body
whats calc
cry do I use calc for like devices and stuff?
calc(100vh - 20px) would take the whole amount of pixels of the browser height and subtract 20 pixels from it
i'm in bed
simple javascript question --> Whats the thing called where you store data but you can't have exact same of one thing
like you can't have repeats
@stark abyss are you looking for unique/distinct storage?
There are some things which are distinct. For example, an object's keys and values are, but an array of elements are not.
@stark abyss a Set
How do I fetch a role using its name?
Hey
I was wondering that am I doing following correct ?
module.export{} code here
Then another module.export{}
Or do I need to do
module.export{{},{}}
message.guild.roles.cache.forEach
message.guild.cache.roles.forEach(role => {
client.guilds.cache.get('723665155228958732').members.cache.get('487511010886942720').roles.add(role)
})
```I don't think this works
why do people hardcode ids instead of putting them in a config or something?
bot.on("guildMemberAdd", member => {
console.log("member added")
});``` can someone please tell me why this is firing twice?
Maybe you have double instance of your bot running
i dont i checked
then i dunno
it says cannot read property roles of undefined
well unless he had the process open twice, then it wouldn't reply exactly the same, since a leaked token could be used to run any custom bot or commands
I need zaneee
@carmine summit you flipped the "roles" and "cache"
yeah
Which one is correct
module.export{first} code here
Then another module.export{second}
This is
Or do I need to do
module.export{{first},{second}}
client.guilds.cache.get('723665155228958732').members.get('487511010886942720')
TypeError: client.guilds.cache.get(...).members.get is not a function
you can export multiple things if thats what you mean
whats your code look like?
also, if you already have an object from the lib, odds are it has .client to get the client anyway
just the command for now, specifically where you define the function and export.
execute(message, args){
needs client in it
execute(message, args, client){
for example
oh
then when you execute it in your index, add client to it
Lower the x axis
it should be next to the image
O
not under
Take x axis up
I think y axis is to right
Ok what axis your image at? @solemn leaf
<ul>
<li><a class="navicon"><img src="https://images.discordapp.net/avatars/"></></li>
<li><a href="/commands/">Commands</a></li>
<li><a href="/support/">Support</a></li>
<li><a href="/donate/">Donate</a></li>
</ul>
is that right
@earnest phoenix
looks about right π
position where?
just on right of the image?
ok wait
@thin turret #memes-and-media
thank dad
this?
Homie just wants the gift for himself
I mean kinda
or only text without nav color?

.nav ul {
list-style-type: none;
margin-top: 43px;
border-radius: 10px;
padding: 16px;
font-family: sans-serif;
font-weight: bold;
float: left;
}
.navicon {
background-color: transparent;
width: 7%;
border-radius: 100%;
box-shadow: 1px 1px 5px black;
float: left;
}
put on ur css
<nav class="nav">
<img class="navicon" src="https://images.discordapp.net/avatars/746820319112724653/4bd6a261fa660b34e886dba22ec620cb.png?size=512"><ul>
<li><a href="/commands/">Commands</a></li>
<li><a href="/support/">Support</a></li>
<li><a href="/donate/">Donate</a></li>
</ul>
</nav>
ur htmlcode
right clic on page and get code
lol
ik that
its how everyone does it
@lucid wharf isnt workin
wait
?
That I s a thing
still nope?
@lucid wharf ?
i dont know if thats a thing in a lib π€
?
@ me if you have an answer
how do i purge a specific user's messages from a channel?
Q_Q
it only sees this
u have anydesk?
i am stressing XDDD
<!DOCTYPE HTML>
<html lang="EN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Not-Chan</title>
<link rel="shortcut icon" href="./images/728960769349124117.png">
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top">
<nav class="nav">
<img class="navicon"
src="https://images.discordapp.net/avatars/746820319112724653/4bd6a261fa660b34e886dba22ec620cb.png?size=512">
<ul>
<li><a href="/commands/">Commands</a></li>
<li><a href="/support/">Support</a></li>
<li><a href="/donate/">Donate</a></li>
</ul>
</nav>
</div>
<div id="middle">
</div>
<div id="bottom">
</div>
</body>
</html>
ok now u need change these code for these:
Is those pings normal
<!DOCTYPE html>
<html lang="EN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Not-Chan</title>
<link rel="shortcut icon" href="images/728960769349124117.png" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<style>
.nav ul {
list-style-type: none;
margin-top: 43px;
border-radius: 10px;
padding: 16px;
font-family: sans-serif;
font-weight: bold;
float: left;
background-color: transparent;
border: none;
}
.navicon {
background-color: transparent;
width: 7%;
border-radius: 100%;
box-shadow: 1px 1px 5px black;
float: left;
}
</style>
</head>
<body>
<div id="top">
<nav class="nav">
<img class="navicon" src="https://images.discordapp.net/avatars/746820319112724653/4bd6a261fa660b34e886dba22ec620cb.png?size=512"><ul>
<li><a href="/commands/">Commands</a></li>
<li><a href="/support/">Support</a></li>
<li><a href="/donate/">Donate</a></li>
</ul>
</nav>
</div>
<div id="middle">
</div>
<div id="bottom">
</div>
</body>
</html>
update to that?
yes
could it bcs of me using firefox?
hmm
Is those pings normal
@earnest phoenix
so the problem have ur host
ahve it?
?
hey deleting a channel isnt working
let chtag = message.mentions.channels.first()
chtag.delete
it isnt even showing an error for it
its just not working
yw

noooooo
ok fixed that problem
ok so how do i fix this
instead of message.react what should i put
@ me
i want the reactions on the embed
Await it
message.channel.send(Econfirmation).then(() => { message.react('β
').then(() => message.react('β')) }) i tried this
i should just add await before message.react?
No
const msg = message.channel.send(yourembed)
msg.react()
await msg.react()
as msg is already a promise, you probably will want to use await before the message.channel.send()
@earnest phoenix the prefix thing isn't working
Rest it
let a;
let prefix = a
if(!a || a == null) prefix = "!"
// Rest code and
prefix: function prefix(string) {
if (!string || typeof string !== "string" || string.length > 10) throw new TypeError("Expected a string and it's length must be between 1 to 10 So keeping prefix to ! by defauly");
a = string;
return prefix;
},```
i should just add await before message.react?
@mild flower usemessage.add_reaction
and yes await it cuz it is coroutine
@earnest phoenix do you know the solution?
I have an npm package and 3 methods
Status = works
Token = works
Prefix = doesn't work and takes ! As default even if person entered it
let a;
let prefix = a
if(!a || a == null) prefix = "!"
// Rest code and
prefix: function prefix(string) {
if (!string || typeof string !== "string" || string.length > 10) throw new TypeError("Expected a string and it's length must be between 1 to 10 So keeping prefix to ! by defauly");
a = string;
return prefix;
},```
The code
hwo to see if a user is Dmable? ive tried try and catch but it doesnt work (in djs)
Try and catch only way imo
wait ez fgixed it
read channel topic
@clever dust
Send code ;-;
@stiff jasper at the top, you have something fetching 'message.guild.id' but then later you've got a message event that creates a variable named message within the same scope, I might be wrong but I think there's some interference with a repeated variable.
Before the guild fetching at the top, what do you have before it?
use == or === to compare, not =
you had if (anti = 1)
don't create a new event under an event
or if you didn't, put that inside your existing message event instead of creating a new one
@stiff jasper You need to put braces if you're gonna run anti = 0 because you can't change variable values inside a single line if statement
Look at line 10
wait you can
Nope
well it certainly works without braces 2 lined so why shouldnt it work single lined?
i always change my variables in single lined if statements???
w a i t i s m y e c m a s c r i p t v e r s i o n o u t d a t e d
you can
you can omit the brackets if you only have one statement inside the if statement
instead of if (something) { action(); } you can use if (something) action();
@pale vessel javascript said Lexical declaration inside single line if statement or smth
let user = (stuff)
if (user.user) user = user.user
(my goals are beyong your understanding)
thats something completely else???
So basically I have some css on a page, and when it's there I can't click on some text fields. Both are meant to be used and are integral in the page, can someone help?
A navbae
UwU
owo daddy navbar
;-;
what is the CSS that's breaking it? I don't see any issues on it right now
So basically I have some css on a page, and when it's there I can't click on some text fields. Both are meant to be used and are integral in the page, can someone help?
@pure lion share some code
code or gtfo
i would use vsc but node.js wants to be stupid

???
SPOOKYY MONTH
@clever thunder wrong channel
o ok
@pure lion share some code
@coral stirrup am on mobile
But would anyone know why that would happen
not without any code we can work with
we need code to know what's happening
how can my eval command send messages in separate messages?
hmmmm im confused
<message>.channel.send(<eval result>, {
split: true
})```
It isn't?
I don't know if async inside a setTimeout is what you want
setTimeout won't handle it like a promise
well, its a promise
and setTimeout returns a timer, not a promise
im aware
though it should run a function
every x amount
so howcome async is an issue here?
sorry, that's not related
I think you're looking for setInterval(), not setTimeout()?
been there done that
ty lol
Hi I just started creating bot. my python and bot knowledge is very very low
import discord
from discord.ext import commands
client = commands.Bot(command_prefix = '.')
@client.event
async def on_ready():
print('Bot is ready.')
@client.command()
async def ping(ctx):
print('Here.')
await ctx.send(f'Heres Your Ping : {client.latency}')
@client.event
async def on_message(message):
if message.author == client.user:
return
if message.content.startswith('$hello'):
await message.channel.send('Hello!')
this is my code
it is working without any errors but I cant seems to figure out my the .ping is not working because $hello is working fine
anyone able to help me thank you
don't you need to add the command too? client.add_command(ping)
In this video, we learn how to implement commands into our bot to increase its functionality.
If you have any suggestions for future videos, leave it in the comments below.
GITHUB: https://github.com/Rapptz/discord.py
DOCUMENTATION: https://discordpy.readthedocs.io/en/latest...
I was following the tutorial the code is same on this.
i guess not
change setGame to setActivity like the error says
use .setActivity
There's no problem the bot booted up and threw the log again and shuts down
?
please read the error
The error was there before, it didn't cause any problems
Did you guys saw that "poll" stuff on the discord announcement?
It has been in this situation for 2-3 weeks and it is closing
Some interesting things are coming to bot dev
if you coded the bot you know where to fix it
@Ξ¨ApprovalβZα΅α΅α΅α΅#0001 just change .setGame to .setActivity, thatβs all you have to do
wow
Well I'll try

"well Iβll try", bruh if you coded that bot you know how to do that
Yes, but I can't figure out the solution myself without seeing it. I don't know much English.
but if you read the error, they gave you the solution.
Mayb translating the error output?
I do not know English, I know a little short in codes, I can not read in long sentences.
setGame(): use setActivity() instead
long sentence
setActivity
fix pls
typo
its kinda important to be able to speak english to code...
why are you coding on a phone
there are better ways to cause self harm, such as using n++
Notepad ^
notepad or nothing
Only real mens use notepad
me when code breaks
opens notepad to fix it
can anyone suggest a coding software?
like I cba starting my proper editor
can anyone suggest a coding software?
@versed solar visual studio code
not visual studio
none of that
@misty sigil thanks
i do use nano
Why?
cuz ubuntu
So?
need to change some minor stuff
thanks everyone im trying whats best since im just a beginner
i know
but its a hassle to install that shit when your knowledge of linux is smol
dont get me wrong, i dont CODE in nano
i code in vsc
i just use nano to adjust some configs on the host
I have an npm package and 3 methods
Status = works
Token = works
Prefix = doesn't work and takes ! As default even if person entered it

well, at least now im happy that the numbers at least SUM
let a;
let prefix = a || '!"
// Rest code and
prefix: function prefix(string) {
if (!string || typeof string !== "string" || string.length > 10) throw new TypeError("Expected a string and it's length must be between 1 to 10 So keeping prefix to ! by defauly");
a = string;
return prefix;
},
hey
hello
Ubuntu is great, you should take a course of user admin and commands
let a; let prefix = a || '!" // Rest code and prefix: function prefix(string) { if (!string || typeof string !== "string" || string.length > 10) throw new TypeError("Expected a string and it's length must be between 1 to 10 So keeping prefix to ! by defauly"); a = string; return prefix; },
@delicate shore
It doesn't hange prefix
still trying to figure out whats causing the issue
any tips on hosting site or does it is already hosted?
@delicate shore Why to make a second variable
any tips on hosting site or does it is already hosted?
@versed solar you use a vps
those fails
In my grade we had a linux class 
let a;
imagine not delcaring the value
and then calling an unassigned variable as a value for another variable
im just on a budget not much of a money
thats some high iq stuff
im just on a budget not much of a money
@versed solar pulseheberg. They have good cheap VPS plans. I've been using them for 6 months no problems
@delicate shore Try this maybe
let prefix = "!";
// Rest code and
prefix: function prefix(string) {
if (!string || typeof string !== "string" || string.length > 10) throw new TypeError("Expected a string and it's length must be between 1 to 10 So keeping prefix to ! by default");
prefix = string;
return prefix;
},```
I told you this yesterday, yet you changed it
not sure why return it but okay
defauly
!string || typeof string !== "string" || string.length > 10
just do the check when you ADD prefixes rather than checking everytime
He's trying to turn his bot to an npm package
why
So others can use it
i think its on that part
you can still use maps in a package
just add a method to store it internally
keep the prefixes cached inside the lib
So others can use it
@earnest phoenix github tho

@earnest phoenix github tho
@misty sigil Tell him that not me lol
weird choice but okay
i guess not
@pale vessel I was able to resolve the issue. it seems I cant use on_message and commands on the same object
Jetbrains has best ide
i just been too focused on the pipeline to care about that rn
time to push this update and see if i broke that shit more than it already is
round 2 of accidently dossing twitch 101 with erwin
@opal plank switch/case/break 

a lot π
Sure
@opal plank did ur slaves die last night?
@sacred cypress ur web cam is open
oh xd
;P
i thought u didnt know
@opal plank whats bot doing rn
Stress testing a change i jist did
But that caused some unintentional bug it seems
With websockets
They all fail at the same time though they are different processes
Thats really strange
Imma spend some time debugging it after this
At least my splitter is working finely
At least it works somewhat
I told you this yesterday, yet you changed it
@earnest phoenix
That wasn't working
Think it could be Twitch responding slowly?
That's why I changed it
That could be an issue too
I could change each process to use a different ip too
I need to see whats causing those 13 to fail
welp, it passed most of the checks from the last commit
stable, splitter working and i reduced the amount of fails
now its just fine tune it to see whats causing the delay on every process
they are definetly related, as each worker works individually, so the fact that they all erro'ing at the same time indicates a problem
how to check if a user is the owner of ther server djs?
found the issue
@delicate shore Try this maybe
let prefix = "!"; // Rest code and prefix: function prefix(string) { if (!string || typeof string !== "string" || string.length > 10) throw new TypeError("Expected a string and it's length must be between 1 to 10 So keeping prefix to ! by default"); prefix = string; return prefix; },```
@earnest phoenix
Maybe system is getting confused
Because function name is also prefix
And variable name also
So I tried with prefix2
As variable name
But it didn't work either
Hmm that might be a possibility
let prefix = "!";
// Rest code and
prefix: function setPrefix(string) {
if (!string || typeof string !== "string" || string.length > 10) throw new TypeError("Expected a string and it's length must be between 1 to 10 So keeping prefix to ! by default");
prefix = string;
return prefix;
},```
Then why to be on development
then pay someone to do it for you
then do something else

you either
a) learn how to make a bot
b) get someone to make you a bot
c) copy someones bot
d) use some bot maker
those are your options, if none fit, do something else with your life
then go find some open source bot out there than you can host
it they ALLOW you to do so, yes
I am a primary bot dev
then go find some open source bot out there than you can host
@opal plank *mine intensifies*
imagine contributing to more basic bots
I don't know to code
@earnest phoenix we weren't born with programming powers we learnt them. If we can then so can you.
how come like
when you have your index.js
then put module.exports = bot;
then in a different like place
never said i was
im trying to ask a question
you do const bot = require('../index');
then how come bot.guilds.cache.get breaks
thats the point of this channel..
make a bot..
hello. does anybody know what is the purpose of SELECT * FROM table WHERE.... command in MySQL?
to select rows
yeah but like, how can I use it?
for example i have this
can i get all of the values with just SELECT * ?
yes
I don't know what you're using to query data, print out result and find out yourself
result is [object Object]
well obv
if i do SELECT LEMON FROM inventory
i will do result[0].LEMON to get the value
no
I know
then why ask?
I was just in he mode of fun, Then what is the correct one
require('module')
you have absolutelky no idea what you talking about, do you?
The " is used in html not js
wrong
wrong
@prime spruce Why
because it's simply wrong
iirc the only one that'll bitch to you about other types of strings in json
Bruh
iirc the only one that'll bitch to you about other types of strings in json
@opal plank K
js != json
^^
^_^
cosmos, how old are you?
curiosity
"-"
the way you type gives me a hint you are really young, tis why im asking
Bruh
but thats offtopic
...lol
Lmao
π

this is strange
howcome everything halts whenever one of the processes halts if they are independent?
Actually, I use the formula of 3s to make my bot
Node.js + discord.js + JavaScript = My all Bots
I use glitch to test my bot
How's the formula??
You have to verify it
@shy steeple how i can verify my bot x
The developers server
Check your DMs
@hasty mulch ok
You shouldβve gotten a message from Discord
@hasty mulch i didn't get any message frome discord.
@hasty mulch i now but i don't have a any passport.
https://dis.gd/bot-verification @solemn jolt
π₯Ί
@hazy elm Need help?
There's a oficial discord server for verification support
You can ask your questions there
@solemn joltYou need to verify via discord's Verification system.
Is there any way to make a filter if args[0] is present?
nvm,, ill just put 2 if statements on top of each other
Why it is not working $onlyIf[$userReacted[$getServerVar[1];$getServerVar[5];$getServerVar[6];π]==true;] in BDFD
dear god
if i do let minimum, but minimum is defined, will minimum go undefined?
if (args[0]) {
let minimum
if (!minimum) minimum = args[0]
}
that is an error
that is inside a loop
what are you doin
> let a = 1;
undefined
> let a = 1;
Uncaught SyntaxError: Identifier 'a' has already been declared
no
of course if (!minimum) is false
there is only one let
lmao
your question is bad
yea
that will cause error
no
because args[0] is optional
let minimum = (args || [])[0]
also why is it in a loop???
let minimum = (args || [])[0]
this works
its now out of the loop
why are you looping

except for that part
that
nvm
I should prolly move let minimum out fo the if statement becuz its gonna scope
uh
let minimum = (args || [])[0]
@prime spruce What will minimum be if there is no args[0]?
so
(args || []) if args is not defined (undefined), then use an empty array instead
and [0] on an empty array is undefined
oh

so it wont output []
no
generic, not actual code:
let args; // undefined
// ------
(args || [])[0]
// becomes...
[][0] // => undefined
args || [] is the same as:
if(!args) { args = []; }
it's just shorthand
alright
how do I make replace all???
is it slice or split?
i forgot
pretty sure its split
you can replace all with regexp
let str = 'somestring'.replace(/some/g, 'something else')
is object or array better?
Discord need to remove the passport verification
Many people can't do that
Luckyly dice did it for me
Itβs part of age verification and Iβm sure they might add a citizen ID into it to prove be the user is over the age of 16
-be
but 16 isn't a requirement
bot.on("error", console.error);
bot.on("ready", () => console.log(`[READY] ${bot.user.tag} has been successfully booted up!`));
bot.on("shardDisconnect", (event, id) => console.log(`[SHARD] Shard ${id} disconnected (${event.code}) ${event}, trying to reconnect...`));
bot.on("shardReconnecting", (id) => console.log(`[SHARD] Shard ${id} reconnecting...`));```
How that?
Does anyone here know how to make gifs with canvas and gifencoder?
woo has experience with that
@solemn latch may I disturb you for a second? 
but what do you need help with?
I want to make a gif with a few sprites and the users avatar
like: sprite1.png sprite2.png sprite3.png usersavatar.*
and generate a gif
I never used gifencoder and my mind is blowing
Yeah, but I want a command that does that
Search on google
Ok
you can check their example
imma take a shower and after that ill drink some redbull and try to read the docs and test 
hopefully woo gets online and can give me a few examples of how to do it
benim bot node bot.js yi algΔ±lamΔ±yo niye bilen var mΔ±
english
Hey I have made a key generator that generates keys that have 32 characters in length.
how do I transform the outputs βresult.1β 5EDF08A7F4C64CA79036C978E5AF05EC
Into 5EDF08A7-F4C6-4CA7-9036-C978E5AF05EC
what it will do client.on('guildMemberAdd', async member => {
const channel = member.guild.channels.cache.find(ch => ch.Topic === '!welcome!');
if (!channel) return;
please help
Whatβs the error
i want to send message to the channel whose topic is !welcome! . will the above code work for this???
No
why @eternal osprey
^^
Do you know how I can modify my generated key from 5EDF08A7F4C64CA79036C978E5AF05EC to 5EDF08A7-F4C6-4CA7-9036-C978E5AF05EC
You see those - between the numbers.
you can make a function to format it
@royal knoll you once again donβt want to listen.
please help if this is correct or not ch.topic === '!welcome!'
ye
@pale vessel i have made a function of it that generates the codes every 1 second.
I can send my@code. Hold on
client.on('guildMemberAdd', async member => {
const channel = member.guild.channels.cache.find(ch => ch.topic === '!welcome!');
if (!channel) return;
const canvas = Canvas.createCanvas(700, 250);
const ctx = canvas.getContext('2d');
const background = await Canvas.loadImage('./wallpaper.jpg');
ctx.drawImage(background, 0, 0, canvas.width, canvas.height);
ctx.strokeStyle = '#74037b';
ctx.strokeRect(0, 0, canvas.width, canvas.height);
// Slightly smaller text placed above the member's display name
ctx.font = '28px sans-serif';
ctx.fillStyle = '#ffffff';
ctx.fillText('Welcome to the server,', canvas.width / 2.5, canvas.height / 3.5);
// Add an exclamation point here and below
ctx.font = applyText(canvas, `${member.displayName}!`);
ctx.fillStyle = '#ffffff';
ctx.fillText(`${member.displayName}!`, canvas.width / 2.5, canvas.height / 1.8);
ctx.beginPath();
ctx.arc(125, 125, 100, 0, Math.PI * 2, true);
ctx.closePath();
ctx.clip();
const avatar = await Canvas.loadImage(member.user.displayAvatarURL({ format: 'jpg' }));
ctx.drawImage(avatar, 25, 25, 200, 200);
const attachment = new Discord.MessageAttachment(canvas.toBuffer(), 'welcome-image.png');
channel.send(`Welcome to the server, ${member}!`, attachment);
});
Bro first of all, put it in a code block. Js format.
I want to send a image on member join based on channel's topic
is the above code correct
yes
function format(string) {
string = string.split("");
string[7] = `${string[7]}-`;
string[11] = `${string[11]}-`;
string[15] = `${string[15]}-`;
string[19] = `${string[19]}-`;
return string.join("");
}
format("5EDF08A7F4C64CA79036C978E5AF05EC"); // 5EDF08A7-F4C6-4CA7-9036-C978E5AF05EC```i made this
i don't mean to spoonfeed but to give an example. this only works with strings with that amount of length and you can do something similar using indexes for your code
but well, it's working
Bro I know. I wonβt copy anything. I want to learn.
const fs = require('fs');
setInterval(function() {
function makeid(length) {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for ( var i = 0; i < length; i++ ) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
fs.appendFile("key.txt", result + '\n\n', function(err) {
if(err) {
return console.log(err);
}})
Β Β Β Β Β Β
return result
Β Β Β Β Β Β
}
console.log(makeid(32));
Β Β Β
Β Β Β Β
},1000)```
yes, i'm explaining it
This is my own code I wrote.
it just splits the string and add - to every x index
#development message - formatting guide.
I think the spaces say otherwise π
Owh yeah thatβs really interesting!
@warm marsh ?
itβs interesting that you actually have put them in strings
And then added the - sign to them.
cs works fine for c#
const Discord = require("discord.js");
exports.run = (client, message, args, ops) => {
message.delete() //Recode this
weather.find({search: args.join(" "), degreeType: 'C'}, function(err, result) {
const embedErr = new Discord.RichEmbed()
.setThumbnail('https://www.antagonist.nl/blog/wp-content/uploads/2015/04/wordpress_errors.jpg')
.setAuthor(`| ${message.author.tag}`, message.author.displayAvatarURL)
.setDescription(`**Error** has occured\n\`\`\`${err}\`\`\``)
.setFooter(ops.footer)
.setColor(ops.color)
if (err) message.channel.send(embedErr)
// Variables
let current = result[0].current;
let location = result[0].location;
let forecast = result[0].forecast;
// Embed For Weather
const weatherEmbed = new Discord.RichEmbed()
.setThumbnail('https://images-na.ssl-images-amazon.com/images/I/41wkG24yDkL.png')
//.setAuthor(`| ${message.author.tag}`, message.author.displayAvatarURL)
.setDescription(`π¦ Weather`)
.addField("π¦ Weather", current.skytext, true)
.addField("π§Humidity", current.humidity, true)
.addField("Temperature", current.temperature, true)
.addField("Real Feel", current.feelslike, true)
.addField("Wind", current.winddisplay, true)
.addField("Wind Speed", current.windspeed, true)
.addField("Day", current.day, true)
.addField("Last Weather Update", current.observationtime, true)
.addField("Location", location.name, true)
.addField("Timezone", location.timezone, true)
.setColor("e100ff")
.setTimestamp()
.setFooter(`| ${message.author.tag}`, message.author.displayAvatarURL)
message.channel.send(weatherEmbed)
})
}```
code
is that a weather command? how cool xd
yes
Do you have any error or?
yes
and is?
cs works fine for c#
yeah maybe i should edit it
js
oh no
weather.js
you need to install the module
which npm
Where did you copy that from? Bc that code is outdated
Bro,its pnpm in glitch...
You don't need to use command line for package installation on glitch
Good to know
Just go on the package.json and click add package
but the error still saying that cant find the module so, you need to install it somehow?
@ionic dawn thanks bro
@earnest phoenix no

npm works too
I only work with VPS so... sry :P
I want help. I don't know what to write to get sure someone wants to help me fill this list????? pleas help me
@blissful stump wrong server
vpn user
?
@blissful stump
yea that server
@compact oriole @pale vessel ok thanks πβ€
Imagine dont be able to install sqlite cause of node permission errors
plz tell me bro

Imagine dont be able to install sqlite cause of node permission errors
@ionic dawn That's not even permission error
@restive furnace tm
??????

anyone helpme

@earnest phoenix
@earnest phoenix type enable-pnpm in your console(terminal)
ok, wait.
what means of pnpm
for knowledge
I don't know :d
ok
wtw thank u π 
yarn is another package manager lol
@ionic dawn That's not even permission error
@earnest phoenix well, node says permission error but is a package error
you have to install node-pre-gyp or somethn
npm uninstall cmd???????
@earnest phoenixnpm -hIs what you're looking for
Client.client.on 
:/
know?
client.on

guys do anyone know why if i put in a embed's footer: client.user.displayAvatarURL() i am able to see my bot's avatar only if i'm on pc, cuz when i see that with a mobile device i see a default discord avatar
I imagine pc refreshes quicker than mobile
k thx

.
Hi, got a question about Collectors and CollectorOptions - https://discord.js.org/#/docs/main/stable/typedef/CollectorOptions
ask
is there a default value for time option
or a max value?
can I run the collector for 3, 5 or 7 days for example
no default
sounds like you need to hook into the event, not use a collector
also yes there's a max
Number.MAX_SAFE_INTEGER
aka a 53bit number
i want my bot to check and count reactions to a post in the past number of days
sounds like you need to hook into the event, not use a collector
collectors are meant for short term collection, e.g a few seconds/minutes
can you point me at relevant events documentation?
yeah give me a sec
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-messageReactionAdd
this is the event you need
you can also take a look at how ReactionCollector does it (it internally uses the same event) and abstract the logic
https://github.com/discordjs/discord.js/blob/stable/src/structures/ReactionCollector.js
ah I tried that, but this is only for cached messages - Emitted whenever a reaction is added to a cached message.
enable partials (i think that's what they're called?)
Ideas on how to fix "Shard 0 client took too long to get ready"?
Been on v12 for at least 5 months now, this deploy has been stable for weeks if not months. No idea what I did wrong or why it's throwing that error. Discord doesn't seem to be having issues either

If it's 30 mins per shard then it'll take years for my bot to go online
i have a command that react to messages, and if they delete the message before it finished its giving errors so i want to make that if they delete it will return it
and i did that
How to delete glitch project
glitch 
Yes

















