#development
1 messages ยท Page 1480 of 1
@client.check it's a decorator under commands, you would do it as ```py
@commands.check(is_owner)
ohhh
but i got an error saying commands not defined
frick i messed up
i think it worked
tysm all of you
lemme try it out
you can also do a custom check like this, for a cleaner code, ```py
def my_custom_check():
def predicate(ctx):
return your_condition
return commands.check(predicate)
@client.command()
@my_custom_check()
async def command(ctx):
My bot is 3.500 server and I am sharding. My bot works very well on my own computer
but VDS does not open and gives an error. What is the problem?
ju
vps in its virtualized form VDS
Ah
quick question, python or node.js for discord bot development
woah this looks so much better...... tyvvm
please don't take screenshot from 1km away
https://take-a-screenshot.org
Whatever you're better at
hm
hmm for example?
How can I give an example of what you're better at?
lol
is this @summer torrent
I mean like for comparison what python is better at
python is slow
python is easier to write but has slower performance
oh god ill go with js
js because me lob js hehe
if you don't know either python or js i think python will be easier to learn
yea true
My bot is 3.500 server and I am sharding. My bot works very well on my own computer
but VDS does not open and gives an error. Does anyone have an idea
I know js alot
Like, it's like choosing between olive oil or soy oil
What's even the point of threads in Python
Idk, seriously
gosh darn GIL
It blew my mind when I discovered how threads work in python
Like, it makes no sense
GIL is why Python is a safe yet slow language
Your only option for concurrency is processes
Looks like your issue is that one shard is timing out
Not seeing the vds issue, since it's open
How can i cut a line of text
html/css
When i want to add a bot i get following error **
Forced themes are only enabled for creators who use custom CSS in their detailed description.**
It's not "only enabled", but it's recommended to be used only for this case
Ahh thank you
is this canvas
that's a thing?
i just stole a function from stack overflow and attach it to the context prototype
Idk canvas commands, they just look similar enough to graphics2d
Hmmmm
Does canvas have do csv
Docs*
If so check those
There is a way to round I just forgot how
this
just grab one of these
yeah with the html and css
gotta make sure it works properly
i'm not doing those arcTo() manually

god bless those people that made a function for it
const currentremind = await remind.fetchremind(message.guild.id , "message");
let content = [];
let g;
let r;
for(g = 0 ; g< Object.keys(currentremind).length ; g++){
content.push("Name:" + currentremind[g].name + "\n" + "timer:" + currentremind[g].time + "\n" + "triggers on:" + currentremind[g].trigger + "\n")
}
const reactremind = await remind.fetchremind(message.guild.id , "reaction");
for(r = 0 ; r< Object.keys(reactremind).length ; r++){
content.push("Name:" + reactremind[g].name + "\n" + "timer:" + reactremind[g].time + "\n" + "triggers on:" + reactremind[g].trigger + "\n")
}
``` the first for loop works but the second one give a error `Property of Undefined by name `
but why?
unless currentremind has numbers as keys, you can't just use an iterator to loop through its values
you'd have to do something like a for/of loop or Array.forEach
both have the same object structure
does it use numbers as keys?
wdym
it works on the first , why not on the second one?
i just want to ask that
^
gldid: { type: String },
channelid: {type: String},
name: {type: String},
time: {type: String}, //// just for Interval
astime: {type: String}, //// 14d 22h 02m
remindtime: {type: String},
option: {type: String},
content: {type: String},
ping: {type: String},
trigger: {type: String}
thats the structure
o
yes ๐ญ
I nearly wanted to kill myself
bc I am so dumb
happens to the best of us
you just want to die until you saw that one little thing you missed
@earnest phoenix it has a random code and it worked just fine yesterday
I have no idea abt dashboard but I have a question does the dashboard server is also hosted by the bot hosting
Maybe a dumb ques
Even if only one gif was broken, the other ones shouldnt
Yk what I mean
Fr, sigh
Lemme finish that horror first lol
Should I?
Mhm, I don't really see the difference yk
Nah, u right
Will try to remember it
Lol
They are lol
My private commands are others yk
Like more intimate stuff yk

