#development
1 messages · Page 962 of 1
Np
dumb*
You'll get there soon
how what
sorry I'm kinda dumb, I know that one of the ways to edit a message is using this .then(msg => { msg.edit but how can I trigger it without the ".then"?
I know I need to define the message first
I did
I'm saying that to lite
she asked it
mihz0 how do i destory queue 😄
@calm lantern use await
<style>
.html {
background-color: #4a4a4a;
}
.body {
background-color: #4a4a4a;
}
.bot-img {
border-radius: 500%;
}
</style>
i tried to change background color to see efects
Timo
But like i said, this doesnt give any efect.
i tested border-radius on inspect element and it should work
500%?
Try and do !important at the end of each thing (example: background-color: #4a4a4a !important;) as some things need an important to be overwritten. Also pretty sure it's just body rather than .body
yello
yes its just body
@weak parrot nah, doesnt work
are u sending guilds
i have: ```js
app.use(passport.initialize());
app.use(passport.session());
Okay nevermind it worked, now thanks guys.
for a dashboard, but req.guilds is undefined for some reason. i also have: ```js
router.get('/', auth, (req, res) => {
res.render('dashboard', {
user: req.user,
guilds: req.guilds
});
});
i wrote this code in rust but i'm curious as to why i need to cast data_set.len() to i32? if i don't do this it says the type is usize
fn main() {
let mut data_set = vec![2, 4, 8, 10, 6];
data_set.sort_unstable();
let sum: i32 = data_set.iter().sum();
println!("The mean of data_set's values is {}", sum / data_set.len() as i32)
}
uh
one sec lemme hop onto my computer
Ok so I took a look and .len() returns a usize because that's obviously how big the array could possibly be and Div<i32> isnt impl'd for uize because that can cause some errors say the sum is -5
I don't think there is a big work around
I guess you could make sum usize which might eliminate some redundancies but that's all i know of to do
im not entirely sure of what your problem is, but rusts compiler wants to know what type of result you want. it doesnt know what to value to use that emcompasses all the possible values of your solution whatever that solution may be. i hope that makes sense 
Can you send an embed + normal text in the same message?
help
anyone know how i can adapt this for use with my bot it only accepts stuff like this https:\/\/purr.objects-us-east-1.dream.io\/i\/zeVFT.jpg and not this https://i.imgur.com/VQi7xiv.jpg
Yes @opaque seal.
thx
@misty sigil what?
tryna get images from an api
it doesn't go past the fetch command tho
What's the char to quote text like that?
fetch("someurl")
.then(res => dosomething)
res => then just my code?
Res can be called whoever you like
And yes, res will be the response returned by the fetch
That's a promise
RESponse
That's why I call it like that
thx
.send(‘msg’, { embed: embed });[@opaque seal]
@earnest phoenix is there a way to send the embed first and then the msg?
aside from actually sending them seperately
Uhm
but the api might wanna have a talk
Yeah, you'll need to do a bit of research about fetch
Also, there might be another easier way of getting an image from the web
As I said, there might be an easier way of getting an image from an url
probably
Probably
just need it to return res.body.whateveriwannaget
Just dont save the image, use it from inside a var
Downloading doesn't necessarily means creating a file in your system
although I want to get the link not the file
So fetch would be better then
yea
as the API im working with returns
{
"message": "https://images.dog.ceo/breeds/pitbull/20190710_143021.jpg",
"status": "success"
}```
You'll need to use imgur api if you want to get imgur links
You can't use api from X to get links from Y
ill just ignore imgur then
Imgur is the safest tho
I need help trying to get my bot online
give
code
no no
you dont need to
this is how it works
alr ill look at it though i guess
theres 2k people who dont need your coding but alr
hi
hi
im kinda new to css
does anyone know why <link rel="stylesheet" href="../../public//stylesheets/main.css"> isn't changing anything?
like, the css in there isn't changing anything
its on my pc
then you could try replacing the // with just / or providing an absolute path
thats the path that vsc automatically done
like, i just do / and it says the next path thing
im trying to make a line like that
just replace // with /, vscode has a seizure sometimes
then you can try to look at the network tab in devtools and look at the path your browser compiled that to
and maybe fix it from there
or add a ./ infront of the path
the path to the file is correct
try adding a ./ infront of the path
that means basically “Go from the directory this file is in”
thats not the issue, idk if its cuz of whats around it
kk
but thats changing the path
im already doing ../
Have you closed that tag?
how can i make it so that when my dashboard goes offline it will show on command stats
you don’t need to close a link tag
Ah
@twilit prairie ping it every few secs / mins and if it times out display it as offline
still nothing
so you should now have ./../../public/stylesheets/main.css
<link rel="stylesheet" href="./../../public/stylesheets/main.css">
yeah
is the link tag in the head tag?
its not
bruh
so like html <head> <link rel="stylesheet" href="./../../public/stylesheets/main.css"> </head>
yes
did it work
you have to (I think) create a link with favicon as rel
but I’m not sure
also REEEE
no
theres nothing there
there should be
oh, browser console
i only get The key "width-device-width" is not recognized and ignored.
<meta name="viewport" content="width-device-width, initial-scale=1.0">
i'm using something called 'bulma'
that's not bulma, that's html xd
o
does it work now?
just chekcing 2 secs
What is bulma? Never heard that name except for goku's passion
it's like bootstrap but better (i heard)
Ah
It's a css framework that makes responsive designing easy
***I NEED ***
nothing in the console and it still doesn't work
help it says I don't have permission to install npm package
Right click -> run as administrator
Hi can I get some help
I already have from discord.ext import commands, tasks
@tasks.loop(minutes=10)
async def auto_updateleaderboard(self):
guild = self.bot.get_guild(privacy)
channel = guild.get_channel(privacy)
msg = await channel.fetch_message(privacy)
count = 0
leaderboard = discord.Embed(title="Leaderboard", description="top 25 clans, based on points", color=0x00FF00)
for rol in points.find().sort('points', pymongo.DESCENDING):
rol_id = rol["_id"]
clanname = self.bot.get_role(int(rol_id))
if count == 0:
leaderboard.add_field(name=f"**:medal:: __{clanname}__**", value=f"Points: **__{str(rol['points'])}__** \n \n ", inline=False)
count += 1
elif count == 1:
leaderboard.add_field(name=f"**:second_place:: __{clanname}__**",
value=f"Points: **__{str(rol['points'])}__** \n \n ", inline=False)
count += 1
elif count == 2:
leaderboard.add_field(name=f"**:third_place:: __{clanname}__**", value=f"Points: **__{str(rol['points'])}__** \n \n ", inline=False)
count += 1
elif count <= 25:
leaderboard.add_field(name=f"**{clanname}**", value=f"Points: {str(rol['points'])} \n \n ", inline=False)
count += 1
if count == 25:
await msg.edit(embed=leaderboard)
print("Leaderboard updated.")```
for context there are 25 clans with points
but there is no "Leaderboard updated." in my terminal
I also already have self.auto_updateleaderboard.start() in my init
help
3|python | at Function.Module._load (internal/modules/cjs/loader.js:543:3)
3|python | at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
3|python | at startup (internal/bootstrap/node.js:238:19) code: 'MODULE_NOT_FOUND' }
3|python | { Error: Cannot find module '/root/python'
3|python | at Function.Module._resolveFilename (internal/modules/cjs/loader.js:594:15)
3|python | at Function.Module._load (internal/modules/cjs/loader.js:520:25)
3|python | at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:32:23)
3|python | at Module._compile (internal/modules/cjs/loader.js:702:30)
3|python | at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
3|python | at Module.load (internal/modules/cjs/loader.js:612:32)
3|python | at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
3|python | at Function.Module._load (internal/modules/cjs/loader.js:543:3)
3|python | at Function.Module.runMain (internal/modules/cjs/loader.js:744:10)
3|python | at startup (internal/bootstrap/node.js:238:19) code: 'MODULE_NOT_FOUND' }```
🤔
Learning python
pythonscript
Ayy
I was planning on getting a vps which should i get
Google cloud platform pr aws
Or*
K thx
Whats that
then use that
Well only google, aws and azure are the bosses in this stuff for me
i hear hetzner is good
I never heard of these 😭😭
honestly i'd probably only use gcp/aws/azure if something i'm doing requires something only they can provide
like autoscaling etc
There are better providers than the big three lol
or you can use them for their free credits lol
I only know digital ocean linode n vultr except the gcp, aws, azure
vultr is nice
Yee
if you don't need to host anything they do have a cheap plan with only a ipv6 address
aws and azure
are overpriced imo
you can get cheaper vpses from other reliable providers
Actually aws offers way more free services and i like that
same w digitalocean too tbh
yea but they're free for a reason
they're not that strong
But i dont like how the random make you pay if you overuse em
Who is ovh by?
and its easy to upgrade
I only know digital ocean linode n vultr except the gcp, aws, azure
@fiery stream - I use and love Vultr. Would highly recommend
I understand but isnt the free option better then that
Since google cloud platform is free for a year
thats extremely deceiving advertisement
ive tried out other offers from other sites but
Do is nice i like it#
you my bot get verifyed ?
Lol my bot actually needs 10mb as of now
yes, now
With a good provider, you're paying for more than just the VPS. Vultr ain't cheap but they respond in minutes at all hours, they've helped me with legal issues, and I've got projects that haven't had a minute of downtime in two years
^^ what @paper phoenix said
yeah totally
how my bot get verifyed ?
Same with contabo
@narrow hedge wait a week or two
i hear do support is insanely good
hey how do i fix that error
Issues solved within hours
@fiery stream what lang is your bot?
someone help
hey help me someone
Getting a VPS and the service that comes with it is very, "Pay cheap, get cheap." Or the other, "The cheap man pays twice."
HELP ME
yea
is tehre somewhere
SOMEONE HELP
@vale garden you've put , instead of dot
@strong tundra py
i feel most of the mainstream vps providers are good enough in terms of that
where
thanks
how my bot get verifyed in discord
@vale garden i think it’s supposed to be "." Not ","
@vale garden
oh
lol
how my bot get verifyed in discord
Read error plz
it says .js
rust
how my bot get verifyed in discord
@narrow hedge - If you don't know how to properly research that you're probably not going to be eligible.
But start out by joining the official Discord Developers server.
it's pretty nice
But before that i wanna try go
real bot developers make a bot entirely in scheme
Py is my second Lang after js
ah yes, one of the "script-kids"
It's as hard as pressing a button
plus even js is compilable now!
How?
And compilers point your errors before you actually run the code
well, compile to js
Wait, what?
which is how javascript should be written now imo
Lol for a second I though I'd be able to compile js code
Nah js is fine
compiling doesn't really take that long for a smaller project
i used to be kinda scared of compilation times lmao
Thats why i dont like that langs
compiling + type declaration has helped me write smarter code the first time tbh
- helpful for when you come back to some old code after awhile and give you a better idea of where u left off
Its my brain who stops me from writing a compiling app
Not to say the supreme debugger
Whenever i start on something i just randomly start thing how is multi file compiling gonna work n stuff
And then i do t get any motivation
?
Like, compiled langs aren't hard at all to understand, "compiling" itself ain't cerberus
I dont know ill try that sometime later in life
Yo
Hey, is there a way to make sure an image embed works?
I have a bot set to post a random image using a list of imgur links.
Whether an individual image loads in the embed seems to vary on the day, completely unrelated to the code or the bot's state.
Are u using discord.js
it pretty much depends on how discord's cdn and how the image host you're using feels
Gosh darnit.
That's what I thought.
I really don't understand you hehe
It randomizes fine.
Sometimes the images just don't load.
you might wanna include a link in the description just in case the image doesnt work
Yeah...
and the user is that desperate lol
This bot is time-sensitive so I'd rather not but I might just in case...
I want to do a Spotify Playlist bot but
I want the bot to be able to detect when the image isn't working. Is that possible?
I tried using the image properties in the embed but they aren't different between when it loads and it doesn't.
I'd help you poryx but I don't know how to do that either.
can you help with mongo
I am a little bit stuck
Im trying to make a database to hold currency system
where the key is the user ID and the value money is a number
so a bit like this
Documents
{
{name : (id), money : 10},
{name : (id), money : 69},
{name : (id), money : 420},
}```
my issue is finding the money of a user and then changing it
ive read the docs and don't quite understand
I think this is the code to change the value:
db.collection('money').updateOne({
"money": money
}, {
$set: {
"money": (newvalue)
}
});
But how do I get the specific user's data (which is the one I want to update)
var cursor=db.collection('money').find({name: id})
Is this it??
@pure lion error pls?
@jagged gulch none, but it's only ever calling the first if statement no matter the condition of the custom status
i have no idea what to do
i use quick.eco
i randomly removed everything from the sqlite file
and put it back
and that did something
you corrupted it
so what do i do
start from scratch if you don't have a backup
oh no, just a new db
its nothing wrong with the bot
oh
its a problem w the database file
yeah but its the same with any package right
ok
the sqlite?
ill delete thesqlite file and the package
then reinstall it
will that work
@steel drum
yeah the sqlite file right?
kk
you gotta create your tables and add colums to them again
never touch database files
np
what snails said
now i know how to reduce everyone's bal back to 0
lol
thats like what i tried to find out
don't do it that way
there is software to edit SQLite files using a client, but you'd need to download those
wouldnt a simple query like sql UPDATE users SET money=0
yeah
work
ok
an SQL string will always work
you should make backups of your database file if you're going to use it long term fyi
since you're using sqlite, you could just copy the file
save it under a different name
ok
btw
const Discord = require("discord.js");
const client = new Discord.Client();
const Eco = require("quick.eco")
const eco = new Eco.Manager();
module.exports = {
name: 'leaderboard',
description: "shows the server's leaderboard",
execute (message, args) {
let lb = eco.leaderboard({ limit: 10, raw: false });
const embed = new Discord.MessageEmbed()
.setAuthor("Leaderboard")
.setColor("BLURPLE");
lb.forEach(u => {
embed.addField(`${u.position}. ${client.users.cache.get.tag}`, `Money: ${u.money}`);
});
return message.channel.send(embed);
}}```
this is my code for the leaderboard command
but it gives me this
does anyone know how to fix the undefined
ok
is that L or 1
but unless you specified you want to cache all users, its possible the user isnt in the bot cache
so its better to fetch the user
that says ul lol
oh lol
well
it should be a u
idk why i added a l
but u get the gist of wht im trying to say
ok
i got this
and if i didnt use cache it just didnt work
@steel drum
help me lol
what
i got this without cache
what he said
without cache i still have problems
i changed it to this
const Discord = require("discord.js");
const client = new Discord.Client();
const Eco = require("quick.eco")
const eco = new Eco.Manager();
module.exports = {
name: 'leaderboard',
description: "shows the server's leaderboard",
execute (message, args) {
let lb = eco.leaderboard({ limit: 10, raw: false });
const embed = new Discord.MessageEmbed()
.setAuthor("Leaderboard")
.setColor("BLURPLE");
lb.forEach(u => {
embed.addField(`${u.position}. ${client.users.fetch(u.id).tag}`, `Money: ${u.money}`);
});
return message.channel.send(embed);
}
}```
What problem you get without cache
how do i fetch all the member ids in a guild (discord.js) my current code is this but idk how to get just the ids
var membersInGuild = msg.guild.members.fetch()
:^)
With discordjs you have to fetch the entire member object sadly
oh god
is there a way to only do the first 100? i dont want my computer to explode
log the first 100*
The first 100 members of a guild? No
I think you can. Look at FetchMembersOptions: https://discord.js.org/#/docs/main/stable/class/GuildMemberManager?scrollTo=fetch
first 100 members are not guaranteed
Your bot will probably fetch other members after a while
oh alrighty
Probably
I see.
@coral trellis
I have same problem.
it's easier to use .catch if you only need to make one request
otherwise use try catch with await
fixing your indentation would be a good start
yeah
Hello there, I am having issues with going setting my bot's status (to dnd) but I only have this issue when intents are on, when they are not defined, everything works fine. What could be causing this and how can I fix this (feel free to ping if you have a response). I am using discord.js v12.2.0. Thanks in advance :)
This is what I have in my ready event
const presences = [
"c!help | New Web Dashboard!",
"c!help | https://corynth.xyz/",
`c!help | ${client.guilds.cache.size} servers`,
`c!help | https://corynth.xyz/support`,
"c!help | https://corynth.xyz/invite"
]
let i = 0;
setInterval(() => {
if (i === 2) {
client.user.setPresence({ activity: { name: `c!help | ${client.guilds.cache.size} servers` }, status: 'dnd' })
i++
}
else {
client.user.setPresence({ activity: { name: presences[i] }, status: 'dnd' })
i++
if (i > 3) i = 0;
}
}, 15000)```
nope
No
15 seconds is way too fast for presence change
it was setGame() iirc
15 seconds is way too fast for presence change
@smoky spire no it isn't
it's less than ~5 secs
^
that's not the point, the bot won't set itself to dnd
If you don’t put the variables in the interval they won’t update since the ready event only happens once.
@earnest phoenix it works, it sets the status every 15 seconds
he overrides the index 2
oh really
yeah
which intents are you using?
intents: ["GUILDS", "GUILD_MEMBERS", "GUILD_BANS", "GUILD_VOICE_STATES", "GUILD_PRESENCES", "GUILD_MESSAGES", "DIRECT_MESSAGES"] (I am whitelisted)
weird lol
i just tested in mine and it worked
my intents are "GUILDS", "GUILD_MESSAGES", "GUILD_MESSAGE_REACTIONS", "DIRECT_MESSAGES", "DIRECT_MESSAGE_REACTIONS"
is any one here able to make an announcments channel for me?
That costs money mate
@golden condor do you have another bot running? like a development version of your bot
do you have an eval command?
Yes
have you tried using client.user.setStatus() in your eval?
Yes I have
well idk then
i've seen this happen to other people and nobody knows why
it randomly works or doesnt
It's so weird that it works without intents but doesn't with tjem
I'm just so confused
@dusty bronze
how can i make a fill the background of something with css?
like ^
but not messy, just a big block
im trying to see if the thing even works, and when i do css base { background-color: #fff } nothing happens
that is definitely not the correct "base"
are you sure it's a tag?
the tag base would be in head
maybe it's a class/id
oh
also, ;
how can i make this background black like others bots

use css
Can I use markdown on Discord?
@opaque seal discord ?
yes u can
Ouch
that's hyperlinks
use css
@digital ibex i said how
ok, now i done css body { background-color: grey; } but it didn't change anything
embeds and webhooks only
@pale vessel ?
im trying to do
So Discord doesn't support markdown?
fill that bit in
So embeds support markdown completely while normal text only a few things
still, there's no headers and stuff
Discord should implement markdown fully imo
Could be useful for announcement and stuff
would you want people to send big text
@digital ibex whats used for multiple colors ?
maybe an option to toggle them, yeah i would agree
And create a permission for it
wym
I deleted a folder in my bots project by accident and I can't find the file I need in the recycling bin, How do I recover deleted files in visual studio code
If your not gonna be helpful don't respond if you don't know
if you have a host and posted it on github you could get ur code back
i wasnt finished xd
VSC puts in the recycling bin it should be there
Thank you, I found the folder in my recycling bin tysm
If your not gonna be helpful don't respond if you don't know
idk but it would be good if you do backup
This is useful.
ikr xd
im doing every 2 weeks some backup so it cant get lost or if my hard drive dies
does anyone actually use a .yml file for their bots error messages etc? i dont im lazy af xD
hi, with css, how can i change the background of the whole page?
like ik i need to use background-color but what hthing do i put? like css this-thing-here { background-color: .. }
body
either the body{
}
Or the container that contains the page
i done that but it didnt change anything
Use element inspect for that
There is a * next to the file name, is it saved?
yeah
i remove the .navbar and the css goes, and i add it back and it comes back straight away
When I edit anything in the console a * appears above the file name so it's probably not saved
CTRL+S to save it
What does it say when you hover over the triangle?
'changes to the file were not saved to the system'
why aren't you using an editor
I am
Then why aren't you editing the file in the editor instead of in inspect element?
diesIrae said try in inspect
Yae , i assumed he was changing an existing page
doesn't work in either
Didnt know you were making one from scratch
reload the page, are you hosting the files on a server or is it just a html file
just html and css
try reloading the page
same
have you saved the css file?
can you open your editor and show me?
u can open it over a browser and then look at it
just click on the file and click open with
it shows it in inspect as well
hm ok
try putting body above .navbar
it will be still the same
where do i add !important?
grey !important;
before semicolon
kk
isn't this for his dashboard
how can I send the embed to a different channel than the one where I sent the command? (discord.js)
https://prnt.sc/svcfzz
fetch the channel and then use .send
example
<client>.channels.cache.get("channel id").send("a message")
Yes
you didn't define channels
What is ''channels''
@pale vessel how I define channels
To define a channel you must specify in what event you want to get the channel, or just get it from all the guilds.
If you want to get it from the message event, and in the same channel of the message, use message.channel for that.
If you want to get another channel from the guild of a message event, instead of the channel where the message was sent (message.channel), you must use message.guild.channels.cache.get('ID')
This will go in the message event message, get the guild where the message was sent guild, then get the channels of that guild channels and you must use cache for the get function.
thank you very much
You're welcome.
How do I do that when I start my bot in my terminal it shows me on which servers it is?
If it's possible.
you mean server count?
yes
its possible but i have never done one
(client).guilds.cache.size
to show the names of that, use (client).guilds.cache.forEach(g => {
then for each guild, you can store g.name into an array, or just console.log it / export it.
(client) is what you defined discord.Client() after
how can i add it to this code, or rather where
async def on_ready():
activity = discord.Game(name="Netflix", type=3)
await bot.change_presence(status=discord.Status.idle, activity=activity)
print("Bot is ready")```
oh discord.py
idk shit about py so ima go
nah b
set activity with the name equal to the size of the guilds.
or do i have to make a new event
on_ready should be good
u can actually put it in that event
ah thx
len if you want the amount
u can do it as a command
don't spoonfeed code, especially incorrect code
:c
im kinda lost, how do i do have to change this event? Or rather what do i have to "copy & paste"
async def on_ready():
activity = discord.Game(name="Netflix", type=3)
await bot.change_presence(status=discord.Status.idle, activity=activity)
print("Bot is ready")```
if you want the name of the guilds look at https://www.python.org/dev/peps/pep-0289/
len(client.servers)
or len(self.bot.servers)
i think that should work
just give it a new activity
like game or watching
@pearl igloo does it work?
no
hi,i have padding-left: 50%;. why does it not go 50% of the way, it only goes a a bit?
where do i have to put it in? i put it under await bot.change...
but it says that "self" isn't defined
why await?
wait
u have to position it in the center
position: center;
i think that was that
oh wait
o ok
test it out with left: 50px;
try to put 50px more so it gets centered
test around with it
are you trying to center or what
yeah im not sure if position: center; would function
padding expands the container of the element, "padding" it out
i think its float: center;
im trying to make it go to the middle
such thing does not exist
float exists
let me look give me sec
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Aligning_Items_in_a_Flex_Container , @digital ibex
i took 2 years of web design, i know what exists and what doesn't lol
oki, thank u
it was a part of my course for two years
i took 2 years of web design, i know what exists and what doesn't lol
@earnest phoenix i thought u meant float doesnt exist
but u are right center on float doesnt exist
in modern css you should almost always go with flex containers for aligning now
Flexbox is nice
flexbox is the best
hi
i keep getting problems
my bot was working normally
so i randomly check my bal
i didnt change anything
you have multiple instances of the bot running
ok
@vale garden You could try to restart it.
when you cant afford a vps
restart the computer*
Is there any html template or something like that i can copy paste for a documentation of the possible bot command and maybe a "getting started" ?
bootstrap is a css framework
there isn't a template
you should try to be original and build your own regardless though
<pre> incomming
he asked for html templates, i gave him html templates
First get your bot verified here: https://top.gg/bot/new
Then apply here to take part in the auction: https://top.gg/advertise
You can not sell stuff yourself, you can only buy advertisements spots.
How can i see at my presence on how many servers my bot is?
guilds.cache.size?
bot.user.setPresence( { activity: { name: `${ bot.guilds.cache.size.toLocaleString( ) } Servers` }, status: 'online' } );
hello
im new to discord.js
and bot making
const Discord = require('discord.js');
const prefix = require('./config.json');
const token = process.env.DISCORD_BOT_SECRET
const fs = require('fs');
const keep_alive = require('./keep_alive.js')
const client = new Discord.Client();
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.once('ready', () => {
console.log('Ready!');
});
client.on("message", async message => {
let perms = message.member.permissions;
const args = message.content.slice(prefix.length).split(' ');
const command = args.shift().toLowerCase();
if (command === "ping") {
client.commands.fetch('ping').execute(message, args);
}
});
client.login(token);```
this is my index.js
and
module.exports = {
name: 'ping',
description: 'Ping!',
execute(message, args) {
msg.channel.send('Pong.');
},
};```
this is my ping.js
but when i do the command it doesnt work
even an error doesnt show up
how do i fix it
?
Is that code copy-pasted?
yeah of couse
course
like do you mean the
wait
i typed it in by the help of a website
but i understand and typed lot of the stuff myself
You haven't created a commands.js file
do you have to
ok
It's reading the directory
Does the command dir not exist?
idk what that means
Ah, readdir
oh ok
Also with the module.exports, how would you use async execute ?
I've seen people using it
But I'm not sure how to use it myself
What is your message event?
msg
module.exports = {
name: 'ping',
description: 'Ping!',
execute(msg, args) {
msg.channel.send('Pong.');
},
};```
has anyone here messed around with azure pipelines, i'm wondering if it's good enough as a CD for a small private github project
can i use something like this
bot.commands.get('test').execute(message, args);
break;```
instead of the command === 'test'
i found this one somewhere
while if/else and switch case commands are not the best ones, switch case commands will be more performant than if else ones
ok so ill use this
Can anyone here with a dashboard tell me what percent of your users access your dashboard via a mobile device please?
More than half as it seems
I'm getting 60% desktop and 40% mobile, I'm thinking that's lower than the expected for web as a whole
Mobile includes tablet users
well do you have a switch
case statements are illegal outside of switch closures
switch (cmd) { or similar
Something to also consider in your code is prefixes
I didn't see any prefixes, and best to be configurable too
debug
how
Debug is what flies round de room all de night 
const Discord = require('discord.js');
const prefix = require('./config.json');
const token = process.env.DISCORD_BOT_SECRET
const fs = require('fs');
const keep_alive = require('./keep_alive.js')
const client = new Discord.Client();
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.once('ready', () => {
console.log('Ready!');
});
client.on("message", async message => {
let perms = message.member.permissions;
const args = message.content.slice(prefix.length).split(' ');
const command = args.shift().toLowerCase();
switch (args[0]) {
case 'ping':
client.commands.fetch('ping').execute(msg, args);
break;
}});
client.login(token);
Aaaaah
I think you're about getting to the point where you should use a pastebin
you're going to find your issue if you do so
whats a pastebin
avoid pastebin
use alternatives like hastebin/paste.mod.gg/hatebin
pastebin is profiting from something that should be free lol
a text sharing service does not require much processing power at all
in fact, hastebin is hosted on heroku for that very reason
It does when you get millions of hits a month
alternatives (which are free) do too, and they still remain free
I wouldn't put any real production site on heroku any more than I'd try and host a bot on it
pastebin profits from ads, which contain trackers because google adsense, and it does not allow you to use a dark theme by default, making it a shitty ass service when there are much much better alternatives to it
Anyhow i did say use "a" pastebin
Not the site called pastebin
But I think too much flack is thrown at sites for deciding to put ads on them
Just use adblock
They learn that it's not profitable soon enough
not everyone is that smart :p
Using adblock is common sense, it's the 2020s version of using antivirus, except it doesn't eat all your pc
today alone in this guild i saw 3 people not use adblock when they screenshotted their device lol
More fool them
Lol
Still most malware is delivered through malicious paid for ads these days
On dodgy ad networks
honestly, ublock origin + anti adblock killer scripts is a match made in heaven
adblock for resource heavy ads
chrome 
nanoblock is basically ublock origin and anti adblock killers in one
it's pretty nice
also i think chrome has anti trackers, not adblockers built in? which are very minimal
It does have adblock
mozilla went full in with anti trackers on firefox
It was implemented in a recent update
didn't chrome say they're killing ad blockers
^
they said they would
They can try lol, I don't use Chrome
it's a browser made by google, google makes a lot of their profit from adsense