#development
1 messages ยท Page 990 of 1
You know.
Nvm
I just kept it like this better.. ๐คทโโ๏ธ
bot.user.setActivity(`${bot.users.cache.size} members! || a!help`, { type:"WATCHING", })
should I keep it as it is better?
you could just say the guild amount, if you update the description at every member youre gonna get rate limited
Does anyone know why this happens?
Does anyone know why this happens?
@still merlin send log
here's what i would do for my bot client.guilds.map(x => x.memberCount).reduce((x, y) => x + y)
mine returned NaN too but this fixed it
woooooooooooooooooooooooooooooooooooooooooo
Is it my eval command then?
can you like actually send the error instead of "error happened"
^
${error} is undefined apparently
cache?
and I dont know how to define it
are you still on v11?
try {eval} catch (err) {send(err)}
No im on v12
I evaled catch (err) {send(err)} and a error
is the eval command incorrect?
client.on("message", (message) => {
const args = message.content.split(" ").slice(1);
if (message.content.startsWith(prefix + "eval")) {
if (message.author.id !== "529770099285032980")
return message.channel.send(
"**error** Only the bot owner can execute this command!"
);
try {
const code = args.join(" ");
let evaled = eval(code);
if (typeof evaled !== "string") evaled = require("util").inspect(evaled);
message.channel.send(clean(evaled), { code: "xl" });
} catch (err) {
message.channel.send(``:x: Error preforming eval command`");
}
}
});
so err is undefined you say?
no error is
wait what, i've literally told u before to stop creating an event for each command.. why are you still doing that?
bruj
sounds like a bad memory leak
it was a while ago too, and they had one then too
You never said that OfficalyLost, Or I didnt see it
a event for every single command? wtf?
better get that checked out
would be to annoying for me to keep track of
yes you did, you even said it already says you've got a memory leak when i said your going to get a memory leak..
You never said that OfficalyLost, Or I didnt see it
its like a n unwritten rule, use switch case-
or a command handler
how does a memory leak effect code?
it leaks your memory lawllll
In computer science, a memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in such a way that memory which is no longer needed is not released. A memory leak may also happen when an object is stored in memory but ca...
do I just remove all client.on's then?
execpt one
yes
ok
so like js client.on('message', message => { if (message.content == 'hi') message.channel.send('hi'); if (message.content == 'bye') message.channel.send({ embed: { title: 'hi' }}); });
https://discordjs.guide/command-handling/#individual-command-files maybe read into this
HH i need to re-write my hole code?
well, yes and no.
all your commands code can be the same, just how you are handling does
if you're not going to use a handler, you don't have to, its not going to change anything in performance or anything, just easier for you.
ok
handler actually has better performance, based on my experience
but can't really prove it
doing it this way also allows you to have dynamic help commands
with a command handler you can have a way better track of your commands since every command is in his own file
and reloading commands would be easier
no, not nesaccarily, woo
but you can always have a collection of commands in one file
dynamic help command would be possible with or without a handler
yeah
the handler makes it more efficent i guess. since you dont end up with some sort of super spagetti code
that doesn't change efficiency tho
but it's still really handy to have one, for keeping commands organized
yea
and reloading, again
@digital ibex it makes the coding workflow a little bit more efficent
how
Can I just copy and paste my package.json file into another one? (I'm gonna make another folder for a command handler incase it backfires- Most of my command handlers dont work)
you dont have to deal with clutter and keeping track of stuff in more complex commands
it makes it easier for u, and thats about it
@still merlin just make a copy of the entire bot and paste it somewhere
or, use git
u wot
(the main folder so you have your-bot and your-bot-copy)
but can I copy my package.json thing inside of it
its not the most efficent but you have a fallback
oml
the package.json wont help you much
ok
package.json is just the node modules you have installed
backing that up does nothing for you
if you want to add a command handler backup the entire bot. since you will edit not only the package.json
I cant be bothered to install all of my packages again so I copied node modules package.json and package.lock.json to my other folder
.-.
how many packages do you have installed
why are you guys talking about package.json
ur node_modules folder should be in the root directory of the folder, but ig you don't have to do that
idek
ยฏ_(ใ)_/ยฏ
dashboard
what do u use?
express + html & css + i forgot the third one lol
i have a handful, but because there are some prettifier things that im too lazy to write myself
html and css is a package?
wait wut
how would one go about Getting every user in ever server the bot is in so a (Total User Count) if you will Discord.py
as accurate as i can, lol
i know how todo it with guilds, but Users i'm having trouble with..
iterate through guilds, then save the members count in a variable, thats probably the most accurate way
so, len(guild.members) wouldn't work for this? ๐
well it works if all the guild members are cached
salut
if (command) {
if(command.timeout) {
if(Timeout.has(`${message.author.id}${command.name}`)) {
const p = new MessageEmbed()
.setColor("#ff9900")
.setDescription(`:no_entry_sign: **You can only use this command every ${ms(command.timeout)}!`)
return message.channel.send(p);
} else {
Timeout.add(`${message.author.id}${command.name}`)
.setTimeout(() => {
Timeout.delete(`${message.author.id}${command.name}`)
}, command.timeout);
}
}
command.run(bot, message, args);
}```
help ?
remove "." in front of setTimeout
What?
can
anyone help me?
how to i make a command called ${prefix}pokemon to display the pokemon for the user in the file mons
Can you show the package file and main file
ok
My main file is
https://pastebin.com/rZTY7h5K
Package.json is
{
"name": "discord-bot",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "amazrisf",
"license": "ISC",
"dependencies": {
"dblapi.js": "^2.4.0",
"discord.js": "^12.2.0",
"ffmpeg-static": "^4.2.1",
"ms": "^2.1.2",
"opusscript": "0.0.7",
"sequelize": "^5.21.13",
"ytdl-core": "^2.1.2"
},
"devDependencies": {
"prettier": "2.0.5",
"sqlite3": "^4.2.0"
},
"description": ""
}
wheres client.login()
Lol
I have it
how i do URLenconde in ruby?
your logging in on the ready event
but the ready event only happens when logged in
url_encoded_string = CGI::escape("'Stop!' said Fred")
# => "%27Stop%21%27+said+Fred"
Uh, I can't seem to find how to make a dynamic help command (discord.py). Could someone explain that to me?
Hi, how can I do invert avatar command? It doesn't work for me.
Can someone help me, please?
what doesnt work for you
function randomStatus() {
let statuses = [
`${bot.guilds.cache.size} servers!`,
`lt!help`,
`${bot.channels.cache.size} channels!`,
`Over ${bot.users.cache.size} users!`,
`Version 1.2.0`,
`Music Update!`
];
let rstatuses = Math.floor(Math.random * statuses.length);
bot.user.setActivity(statuses[rstatuses], { type: "WATCHING"})
}; setInterval(randomStatus, 20000)
Why my bot doesn't have any status ?
let Liste = Trier.map((e, Gcompteur) => `${(Gcompteur+ 1)}) [${bot.guilds.get(e.guild).name}](${e.link})`)``` 
You can't use links like that in plain text. Only in embeds or unless you use a webhook.
ow yes i'm stupid, sorry
what doesnt work for you
@solemn latch everything :D
well, whats your code, and what errors?
I tryed now image-js npm, gimme minute I'll send code
const { orange } = require("../../colours.json");
const fun = require("../../botconfig.json")
const db = require('quick.db');
const { Image } = require('image-js');
module.exports = {
config: {
name: "ainvert",
usage: "ok ainvert",
category: "fun",
accessableby: "Members",
},
run: async (bot, message, args) => {
if(message.channel.type === "dm") return;
let section = db.get(`fun_${message.guild.id}`)
if(section === null) section = fun;
if(section === "false") return
let member = message.mentions.members.first() || message.member;
let avatar = member.user.displayAvatarURL({ format: "png" })
let image = await Image.load(avatar)
let grey = image
.grey()
.resize({ width: 128 })
grey.save('bulgee-avatar.png');
const send = new MessageEmbed()
.setTitle(`${member.user.username}'s inverted avatar`)
.setImage(grey);
return message.channel.send(send);
}
}```
(node:177717) 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: 28)```
this is error
avatar is a link, not an actual file
^
I don't know how to fix it
i'm not wrong in saying there is a way to check for Guild owners right?
it would be in the guild collection
ty
@somber pumice keep shitposting in #memes-and-media please
if(messages.content !== "fr" || messages.content !== "en")return message.channel.send(`the only lang available are french and english`)```
How to overwrite all channels permissions ?
loop
@bot.command()
async def rainbow(ctx):
if ctx.message.author.Guild.owner:
await ctx.message.delete()
i've 100% used the Guild.owner wrong,
lmao
message.guild.owner
however python does it
Cause at that point you are trying to get a guild through a user, which doesnt make sense
Hey, how do i use image-js with a URL?
I can't seem to find how to make a dynamic help command (discord.py). Could someone explain that to me?
i'm trying to make a Owner only command @grizzled isle only the Guild owner can run ,
Okay do:
"ctx.message.author.id === msg.guild.owner.id" or however the syntaxes is with python
@bot.command()
async def rainbow(ctx):
if ctx.author == ctx.guild.owner:
await ctx.message.delete()
@grizzled isle thats not how python works
@digital ibex I did state "however the syntaxes is with python"
what even is the var ctx supposed to be 
ctx means context typically
yes
Sorry, I died. Did someone help me?
check it urself lol, scroll up or something
Basically image-js, how to use with avatar URLs
Oh it's like 15 messages up
e
Can someone help me please?
I'll send code in a sec
what are you trying to do?
Hi
youll need to download the image, with canvas there was always a function for it
idk about image-js
@digital ibex (or woo lma9)
h().catch(console.error);
async function h() {
let image = await Image.load(target.avatarURL())
let invert = image.invert()
return msg.channel.send(invert)
}
that should be it
not working, lemm try again
Idk how to do it :v
r u getting any errors?
Yeah
what are they
I've tried ctx, but it doesn't work
no such file or directory ('file path string with image url at the end')
im confused, what do u want to happen?
it to send the inverted image into the channel
and invert the image d- ok
wait ill buffer it ๐
u need to provide an actual url
:ooooooooooooooooooooooooooooooooooooooooooooooooooooo
and then u just do .invert(url) or whatever
console.log(target.avatarURL())
i am confusion
@pure lion me 2 XD

the example was
const image = await Image.load('https://example.com/image.png');
but how was it loading this from the web, its searching from a file path on my pc and ugh wsoaighiodfshgliueshrgtioukhasdfiu
waitnvmimretarded
it appears .load gets it from the web
look at my code
its using .load rn ://///
Ok
console.log(target.avatarURL())
theres two ways to do it apparently
u wot
what's the ratelimit for deleting messages
100
not sure but you can only delete up to 100 per request
all of the rate limits are on the developer docs
I still don't know how to invert it xd
well
And send
woooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo it logged it
i just wanna know ie, how many .delete() i can call say every 5s
its on the doc site
i'm too tired to trawl through the api docs lol
okay, well then im too tired to do it for you

the full url @pure lion ?
yeah
you can check headers [@sick cloud]
ah shit
var request = require('request').defaults({ encoding: null });
request.get(target.avatarURL(), function (err, res, body) {
if (err) {
console.log(err)
} else if (res) {
}
});
what is res
i litera-
why are you making a request to the avatar url
:inhale:
ah
why are you making a request to the avatar url
StAcK SaiD sO
you can try that one
well don't
because you don't need to request the url for anything other than to waste discord's resources
also ok cool
ok how do i buffer shit-
it doesn't seem to have a response lol
๐๏ธ
amazing
i just want to know how many messages i can delete before i get ratelimited ๐
so i can put a time queue on this filter
you can also try asking in the discord developers server
no response
waittheresadiscorddevserver?
lol yes
well until i know the ratelimit i'll just make it try to repeat, that should do
can't you use deleteMessages()?
uhhhh
Ok xd
how can docs be wrong
@pale vessel i see u
Error: Could not load data:image/webp;base64,UklGRnwAAABXRUJQVlA4WAoAAAAQAAAAfwAAfwAAQUxQSA8AAAABBxAREQBQpP//I6L/qX8AVlA4IEYAAABwBgCdASqAAIAAPm02mUmkIyKhIIgAgA2JaW7hdJAAT22IvEFRz2xF4gqOe2IvEFRz2xF4gqOe2IvEE2AA/v+VgAAAAAAA
sdfsldfskhjdfg
plerase
help
that's not a buffer
ik
but
shit happened
i had a buffer
and when i fed it to image.load thats what it output
just- const buffer = await fetch(url).then(x => x.buffer());
but you shouldn't even need to do that
*fucking explodes*
It said that itd search for a path in node
alright
or if you're not lazy, use canvas
canvacord is basically a wrapper for canvas and jimp
I have canvas
try using it
can it handle webp?
oop
Okay
const buffer = await fetch(msg.author.avatarURL({format = 'png'})).then(x => x.buffer());
wat is this
format:
is this where you make discord bots
it's an object
i am going to die i am going to die i am going to die i am going to die i am going to die i am going to die i am going to die i am going to die i am going to die i am going to die i am going to die i am going to die i am going to die i am going to die
@earnest phoenix not really
I'm being retarded as usual
this is where you can get help making a discord bot
DiscordAPIError: Cannot send an empty message
my internet sucks or your pfp is empty @pure lion 
its empty
Its just a blank png uwu
(node:13036) UnhandledPromiseRejectionWarning: TypeError [REQ_RESOURCE_TYPE]: The resource must be a string, Buffer or a valid file stream.
vAlId FiLe sTrEaM
bitch please

so 0 is text
YEP
const buffer = await fetch(msg.author.avatarURL({format: 'png'})).then(x => x.buffer());
console.log(buffer)
h().catch(console.error);
async function h() {
let image = await Image.load(buffer)
let invert = await image.invert()
//return msg.channel.send(invert)
let inverted = new Discord.MessageAttachment(
invert, 'inverted.png'
)
msg.channel.send(inverted)
}
hep
me
please
does anyone know how to
(node:17920) UnhandledPromiseRejectionWarning: TypeError [REQ_RESOURCE_TYPE]: The resource must be a string, Buffer or a valid file stream.
change the colour of links
ive already told u how to do it
you didn't generate a buffer
jeremey, wym? w/ css or disocrd embed?
css
isn't it toBuffer()?
wai wrong server
wait lemme have a look
please read docs
u can use text-decoration
what lib?
@pure lion what lib do you use?
discord.js
new Discord.MessageAttachment( discord.js i'm assuming
i see no send function in the guildchannel docs wtf
its returning the same error
it's a text channel
๐
guildchannel is like the base
ah nvm, yeah it is on textchannel
now to make the nav bar transparent
where am i putting toBuffer(), ive tried it in 2 different places
in the docs:
// Send a local file
channel.send({
files: [{
attachment: 'entire/path/to/file.jpg',
name: 'file.jpg'
}]
})
.then(console.log)
.catch(console.error);```
i think you need to add that attachment in files array
okay
@misty sigil use opacity
or in the send
opacity: 0
@digital ibex doesn't that remove the links?
opacity?
let inverted = new Discord.MessageAttachment(
invert, 'inverted.png'
)``` should be correct
no it doesn't
apparently not since the module is broken and can't load URLs
weird
yeah, it's stupid
ah buy nvm i didnt see he wanted to modify the image too
i think i got rid of the wrong thing
files must be an input of Array<FileOptions> or Array<BufferResolvable>
FileOptions then needs BufferResolve
and then a name, which is optional
how would i do that
okbrb
how about using a module that isn't completely dogshit
can you double check if it is a buffer at all?
canvas is kinda nice 
it logs the image before
console.log(buffer);
as buffer
hmm
did you use toBuffer()?
const buffer = await fetch(msg.author.avatarURL({format: 'png'})).then(x => x.buffer());
console.log(buffer)
h().catch(console.error);
async function h() {
let image = await Image.load(buffer)
let invert = await image.invert()
//return msg.channel.send(invert)
let inverted = new Discord.MessageAttachment(
[{files: invert, name: 'inverted.png'}]
)
msg.channel.send(inverted)
}
code rn
you didn't
alright ill try then again
let invert = image.invert() // remove await because you don't need it
let buffer = await image.toBuffer()
// load as buffer
let invert = await image.invert().then(x => x.toBuffer());
// load as invert
// edit: doesn't work since invert doesn't return a promise
so if @everyone is the guild id, what's @here?


i think i am going to die

(node:16472) UnhandledPromiseRejectionWarning: TypeError [REQ_RESOURCE_TYPE]: The resource must be a string, Buffer or a valid file stream.
show code
wait
im so close
i can smell my inverted pfp
ooooh boy
@pale vessel
TypeError: image.invert(...).then is not a function
so if
@everyoneis the guild id, what's@here?
@sick cloud
nothing, here isn't a role, everyone is
show code
doesn't return a promise
@here
literally send @here
check your channel overwrites
let inverted = new Discord.MessageAttachment(
[{files: invert, name: 'inverted.png'}]
)
``` w hy n o s e n d i m a g e @pale vessel w h y yy y y y y y y y y y y yewmnr yn hjkbey
idk
well if thats the case then i have to set that for all channels which is dumb
aaaa
check your channel overwrites
@earnest phoenix admin bypasses all channel overwrites
even with overwrites on regardless, it doesn't work
that's weird
are you just sending @here as a string
this might have something to do with allowed_mentions field
do some digging around your library to check for this https://github.com/discord/discord-api-docs/pull/1396
or you might be setting it somewhere in your client config if it exists
i'm just using eris' defaults
what is the default
yeah
check the source [@summer torrent]
edit: i see no default value, it's only mentioned in docs
so
super(process.env.DISCORD_TOKEN, {
allowedMentions: {
everyone: true
}
});
that should sort it
yee ok ty
I think I got a headache from hitting my head on the desk
Btw @pale vessel it doesn't work
Time to not sleep because unfinished code makes me stressed
does anyone have a link to a free hosting service, as glitch has now banned the use of html pingers to keep bots awake
(heroku doesnt count, it only keeps programs awake for 30 minutes)
There really isnt good hosting services. A couple bucks a month though could go a long way
being a freshman without a job doesn't work with a couple bucks a month unfortunately๐
i can always host on my computer, but thats not ideal for me
Ah, well yea.
I'd say to invest in a raspberry pi
They're a life saver for hosting if you can't afford a monthly vps payment
lets not spam lol
Open You browser of choice
go to the default url
erase it
go to youtube
look up "how to host bot on rasberry pi"
(heroku doesnt count, it only keeps programs awake for 30 minutes)
@valid gyro excuse me, but.....30 minutes?
It actually keeps it online for 23h and 55 min
And 22 days per month
the free version is only supposed to do 30 mins i thought
i found repl.it so im using that instead
google and amazon offer free trials as well
1 year free trial
plus google also has an always free f1-micro instance
but they charge for excess bandwidth usage
which discord bots use a lot
the free version is only supposed to do 30 mins i thought
@valid gyro no it doesn't
(if you dont disable presences)
Free version just limit u to 450 hours/month
Or 550 h/m if you register a credit card
You just need to use worker dyno instead of web dyno
oh cool!
I need help how to make a private DM with this code help me
client.on('message', message => {
if (message.content === Prefix + 'JoinBot') {
const embed = new Discord.MessageEmbed
user.send()
.setTimestamp()
.setTitle('This Is the Bot Link')
.setAuthor('This Code Is By Xp And P O U T I N E')
.setDescription('https://discord.com/api/oauth2/authorize?client_id=721775900949086240&permissions=8&scope=bot')
.setColor(15844367)
.setFooter(message.author.tag,message.author.displayAvatarURL());
message.channel.send(embed);
}
});
user.send
But where do I put that
Right question is where you DON'T put it
user is a collection.
https://discord.js.org/#/docs/main/stable/class/User
when someone says user.send, they just mean, send it to a user collection
What
No I just need the code with my code
Get the user object -> open the user's dm channel -> build the message -> send to that channel
so, you have the collection named message, and you know the way to send a dm is with
user.send()
so you can go to the docs, for message
https://discord.js.org/#/docs/main/stable/class/Message
and it will tell you how to do that
you want to pm the author, so you follow the properties of message,
its https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=author
that link tells you, you get a User back
I still don't get it but ok
okay. you have a message, and you want to know more about the properties of message right?
Ya
so you can go to the docs, and itll tell you all about message.
these are all the things that you can do with message.
your looking to pm the author of the message, go to that section
and itll tell you this
message.author
will give you the author
if you click on the type(User)
itll give you the list of properties and methods of a user
if you look at the method, .send()
it tells you, that it sends a dm to that user
docs, are a chain you follow to get you the info you want
if you follow that chain, you get that information
Ah am bad at coding I'm confused but can you put it in for my code
i am trying to teach you how to use docs, so you never have to ask these questions again
and can find it yourself
Okay but can you at least show me example
i just did
O

So like this
.setFooter(message.author.tag,message.author.displayAvatarURL());
message.user.send(embed)
Just asking, but where did u get that code you currently have?
I made it
Really?
Okay my friend made
so close, the property to get the user, is author
message.author.send(embed)
here it is in the doc
https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=author
anyway, the point i was trying to make, is the docs explain everything, and just play around with the discordjs docs
Thank u, knowing your level of experience is the first step to knowing how to help u
.setFooter(message.author.tag,message.author.displayAvatarURL());
message.author.send(embed)
Like that
I'd recommend watching some videos about d.js
Videos explain a lot better than text
And keep the docs open at all times
Whenever you have questions just jump into the docs
the docs are the bread and butter of a developer
I like doing in text
The bread is the internet

its just the channel thats "created" between two users
How could I move a user to a voice channel using Discord.NET
O ok
Can't find anything
And what for dms
you can send PMs that way, its more of something for creating a message collector, or checking if a user is typing
yeah, you can use DMChannel if you want, theres no real reason to. both work fine
I need it to send it to the user dm not in a channel
well, like i said
message.author.send
sends it to the dm,
or if you wanna bother with dmchannel, you can use that
a DM is sent into a channel, its just a special type of channel, between two users
What is Dm like in a Channel or like it was send it to them
your just asking the same question
a DM is a channel, its just one between two users
And how do a pm
okay?
๐ค
so
DM means direct message
if you didnt know
send, means send to the thing its being applied to
so author.send means, send to the user author
or DM him
why you gotta troll me like this 
send, sends to the thing its being applied to
if you send something to a user
it goes to that user
and that user only
author
.setFooter(message.author.tag,message.author.displayAvatarURL());
message.author.send(embed)
Like that
yep
well, the answer was given instantly
you ignored it
so i tried to teach you how to use docs
then i gave you the answer, and you continued to say it was wrong

Me : ๐ You : ๐ค ๐

its annoying to answer a question, and to have the answer ignored
repeatedly
for 20 minutes
especially since i stopped working on my own project to help 
O ok
How the fuck do I stop my bot from exceeding rate limits
Im using code to make temporary voice channels and now it just wont turn on
I don't know how the rate limits work is the problem
also add a cooldown if not alr
I think I get why it happens, just have no idea how to fix
Clients are allowed 120 events every 60 seconds, meaning you can send on average at a rate of up to 2 events per second.
You can make a function which allow up to 2 events every 1 second.
To get it to start working again though, should I just wait for the rate limits to settle back down>
Huh
about a minute
Does discord.net have a system to tell you how much have been cut from that budget or do I need to count them? If so Im not sure how to count events
I knew I wasn't sending requests that often, but turns out I had a while to handle old voice channels using a bool = true as apposed to bool == true
Hi in this code I am trying to react with the 1๏ธโฃ emoji but I am not sure how I am supposed to input it in the parameter of the react method. I tried using unicode to put it in but It didnt work.
message.channel.send({embed: embed})
.then(message => message.react(': one :'))
.catch(err => console.log(err))
Their were no spaces between the colons in the code I just put spaces here so it wouldn't put the actual emoji
You might be able to just copy the actual emoji into the code 
I tried that and it just printed the unicode.

\:emoji:
I tried that too, it just says unkown emoji.
It says to just copy it in
Some emojis cant
ok
If I have separate CPUs for both of my server and database, which should I upgrade to reduce database lag like on writing?
Do i have to download npm
@dusk sphinx it comes with nodejs
I know but do i need to download it
do you have nodejs?
Not sure
do you have something called node.js command prompt installed in your computer?
node -v
I never had computer
Mobile๐
Android
does it have root access?
Maybe
termux allows you to install nodejs on mobile iirc
i never tried installing nodejs directly into my phone before so idk
Node.js or discord.js for control the bot
do you even have anything that can run node files in your mobile?
Why
small keyboard/screen...
i mean i even code on my tv
Really๐
ya my tv can install ssh clients so...
That's very large
i think the simplest way to code a bot on mobile is spend a few bucks to buy a vps and access it on your mobile using a ssh client
Why vps is simple
because i dont think you can install nodejs on your iOS or android mobiles
or you can just use https://glitch.com
I try if it can install
just install an ssh client if you want to use vpss and a browser if you want to use glitch
but glitch is not recommended if you expect your bot to grow large tho
since it's actually made for webhosting and stuff
hi someone told me about Keep Alive js and also Heroku. as this is my first project i wonder if anyone uses them and which one is more preferred?
How to make my bot worked
get a good hosting
check pinned messages
Where can i find it
no spoonfeeding here
but if you want a hint. you need probably a few commands and a Database
we can't just give you code and expect it work, you'll need tl have a lot of things which you probably don't have already
fuck I can't type
https://discordjs.guide/sequelize/currency.html#file-overview its a currency system but not that different from a inventory system
does discord js embeded message support markdown text? Trying to format messages
I think so
there is nothing to support lol
markdown is unrelated to it
it's strictly parsed and displayed on client side discord
Js does not support markdowns natively, but you can use markdown to send discord messages, and the client will render the markdown.
But if you want to render markdowns in source code
, then you would need a plugin for that
problems with canvacord module.
so how would I do markdowns when sending a discord message?
Just send markdowns
*this is an unformatted markdown message*
Then copy that message, paste it into what you are sending to
Can anyone teach me how to do the bot system
Hello Following Devs.
I hope you are in good condition
Can anyone recommend me a very good bot online hosting?
As I am computer hosting and it is really not ok..
check the pins
Or buy raspberry pi
help, i made a unmute command and its" working" . the problem is my test account is muted and there is no errors in my code but it still wont unmute my test account
did someone here know if you can find with Mongoose all documents where the timestamp in the doc.timestamp > Timestamp.Now ?
A complete mess bro
@earnest phoenix what do you mean?
does anyone know what the discord dev license can give to your bot?
Idk
Can i get a bot developer role?
Someone told me it can do something for your bot
then wait
Once itโs been approved you get the role ๐
and you get the role ONLY once it is approved
i made a warn command using mongodb but i don't know how to delete all data from a specific user through a command ( ex: /clearwarns @granite pagoda ) help ?
how do i change the font colour on canvas?
Someone told me it can do something for your bot
@rocky escarp
it does nothing for bots since you can have 50 bots per account lol
the license is meant for game developers
@rocky escarp after the 7.10.2020 you can get more than 100 Guilds. also he gets the verifyed tag
if your bot is not verified until than its capped at 100 Guilds
ohh..
you can make a shop in your Discord Server
but it doesnt give anything to the bot
"game developer"
How do I invert the colour of the entire canvas?
Hey I have a command which logs the "message.guild.roles" in the console, is there a way I can get it to dm the info to the user instead
Dice, draw a rectangle with the size of your canvas and the color you want
yeah I have this but it doesnt work: message.author.send('Server Info:' message.guild.roles);
error message: (node:28776) UnhandledPromiseRejectionWarning: DiscordAPIError: Cannot send an empty message
if I dont have 'Server info:' before
Dice, draw a rectangle with the size of your canvas and the color you want
@cinder patio if im doing from imageLoad?
yeah I have this but it doesnt work: message.author.send('Server Info:' message.guild.roles);
anyone know what to change?
thats literally basic js (joining strings together)
https://discord.js.org/#/docs/main/stable/class/RoleManager?scrollTo=cache
https://discord.js.org/#/docs/collection/master/class/Collection?scrollTo=map
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join
resources you need for what you want to achieve
is mmbr a array?
have you tried reading the error
i have
and what does it say
is mmbr a array?
its not a array its a value. try to remove the [0]
it's undefined
but it needs the 0 so that the person can't chose another pokemon
rip
what's bad?
idk that stuff
both are sqlite style databases
docs exist for that very reason
for you to learn
don't use json as a database, especially when you have data which quickly alternates, like pokemon
^
i never used quick.db and switched to Mysql then MongoDB after enmap used about 1GB ram on a bot with less than 10 Guilds
yes
when i think about it probably one you could look into bcs you can get a Free Database hosted for you
what is bcs?
because
i suggest looking into mongoose tutorials (node.js mongodb client)
and you can get a free MongoDB instance here https://www.mongodb.com/cloud/atlas
Host MongoDB in the cloud with MongoDB Atlas, the official database-as-a-service, on AWS, Azure and GCP. Try free!
can u help me get started with basics of it?
i started using MongoDB 3 Days ago. i still learn it
oh ok
i'll continue using json until i finish my bot then try mongoDB
also do you know how i can keep my bot online all the time?
#getavps
contabo, gcloud, azure, aws?
i use digitalocean
how much do they all cost?
heroku is free but has a few downsides
ok
you should avoid completely free hosting
^
heroku is really trash and glitch is starting to remove projects using things like uptime bots to keep the app alive
hi
ask2ask
can any body tell me how to get votes
hello, my bot is offline for 1 hours
how can i fix
anyone good at js and json?
case 'pokemon':
mmbr
how do i make my code so when i write .pokemon
it shows the pokemon in the mons.json file for the user
@stuck scaffold can you try do client.on("debug", console.log) and see what happens
@long yew require the json file, then get the data based on author id, then list the contents
okayyy i'll try
Although it isn't recommended to use a JSON db
@long yew that covers the basics of node.js https://www.youtube.com/watch?v=zb3Qk8SG5Ms
Hey gang, welcome to the first Node.js tutorial from this crash course. To download Node.js go to https://nodejs.org/en/download/ and select either the windows or mac version.
0:00 -- Welcome / what is Node.js?
5:19 -- What you'll learn
9:33 -- Installing Node.js
13:31 -- Ru...
yeah not even a db
yeah i'll change from json to another later on
Alright
i just wanna get a working basic code atm
Ok
that's not a good way to go about it
@long yew require the json file, then get the data based on author id, then list the contents
wow that is harder than it seems
write optimised code as you go
i just started using json
which is a good moment to also stop using it
oh idk much about how to use or change using it
@long yew require the json file, then get the data based on author id, then list the contents
@quartz kindle what are basic codes that i need to use to do that stuff?
You could use a forEach
enmap is relatively easy to use and is not bad in the beginning
but switching later one to something like Mysql or mongodb as already suggested earlyer makes sense
mysql is really bad from my experience w it
its not bad if you get the hang of it
yes it is
What is a database I should learn which is good for my CV 
postgres is so much more optimal
thats true
oracle is just not a company that targets performance
any sql db is good for a cv
you can see that from their jdk distributions ๐๏ธ ๐ ๐๏ธ
you could run mariadb wich is atleast opensource
if you learn sql, you can work with any sql-based db
MongoDB is also not bad
I don't think many companies uses MongoDB
and seems to be more lightweight
mongo is very popular, so definitely also a plus for a cv
yes
You could use a forEach
@golden condor how?
array.forEach(userid => {Console.log(userid))}
ok
not sure if this is valid
@long yew once you require your json file (mons = require("./myfile.json")), then you can access its contents using mons in the rest of your code. but then it depends how your json is structured
maybe nest the data per user
for example if your json is structured like this js { "347593857459":["a","b","c"] } then you would do this mons[message.author.id].join(", ") for example to list a, b, c
where mons is the entire file and mons[message.author.id] is the contents of that specific id
what is mmbr?
var mmbr = mons[message.author.id]