Will do, thx boss reno
Time to finish that horror weird hoe, cya later
A dashboard is just a normal site
You host it like you'd do with any other site
Hosting at the same vps will help reduce latency tho
same datacenter also works, sure not as fast as same machine but still faster than somewhere else
Suprised for the millions of bots out here only a few have dashboards
also some Hosting Provider give you Private Networks so you wont have to use the long way
Dashboards are annoying
Require knowledge in Frontend stuff and Oauth2
sure Oauth can be optional but makes it way easyer
Using python there are already some discord oauth 2 libs that make stuff so much easier
Same machine > same datacenter > same city > same region > same country > same world
i host my next Bot on a Server that is located on the ISS so it will have wired Latency
in js i would catch the error that will be created by it
does it fire a trigger or event when it runs out?
Doesn't node have a debug mode?
he uses py
What error
put your code in a try except block
try:
// some code
except:
// time out error thrown by discord.py
send message
You can do that when your client is ready
oh
you can just put that in your ready event/provide the presence under ClientOptions
Yea
it works now, tnx
hey does anybody know a really good and cheap vps?
you get what you pay
i forgot the name of the vps someone sent me.
yeah I understand but my budget isn't that high tbh/
AWS, Azure, Google Cloud, Digitalocean, Vulture,OVH
they are pretty decent (even tho ive had my issues with OVH)
Lightning-1GB
1Vcore
1GB RAM
15GB SSD Storage
1Gbps Down / 100Mbps Up
Private Networking
Unmetered Bandwidth
Weekly Backups``` is this good enough for 2 bots to be hosted on?
i used to run 6 bots on a similar speced VPS
okay then it's good.
what is this btw
should i just make up something?
you dont really need it usually. you can name it like you want
having some issue with canvas rn
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
the attahment wont send. only the text
i love how pastebin puts the actual code in the opengraph title 
lmao ikr
hmm i dunno about that
Contabo
i always send just the image without any message
the background.png is there
wait lemme try that
aight
contabo
well i think you can use channel.send({ files: [canvas.toBuffer()] }) @steady karma
Had my issues with the cheapest plan, but that's because my server had a noisy neighbor
@mellow kelp thank you now it works lol
1GB container is pretty small unless you set up some swap. I do run my main bot on 1GB, but it's memory usage at 2900 guilds is ~80MB. Unless you do some serious cache control, 1GB might not scale well
if you know what you do you can run 5k Guilds off 500mb Ram
Meanwhile me at 1 GB usage 
stateless bots can run probably 10k guilds or more on heroku
heroku dont works for me 
Heroku is only good for dad bots
const av = await loadImage(member.user.displayAvatarURL({format: "jpg"}))
errors me that it isnt a function
what isn't a function?
@mellow kelp (node:464) UnhandledPromiseRejectionWarning: TypeError: member.user.displayAvatarURL is not a function
are you on discord.js v11
might wanna check to make sure
i- oh
npm installed me 11.3
lol
having v12.5.1 installed wont changes it
Still, djs 11 is pog
but what can i that error lol
U sure that function exist?
well it is in my code
Are you sure it actually updated
Yes
try member.displayAvatarURL()
1sec
if that works you really need to work on your variable names
because if it's a user you call it user, not member
It would say cannot read displayAvatarURL of undefined since User.user does not exist
User.user = message.user 
Something to keep in mind, if you installed any file:// deps which require Discord.js, things can be fucky
try running npm ls discord.js
now it doesnt fucking show the pfp
Well, djs 12 has some breaking changes if you updated
Just saying
Review ur entire code
took the source from github directly
log the url
might be an issue with your loadImage function
probably where you place it on the x and y

oh no my dumbass.
how to remove an element from a string? example: test123.js remove .js?
there's multiple ways to approach this
you can substring, slice, replace, split, and probably more
replace is usually preferred if what you want to replace is predictable since it accepts both regular expressions and strings as what to search for
You could also use regex with "don't match"
It'll stop right before .
And return the word
i did, returns me [Image:128x128 complete]
That's not the url, that's the image object
How do i get the url then?
it's the return value of User.displayAvatarURL
someone here knows a fix if dotenv wont load anything from a .env file even when its in the same directory as the main file where the config is loaded?
@rare plume Here: ```js
.setFooter(${message.author.displayAvatarURL()} ${message.author.tag})
๐
hey
{
var embed5 = new Discord.RichEmbed();
embed5.setThumbnail("https://media.giphy.com/media/cz314BBYiCkiA/giphy.gif")
embed5.addFields(
{ name: "**Moderation commands**", value: ```!kick``, `` !morehelp``, ``!help``, ``!lockdown``, ``!purge``, ``!tempmute``, ``!unban``, ``!warn``, ``!warnlvl```, inline: true },
{ name: "**Music commands**", value: ```!play``, ``!queue``, ``!skip``, ``!stop``, ``!resume``, ``!pause``, ``!shuffle``, ``!clear-queue``, ``!volume``, ``!filter``, ``!w-filters```, inline: true },
{ name: "**Misc commands**", value: ```!botlink``, ``!ping``, ``!serverinfo``, ``!userinfo``, ``!donate``, ``!support```, inline: true }
)
embed5.setDescription("**MAKE SURE THAT YOU HAVE A CHANNEL CALLED**" + " *``mod logs``* "+ "**IN YOUR SERVER!**" + "\n" + "**For more detailed help, use command !morehelp**")
embed5.setColor("RANDOM")
embed5.setTimestamp()
embed5.setAuthor('AwsomeCord || Server Moderation')
message.channel.send(embed5)
}
```TypeError: "" is not a function
really
no db for mod log channel?
and a static help command?
and discord.js v11?
anyway
what line?
Could someone give me a hand with the CSS on the top.gg page? I do already have the css ready to go, i just need some guidance on the class names and how to put the into the page itself
line 12
@misty sigil
{ name: 'Moderation commands', value: !kick``, `` !morehelp``, ``!help``, ``!lockdown``, ``!purge``, ``!tempmute``, ``!unban``, ``!warn``, ``!warnlvl, inline: true },
that is line 12
@misty sigil
i have no clue what this error even means. Never happened to me before.
you shouldn't use RichEmbed anymore
use MessageEmbed
(Unless you got some outdated version ig)
but my other help command works just fine
and it is built the same
o
okay uhhm
so i chaned it to messaEmbed and changed the lay-out to its constructor.
TypeError: Cannot read property 'client' of undefined
const n = require("../n.json");
const Discord = require("discord.js");
const human = require('humanize');
const client = new Discord.Client();
exports.run = (client, message, args) => {
{
var embed5 = new Discord.MessageEmbed()
.setThumbnail("https://media.giphy.com/media/cz314BBYiCkiA/giphy.gif")
.addFields(
{ name: '**Moderation commands**', value: '``!kick``, `` !morehelp``, ``!help``, ``!lockdown``, ``!purge``, ``!tempmute``, ``!unban``, ``!warn``, ``!warnlvl``', inline: true },
{ name: '**Music commands**', value: '``!play``, ``!queue``, ``!skip``, ``!stop``, ``!resume``, ``!pause``, ``!shuffle``, ``!clear-queue``, ``!volume``, ``!filter``, ``!w-filters``', inline: true },
{ name: '**Misc commands**', value: '``!botlink``, ``!ping``, ``!serverinfo``, ``!userinfo``, ``!donate``, ``!support``', inline: true }
)
.setDescription("**MAKE SURE THAT YOU HAVE A CHANNEL CALLED**" + " *``mod logs``* "+ "**IN YOUR SERVER!**" + "\n" + "**For more detailed help, use command !morehelp**")
.setColor("RANDOM")
.setTimestamp()
.setAuthor('AwsomeCord || Server Moderation')
message.channel.send(embed5)
}
}```
TypeError: Cannot read property 'client' of undefined
2020-12-26T20:30:30.066825+00:00 app[worker.1]: at new MessageEmbed (/app/node_modules/discord.js/src/structures/MessageEmbed.js:13:60)
2020-12-26T20:30:30.066825+00:00 app[worker.1]: at Object.exports.run (/app/commands/help.js:9:19)
2020-12-26T20:30:30.066826+00:00 app[worker.1]: at Client.module.exports (/app/events/message.js:11:13)
2020-12-26T20:30:30.066826+00:00 app[worker.1]: at Client.emit (events.js:326:22)
2020-12-26T20:30:30.066845+00:00 app[worker.1]: at MessageCreateHandler.handle (/app/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
2020-12-26T20:30:30.066848+00:00 app[worker.1]: at WebSocketPacketManager.handle (/app/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
2020-12-26T20:30:30.066848+00:00 app[worker.1]: at WebSocketConnection.onPacket (/app/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
2020-12-26T20:30:30.066849+00:00 app[worker.1]: at WebSocketConnection.onMessage (/app/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
2020-12-26T20:30:30.066851+00:00 app[worker.1]: at WebSocket.onMessage (/app/node_modules/ws/lib/event-target.js:120:16)
2020-12-26T20:30:30.066851+00:00 app[worker.1]: at WebSocket.emit (events.js:314:20)```
@quartz kindle
v12 probably.
probably
yeah probably.
by that i actually know, v12.
but why is this error occuring to this code?
what's line 9?
try require('discord.js').version
2020-12-26T20:54:51.843067+00:00 app[worker.1]: TypeError: Cannot read property 'client' of undefined
2020-12-26T20:54:51.843068+00:00 app[worker.1]: at new MessageEmbed (/app/node_modules/discord.js/src/structures/MessageEmbed.js:13:60)
2020-12-26T20:54:51.843070+00:00 app[worker.1]: at Object.exports.run (/app/commands/help.js:9:21)
2020-12-26T20:54:51.843072+00:00 app[worker.1]: at Client.module.exports (/app/events/message.js:11:13)
2020-12-26T20:54:51.843073+00:00 app[worker.1]: at Client.emit (events.js:326:22)
2020-12-26T20:54:51.843074+00:00 app[worker.1]: at MessageCreateHandler.handle (/app/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
2020-12-26T20:54:51.843074+00:00 app[worker.1]: at WebSocketPacketManager.handle (/app/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
2020-12-26T20:54:51.843075+00:00 app[worker.1]: at WebSocketConnection.onPacket (/app/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
2020-12-26T20:54:51.843075+00:00 app[worker.1]: at WebSocketConnection.onMessage (/app/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
2020-12-26T20:54:51.843076+00:00 app[worker.1]: at WebSocket.onMessage (/app/node_modules/ws/lib/event-target.js:120:16)
2020-12-26T20:54:51.843076+00:00 app[worker.1]: at WebSocket.emit (events.js:314:20)```This is the full error code.
hey nerds
hey nerd
const embed5 = new Discord.MessageEmbed()```line 9
yeah.
maybe it's because you're instantiating another client at the top of the file
removing it maybe works
i don't want a probably
already tried that.
so im trying to implement an asynchronous trait (with async_trait) and its erroring for some reason:
#[async_trait]
impl Sandbox for Counter {
type Message = UserInput;
fn new() -> Counter {
Counter {
value: 0,
..Default::default()
}
}
fn title(&self) -> String {
return String::from("Veldy weldy twatty chatty");
}
async fn update(&mut self, message: UserInput) -> std::result::Result<(), Box<dyn std::error::Error>> {
match message {
UserInput::IncreaseOnPressed => {
let res = get("https://httpbin.org/ip")
.await?
.json::<std::collections::HashMap<String, String>>()
.await?;
println!("{:?}", res);
Ok(())
}
UserInput::DecreaseOnPressed => {
let res = get("https://httpbin.org/ip")
.await?
.json::<std::collections::HashMap<String, String>>()
.await?;
println!("{:?}", res);
Ok(())
}
}
}
fn view(&mut self) -> Element<self::UserInput> {
Counter::view(self).into()
}
}
```and the error is ```rs
lifetime parameters or bounds on method `update` do not match the trait declaration```I'm stucked af so like glsjkgkljhfsdg
oh no
Hey, you can find them when **Inspecting Element! ๐ **
already did, like i mentioned, its not about me NOT knowing how css works, its simply some of them not being loaded into the page @feral aspen
for example, the wrapper class is being rather funky where it doesnt work sometimes when i try calling it by class name https://top.gg/bot/773585165317570610
erwin, can you send any relevant code
.setDescription(command.timeoutMSG + ` You need to wait **${this.ms(Date.now() - this.timeouts.get(`${command.name}${message.author.id}`), { long: true })}** to use the **${command.name}** command again.` || "You can't use this command, as you are on cooldown!" + ` You need to wait **${this.ms(Date.now() - this.timeouts.get(`${command.name}${message.author.id}`), { long: true })}** to use the **${command.name}** command again.`)
UnhandledPromiseRejectionWarning: Error: val is not a non-empty string or a valid number. val=null
???
im still trying to fiddle with it, but its a simple <style> tag with .entity-wrapper
and you get nothng?
what arent you getting
ah
why is that the only one going if they are all named cell's?
what about it is not working?
its not affecting all the cells
the fact that every single one of them is called cells
but its not applying to all of em
did you check for any IDs
i did, they are all the same class, not id though
but adding css onto a class should be absolutely fine
since they are all the same
call them each by ID just to check
the problem is the table or entity-wrapper?
it looks fine on my screen
im hella confused
ah
css!
wait
but its just acting up on its own lmao
try changing the class
i stll dont get what the problem is lol
and fucked again
entity-table__cell
welcome to the club
you mean that this background is randomly changing?
yes? lol
yeah looks fine to me too
oh erwin
do you have cache disabled? lol
CTRL + F5 maybe
ctrl f5 is very pog
pogging
ugh ffs
poggingers
papa
i assume rust lang
same
there 2 types of rust
the virgin one
the virgin'est one
which is which
good question
you are either a developer or a pvp scrib, i'd say they pretty goddamn close to eachother

hey i am looking to buy a vps but what should i put here?
like just a random hostname?
fair point
lmao google.com
just put mymomisfat
^ ^
yes, put timsmomisfat
is tha' true?
okay.,
I dont know what i have done wrong but custom prefixes are not working
const mongo = require('../../mongo');
const commandPrefixSchema = require('../../schemas/command-prefix-schema');
module.exports = {
commands: ['setprefix'],
minArgs: 1,
maxArgs: 1,
callback: async (message, arguments, text) => {
await mongo().then(async mongoose => {
try {
const guildID = message.guild.id;
const prefix = arguments[0];
await commandPrefixSchema.findOneAndUpdate({
_id: guildID,
}, {
_id: guildID,
prefix,
}, {
upsert: true,
});
message.reply(`The prefix has been updated to ${prefix}`);
}
finally {
mongoose.connection.close();
}
});
},
permissions: ['ADMINISTRATOR'],
requiredRoles: [],
};
If I set the "useFindAndModify" to false it says that "the options [useFindAndModify] is not supported"
Hello! How i can create bass booster mode for my music bot ?
amp up lower frequencies with whatever tool you're using
on ffmpeg there's directly an equalizer filter
"@discordjs/opus": "^0.3.3",
"array-move": "^3.0.1",
"discord.js": "^12.5.1",
"erit-ytdl": "^0.1.2",
"ffmpeg-static": "^4.2.3",
"lyrics-finder": "^21.0.5",
"simple-youtube-api": "^5.1.1",
"soundcloud-downloader": "^0.2.1",
"string-progressbar": "^1.0.1",
"ytdl-core": "^4.2.1"
Iโm looking for a bot that notifies the server when a person of choice posts a new tiktok video
im curious, even if its not efficient, would it be possible to stream using a bot? like is it even possible for a bot to stream?
client.on('message', async message => {
if (message.content.startsWith(prefix + 'hack')) {
var ids = ["673332321600143389"]
if (!ids.some(ids => message.author.id == ids)) return message.channel.send('Este comando estรก en desarrollo, por el momento, sรณlo mi dueรฑo es capaz de usarlo para testearlo.');
const args = message.content.slice(prefix.length).trim().split(/ +/g);
let autor = message.author;
let user = message.mentions.users.first();
var tipo = args[2]
async function mensajeHack(mensaje){
await message.channel.send(mensaje).then(message => {
message.delete({ timeout: 2000 })
})
}
if (!user) return message.channel.send(`No, ${autor.username}, Debes mencionar a alguien.`);
if (!tipo) return message.channel.send('We, tambiรฉn debes poner un tipo de hack, vaya animal.');
if (tipo == 'bot') {
if(!user.bot) return message.channel.send('Ese no es un bot animal.')
var servers = ["14","29","58","126","364","651","894","1356","1895","4793","8558"]
async function mensajeFinalBot(mensajeS) {
await message.channel.send(mensajeS).then(message => setTimeout(function(){
message.edit(`Fueron raideados **${servers[Math.floor(Math.random() * servers.length)]}** servidores con el bot **${user.tag}`);
}, 3000));
}
const hackBot1 = await mensajeHack(`Extrayendo token de **${user.tag}**...`)
const hackBot2 = await mensajeHack(`Inicializando Discord Bot Client...`)
}
}
});
it sends all messages at time
i mean the constants hackBot1 and hackBot2
It's not possible
so then the only way would be using a selfbot which is bannable, so pretty much "impossible"
Yeah
does selfbot only refere to coding one using discord.js v11 etc, or does it also count to an external item, for example using an external item which only reads for example a phone screen and can also click on the screen?
Selfbot refers to using a non-bot account to interact with the api through code
For example if i would send an embed without being a bot, this would be considered selfbotting
automating messages is also selfbotting
can someone help me?
Pretty much everything that cannot be done by a user and the normal discord client, this is also a reason why Discord does not allow Modified clients like betterdiscord
If they weren't so lazy to actually do some of the stuff I see betterdiscord can do maybe it wouldnt be against TOS
the both constants get executed at time
**My Code Not Working :-
client.on('message', message => {
if(message.content.startsWith(prefix + 'mute')){
if(message.author.hasPermission('MANAGE_ROLES')) {
const role = guild.roles.cache.find(role => role.name === 'Muted');
const member = message.mentions.members.first();
message.channel.send(member + 'Has Been Muted')
member.roles.add(role);
} else {
message.channel.send("Please Mention Who To Mute")
}
}
})
```**
wdym
what goes wrong?
i host it on heroku i dont get errors
bro
have you checked the output?
chill im jk
or the app logs
everything else looks fine though
yea
just add a if (!member) check
is that a new error?
ye
what's the error message
11 message events
the image doesn't show the full error
wait

sometimes heroku doesnt display it
yea it does
like it cuts off
scroll up
heroku logs -t -a my-app
whats the -t tag?
well -t is not necessary
well that doesn't seem to be near line 18
shows lines 122 to 133


@earnest phoenix do yourself a favour and don't use 11 message events
just use one
and else if statements at the very least
wdym?
don't use one message event per command
i cant do that all
create a command handler
i can do it for ~50 commands
im noob...
it's not that hard to make a handler
client.on('message', message => {
if (message.content.startsWith(prefix + "ping") {
}
else if (message.content.startsWith(prefix + "mute") {
}
});
beginer
yeah
bro i want to make sure that the user has manage role perms
i dont want handlers
why?
why not
how can you not use command handlers
i hate handlers they are complex to use
alright lets just focus on that then
right i'm out
just change guild.roles.cache to message.guild.roles.cache
lol
and you should be good
there was the listeners error too
asides from all 11 event emitters
@misty sigil talking about clean? my index.js has 500+ lines
you have to reduce the event listeners of your client
just use else if i am begging you
oh god

im out 
mine has 160 lines but thats with an api, sharding utilities and all the other shit
i'll reduce it to fuckin 50
sad require() noises
just watch me
hey i just looked up and java is a lot more popular on google and javascript and python
look it up on google trends
just watch this
bc minecraft
can anyone solve my problem?
well probably
i just did?
reduce the event listeners you have
LOL
how?
use a command hanahdler
i said im noob
didnt help made my bot go offline
how else are you gonna stop being a "noob"
"im noob" = You spoonfeed me
returns false ๐
I mean, do you even know what noob means?
im not really sure
im not proficient in canvas, but this is pretty useful
https://discordjs.guide/popular-topics/canvas.html#manipulating-images
yes
Javascrub
Some fix plzzzz
what's the error again
Oh my, titlecase everywhere
message.member
Panik
gwadibig it shows no error
and what is it not doing correctly?
or wait does that matter
we can't read your mind
@earnest phoenix change message.author.hasPermission to message.member.hasPermission
my bot is spamming Hi in console and its creepy
and that should have thrown an error regardless
i did pateice is the Key to success just wait
something like "User.haspermissions is not a function"
guess you didn't read the logs or something
Where are you printing Hi to console?
the bot executes the command but not assigns the role
no where
?
search it with ctrl+f
The bot won't print it unless you added it
oh is that how you search in vs code
yea
it says given but not actually giving role
ctrl+f
wouldve been useful like a few hours ago

5 seconds if your pc is burning some steaks
i use ctrl + f
I know
There's also a "Search everywhere" hotkey
Idk what it is in vscode
Lul
@wanton nova Thanks my code is working
A ctrl + f fixed it?
PHP is hot trash
no idiot
why'd you have to call him an idiot tho
bruh
like joke are you too offended? -_-
anyways does anyone know why visual studio is taking so long to download ๐ฉ
Quiet scrub
not at all
I'm trying to help
sadly no one paid attension
glad to see people check the channel topic
He's still offended from when I said "free nordvpn premium lul"
160 to 55 lines

ez
Lul
lul
lul
Visual studio is big af
sad
Like, you could download all IDEs and it'd still be half VS size
Except delphi
i used to code only with intellij
Delphi is shit
o
Visual studio
oh yeah
two different things
The big boye
that one's the big boi
Vscode is a text editor
18% rn ๐ญ

Ue4 will have official integration with intellij rider
I'm only using it for C# and C++ because I hear VS Code isn't all that great for those languages
the imported .uasset boi?
never in your life try to import a uasset in ue4
visual studio?
yea
that motherfucker tried to get 58GB
o
Use rider
i saw it trying to allocate that in the console
i could never even wish to use visual studio for anything lmao
Or resharp
my laptop cant even boot it up
Actually, use resharp
same lmao
welp, back to the goblin code cave we go
55*
Go erwin, your people need you
well actually 54 but i could make it more
my bot is printing my messages in console it s creepy
RPG(Idle RPG) or Economy(dank member) 
hhmm how??
figure it out
Imho, none
I don't use either
it takes two keyboard presses
But dank is quite popular
yea
I'm leaning to make an RPG type system
and the guy's commit names are epic
isntead of the typical economy
dot poster i am
check out the dankmemer.lol repo
Rpg is cool, but it can easily fall into afk arena niche
A storytelling rpg bot would be dope
Like, have a campaign akin to zork or fallout
"Long ago, two races ruled over Earth"
isnt this a development channel? just curious?
which
And we're talking about a rpg bot development
Booya
oh i thought rpg is a game...
ok??
neither did we ask for this
i didnt asked that either
ITs an opinion not an answer
isnt this a development channel? just curious?
ok??
and 16 line index file
whats so fxking insulting in that?
when did he say it was insulting 
its for all development
amateur
Legends : write 650+ lines in 1 index file
i never ask for your opinion
why are you acting so dumb??
yeah lol
dude, could you stop this already?
we're trying to have a normal development conversation
sure?? this is development
okay
anyways im out
Btw ElCholo, what do you think it's better to use in my ranked system?
A - Use players average mmr as division mmr
B - Set fixed mmr per division
C - Don't use division mmr, only player mmr
wait whats mmr?
Like, division mmr affect RP gains
Matchmaking rating
It's a secret score every player has depending on their performance
A is probably fine
Yeah, I've allowed ranked matches to servers I've given beta access
To collect info
thats pretty cool
Currently I use A, but looks like the first player to reach each division has somewhat a headstart
Because the division mmr will be same as theirs
For balance maybe do B
But then it's up to you if you want this to be more competitive or not
Hm, I'll have to think more about this
I think A would probably be called unbalanced at a certain point
It is a good concept so maybe you could introduce balance
Not at all because high mmr players rank very fast
its 2am here too 
like a points thing
A secret performance score to use in matchmaking
It'll adjust to how well you play
Yeah do it per player
It is
I mean divisions or whatever the fuck
But there's also a division mmr
I don't know mannnn
Like, eventually you'll fall in a dead zone
Which is a point where your division will match your ability
So it'll be harder to rank
Also called "elo hell"
Which is intended since it gives a greater satisfaction upon ranking up
you mean make it smaller to fit something?
measure the text with ctx.measureText
if it's longer than what you want, reduce the font size
Yeah, measureText will prob be more accurate
confusion
sad while loop noises
im getting ronaldinho soccer 64 flashbacks 
check the discord.js guid on canvas
maximum text size * maximum font size / current text size
Panik
they show a do/while loop
I don't mean that
Also not pro
But why specifically 2.5 or 1.8?
Use a fixed height and width
And rule of three for font size
meth
This
Like, let's say the maximum text size is 400px
400 * maximum font size / current text size
And you want a maximum of 10px to be font size
400 * 10 / current text size
Then let's say your text is currently 500px wide
400 * 10 / 500
4000 / 500
Your font size will be 8
Ik
You use a bigger limit then
Also, you need to clamp it
Else it'll also grow the font if it's smaller than 400px
The cool thing is that you don't need to pass actual font size
You put that formulae in it
The code will decide the size
the code will decide your fate
SHOW ME WHAT YOU GOT
Math.max(10, Math.min(maxWidth * maxSize / textWidth, maxSize))
For example
It'll be interpolated between 10px and maxSize
maxWidth = maximum available text width
maxSize = maximum font size
textWidth = current text width
Btw, this is an inverse rule of three, where the value is inversely proportional to the output
Use Math.max and Math.min
If you don't clamp it'll be quite wild
10 is quite small
You'll need to experiment it a bit
Also, consider shortening names that are way too big
With ...
Try 100
The formulae is, but idk if the way you're applying it is
Oh, wait
I don't think that's how u get text width
Length will get u the amount of characters in it
@mellow kelp come here dude
im trynna edit my level card
Oh
Ah, jumapa
Ik the issue
Length is right
Yeah, there's a reason for that
If you use characters u gotta set the maximum length in characters too
Currently it's using px
The first number in the formula is the maximum text size
Set it to something like 20
Or 25
Also, use math.max and min
U need to clamp it
Around the formulae
Math.max(minimum, Math.min(formulae, maximum))
Maximum will be the same number as the second value in the formulae
Minimum is whatever minimum font size u want
const find = await Queue.find({ rank: { $lt: 1 } }).sort({elo: 1}) how do i check if there is 2 items found?
Almost
Instead of 20 it'll be the formula
800 * 40 / textsize
Replace that 2800
Set it to 20 or 25
2800 would be in px
You gotta find a smooth value in character count
20/25 is a safe value
Most discord names will be around that
Yes
Try it
So, below 25 characters it'll be 40px font size
Anything above that will reduce the size, with a minimum of 25px
Yeah, experiment with the maximum size
You'll want to fine-tune both maximum size and maximum length
Maximum length will define the maximum name length before the interpolation kicks in
And maximum size will define the starting font size
if ( find.length === 2) {
console.log("Two players found");
}``` if the length is 2 it dosent acc do anything?
how do i search for 2 items with the rank: 0?
so const find = await Queue.find({rank: 0}, $filter: { size: 2})
Is that js or python?
js
someArray.find(val => some conditional that returns true or false)
but its not an array
It'll leave only values that equalled true
const QueueTest = new mongoose.Schema({
id: { type: String},
elo: { type: Number},
rank: { type: Number},
})
module.exports = mongoose.model('queue test', QueueTest );```
its numbers
Same works for maps
Pretty much all collections will work
then count will work?
Yw
or length
Size ig
throw er; // Unhandled 'error' event
^
TypeError: Cannot read property 'rank' of null```
ReferenceError: val is not defined
may be an easier way to do what i want
im tryna put players into the db
and get 2 members in the rank 0
Oh, wait
Mb, don't use find
Use filter
Didn't notice it
Ooooo wait
That ain't gonna work
Just now I noticed it's mongo
Sorry, you'll need to use mongo's filter which idk how to work with
does nodejs EventEmitter also accepts numbers as an argument for emit method?
like event.emit(4);
args can be any but the name needs to be a string
do you have used ts enums?
I want to know a quick way to convert the const enum keys to have the value of string version of keys like
enum EVENT {START, END, ....etc} to be
EVENT = {
START: "START",
END: "END",
....etc
}
you can use Object.keys()
It'll give you an array of keys, which for some reason will include each element's value
So for example:
[insert example]
enum E {
START,
END
}
const keys = Object.keys(E);
console.log(keys); // ['0', '1', 'START', 'END']
kinda surprised to see that ts allows something typescript-only to be used on runtime
can someone help with this js const find = await Queue.findOne({rank: 0}) const stats = await getUserRank(user.id) if(!find) { const queue = await Queue.create({ id: user.id, rank: stats.Rank }) i want players to only match with people in their own rank but i can only search for 0 is there a way to link if that makes sense?
so if there rank is 1 only match with people from one
u should have tagged me. ๐ณ
Anyway, using const at begin of enum, eliminates, the numbers as keys
let message = message.channel.messages.cache.get('MESSAGE_ID')
is it correct?
please no tryandsee link
[Insert tryandsee link here]
goddamn
U are not guraanteed to always get the message from the cache
u need to fetch it first
you might also want to use messages.fetch() as a fallback
Any good dashboard totourial?
sorry we're not doing tutorials here
this place is ask for code help not ask for code
@rocky hearth so how to do it correctly?
<TextChannel>.messages.fetch(snowflake)
There are couple more options there
https://discord.js.org/#/docs/main/stable/class/MessageManager?scrollTo=fetch
How do I get bot vote event from discordbotlist.com api? I don't know how to set it up.
ask their support server
Ik but a moderator told me to ask here
They didn't expect you to ask about another bot list
Oh
Can someone help me ?
This is my code -> https://hastebin.com/ehosigazuy.js
I am using gifencoder and gif-frames to get frames of a gif and encode then into another gif and in between changing some things using canvas.
The gif-frames is able to get the frames and it is getting edited by canvas but the encoder is however not displaying the frames and when I log it it is just a buffer with 7 bytes of data.
const lossAmount = Math.floor(Math.random() * 15) how do i make it 5-15?
let lossarr = [5,6,7,8,9,10,11,12,13,14,15];
const lossAmount = lossarr[Math.round(Math.random() * 11)];```
Something like this ? @fierce ether
how can i send private message like Clyde bot
not like that
There's a more efficient way to do that.
Math.floor(Math.random() * (max + min) - min) + 1
- 1? wouldn't Math.ceil() work?
Remind me what ceil does
opposite of floor kekw
how can i send private message like Clyde bot
?









