#development
1 messages · Page 1125 of 1
and my skool computer classes suk anyways
being a computer science major doesnt make you a good programmer btw :^)
This^
self taught in js, C, HTML and CSS
me too, without the C
schools usually teach you basic python but thats about it
Etc
do schools actually just teach you how to print
then go ahead and code your bot
schools usually teach you basic python but thats about it
what if they teach you friking qbasic
so
im a done
So I’m must leave
The extent of py my school teaches:
T u r t l e g r a p h i c s
True, though. I applied for Comp Sci in college and we learn simple stuff like Pascal, VERY basic C#, JS, HTML, and CSS.
I self-learned Python and don't regret learning it to this day tbh
imagine schools start telling people to make a discord bot instead of turtle
rip dbl
yeah approval times would be 6 months
@pure lion but DBL will be flooded by students
Just harass plexidev
that says "please approve my bot or i will get bad grades"
then so be it
Also we gotta build a website....
lmao jokes on literally everyone else in my class
True, though. I applied for Comp Sci in college and we learn simple stuff like Pascal, VERY basic C#, JS, HTML, and CSS.
I self-learned Python and don't regret learning it to this day tbh
i self learned 25%, grasshopper by google teached me 50% and talking here taught me 25% ||for that last one : i also learned how to talk to people||
In which living hell's name did I think socketio.Client is a server to connect to
The what
living hell's name
Anyway I'm going to go steal Boeings websocket.ts file because I can
imma go use dank memer API
I was apparently too tired to understand that I needed a socketio.AsyncServer, not an async client 🤔
I could probably make my own lib from scratch how hard could it be :/
@quartz kindle are assets files required from an HTML file supposed to return a 304 status code?
rumours that tim has more pings than the mod role
Tim has 3k pings last time I checked
hey vsauce (are typing...)
yes
i have 0 pings
Fuck I almost have 1k lmao
how do i check
@slender thistle i mean, you can make your webserver return 304 regardless of its content
Well, my CSS apparently doesn't want to load
I tried parseint but still not working?
No
Shards won't launch (node:24) UnhandledPromiseRejectionWarning: Error [SHARDING_READY_DIED]: Shard 0's process exited before its Client became ready.
const { ShardingManager } = require('discord.js');
const config = require("./config.js");
const token = config.token.replace('7',"")
const manager = new ShardingManager('./bot.js', {
totalShards: 'auto',
token: token
});
manager.spawn();
manager.on('shardCreate', (shard) => console.log(`Shard ${shard.id} launched`));```
Use isNaN
bruh
@earnest phoenix theres an error in your code, and its not here
do you even know what you're doing
oh, it seems that... my page isn't requesting my .css files at all?
Oh no
if(mathaction === '+') return message.channel.send(parseInt(math1 + math2))
@earnest phoenix theres an error in your code, and its not here
@tight plinth wdym?
bro
check the page source in the browser
check the whole error
Me when the f12
at Shard.onDeath (/home/container/node_modules/discord.js/src/sharding/Shard.js:155:16)
at Object.onceWrapper (events.js:422:26)
at Shard.emit (events.js:315:20)
at Shard._handleExit (/home/container/node_modules/discord.js/src/sharding/Shard.js:371:10)
at ChildProcess.emit (events.js:315:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
(node:24) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:24) [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.```
Yeah, none of my .css files are loaded
Dafuk
@mild flower that's the worst way to make a math command
there should be smth above that
Do you think it could be related to Sanic somehow not loading them?
r u sure
above that is ```Shard 0 launched
yep
interesting
sanic logic
well that brightened my mood
interesting
@tight plinth ikr
but nah, a bootleg remake with style similar to Flask
Yeah my bets are on me not loading static files properly
@earnest phoenix if the process exited before the client became ready, that means the shard is crashing for some reason, you'll need to check your shard file
thats the shard file...
if you run node bot.js does it work?
yes
yep
maybe there is some problem with the shard. do you have enough ram for 100 shards
how much?
idk
how big is your bot
54 servers
why the hell
do you get Shard 0 launched in your console?
Why are you sharding
are you using shards then
lol late
BIG respond times like 15s
do you get
Shard 0 launchedin your console?
@quartz kindle yes
response times are not solved with sharding
anyway try listening to shard events
im still gonna make one
like this
im still gonna make one
then you're friking your own RAM and CPU
trust me
ok...
don't make an ExpressJS server and a bot in the same computer with terrible RAM
and CPU
Yeah it's gonna double the thing
ExpressJS takes a FRIKING lot of CPU
manager.on("shardCreate", shard => {
shard.on("error",console.log)
shard.on("death",console.log)
})
``` or something like that
umm
there is nothing to log
...
do u know djs
its going to log the error
does console.log without any params just log errors
do u know djs
i know relatively a lot but me still an amaeteur
Yeah it does
console.log is a function
Console.log with no params logs promise stuff
events expect functions
so when you do bla.on("event", function)
the event does function(event args)
like a sort of callback
for example
_events: [Object: null prototype] {
internalMessage: [Function],
message: [Function: bound _handleMessage],
exit: [Function: bound _handleExit]
},
_eventsCount: 3,
_maxListeners: undefined,
_closesNeeded: 2,
_closesGot: 1,
connected: false,
signalCode: null,
exitCode: 0,
killed: false,
spawnfile: '/usr/local/bin/node',
_handle: null,
spawnargs: [ '/usr/local/bin/node', '/home/container/bot.js' ],
pid: 36,
stdin: null,
stdout: null,
stderr: null,
stdio: [ null, null, null, null ],
channel: null,
_channel: [Getter/Setter],
_handleQueue: null,
_pendingMessage: null,
send: [Function],
_send: [Function],
disconnect: [Function],
_disconnect: [Function],
[Symbol(kCapture)]: false
(node:25) UnhandledPromiseRejectionWarning: Error [SHARDING_READY_DIED]: Shard 0's process exited before its Client became ready.
at Shard.onDeath (/home/container/node_modules/discord.js/src/sharding/Shard.js:155:16)
at Object.onceWrapper (events.js:422:26)
at Shard.emit (events.js:327:22)
at Shard._handleExit (/home/container/node_modules/discord.js/src/sharding/Shard.js:371:10)
at ChildProcess.emit (events.js:315:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
(node:25) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:25) [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.```
bla.on("event", a => console.log(a))
bla.on("event", function(a) { console.log(a) })
function f(a) { console.log(a) }
bla.on("event",f)
``` all do the same thing
I need to get a new VPS, any recommendations? It doesn't need to have very good specs
its the same thing, passing in a function without calling it, ie console.log instead of console.log() will make the event call it with whatever arguments it has
Oh ty tim
yep
@earnest phoenix can i see your bot.js file?
What would 2 GO RAM mean? DO they mean gigabytes?
yes, GO = GigaOctets
@earnest phoenix makes a request to the file
ok
client.login(client.token).catch(console.log)
Oh huh you learn something new everyday
french people use octets instead of bytes
F e n c h ?
oui oui baguette
Honhonhon baguette
array -> setInterval -> set status
embed:{
thumnail:'some random url'
}
```it dosent work
Is that the actual name?
thumnail?
oh
Can I have some help please, My test website isnt working, My rickroll I embeded to my site as a test didnt show up and nor did my cheese question >:(
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<p> id="CheeseTypeAnswer"</p>
</body>
</html>```
```js
console.log('Welcome to my website!')
alert('You are visting my website!')
var CheeseType = promt('What is the best type of cheese from your point of view')
document.getElementById('CheeseTypeAnswer').innerHTML = 'The best type of cheese from your view is,' + CheeseType```
LmAo
thx
{ embed: { /**/ }}
i didnt saw rip
what is promt()
@still merlin its prompt
@still merlin <p id="CheeseTypeAnswer"></p> not <p> id="CheeseTypeAnswer"</p>
Oh thanks, Sorry. I've just started learning js today
Welcome to the club
Is hosting a bot on a raspberry pi a good idea?
kek
It depends
depends how good your internet is
I say no but my internet is 🥴 🥴 🥴 🥴
I'd say it's pretty good
@pure lion like request(message.attachments.first().proxyURL)
No
what are some nice packages for functions for example(lodash) which does not have its own .d.ts
I fetched the first key thingy of the message (attachments are stored in arrays)
i think thats proxy
Then went to it with node fetch and got the body and put it to hastebin
ok
I'll check wait
Is <script> tag supposed to be used in <head> or <body>?
java.lang.UnsupportedClassVersionError: lavalink/server/info/AppInfo has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I normally put it in the bottom of the body @slender thistle
What is wrong with this?
Well, my .js files are being loaded but not .css 🤔
Wait how are you loading in your css file
java.lang.UnsupportedClassVersionError: lavalink/server/info/AppInfo has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
@feral aspen update java jdk
Where can I do that
@queen moss ever heard of defer?
There's a lot of possible meanings for that word be more specific
<script defer>
Oh yeah
Wait how are you loading in your css file
@queen moss<link rel="stylesheet" href="/assets/css/main.css">
path is correct, since it's what my js files use as well
for reference, <script src="https://cdn.socket.io/socket.io-1.2.0.js"></script>
no, wait
<script src="/assets/js/cards.js"></script>
Hm
it would be better if its above </body>
it is
<script src="/assets/js/max.min.js"></script>
<script src="/assets/js/theme.js"></script>
<script src="/assets/js/cards.js"></script>
</body>
Have a brazilian coder here?
no don't think so
@feral aspen update java jdk
@restive furnace It says to update JRE. The app was compiled with a later version of JDK
@restive furnace It says to update JRE. The app was compiled with a later version of JDK
sorry, my bad, havent used java and i dont know what is what
js is loading fine, css isn't
Oh
@inland apex
Don't ask to ask.
Just ask your question, it wastes time if you say "i need help" or "can someone help me?" instead of just saying what the problem is. Save your time and other people's time and just ask the question.
Please read https://dontasktoask.com/ for an explanation on why this is an issue.
Whats the default header?
Yup, not a single .css file is loaded 😂
I just asked (sorry my english is very bad) if have a brazil developer
Thats weird
THEBEASTARDUDHFUEHFIENFJE
WAT
What do you want
Should I try asking in Python server, since I'm using Sanic?
u left me alone...
Here
Yeah I don't see why it would load js in with the same path but not css
const hastebin = require("hastebin-gen");
const Discord = require('discord.js');
const fetch = require("node-fetch");
module.exports = {
name: "haste",
description: "Puts something in haste bin for you!",
aliases: [],
usage:"<code or text>",
display: true,
type: "general",
execute: async function(client, message, args, prefix) {
console.log(message.attachments.first().proxyURL)
var text = args.slice(1).join(' ') || fetch(message.attachments.first().proxyURL)
message.delete()
const haste = await hastebin(text);
message.channel.send(new Discord.MessageEmbed().setDescription(`Sucess! Here's your hastebin link: ${haste}`).setColor('RANDOM'))
}
}```
so the way of importing css would be different shivaco
i forgot that
@earnest phoenix first().attachment
hey, whats good as a music bot? im using heroku and python
Don't use heroku for music bot
@slender thistle https://github.com/huge-success/sanic/issues/1459
its not just a music bot
Just don't
who tf came up with that name
what is good?
S a n i c
@quartz kindle
Oh my god
.
@earnest phoenix Doesn't help, that issue is related to 304s and CSS rules being overwritten
whereas my issue is .css files not loading at all
Where would I put a function that I wanna call every hour (has to use message) ?
What is a good bot scripting
-dotpost @hoary crown
@hoary crown
Please do not post dots to clear your messages/get attention. It adds absolutely nothing to the conversation and just causes spam.
If you need to get attention, then say hello everyone. If you need to clear your messages, then press the Esc key. If you do not follow these instructions you will be muted.
?
Omg
Btw, how can I use an older version of lavalink.
still obect promises
???
@earnest phoenix b r o
Any help please?
Are you getting the res/body?
Ahhhhhhh
npm install <package>@<version>
That's nodeJS
mpn install X)
sorry, heat is killing my brain
It's fine
Are you getting the res/body?
@pure lion its not letting me
Wym?
keeps saying absolute urls are supported
let res = await fetch (first().attachment)
let body = await res.json()
B r o
wdym and how do i check
How u install pacc
pacc???
I downloaded the lavalink file then add application.yml and add its code
java.lang.UnsupportedClassVersionError: lavalink/server/info/AppInfo has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
and in console
this error keeps occuring
throw er; // Unhandled 'error' event
^
Error: getaddrinfo ENOTFOUND sftp
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:64:26)
Emitted 'error' event on WebSocket instance at:
at ClientRequest.<anonymous> (C:\Users\hajji\OneDrive\Desktop\Attitude Future\node_modules\ws\lib\websocket.js:554:15)
at ClientRequest.emit (events.js:310:20)
at Socket.socketErrorListener (_http_client.js:426:9)
at Socket.emit (events.js:310:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOTFOUND',
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'sftp'
}```
so I need to use old version of lavalink
😐
hostname: 'sftp'
throw er; That line means, "Throw an error" (intentionally)
Hello, I still try to make my bot change status, but its not really working
how to make clear command in python like if i type .clear all the msgs is cleared but my msg is not deleting please help
Hello, I still try to make my bot change status, but its not really working
@earnest phoenix Look in the docs for something like: client.SetGameAsync("Some status")
how to make clear command in python like if i type
.clearall the msgs is cleared but my msg is not deleting please help
@lethal pine Deleting messages is it's own api call, not clearing console
Then set it on a timer?
Yes but how do I even let it change
i tried random stuff
based on what i thought
and the docs aswell
Look for the OnReady event, and make a loop with a sleep command for 10 seconds that setsStatus
@earnest phoenix
client.on('ready', () => {
// Do timer that calls setStatus
}
@faint prism uhm I finally did it lmao now I just gotta figure out some other stuff (the birthday thing)
yeah
I did it differently tho
``select bdUser from birthday where DAY(bdDate) = DAY(CURDATE()) and MONTH(bdDate) = MONTH(CURDATE());` <- was easier
Oh you're using sql?
mysql, yea
Gotcha, yeah I could imagine that being easier to do
What's the performance on that query?
I know using functions in SQL queries can slow it down a bit, so I was jw
ah well no idea tbh, since it's only getting called once per day (or at least that's the plan)
Oh, does it load the bdays into memory?
I have a commands folder which has subfolders in it, how can I adapt this code to work in subfolders?
delete require.cache[require.resolve(`./${command.name}.js`)];
try {
const newCommand = require(`./${command.name}.js`);
message.client.commands.set(newCommand.name, newCommand);
message.channel.send(`Command \`${command.name}\` was reloaded!`);
}```
Oh, does it load the bdays into memory?
@faint prism yes
I just can't figure out why my cronjob won't work
What is it?
No, what's the cronjob
try node-schedule
well I mean it is kinda working but like in a weird way
I can't call anything related to finding a channel or something
it just posts it in general lmao then it works
or well I can use id's in that term but no names
even tho I'm using the cron in my on Message
do you need a yt api key for lavalink ?
bdGreet.send('**THIS IS A TEST**' + 'Happy birthday to ' + '<@'+results[i].bdUser+'>' + ' Take a shot!' + '**THIS IS A TEST**')```
And I don't see anything wrong with that code 🤔
what is bot.guild
client.guild
discord.js . version?
11
ah
bot doesnt have a guild property does it
yeh I really gotta update
can't help you then
only guilds right
bot doesnt have a guild property does it
@earnest phoenix idk probably not
why dont u use <client>.guilds.find( "compare id" ).send( message )
because I don't want to use id's
I have a commands folder which has subfolders in it, how can I adapt this code to work in subfolders?
delete require.cache[require.resolve(`./${command.name}.js`)]; try { const newCommand = require(`./${command.name}.js`); message.client.commands.set(newCommand.name, newCommand); message.channel.send(`Command \`${command.name}\` was reloaded!`); }```
btw can anyone help me with that?
just update it to v12
@earnest phoenix
It will probably break some stuff I guess, right?
you can look the changes up
ah ty
do you need a yt api key for lavalink ?
ohh that's way more chill to work with that
np
just ctrl f the code that errors after you updated to v12
and you should be fine
do you need a yt api key for lavalink ?
@earnest phoenix no it relies on scraping
Ah scraping. Easier than some APIs
But against yt's tos
What, getting the first video result in a search, and extracting the video link?
Scraping in general
can anybody say me how can I use asyncio Timeouts for timed messages in dpy
if (msg.author.roles.highest.position < member.roles.highest.position) { return }
is this
even valid code?
ok
so
roles doesn't exist on msg.author cuz it's a user
@tawny lava then how
can i do it
get the member property
u'll need to get the member object not the user
msg.member
AAAAA
Who tf uses msg instead of message
for some reason that makes me go reee
if (msg.member.roles.highest.position <= member.roles.highest.position) return msg.reply(`Person has a higher or same role as you so... Later Boomer`)```
is <= something ?
or is it =<
but it doesn't make sense
it must be <= right ?
No
There should be more proof you own the bot when you add a new bot. I could add @wild tree (my bot) and I could add @thorn flower or whatever with just the ID
It should be >=
why ?
Since you're comparing
Don't use <= it won't work
i wanna see
@delicate shore then freaking https://tryitands.ee
if person has lower role
@delicate shore bruh
try it
alot of coding is trial and error, if you dont try something out once in awhile then you'll never know what you can and cannot do
pl
soo what would be the equivalent of message.member.voiceChannel.join in v12?
either I'm dumb or just blind
member.voice.channel.join()
oof okay thanks
https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=voice https://discord.js.org/#/docs/main/stable/class/VoiceState?scrollTo=channel https://discord.js.org/#/docs/main/stable/class/VoiceChannel?scrollTo=join
:bruh:
okay finally updated everything to v12, thought it would've been way more to fix lol
(async () => {
await client.login(process.env.DISCORD_TOKEN);
client.music = new ErelaClient(client, [
{
host: process.env.HOST,
port: process.env.PORT,
password: process.env.PASSWORD,
}
]);
client.music.on('nodeConnect', node => console.log(node))
})();
->
^
TypeError: client.on(...) is not a function
best database for discord.py ?
Best database depends
like
Cloud 66 Blog: simplify devops for rails and containers
at Function.resolve (C:\Users\thury\Desktop\Bot Do Rick\node_modules\discord.js\src\util\BitField.js:150:11)
at Permissions.has (C:\Users\thury\Desktop\Bot Do Rick\node_modules\discord.js\src\util\BitField.js:45:28)
at Permissions.has (C:\Users\thury\Desktop\Bot Do Rick\node_modules\discord.js\src\util\Permissions.js:45:85)
at C:\Users\thury\Desktop\Bot Do Rick\node_modules\discord.js\src\structures\GuildMember.js:268:53
at Map.some (C:\Users\thury\Desktop\Bot Do Rick\node_modules\@discordjs\collection\dist\index.js:235:17)
at GuildMember.hasPermission (C:\Users\thury\Desktop\Bot Do Rick\node_modules\discord.js\src\structures\GuildMember.js:268:29)
at Object.exports.run (C:\Users\thury\Desktop\Bot Do Rick\commands\anuncio.js:4:24)
at Client.<anonymous> (C:\Users\thury\Desktop\Bot Do Rick\index.js:46:26)
at Client.emit (events.js:315:20)
at MessageCreateAction.handle (C:\Users\thury\Desktop\Bot Do Rick\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
(node:10184) 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:10184) [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.```
This is an aerror
i will send the code
exports.run = async (client, message, args) => {
if(!message.member.hasPermission("Anunciar Mensagem")) return message.channel.send({
embed:{
title: ':x: Erro',
color: '#2F3136',
description: `
Você não tem permissão.`
}
})
if (!args[0]) return message.channel.send({
embed:{
title: ':x: Erro',
color: '#2F3136',
description: `
Utilize: /anunciar <anuncio>`
}
})
let canal = message.guild.channels.cache.get('739901247087444070')
let anun = args.slice(0).join(' ');
let author = message.member.displayName;
let embed = new Discord.MessageEmbed()
.setTitle(":bell: | **YT - ANUNCIO**")
.setColor("#2F3136")
.addField("Anuncio:", `${anun}`)
.addField("Autor:", `${author}`)
.setTimestamp()
canal.send(embed).then(icon => {
icon.react(":white_check_mark:")
})}```
AUGH
Its a announce system
USE ```
Anunciar Mensagem isn't a bitfield/flag
docs.
Thanks
Is there any real way I can use the Discord API without a wrapper like d.js
It will be HARD AS FRIK
ik
but
just curious
websockets and http requests
Of course
can anybody send me discord.py server link
ok
I wouldnt recommend using the discord api without a wrapper as a starter
Pretty sure even discord doesn't recommend not using a lib for bot stuff
For learning 100% do it
For an actual bot, use a lib
i wanna lock my bot to one VC
otherwise it breaks when someone uses command
in another VC
Then
didn't get the channel in disboard
Check if it is already in one
;-;
;-;
;-;
@delicate shore you asked for help we helped you don't expect us to always go shenanigans for you or anyone tbh
this is how you check:
-;-;-;-;;-;-;-;-;-;---------
if you know the basics of http requests and websocket connections you should be fine as long as you have some experience with your chosen language
Yes, I just googled it
thanks @solemn latch
Also this isn't shitpost, this is development
How are you guys running your bots? Mine is via a system service
Pm2
if (message.member.voice.channel != bot.member.voice.channel){
message.reply("no boi i can't stay in more than two vcs");
}
@delicate shore hope it works
op
Someone please say I was correct
op
@delicate shore so you literally wanted sspoonfeeding
Node error: connect ECONNREFUSED 127.0.0.1:7000
When I'm trying to connect to ErelaClient
what is erelaclient
lol
eestop
So a server using my bot has 2Factor enabled, so now the bot can't use the message.delete() command. How am I supposed to fix that? Can't easily find much explaining 2Factor with bots
Pm2
@solemn latch Damn that terminal UI looks clean
Also about as simple as it gets
Takes 15 seconds to get pm2 up and running on a new vps
Does it restart the bot if the server reboots?
I use pm2 as well
but @earnest phoenix problem is
i use
distube
so
RIP
um
discord is lagging or is it only me ?
So many music libs
wait what
Well, so far I've managed to avoid using nodejs
@earnest phoenix i don't think it is has anything to do with v2 but sure
i have a backup code
my previous one
i will use that
in which i use ytdl core
use git

??
So does distube not let you use djs methods or something?
it legit says
git-scm is pretty good
So does distube not let you use djs methods or something?
@solemn latch yeh
that you need to change it to Manager
but i keep gettting the error that it is not a constructor
wolfy it's a node error which means it couldn't connect to Lavalink and also v2 isn't out it's in beta
but i keep gettting the error that it is not a constructor
you've used it wrong
ok i changed it back
but why cant it connect to lavalink
how can i find that out
Looking at the distube docs, you still have full acess to your guild member object.
Theres zero reason checking this wouldnt work
@solemn latch js if (msg.member.voiceChannel != bot.member.voiceChannel){ msg.reply("no boi i can't stay in more than two vcs"); }
but why cant it connect to lavalink
@earnest phoenix it's probably your nodes
Bot.member makes no sense
they have a lavalink channel
discord laged
Yeah
ok
You probably will need to check if your bot is even in a channel aswell
if (msg.member.voiceChannel !== msg.guild.me.voiceChannel){
return msg.reply("no boi i can't stay in more than two vcs");
}```
You probably will need to check if your bot is even in a channel aswell
@solemn latch i already do that
and this is not working
no repsonse
are you dumb
I am. Thats forsure
read the docs
I didn't read the docs yday, and my commit wiped my db ;P
did you check the docs
IDs
ok
@delicate shore
lemme try
Er my website is a bit broken, I was trying to learn Javascript and I have 2 issues, My rickroll test thing dosen't show
<body>
<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<p id="CheeseTypeAnswer"></p>
</body>``` and my alert and prompt aren't working
```js
console.log('Welcome to my website!')
alert('You are visting my website!')
var CheeseType = prompt('What is the best type of cheese from your point of view')
document.getElementById('CheeseTypeAnswer').innerHTML = 'The best type of cheese from your view is,' + CheeseType```
OP
🧀
if (msg.member.voiceChannel.id !== msg.guild.me.voiceChannel.id){
return msg.reply("no boi i can't stay in more than two vcs");
}````
so tim like this ?
@quartz kindle That comparison works for a simple object, but more complex ones may differ slightly
so tim like this ?
@delicate shore A better bet
yes, but its a best practice precisely because of that
you never know how complex objects are gonna get cast
chrome's dev tools
idk
or ctrl + schift + i
i dont wanna implement on a bot
i need like an site
bruh then you just get the image anyways
it literally just takes a URL and returns an image
not limited to bots only
bruh are you like
jeremy clarkson the best
nice telk's api
what
Discord is absolutely perfectly flawless, it couldn't have glitched. You glitched
no
i typed @ then Telk and it only showed kirby not telk's face
also #general let's go yeeeeeeeeet
Thats just discord loading users
Base 16 number system
Anyone know a way to go around overlapping text in canvas?
Like to prevent it from happening?
1 to F
0 1 2 3 4 5 6 7 8 9 A B C D E F
🆗
Theres ways to scale text to fit within an area
Of course there's 0
because what you typed counts to 15 characters
1 2 3 4 5 6 7 8 9 A B C D E F
Theres ways to scale text to fit within an area
is there any docs on it?
yep
just search on their websie
not even the mdn docs site but ok
then
n0t an Ip gra<bber
lol
I currently have this http://jsfiddle.net/dgAEY/ which works perfectly, I just need to figure out a way to size the font when it gets too long. I've looked into Auto-size dynamic text to fill fixed...
umm
You wouldn't do canvas width, but the width you want
use word-wrap
oh you don't get what i mean
set the text box to the size of the canvas
finally it works
i've already use the measureText method
then do word-wrap
@earnest phoenix ty
np
eventhough those people didnt help me
o rip
but i appreciate you tryna help me 😄 😄
soz just gotta write over some stuff
but see you i used measureText on the user's tag
but it overlaps the welcome text
the size differs between how big the user's name is
it's hard to explain from my point of view
Right.
as the username is longer, it gets smaller.
If the name is too short, it gets to big. So you need a max size
yeah i got u
huh?

is that website
the text height is font size
html ?
css ?
of course
:0
html and css work together
i am not good in designing
html is the website and css makes it look fancy
: /
you can't have CSS without HTML
it will do nothing
ik
dude i am not dumb
is that website
html ?
css ?
you're literally asking if it just html or just css
let's end this
period
._. why u make everything importain
@solemn latch yeah ill just set a max size
when it is just a small problem in syntax
if my bot uses sharding how do i get the server count?
ahm
when it is just a small problem in syntax
tf are you saying you never showed any code to me
period
client.guilds.size
use broadcasteval and reduce
i bet you don't even need to shard

just use that way for now
don't
i ask a lot of stuff for curiosity
just broadcastEval lmao
what i put process.exit in it
you don't need to shard for now
and stop every single sahrd
¯_(ツ)_/¯
you don't need to shard for now
i ask a lot of stuff for curiosity
ok
broadcastEval goes over every single thing in an array and does smth to it?
u should shard when u have 100 servers +
no
1000+
anybody with the idea why ping is -ve
wut
u should shard when u have 100 servers +
dude shut up tbh
@arctic cape LMAO
ur bot is so fast
anybody with the idea why ping is -ve
because your bot is literaly too fast
ltieraly
no joke
less then ms
lmao
that happens to me too
any idea why it say -ve no. though?
its a bug. i have this usually when i run it on my PC
i never changed the ping command
my ping command has gif 😍
i dont have ping command
(i guess difference in system time in ms)
its a bug. i have this usually when i run it on my PC
oh ok
i add it into Bot info command
maybe your system time is not 100% there
any idea how to do wildcard?
If you measure ping by sending messages and getting the diffrence in time between the sent message and when it was processed by discord this can happen
since for calculating the delay you use the hosts system time
nope its online 24x7 and updating stuff
The typical proper way is to use websocket ping
it handles server stats as well
so its constently listening to events
anybody knows how to use wildcard?
in command if statement?
in what context?
like i want to search user's msgs for a specific string
yep
i guess this can become a pain in the ass if you want to search in older messages
nah new things
i got my bot upto V0.9 till now
regex also works
@earnest phoenix where are you from 🤔
noice
which state bro?
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/donenv - Not found
npm ERR! 404
npm ERR! 404 'donenv@8.2.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\filip\AppData\Roaming\npm-cache\_logs\2020-08-07T15_15_53_270Z-debug.log
``` helpp
yea come there
How does first() work? Would it also work in arrays or na
donenv?
try dotenv
its collections
use dotenv
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/donenv - Not found
npm ERR! 404
npm ERR! 404 'donenv@8.2.0' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\filip\AppData\Roaming\npm-cache\_logs\2020-08-07T15_15_53_270Z-debug.log
``` helpp
@finite nimbus bruh you put a package that doesn't exist
ohh 
type the name correctly
XD
npm i <name without type>
not donenv xd
you typed donenv 
oendotven
let's forget that me also made a typo
wth's that?
.env files are awesome
yea
you can store stuff without anyone peeking
chilling
and asking some doubts
also
if i ever want to make bot public
what does <canvas> in HTML do
wtf???
Canvas is canvas
bro
It's node canvas but native
A lot of web animations are canvas
Is canvas written in js btw?
The canvas element is part of HTML5 and allows for dynamic, scriptable rendering of 2D shapes and bitmap images. It is a low level, procedural model that updates a bitmap and does not have a built-in scene graph, but through WebGL it allows 3D shapes and images to be displayed.
like the https://onedirectionmusic.com buttons that go REEEEE when you hover them?
mdr
this is made with canvas
It's just a blank PNG lmao
yea exactly
Yes
Yep
Nope
nice to know that Chartjs hates mobile users
nope
discord cdn dying
pc
lmfao
Lol
since its litterally adding .json at the end of the page url
How can i add an error report to the mathjs?
I dont want it to crash everytime i enter ;math lmao
some APIs are hidden
how can i send an error message everytime the bot cant solve the question
using mathjs
Even discords api has a lot of undocumented stuff
oh
try{
math shit
}catch(err){
error shit
}```
but they still have docs atleast
how can i send an error message everytime the bot cant solve the question
you do :
try {
//code
} catch (err){
//run smth on error
}
try catches are really useful
^ yes they are



