#development
1 messages · Page 964 of 1
const prefix = "!"
when i changed it to const prefix = '!' it told me that message was no defined
i dont know what that means
ok
lol
hi
does why is guilds undefined? im trying to display the users guilds but its not showing them for some reason, it says cannot read property of 'forEach' of undefined and all it is is guilds.forEach , anyone know why that may be happening, when i do console.log(guilds) nothing responds, im probably not making much sense cuz ive been trying to fix this issue for ages
ik i can't
but user is not undefined, it shows my id, and i done the same thing i done for user to show my id with guilds to show my guilds, but its not undefined
res.render('dashboard', {
user: req.user, // my id
guilds: req.guilds // undefined
});
And what's req
request
request comes from expressjs
the other code is irrelevant
but sure, ```js
const router = require('express').Router();
function auth(req, res, next) {
console.log(req.user); // logs my id - 475371795185139712
if (req.user) {
next();
console.log(${req.user} is logged in); // logs: 475371795185139712 is logged in
} else {
res.redirect('/login');
console.log(user is not loged in); // logs: user is not logged in
}
}
router.get('/', auth, (req, res) => {
console.log(req.guilds); // logs nothing
res.render('dashboard', {
user: req.user,
guilds: req.guilds
});
});
module.exports = router;
learning javascript can help
me ?
yes
yes
can u learn javascript, u come here for the most simplest issues which u would kno if u kno the language

@digital ibex dude i know the language
ok
when you concatenate an object into a string, for example "bla" + object js does this for you: "bla" + object.toString()
but objects cannot be stringified like that, they need to be serialized
which means to go through the object and stringify each key and each value into json
so in order to display an object as text, you need to serialize it, using for example JSON.stringify()
node.js also offers util.inspect for serialization with some advanced functions and utilities
note that discord.js collections are based on Maps not Objects, so they work differently
but util.inspect works on everything, so its better to use it instead of JSON
dose anyone know how to make a simple embed
Are you using discord.js
yes
message.channel.send({ embed: { /* data u want */ } })
ok
or use their builtin embed builder
see, you didn't know the lang
How's possible to like slice an eval message into more messages?
For example if the eval message has more than 2000 characters show the first 2000 characters on the first message and it's other parts in different messages
use discord.js split option
but it would break the codeblock but i think you can also provide a codeblock option too so there's that
But use the split option where that's what I'm thinking about
.send(message, options)
Oh nice
Like
<Channel>.send(<message>, { split: true })?
since when does d.js have a split option
not sure but i remember it being in v11
how do you set the bots status
by sending a status update via the websocket connection
If you use discord.js, this may be a more helpful answer
I've got two bots that are identical in every way except name, tag, client ID, client secret, and token. I'm testing a new command I wrote and one bot can use it perfectly fine while the other says that it lacks permissions. What could be the issue?
Both bots have identical roles, and use the exact same code.
I've tried both bots in several configurations on two different servers and it works out the same way every time. I am confident that there is no typo in the code itself since both are running from the same files.
Are you running the command in the same space. What permission does it lack? What action are you trying to perform?
what are you trying to do
if one bot is trying to do something to the other bot then...
Yes I'm running the command in the same place. It doesn't tell me what permission it lacks, but I can tell it's "Manage Roles" since I'm trying to get it to add a role to me. The role it's trying to give me is below it in the hierarchy.
dude
if you're the owner of the server
then that won't work
bc nobody can do anything to the owner of the server
One of them gives me the role just fine. As long as the role it's trying to give me is below it, it can give it to me perfectly fine.
The bots are identical as far as I can tell and one of them works
message.guild.roles.size error undefined Roles same for emojis
@prime glacier .roles.cache.size
How i can get the role object and give it to {member}
role = self.bot.get_role(role_choice[0])
await self.bot.add_roles(member, role)
then don't
is there a way of deleting a message if it has a certain word
what library
in djs v12 it would be like
client.on('message',async function(message){
var bannedwords = ["put", "banned", "words", "here"];
if(bannedwords.some(word => message.content.includes(word))) return message.delete();
});
thx
oops lol
i meant library
djs would be a library actually
lol
yeah
do you know the code to auto temp mute/mute/kick/temp ban/ban
yeah
How to get user status? used to be member.presence.game.type == 0 and now how?
member.presence.status?
but I ain't spoon-feeding you
how do i get the ip of the users accessing my site?
you dont need cookies for that?
idk
that depends on your webserver
you could use them tho
ye
hello guys,
i need help with CSS. I have a div container with a button inside. How can i set that the button is alwasy at the and of the div?
but you can get the ip from the request iirc
How do you auto temp mute/mute/kick/temp ban/ban
think about the logic behind it
then write some code
then write some more code to fix your bugs
@radiant estuary horizontally or vertically?
then cry bc the code you wrote only made things worse
like always at the bottom or always left/right
@radiant estuary horizontally or vertically?
@quartz kindle horizontally
like always on the right?
no, at the bottom. Sorry.
ah then vertically
yes
you can use flexboxes, or absolute positioning i guess
its a bit tricky to do
you can also google "sticky footer"
its the same principle
okay, thank you
to get the game status do i need member.presence.activity.type?
member.user.presence ?
@radiant estuary position: absolute; bottom: 0;
my bot @manic pagoda crash when getting the owner from this server
thx
How do you auto temp mute/mute/kick/temp ban/ban
hi, does anyone know why im getting a syntax error? my code: js <% user.guilds.forEach(guild => { %> <%- include('dashboard/guilds') -%> <% }) %>
second line, the error: SyntaxError: Unexpected token ')'
im unsure why thats happening, using ejs
what is this @quartz kindle
I dont think there should be a - there
How do you auto temp mute/mute/kick/temp ban/ban
kick and ban are easy, just domember.kickormember.banrespectively
the others are a bit harder
@stuck scaffold idk
is it happening inside the include then
:/
looks like debug information from an http2 connection
oh?
how are you even getting that?
so theres something inside guild.ejs which is causing the error?
I do not do anything
whats the full error output
@lyric mountain is there a way of doing it so if someone has done something multiple times it will kick them?
I moved the bot from x VDS to y VPS and this problem started to occur @quartz kindle
@lyric mountain is there a way of doing it so if someone has done something multiple times it will kick them?
@earnest phoenix store the user in a database, each time they are warned increase the count in the db
once the value in the db reaches a certain count apply whatever punishment you want
ok
@stuck scaffold the actual error is that your database file is missing
no, your database file
json.sqlite
yes
idk, but for now you can only fix the other errors
hi me again
how can i make separate the guilds the user is in like:
without it showing the way it is
using css
@stuck scaffold try running apt install fontconfig
show your package.json
uninstall everything that you're not using
also uninstall os and fs, those are built into node
snekfetch, axios, superagent and node-superfetch all do the same thing, use only one
mongoose, mysql and quick.db are all databases and database frameworks, use only one
if it's unnecessary data, why keep it?
i only have 18
and my bot has like 200 commands
though i don't think that's a factor
mine has 37 lol
mine only has 10 but you could go to 0 if you want to internally suffer
you're counting dependencies?
no, just copy package.json and see line count
oh lul
let game
if (!argsUser.user.presence.activity) game = `${message.language.get('user_game1')} **${statuses[argsUser.user.presence.status]}**`
else if (argsUser.user.presence.activity.type == 'PLAYING') game = `${message.language.get('user_game2')} **${argsUser.presence.activity.name}**``` code
```TypeError: Cannot read property 'presence' of undefined``` error
why do i have a mistake?
what is argsUser?
argsUser = member.user
argsUser.user = member.user.user
what library
you just pinged someone lmao
include the embed in the MessageOptions
<channel>.send(`string`, { embed: embed });```
you dont even have an embed?
..
make an embed
then implement the code i gave where ever you use <channel>.send()
@earnest phoenix ```js
.send("text content here", {options object here})
embed is an option
yum install giflib-devel
I deleted 26 modules 
i cant get embeds to work?
@quartz kindle still same...
what was ping in eris again?
I can't see it in the docs
I mean like client.ping
to get the shards latency?
client.shards.get(shard id).latency
can someone help me. i don't understand embeds
I deleted the json.sqlite file and restarted the bot but again this error occurred @quartz kindle
show where you've defined the file
require('quick.db') ?
It's quick.db
^
hi, anyone here used bulma before?
Docs for voice recieving are really weird
How do i receive voice in d.js?
cuz im having a little bit of an issue, i got my website to display the users guilds, but now i want it to be split in half, not make a new line for each server
yes @golden condor
I've never used it sorry
Wait weird
i am only able to recieve data whilke my bot is playing something
is it d.js lib bug or what/
how do i make an embed with a custom author,title and url?
What lib
ye
flex
in bulma it looks like you can have a column container with two nested column containers
and that should have the desired effect
what would the name of the class be
columns for the parent container and column for the children
o ok, thanks :)
ye
how do i create an embed that has a custom Picture,title and url
CxllmToday at 4:07 PM
What lib
@earnest phoenix if you mean this part, you use the author field
if you mean this part, then that is not an embed, its a webhook
i mean the 1st one
I deleted the json.sqlite file and restarted the bot but again this error occurred @quartz kindle
@dusky marsh sorry for the ping, how can i separate the columns?
cuz rn just for column it'd be
using css if possible
it should have it already according to the docs, but try putting .is-3 on .columns
and also, how can i not make it repeat?
holy
i would use the data and seperate it into two datasets, and apply either of the datasets to either of the columns
that killed half my screen pixels lol
how are you adding the data to the columns now?
so like, i have a forEach function and thats filtering guilds into guild
and then its just guild.name
yeah but how are you actually displaying that information on the page
frontend?
<div class="container">
<div class="columns">
<div class="column">
<p class="bd-notification"><%= guild.name %></p>
</div>
<div class="column">
<p class="bd-notification"><%= guild.name %></p>
<div class="columns is-mobile">
</div>
</div>
</div>
</div>```
thats it, i only wanted to two bits
i am kinda new to web dev btw 😄
i would make your guild information a list of guild names and then split that list in half, and apply dataset1 to the first column and dataset2 to the second column
how would i do the split bit?
is it possible to code a music bot? on discord.js
Yes very possible
https://flaviocopes.com/how-to-cut-array-half-javascript/ you could do something like this
how can you make a music bot. i have been trying and i cant do it
<p class="bd-notification"><%= (guild.length / 2).splice(o, (guild.length / 2)) %></p>
``` so so like that?
ye
It's quite useful I find
was planning to use vue, but i was having trouble interacting the frontend with the backend
yeah, its quite easy
how can i code a music bot
dont you use quick.db? why do you have mongodb?
I use quick.db for unnecessary data
like instant message id
lul
Erensi_28bugün saat 21:48
like some instant message ids
I clean once a day
I will delete quick.db soon
tm
im building my very first bot, im new, so if anybody could give me tips that would be helpful
do not use free hosts
do not leave optimizations for later, they'll haunt u
do not create two clients, ever
@dusky marsh im confused
your token MUST be hidden, and out of your code
json IS NOT a db
there are others
but I'd stay here the whole evening
MongoError: pool destroyed
how can I fix, please help me
don't destroy the pool :(

you think I'm doing this on purpose?
so you use mongodb? do you have mongodb installed in your server or are you using a service like atlas?
on the server
how did you install it?
how do you connect to it in your code?
mongoose.connect('mongodb://localhost:port/db')
did you change port to your port number? did you create a database called db after installing mongodb?
Does anybody know that the fetchAllMembers option can be the reason that the bot eats a lot of memory?
Currently and currently 227k users in the fetch... Fetching a lot
probably could be, i don't imagine it being a large amount tho
wait so to make a bot restart I would just make it relog?
That defaults to false
yeah, it shouldn't i don't think
So unless you enabled it yourself it shouldn't do stuff
Timo you talking to me?
Yes I am
I set it to true in the client options
So should i turn it off?
im a bit confused on how i can do:
Yes
how would i get all the roles in a guild (discord.js)
instead of: server 1 | server 1 server 2 | server 2 server 3 | server 3
with bulma or css
how would I make a command only execute for one user
sorry, my all-seeing glasses broke and im too lazy to get up and stare into my magic mirror so please tell me what library you are using
epic thanks
guild.roles contains the role manager
guild.roles.cache contains the collection of roles
cache.find what parameters tho :/
what do you want to find?
all
guild.roles.cache is all roles
.find is to get 1 specific role
hahahahahha thx
Hi
how i detect links??
use a regular expression
like what?
google for "url regex"
ok
idk how use that
/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/```
String.match(regex)
why this dont work?
if(message){
let algo = message.content
let regex = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?)/
let matches = algo.match(regex)
console.log(matches)
if(matches !== null){
message.delete
}
}
omg
i put message.delete without () xD
is bot.destory a function?
no
yes it is
lmao
destory
bot.destroy doesn't work
show me the code for the command
.then(bot.destroy())
.then(bot.login(token))```
bot.destroy does not return a promise
you'll want to put them in the same one like .then(() => { bot.destroy() bot.login(token) })
epic it works
one more test
@amber fractal would you mind running wwrestart in #commands?
nvm
Do you guys know any other way of checking if the user has nitro than animated avatar/common discriminators {common discriminators that nitro users use}/custom emoji in custom status?
HEllo, do you know How to run bot code without node.js, cause I can't install node.js, because im not on adminstrator side and its locked
Some guy said use visual studio code and also use node.js, but I sadly can't
I need to be allowed to execute the prefix permission without being the server owner
I use ``` if (!message.member.hasPermission('MANAGE_GUILD')) {
return message.channel.send(fail1)
}``` to deny all users exeept server manager
Asking if you code without node.js is asking if you can live without air.
You either await the promise and assign it to a variable, or attach a .then method to your promise. Then you send a message to the newly created channel
Such as myPromise().then((channel) => channel.send("hi"))
^^^^
The result of the promise is your channel
you are calling on the channel that was created in the .then
Do you guys know any other way of checking if the user has nitro than animated avatar/common discriminators {common discriminators that nitro users use}/custom emoji in custom status?
Anyone?
Already did
Docs is your best friend
I'm myself the docs
If it's not there, then it's most likely not made yet
I mean... I read docs before doing anything
That I know of, there is no exact way of checking if the user has nitro. The only way is based on the avatar If it is animated or not.
Did you even read what i check for
I said the wrong thing
But it's the same thing. Both do not have any kind of methods that checks for you.
Ik they don't... But as i asked... Is there any other way of checking for them other than those 3
No, if there is no exact way of checking if they have nitro, then you have to check if they can use, or has stuff that is only obtainable through nitro. You should be going based on avatars, as some custom emoji are global, meaning anyone can use them in any server, if they are in the server that it is originally from. Common discrim is hard to be exact, as some people could actually have that discrim without having nitro.
let channelID = "383326219866865667"
return client.shard.broadcastEval(async() => {
let channel = this.channels.cache.get(`${channelID}`);
if(channel){
channel.send("Hey")
}
});
Can someone help me? Whenever I try to pass channelID into broadcastEval it says channelID is not defined
There's a way more than thise that pedrokarim64 and larko uses but they don't tell anyone @vernal rivet
I mean that's up to them on how they do it
Put the declaration of channel ID in the broardcastEval. @vague kite
They use the same way as mine... Just check for more things as I'm talking about them @vernal rivet
Well i think we'll never know lol
Yea lol
Well I wanna get it from DB but I need to declare it outside of broardcastEval
then you cant use it
@earnest phoenix what library you use?
evals have their own scopes
Yea
@lethal hawk discord.js
You can't declare an object outside the scope it is being used in.
Then how comes the guide shows that you can use args[0] in it??@amber fractal
Hope you don't mind the ping ❤️
what guide
Because the object is a constant
Yes
you could use member.premiumSince, that returns a date since when the uses boosts your server @earnest phoenix
@lethal hawk i check for that too
theirs uses template literals to do pass the variable as a string
you would like to know if they have nitro, even when they are not boosting?
Ohhh I'm stupid 
¯_(ツ)_/¯
Thank you ❤️
@lethal hawk I'm trying to know both of them... I go this way:
1- Checking for nitro:
Animated avatar/common denominator {common discriminators that nitro users use}/custom emoji in their custom status/if they boosted the server/if they boosted one of the servers my bot is in
2- checking for discord nitro booster:
If they boosted the server/if they boosted one of the servers that my bot is in
But it isn't perfect as sometimes it doesn't detect them... I'm trying to make it perfect by checking for more things
All this... Just to put those badges in their userinfo
You could get that info directly from the discord api (bypass discord.js and make a get request), but that requires some special oauth that has to be done by your bot (with which I cannot further help you I am afraid)
You can take a look at these links: https://discord.com/developers/docs/resources/user#user-object-user-structure, https://support.discord.com/hc/en-us/community/posts/360032697192-Make-it-possible-for-bots-to-check-if-user-has-nitro-is-in-hypesquad-is-staff-etc-
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
@lethal hawk that's what i tried to do before checking for those... I have no idea how that would with a userinfo command which has literally no connection... No connection between them at all... So it's kinda not good to do that
i need help
for my bot
just a dumb question, does the native setTimeout's timer (not client#setTimeout) end if the bot goes down?
can anybody help pls
what's the one-liner to find amount of guilds?
can anybody help???
client.guilds.cache.size or client.guilds.size @torn ravine
Do not ask to ask. Provide all possible information so people know what's up. Just saying "I get an error" doesn't give us enough information on your problem.
just a dumb question, does the native setTimeout's timer (not client#setTimeout) end if the bot goes down?
I am not sure, but you could set the timeout long enough and take the bot offline to see what happens?
yea i'll try that
well. gets cleared, now i have to write my own version, while stringify-ing functions cause of <JS>, yeee x)
I am not sure, but you could set the timeout long enough and take the bot offline to see what happens?
@lethal hawk it does
No single process can keep a timer running once shutdown
hmm. I'm trying to make a "mute" function tho, but since my bot usually goes down, i wanted the timer to not expire each time it does, do you have any simple idea of a way to do it?
Use a database
you cant. Most mutes aren't exact
I set a timeout, but add it to a database so if the bot goes down it queries every 5 minutes to check if they should be unmuted
Store the user id and the timestamp in the database
Each minute check for stored timestamp - current timestamp
If it's bigger than X, unmute
hmm that's what i was thinking about, yea could do it
what's the one-liner to check how many members?
Just remember to use embedded databases like sqlite, because they're faster and allow constant transactions like this
@torn ravine guild.users.cache.length
🤔
If it's to get all cached members, client.users.cache.length
Note that idk how each thing is written in d.js, but you get the idea
As I said, I'm no d.js dev, so idk
alright
k thanks

i really need to make an embed constructor for eris but im way too fricking lazy 
and i dont wanna google one up
but i hate how long it takes to make an embed
and i have to transfer all of my code from discord.js to eris
AAAAAAAAAAAAAAAAAAAAA
using a database
Hello
Can i ask?
Im new about coding
Hey
Blu
I do from our youtube
Umg
The Glitch
i love json ;P
Can you help me more
Anyone know how I can place a 24hr cooldown on a certain command?
@earnest phoenix you can have even 1 century of cooldown
Because database based cooldown aren't running processes, but simple difference checking between two values

Current timestamp - cooldown timestamp
Will give u the difference in millis between two timestamps
If it's to get all cached members,
client.users.cache.length
@lyric mountain sorry to bother, do you know any ways to get cached messages?
Afaik you can't
Could also store the timestamp and then see if currentTimestamp is greater or equal
hmmm...
You gotta cache them yourself
seems fair but i wont ;P
Could also store the timestamp and then see if currentTimestamp is greater or equal
@slender thistle the minus way is more easier to visualize
to each their own
@earnest phoenix Your yt great
@dawn trout you gotta understand what you're doing first
Learn ps basics, your language basics, etc
Programming is not that hard, but copying will certainly not teach u how to code
1000*60*60*24
Rusteeze
Lol jk, ask @queen violet, he might know one
serenity is most started
@fiery stream people usually use serenity
Cs is like a game coder
@fiery stream https://docs.rs/serenity/0.8.6/serenity/
API documentation for the Rust serenity crate.
this domain has docs for most rust things
very useful
And to prevent another botghost
thx jvm
Yay i did it was much simpler than what I thought it would be x)
(having a mute that doesn't expire when bot goes down)
You're welcome
Can you help me about the commands
By using a db you can use a lot of persistent features
in glitch
what for?
Helping like what?
handling?
client.user.setActivity('for B!help and b!help' , {type: "WATCHING"})
you're welcome 😉
Hello
I want to put my status count onlines
can you help?
like
Playing 10294 Onlines !
I wanna put that
Im new

Im wanna learn about making bot
so i appear here
Noo
I mean
Count Online
like
other invite
and they will count
Online users ?
Hmm you could use may be client.users.cache.size in the presence message.
bot.on("ready", () => {
console.log("The bot is online!");
bot.user
.setActivity("Presence message here", {
type: "PLAYING"
})
.catch(console.error);
});
Here
can you change
Put in the
(''B!help or b!help'')
bot.on("ready", () => {
console.log("The bot is online!");
bot.user
.setActivity("B!help or b!help", {
type: "PLAYING"
})
.catch(console.error);
});
Now i wanna count member
@earnest phoenix client.guilds.cache.size for server count
I have to check smthing quickly
like onlines
@dawn trout - For members online you'll need member/presence intents if over 100 servers.
I wanna put it in glitch
For total members:
const total = bot.guilds.cache.reduce( ( total, { memberCount } ) => memberCount + total, 0 );
Can you change this one for me
bot.on("ready", () => { console.log("The bot is online!"); bot.user .setActivity("Coding", { type: "PLAYING" }) .catch(console.error); });
bot.on("ready", () => {
console.log("The bot is online!");
bot.user
.setActivity("Coding", {
type: "PLAYING"
})
.catch(console.error);
});
I'm on mobile at work. Not ATM
const total = bot.guilds.cache.reduce( ( total, { memberCount } ) => memberCount + total, 0 );
Where do i put

im using Glitch
i use glitch idk where to put
xD
Im a Huge Noob
client.users.cache.reduce((total, user) => user.presence.status === 'online' ? total + 1 : total) i believe, or does cache only get users that sent messages after the bot was added ?
Which Do I Use JavaScript Or Go? Hmmm
Or java
Ugh I’ll Use JavaScript But I Need Learning Lessons
Google ftw
Ik this is not a usual thing but does anybody know why the downvote count of posts fetched from reddit are always 0?...
Yeah some
In what means. What do you want it to do? Do you know anything about the fs module?
Do you know why it's not working?
I can't infer what went wrong just by that info. Do you own/develop the bot or is it someone else's bot.
So as i was testing some debugging and stuff... I installed puppeteer-core as it needs a browser to be installed through npm install... But i tried installing some browsers through it and still says could not find a browser... What can cause this issue?
Or do i need to install a specific browser?
If anybody knows that used puppeteer
Just do a npm i puppeteer. It installs the browser automatically.
How do I see how many bots I have in my server?
Js
What library.
The library, not the language.
discord.js
Eris, Discord.js, etc.
ah then just filter the <Guild>.members.cache collection and check if the user is a .bot
The members list: https://discord.js.org/#/docs/main/stable/class/Guild?scrollTo=members
There's a property called .cache which has the collection of members. You can then iterate over it with a method like .filter() to see if the user is a bot.
no spoon
Don't direct to that places for such a simple thing
Why not? You'll find everything you need there.
ok
my filter was wrong
@sudden geyser i mean... He can but he can also learn by that
Most people get confused on reading the docs
Reading the docs is a good skill to acquire.
It's good to get experienced in browsing documentation. You'll need it for almost everything :^)
Yea that's a thing that beginners can't achieve @sacred wraith
That's the main issue
even for puppeteer :^)
if a beginner can't achieve it there's only one way to learn
show me your launch options dank
Are you sure you've installed puppeteer and not puppeteer-core? Because the latter does not come with a browser.
@pale vessel this is what i tested
(async () => {
const browser = await puppeteer.launch({ignoreDefaultArgs: ['--disable-extensions']});
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({path: 'example.png'});
await browser.close();
})();```
you wouldn't want to ignore default args
well, the browser won't open anyway so that's not the issue i guess
did you install chrome?
@sacred wraith i tried both... One can't find a browser even if i installed it... And one can't launch the browser
@pale vessel what's the exact package name?
what do you mean?
Don't you say did you install chrome?
I didn't
what is the actual error that you got
For the puppeteer:
can't launch the browser process!
oh
And for puppeteer-core:
can't find a browser, use "npm install" or "yarn install" to install a browser
args in what?
launch options
I have no idea
you might need to disable sandbox
anyway, remove ignoredefaultargs and read docs on how to define args and disable sandbox
K lemme try
hi
module.exports = {
name: 'random',
description: 'random number generator',
execute(message, args) {
let a = args[0];
let b = args[1];
if (!args[0] || !args[1])
return.message.channel.send("Enter the minimum and maximum value of the random number generator like this for example: t!random 1 10");
message.channel.send(Math.floor(Math.random() * a + b));
}
}
this is a command from v11
what do i change in it for v12
how did this even work in v11
it did
idk how
wait
no
this is not it
wait nvm
anyways how do i do it
lol
can someone just tell me how to make a normal random no. generator in v12
look in your code @vale garden
yeah?
do you not see return.message
i do
that's not how-
so wdym
it's return message
ok
yeah
i forgot
now this is happening
module.exports = {
name: 'random',
description: 'random number generator',
execute(message, args) {
let a = args[0];
let b = args[1];
if (!args[0] || !args[1])
return message.channel.send("Enter the minimum and maximum value of the random number generator like this for example: t!random 1 10");
message.channel.send(Math.floor(Math.random() + a * b));
}
}
console log a and b
im sorry im bad at coding
what
return console.log('yoo the args came in')
return message.channel.send("Enter the minimum and maximum value of the random number generator like this for example: t!random 1 10");
message.channel.send(Math.floor(Math.random() + a * b));
}```
is the logging right
not logging
return message.channel.send("Enter the minimum and maximum value of the random number generator like this for example: t!random 1 10");
i feel really dumb rn
is it correct
cuz i feel like it isnt
i need some help. im really new to this but i need a bot that pins messages every time certain phrases are said is that possible?
and can i merge the function into an existing bot?
or maybe jsut add reactions to them
can i configure it?
Be nice
apologies
You have google on your side https://github.com/Cog-Creators/Red-DiscordBot
thanks, just wanna make sure i get the right thing
ok ima be honest thats kind of a "female dog" to do i made a simpe bot today that links chat from my mc server to a discord channel is there any way to just configure the feature into it?
actually im tired af ill check back in tomorrow
i want to make my guild count apart of my status. but I can't because the string registers as text
Put it inside of ` not '
works thanks
since you use glitch, i think you use discord.js, not your own neither Eris.
if (message.content.startsWith(prefix + "ss")) {
var app = require("node-server-screenshot");
app.fromURL("https://google.com", "test.png", function() {});
message.channel.send("no u", {
files: ["test.png"]
});
}``` so im trying to create a screenshot command and i keep getting the error no file directory exist app/test.png
because the file needs to exists
Hey Sir
im not trying to send app/test.png though
@restive furnace
I mean
That
Can you help me do a setActivity
of
Count Member
i cant see
read the docs, or go read these tutorials
i sent abovee
im not trying to send app/test.png though
some hosters just add app/file.format
if i try to send app/test.png i get app/app/test.png
yep
exports.run = (client, message, [mention, ...reason]) => {
const modRole = message.guild.roles.find(role => role.name === "Mods");
if (!modRole)
return console.log("The Mods role does not exist");
if (!message.member.roles.has(modRole.id))
return message.reply("You can't use this command.");
if (message.mentions.members.size === 0)
return message.reply("Please mention a user to kick");
if (!message.guild.me.hasPermission("KICK_MEMBERS"))
return message.reply("");
const kickMember = message.mentions.members.first();
kickMember.kick(reason.join(" ")).then(member => {
message.reply(`${member.user.username} was succesfully kicked.`);
});
};
its bcs the where you host the bot
so its just a problem with my hosting?
Most likely
@restive furnace Seems like i know you
you can switch hosters tho
try these https://github.com/Automattic/mongoose/issues?q=pool+destroyed
@quartz kindle still same :/
@restive furnace Seems like i know you
Yes. And to change your prefix please read https://anidiots.guide or https://discordjs.guide theyll cover you up with prefixes and etc.
@restive furnace Are you is that guy name Hero?
Keep this channel in-topic...
Yes. And to change your prefix please read https://anidiots.guide or https://discordjs.guide theyll cover you up with prefixes and etc.
@restive furnace
I wanna host self bot
Yes
Good
The free bot hosting is boring
Self bots are bad and against ToS
Not the bot that in your account
Well can you keep your computer on 24/7?
If Self Bot : Required Vps
@dawn trout nah, its just illegal
You can buy a vps or you can host on your computer if you can keep your computer up 24/7
or buy raspbi like my friend did
^
@hallow lance Raspi 4
😦
well yes it's kinda expensive
what if i'd buy a a older one
idk
just get a vps
like
you can get better than a raspi 4 for $3
for example
contabo offers 100Mbps internet + lik 200GB SSD and 8GB RAM for like $5
lemme check real quick
can someone help me get my webhook setup over in #topgg-api
This is what they offer
contabo offers 100Mbps internet + like 200GB SSD and 8GB RAM for like $5
they have even better plans
That's good
and all that for $5 a month
I mean a year you pay how much, $600
5 * 12
wait bruh my math
?
i found 2GB for 50$
$60 per year
lmao
...
today is not my day
normal puns make me go numb
but math puns make me go number
what
Can you check out my setup
Wydm setup
^
if u mean bot code, try it and see
now they're gonna flex on us
no
i have a $200 computer with like $80 gear
iits annoying
don't send an invite, you'll get fucked
youre allowed to send invites for coding servers i think
where you can receive help better
Where is coding server
What do you mean coding server.
Can you get give me a link
What library you use?
like discord developers?
Glitch

