#development
1 messages · Page 1872 of 1
are you running with python3?
should i make another lambda and call it asynchronously before returning the ACK response?
dont ping the role thanks
ok sorry , can you help me?
You need to read the documention.
On the edit page you can see another input for Authorization. Here you can provide a shared secret that you can check for on the server side.
To verify requests are coming from us, look for the value in the Authorization header and make sure it is the same as the value you provided in the form.
so much fun
I just installed a desktop and rn I am RDPing into my VPS
I think sacrificing 2 to 3 GB from 50GB NVMe isn't bad
oops im slow 
can anyone help me with setting up prometheus
ive got all my counters and histograms up and whatever
i just dont know how to get prometheus to record/scrape it
im using java to record it btw as my app is written in java
You just add the url to the prometheus config to scrape
smh imagine using pull based metrics
You'll need to figure out what's causing your response time to be slow.
big fart
I don't even know how can I see that
cuz debugging won't help for sure
it'll probably send off an unreal value for the response time
Well, you can look at some possible issues
Are your commands taking long to respond because they’re computationally expensive?
Etc
Connection issues, host far away from the servers, slow host
How do I make my bot react to a specific message in a specific guild in a specific channel
What library are you using
You need the message to react on (https://discord.js.org/#/docs/main/stable/class/Message?scrollTo=react), but you can obviously filter it down like checking the channel ID (<Message>.channel.id === ...). In Discord's API, all you need is the channel, message, and emoji (https://discord.com/developers/docs/resources/channel#create-reaction)
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
For example, if you had the message and channel ID, you could do <Guild>.channels.get(...).messages.get(...).react(...)
Ok! Thank you!
Wow, on this topic i am trying to create a reaction on a message, I am doing the put request to https://discord.com/api/v8/applications/773725697776549888/channels/842441853726228540/messages/885656702245040128/reactions/crate:885655992505860147/@me. I also tried to URL encode it with https://discord.com/api/v8/applications/773725697776549888/channels/842441853726228540/messages/885656702245040128/reactions/crate%3A885655992505860147/@me but it keeps returning a 404. Am I doing the request wrong?
The /applications/... components shouldn't be there
ok thank you
did the thread permission update change anything in the v9 api
i am getting a 400 error with this request
anyone see an issue with it?
this is the doc for the endpoint
https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
Imagine using qt stuff and not marrying me 👀
what are u doing dude
is there a way to know where this comes from..
ping in replies
also open the file with the toold as file viewer on pc if on pone then 
pls use a source bin like
https://sourceb.in
😑
Hatebin easier and faster
@boreal iron so the problem wasnt in the code, it was the invite link I was using and the mobile app not working properly until used on pc
Hello everyone can you please someone help me my bot there is not join stage channel can someone help me about that after new update discord this is happen 💐
Well yeah you need the application.commands scope in order to use slash commands.
Thought I did mention that but probably not.
It doesn’t change the fact you’re registering the commands over and over again which is API spam.
A proper handler to register/edit/delete commands still is important.
Your method you’re currently using also provides no way to remove a global command.
Considering switching to slash commands at all (because we all need to) should also include a proper setup how to handle and deal with them but not just a few code snippets thrown together in order to get things to work somehow.
Just how I see things…
how do i get the message that caused an error when using oncommanderror (discord.py)
Bots = no stage
do unverified bots have a lower rate limit than verified bots?
So i just continued programming again after 8 months and i see many changes on discord.js but whys this??
Anyone??
Don't think so, except for IDENTIFY ratelimit which gets increased on huge amounts of shards
Update node
How?? I only remember using “npm install node@12”
But how do i update it to latest version
googleable question
For replit you'll need tim's hack
Since repl can't update to latest node normally
Tim’s hack??
Bruh i tried all of the stackoverflow crap but still
Cause maybe im using repl
npm install node@16.x
Repl
worked for me earlier this month
Maybe repl finally added support for v16 then
nah doesnt work... let me recall what exactly I used
Nope for me
Use tim hack
^
Should i copy the run.sh file??
I really dont remember what i did back then
Instructions are there
I tried but damn
I already unistalled the bettersqlite3 thing
Whys still that
Oh got it
Oh shit sorry i leaked my token
Dumb shit
Regen it asap
already got access to all of their "homework" servers 
Yep
dan.channels.cache.get('885726031615508500').send('test')
Send is undefined
the get returned undefined
I used this method back v12 idk if it still works on v13
Wait what
But its the valid id of the channel
are you trying to get the channel before the client reaches the ready state?
don't you have to enable a flag to allow es module loading? Pretty sure cjs statements work inside es modules
if (i.customId === 'yes') {
embed.setDescription(`Yay!, <@${user.id}> and <@${interaction.user.id}> are now married couple!`)
database[interaction.user.id] = {
partner: user.id,
time: Date.now()
}
database[user.id] = {
partner: interaction.user.id,
time: Date.now()
}
fs.writeFileSync("./database.json", JSON.stringify(database, null, 2)```
this correct?
How?? Undefined?? Like its right over there
const method = // user input
const img1 = // image provided by user
const list = ["affect", "beautiful", "wanted", "delete", "triggered", "facepalm", "blur", "hitler", "kiss", "jail", "invert", "jokeOverHead"]
if(list.includes(method)){
let response_buffer = canvacord.Canvas[method](img1)
}
My code
| TypeError: canvacord.Canvas[method] is not a function
my error
@boreal iron
python main.py
COOLYOPBRUH
sh: 1: cls: not found
What is that error
Anyone is here?
how do i display something in js using ejs?
like for eg.
<script>
function hey(){
console.log(secret)
}
</script>
i want to log secret from res.render(fileName,{secret:"abc123"})
how do i do that?
<%= secret%> or <%- secret %>
example?
not now i need to go school
esm uses a multi-stage async loading system, so you cannot require an esm module because require is sync
you can use the dynamic import instead
await import("module")
from esm you can import commonjs but you cant use named exports because they rely on static analysis before being run, which commonjs doesnt support
help
@wide we HisnulMuslim#0556
The variable is defined but the value is not assigned
Im kinda confused but i think the wrong is the ejs tag like <%
?
will the work with JavaScript?
(wrapped around with the script tag)
like this?
ah thx
'E' is for 'effective'. EJS is a simple templating language that lets you generate HTML markup with plain JavaScript. No religiousness about how to organize things. No reinvention of iteration and control-flow. It's just plain JavaScript.
There are no ejs tags, those are called ASP-style tags btw.
no
the function wants the data variable but when it's run by whatever you're using it's not passing any value for data
depends
If you have huge data + want performance use psql (not lightweight at all)
if you don't care about losing your data use mongo (idk if lightweight or not)
if you have little data but want high data read speed use SQLite (lightweight but in storage)
if you don't fucking care about losing your data every time you reload the app use redis (in memory - not suggested at all)
you like Microsoft - use Microsoft sql server (idk anything about it)
you like microsoft
I'd like my DB to be local. I am using Ubuntu 20.04 on the VPS
Only if you don't know what you're doing. And if you don't know what you're doing you can fuck up a hosted db too. In any case, you should always make regular db backups.
Best is storing data in message content in a Discord channel :^)
yes
discorddb
someone actually made that a thing
rather someone made a discord file system
shows up as a networj drive on your windows
Free unlimited storage
No way 🤣
stores data on discord mrssages
Lmao
write speed is 10kbps

any difference between SQLite and MySQL?
not sure if MySQL has differences in the SQL language
or if it's all the same
Is it ok to re-register slash commands when ever the process is restarted for every guild?
Or can it cause ratelimits?
SQL is SQL anywhere at any time
aight
there are differences
The difference is in between the database engines itself
sqlite does not support all the features of mysql, so its sql language is also slightly different
He’s probably speaking about the syntax
I am talking about syntax

yes but some mysql syntaxes are invalid in sqlite due to it not supporting some features
haha, I knew it
its kinda like using an older version of nodejs
99% of js is the same, but some newer features are not supported
The general syntax is the same, you’re speaking about specific features of MySQL
And yeah if my cars doesn’t have lights, I can’t turn on the lights
Yes I’m aware but those features are NOT available but this doesn’t mean the SQL syntax is different
You just can’t use this features
thats what i meant, i mean its a feature of the sql language, not of mysql
ORM gang
nah, seen worse 
lmao
sorry i didnt express myself correctly
you are right
Haha lmao 
hundreds of gb
I have less than 50MB 
xd
Well then SQLite is the right choice for you
Supporting most features BUT not all 
what u guys storin'? I only store critical shit
like profiles, vip status, inventories and server settings
things that are really, really needed for the bot to function correctly on a guild
Your bank data, personal data or addresses are critical
it's like that, but on the bot xD
Also SQLite backups can’t be easier to do
noice, gonna set that up
can someone help?
no acceptable C compiler found in $PATH
I know how to fix this in Windows, but not in Linux 
k, it's done
Aye it is.
For example, if a column has a datatype of "INTEGER" and the application inserts a text string into that column, SQLite will first try to convert the text string into an integer, just like every other SQL database engine. Thus, if one inserts '1234' into an INTEGER column, that value is converted into an integer 1234 and stored. But, if you insert a non-numeric string like 'wxyz' into an INTEGER column, unlike other SQL databases, SQLite does not throw an error. Instead, SQLite stores the actual string value in the column.
Okay I see there are differences.
Didn’t even know some of the mentioned ones.
make a var called newContent that will remove all whitelisted words from my array in censorlist.json and after will check if there are any bad words left
wtf? So you’re actually speaking about a blacklist not a whitelist then?
You actually can convert both to lowercase
message.content.toLowerCase().includes(v.toLowerCase())
String.prototype.includes is a thing?
Your censor list you call whitelist for what reason so ever and the message content
Yeah or overwrite the native function to support case insensitive
String.prototype.includes = t => this.toLowerCase.match(new RegExp(t.smhescapeit, "i"));
ew
I've never messed with prototype of primitives before
Is it possible to get someone's info just by ID?. Where that ID is not in the server the bot joins
@raw gust there are some discord endpoints for fetching public user data
ah yes thank you so much
@errant flax that's a browser issue
-.-
I'm using OAuth2 for my NextJS website
Is this a good idea?
const [data, updateData] = useState(null);
useEffect(async () => {
// when component mounts
let resp = await fetch(`/api/getUserData?token=${encodeURIComponent(context.tokenPassedBySSR)}`);
resp = await resp.json();
if (resp) updateData(resp);
});
problems: token is hardcoded into the app
if i use a cookie it'll have to be non http only
localstorage :troll:
lmao
whats NextJs
how do you access localStorage on server side
it's a framework for making websites in reactjs
ah
it supports SSR which is just rendering the page on the server and adding interactivity on the client side
i dont understand ur code lel
I changed its name just few mins ago
Damn
Alrightt
my god you leaked your IP
delete that screenshot
quick
OH SHIT THANKY YOU im dumb
I thought the repl was off
And forgot to delete that code
it's not a good idea to literally display the user's IP especially if people are going to stream it
On replit, since .env is gone on it, how do i make my Token Hidden? What is the file i need to make and code i need to run?
use secrets
On mobile:
Settings > Secrets
On pc:
Left panel > Secrets
I added my token there, how do i run it?
On mobile:
Why
use it the same way as before
process.env.TOKEN
You cannot use replit on Mobile.
Let me try that
you can
it's just not worth the effor
lmfao i gave you javascript code not python
use the token in the old way
os.getenv
^^
technically u can
but its tedious
and i like it

Same error
Need help with an error , this is the code
I used JS last time. I am trying PY, my bot is ready, i just wanna hide my Token
But, i used secrets. I just dont know to run this time...
look at py examples for replit
Secrets:
TOKEN
Owoq9w8uhbeb.juU6t2.GGy6w6yqgvva
Code:
client.run(os.getenv("TOKEN"))
If that doesn't work then your token might be incorrect
Time to try it out I guess
ayo tim FaKe told me to do this
is this a good idea
I guess yeah
Replit are ballsy in a way
"free ide hosting"
how can I ssh into my VPS without writing the IP itself, like a domain name?
buy a domain
only way? isn't there a way to locally store the name
nope
They're not wrong
when you mention the name, your service provider has to resolve it
so the name must be public and known
They allow you to keep your repls running 24/7
otherwise they wont find it
but Contabo has this vmi[somenumbers].contaboserver.net
thats a subdomain
and I can do ssh root@[that thing]
So technically they're not liars
you can create subdomains if you own the domain
for 7$ per month (unless you use a third party website {uptimerobot} or make a repl ping others repls)
help, code is not running for some reason
you can use subdomains just like primary domains
so I don't need to buy one 😉
if youre fine with a subdomain from someone else, no you dont
change font to Minecraft enchantment table language
I am for starters
still better than emoji C
yes, you can use dns zone management
create an A record that points to your ip address
Yeah, they allow that so I mean
The price could probably be lowered a bit but generally imo if you want a full-on VPS just get one from another company
it actually has some predefined records
but creating the records is enough?
hello , i have a button that do a function but it works in servers , and the others not
the error
the line error
user isn't cached yet
const user = await button.guild.members.cache.get(button.clicker.user.id); // ther error from this line
so , how can i fix it
actually, is button.clicker a thing?
what lib is that?
bleh
It's already in v13 though
also, don't name a variable "user" when it holds a member
yea
and ye, djs 13 already has built-in button support
mmm
regarding your question, somehow clicker is returning a null user
try to use djs buttons
in djs buttons doc , there is no examp clicker
Use discord collections for cooldowns
But there is const filter = i => i.user.id
For cache clicker
What can i do with an API link?
I found this is why i ask:
https://pypi.org/project/dsc.py/
An API is something that allows you to stuff on a service
The most basic example of an API is an endpoint that sends back hello world in JSON
Oh
Anything top.gg related for it?
Server Count? Where would that be showing...
How do you do that?
You can use their API
HOW
const config = require(`../../botconfig/config.json`);
const Topgg = require("@top-gg/sdk")
const topgg = new Topgg.Api(config.DBL_TOKEN)
var ee = require(`../../botconfig/embed.json`);
const emoji = require(`../../botconfig/emojis.json`);
const {
MessageButton,
MessageActionRow,
MessageEmbed
} = require(`discord.js`);
module.exports = {
name: `check`,
category: `Info`,
aliases: [`votecheck`, `vc`],
description: `Check yourself if you voted me`,
usage: `check`,
run: async (client, message) => {
let es = client.settings.get(message.guild.id, "embed")
let button_invite1 = new MessageButton().setStyle('url').setLabel('Topgg').setURL("https://top.gg/bot/802812378558889994/vote")
let button_invite2 = new MessageButton().setStyle('url').setLabel('Topgg').setURL(`https://top.gg/bot/802812378558889994/vote`) .setDisabled()
//array of all buttons
let voted = await topgg.hasVoted(message.author.id);
const row = new MessageActionRow().addComponents([button_invite1, button_invite2]);
if(!voted) {
let embed = new MessageEmbed()
.setDescription(`You Didn't vote me!🤬 \n\n vote me now `)
.setColor(ee.color)
return message.reply({
embeds: [embed], components: [row]})
} else {
let embed2 = new MessageEmbed()
.setDescription(`You voted me \n **Now you can use [Grab, volume, Adddj, Embed, Playlist] Commands**`)
.setColor(ee.color)
return message.reply({
embeds: [embed2], components:[row]})
}
}}
components[0].components[0].style: This field is required
components[0].components[1].style: This field is required
?
anyone can tell me this error
why i can see
yeah
nvm i thought you had a problem with topgg
I've a first_name and last_name
ok and?
i want to make all the possible combinations with them including sperators such as _, .,-
error: i is not a command
use a regex
like {first_name}{last_name)
sorry but i got the solution
regarding this
are you using javascript or python
python
python has regex
idk how you create regex but the regex should be like this: first name here[allseperatorswithoutspaces]lastname
no not like that
combinations such as
{first}{last}
{last}{first}
{first}_{last}
..... so on```
npm ERR! code 127
npm ERR! path /root/.nvm/versions/node/v16.9.0/lib/node_modules/node-firestore-import-export/node_modules/protobufjs
npm ERR! command failed
npm ERR! command sh -c node scripts/postinstall
npm ERR! sh: 1: node: Permission denied
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-09-10T14_41_46_768Z-debug.log
after running npm install -g node-firestore-import-export
more ore less i'm trying to deduce emails
You don't have permission to install globally
Are you using replit
I am root on my VPS @earnest phoenix
based on first and last
Use an actual email detector for that lol
bruh! for that i need to make all the possible combinations
Asking about your attempted solution rather than your actual problem
and that's where i'm stuck
you should've just asked your original problem
well instead of getting spoon feed i wanted to know how i can do it
how can root not have permission to install globally?
I'll try googling it
@quartz kindle !!! root has no perms to install packages globally
probably has coinimp mintme miner too
they use black hat seo tricks to make google think its relevant to your search
for anyone who's looking for code for their discord bots code grepper is good for it
yeah i agree
show full error
@quartz kindle
yea
did you use sudo anywhere?
nvm is not on apt?

Sounds like a great business plan 👀 code.gg
The error is throwing when hey try to install a sus package
yeah, I did curl
node scripts/postinstall says permissions denied
it's pronounced soodoo by the way
not to me :^)
http://code.net/ is the best site
so informative too

What method should I use to get an emoji because when I do getString it returns me null
discord js moment
what ?
One message removed from a suspended account.
which class is that even?
One message removed from a suspended account.
One message removed from a suspended account.
@quartz kindle SlashCommandBuilder
show code
ok
One message removed from a suspended account.
faithity
One message removed from a suspended account.
One message removed from a suspended account.
:^)
https://hastebin.com/oziroqusar.coffeescript - Line 137 at addStringOption((options) => options.setName("emote").setDescription("Indique l'emote | Indicate the emote").setRequired(true)), @quartz kindle
but you said you want to get an emoji? youre setting options there, not getting
Hi, if I set a time filter for my reactions collector (e.g. createReactionCollector({filter, time: 15000 })), will the collector fire the "end" event when the set time has been reached?
I basically want to make it so that the collector stops collecting if there haven't been any received reaction after 15s
discord.js btw
uh yes wait
Line 35 - he log me null @quartz kindle
same problem for getString
so how can i do ?
Hi,
I am using apache2 and having problems
My sites:
mydomain.com
- has a https redirect rule
- virtualhost express server
sub.mydomain.com - has a https redirect rule
- virtual host Document root /var/www/html/
My problem:
if i go tosub.mydomain.com:
I come to the correct page
else if i usehttps://sub.mydomain.com
I come to the page of mydomain.com
why is apache so complicated
don't do me like that
ok, @quartz kindle I can install globbally, but for node-firestore-import-export I can't
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@quartz kindle you have issue so?
One message removed from a suspended account.
the package is trying to run a postinstall script which is the thing that's fucking up
yeah
I don't understand why I'm getting this error:
(node:24) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'cache' of undefined
if (message.content === `${prefix}removereactions`) {
if (!message.author.roles.cache.has(moderatorsRole)) return;
}```
Can someone help me, please?
Message.author returns a user object, not a member object.
User objects don’t have a property of roles since they’re not associated with a guild
So I gotta get the member object from the author's id and then do the check
Yes
Thank you
Np
you can just get the object using message.member
I forgor 💀
TypeError: channel.id is not a function
async execute(client, message, [channel='']) {
const channelID = (channel.match(/\d{17,19}/)||[])[0];
channel = message.guild.channels.cache.get(channelID);
data.greeter.welcome.channel = channel.id;
...what
Show the code for your command handler
(Also can you even use parameters like that in a function? I’ve never seen that before)
whathehell is supposed to be (channel.match(/\d{17,19}/)||[])
regex already return an empty array if it doesn't match anything
that takes us to my second question
whythehell use regex?
Very very very very odd
Any solutions?
Anyone doing blackjack orders?
One sec
Here
Can't u just copy and paste the config?
I'm too lazy to type anything, since your setup is fucked up as hell
Mobile :(.I will send it 2mrw then
Gonna send u an example how to set it up correctly
First VH doesn't need the SSL engine tho, port 80 and redirect to VH @ *443
Note:
Main domain is a express server
Sub domain is a directory
must support https
ah my bad lmao
thanks anyway!
Btw, how can I iterate through the messages of a channel?
This's the error I'm getting:
(node:24) UnhandledPromiseRejectionWarning: TypeError: wwwGamesChannel is not iterable
And this's what I'm basically trying to dojs for (const messageFoundGamesWWW of wwwGamesChannel) { setTimeout(function(){ messageFoundGamesWWW.reactions.removeAll() }, 500) }
Requiring HTTPS for the first VH:
<VirtualHost *:80>
ServerName something.example.org
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>
The actual VH (for SSL):
<VirtualHost *:443>
ServerName something.example.org
SSLEngine on
SSLCertificateFile "path/to/cert.crt"
SSLCertificateKeyFile "path/to/cert.key"
DocumentRoot "/var/www/dist"
<Directory "/var/www/dist">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
thx ❤️
<VirtualHost *:80> doesn't require any docroot etc, port 80 isn't SSL and is a straight redirect only
Second VH is the same issue as the first one
If you enforce a RewriteRule nother further config params are required
Regarding your second picture:
<VirtualHost *:80>
ServerName other.example.org
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>
<VirtualHost *:443>
ServerName other.example.org
SSLEngine on
SSLCertificateFile "path/to/cert.crt"
SSLCertificateKeyFile "path/to/cert.key"
ProxyPreserveHost On
ProxyPass / http://10.0.0.1:25568/ retry=0
ProxyPassReverse / http://10.0.0.1:25568/
</VirtualHost>
The second one uses the main domain but it should same ig
Don't forget to restart/reload apache
Can't see that on your picture
Depending on you setup your DNS records, you may wanna accept www.yourdomain.com as well
i don't use www ,so not needed
Which would look like (for both virtual hosts):
<VirtualHost *:80>
ServerName www.example.org
ServerAlias example.org
...
<VirtualHost *:443>
ServerName www.example.org
ServerAlias example.org
...
This can include multiple hostnames (subdomains) as well
ServerAlias example.org docs.example.org test.example.org whatever.example.org
tysm 
another useful tip
At the end of your VH file(s) make sure to "handle" hostnames which aren't finded as virtual host
<VirtualHost *:80 *:443>
ServerAlias *.example.com
RewriteEngine On
RewriteCond %{HTTPS} =on
RewriteRule ^/?(.*) http://%{SERVER_NAME}/$1 [R,L]
Redirect 404 /
</VirtualHost>
Which will rewrite each connection on port 80 or 443 (SSL) back to http and will return a 404
ServerAlias *.example.com stands for ANY hostname you have not configured as virtual host
The rewrite from 443 to 80 is important to get rid of unsupported SSL cert errors in your browser if a client tries to enter your domain via (HTTPS) for a non setup hostname
Like if https://fatduck.example.com isn't a virtal host you have setup (incl. a valid SSL cert), it will cause a cert error in the client's browser
1.learn how to code
2.search <your coding language> discord library
3.Read and Study the docs
4.build your bot
I know how to code but its complicated
It's not, you're listening to guild member events, check if it's a bot who joined, remove the permissions
Ye
remove the permissions
fetch the member roles, loop through the member roles, overwrite the permissions you need, to be a little more detailed
of course the apache sweat says its easy 😔
Apache is far more easier than NGINX
ngl barely used both lmao
But yeah already dealing with it for many, many years tho
only got the bare minimum config to work with php
PHP
❤️
Because people are too young to understand it’s superior leading position
At a time we had nothing else than PHP, you know

in js how do I play an audio file in VC connection? (discord.js V12)
the most annoying thing about php is the excessive functional ways they do things
and how they cant agree on parameter order
I've never used VC controls before
Didn’t get that.
But once you know then, you know them lol
That’s what you need to do learning any program language anyways
That’s why I said… once you know…
pretty sure djs has built in support for files
True
something.play("file.mp3")
why are aws lambdas so much faster than firebase functions?
i uploaded some of my slash commands to firebase and they took ~30seconds to return
aws <1second
my setup is perfect now that we have slash commands
once i finish moving all the code over
i can get rid of the vps
is there a way to make the bot appear online without having an open connection?
What’s the purpose? Upscaling?
i am not going to have a vpc after i move to serverless
No you can’t keep it online yet without a gateway connection
But I read somewhere that’s on the list of things to do
nice
That’s why I still enforce the bot and commands scope
it would be funny to make the bot go online every time a command runs and then instantly go back offline
I wonder how they will do it anyway
Sending post requests to the bot isn’t an active connection, how do they wanna say if it’s online or not
Online isn’t even a right term for this
Oh
i'm guessing they ease off the requests
like once ever couple hours after its trusted
Hmm maybe
Nvm requiring the bot scope and keep a gateway connection isn’t an issue for me
But yeah moving fully to slash commands without a socket connection will require them to do some work
Yeah that’s what I meant
gotcha
im going to keep both the slash commands and old commands working until they cut it off
Let’s see how fast Discord develops their new system in terms of forcing anybody to use it soon
April 2022 is what i heard
yeah they want to indicate if a bot is actually online or not
I switched to a deprecated warning for older commands to move people towards the new system slowly
You got ratelimited
The bot just send a embed with 2 reactions
I don’t know, you tell me
1 embed didn't spam or anything
if someone can tell you why then they are on your computer
If it’s a ratelimit by discord, you sent more than 120 requests in one second (that’s the limit, right?)
I didn't Lol
¯_(ツ)_/¯
iirc there’s some free ones available
But I don’t like AWS, their billing tactics are kinda sketchy
allegedly
pretty nice of them
i'll try not to get billed lmao
i know these cloud companies hope you slip up
Yeah
you need an api gateway too
i dont know if those are free
12 month free
then
who knows
AWS billing looks like it’s trying to make you not realize you fucked up and slap you with a bill at the end of the month
elastic beanstalk is the worst. it just makes random resources and then doesn't have as way to clean them up
you have to search through each one individually in each region to find it
im gonna fucking strangle someone in a second
these captchas are getting to a point not even humans can solve them
lmao
stuff like that makes me want to use google cloud
bbxb2d
Type the characters shown in the image below
shows a fucking acid trip with some letters
I had to do the AWS captcha about 5 times before I got it right
a bot is more likely to complete the captcha than a human
are captcha getting harder or am i becoming a bot?
15.856pi
At least less annoying than the captchas to select images with special things in it

should've chose to study further maths as an a level
Aye
The trick probably is, if you can solve this question you are a bot and access is prohibited
Big brain
i bet there wont be many math professors using that website
name a fruit
Rock
lmao
The red text is cool tho, filling out all form fields, then reloading the page to get an easier question and poop the form is empty again 
The 'net is a scary place.
throwback to primary school presentations from police talking about online safety
i'm not that old
tim is something else
Within his midlife crisis
Right so I have a matrix that looks like this:
matrix = [
[a, b, c, d],
[e, f, g, h],
[i, j, k, l],
[m, n, o, p]
]
The entries of the matrix n is always equal to the length of each index of the matrix so the matrix can be of any size: 1, 4, 9, 25, 36
Now I need to get a square out of the matrix for example:
Square 1 of the example above would look like this: [a, b, e, f] and square 2 would look like [c, d, g, h] I already know how to do it for a 4x4 matrix but I have no clue how to make it work with any of the size listed above
Language is python btw but I also accept javascript answers as I can translate it if needed, still prefer if you just tell me what to do tho so I can figure it out myself
Bruh that token logger got me banned from didcord.js
then don't use a token logger
fr 
Clearly not a friend lul
can't keep using that excuse man
The one from earlier
you keep saying "a friend sent it to me" when in reality it's your fault for running the script
Plus that friend gave you a script before that that clearly selfbotted
I suggest not running scripts he sends you
Cus servers will continue to ban you
Well he got my token then put it in a selfbot
Also related to my current client
Making me make a bot that logs on a client account
50 dollars cash
Not bad
naughty naughty
how can I define EventTarget
is that in a node module or what
The vid doesnt play
<!DOCTYPE html>
<html>
<body>
<center>
<video class="tab" controls>Your browser does not support the <video> tag.
<source src="vid1.mov"/>
</video>
</center>
</body>
</html>
Code from stackoverfl
thats the problem with copy pasting code
you mean me?
Not you, was talking about zed
ok
Dude ive been searching for the right answer for hours and i think its really about the html5 thing or the browser
And i made my own code using video tag and didnt work either
It just been like that
Wait what i tried changing it to mp4 yesterday and it just doesnt show up
Like its full blank website
how did you change it to mp4
await sentEmbed.react("812104211386728498")
^^^^^
SyntaxError: await is only valid in async functions and the top level bodies of modules
.then(sentEmbed => {
await sentEmbed.react("812104211386728498")
await sentEmbed.react("812104211361693696")
})
await sentEmbed.react("812104211386728498")
await sentEmbed.react("812104211361693696")
})```
ok
plot twist: extensions can't just be changed and expect it to work
is there a risk to someones discord account if they make a bot and share the bot token?
also yeah, mov has very little compatibility with anything
yep
it's yours responsability to choose who you deem trustable enough to share the token
if the bot is punished so are you
i am thinking about letting people create their own bots and register it with my bot and it basically make it a clone of my bot
If someone uses that bot's token to send DM spam or raid, nuke servers for example, then the bot owner is responsible and would be the one who gets punished by Discord (banned).
but they can choose the avatar
For the hijacker, that's a zero risk way of causing damage since the bot owner holds all the liability.
you share the fate of ur bot
people will trust my bot
I wouldn't 
Hence also why I always suggest never asking for admin perms / perms it doesn't need. Because if your bot / account gets compromised then the attacker can literally nuke every server if they want to.
I vote for discord removing admin perm
Sadly, I ran a test on mine (doesn't require admin and never asks for it) and 20% of servers have given it a role with admin permissions. They must just have a "Bot" role with admin perms they slap on every bot they add to their server. As far as I'm concerned, if my bot gets compromised and nukes their server one day that'll kinda be their fault too for giving it the permissions to do that 
Badly built servers 👌
Hi, could someone help me debug my code, please?
let wwwGamesChannelFetchedMessages = await wwwGamesChannel.messages.fetch({limit: 100})
let wwwGamesChannelLastMessage = wwwGamesChannelFetchedMessages.last();
wwwGamesChannelFetchedMessages.then(messages => {
messages.forEach(messageFound => {
setTimeout(async function(){
messageFound.reactions.removeAll()
}, 500);
});
});``` This's the error I'm getting
`(node:25) UnhandledPromiseRejectionWarning: TypeError: wwwGamesChannelFetchedMessages.then is not a function`
If that's not a function how should I actually set it up
since my bot has manage roles permissions can it make a role with more permissions and add it to itself? hopefully not
Some bots don't require it but do need it to function
Users can't give permissions they don't have
You NEVER need admin
my bot for example uses it so that it can see when members join and flag them up if deemed suspicious
i worded it wrong
i meant its NOT needed
but some just don't function without it
like the bot owner made it not function without admin
It doesn't need admin for that
true
No bot needs admin nor should ever be given it
Why do most music bots ask for it lol
Because they're lazy
Groovy used to ask for admin
you already await wwwGamesChannelFetchedMessages on the first line so the .then isn't available
savage
lulw
They don't want to have to explain to noobs how to set up perms in their support server (or the bot dev is inexperienced and doesn't know how to choose or set up the right perms for their bot so they ask for admin because "everything will work")
But it's important to await wwwGamesChannelFetchedMessages, so how can I find a solution to be able to keep using .then?
yeah lmao
Guess what else will work? 👀
||Nuking your server||

Call the foreach by wwwGamesChannelFetchedMessages.forEach(message => { }) instead of calling a .then first
forEach() 
let wwwGamesChannelFetchedMessages = await wwwGamesChannel.messages.fetch({ limit: 100 })
const foundMessage = wwwGamesChannelFetchedMessages.last()
setTimeout(() => {
foundMessage.reactions.removeAll()
}, 500)
Better code

Not only in JS
foreach is pretty good in php
Aye, but for is still faster
btw that line const foundMessage = wwwGamesChannelFetchedMessages.last() is not supposed to look like that; it was previously as "let wwwGamesChannelLastMessage = wwwGamesChannelFetchedMessages.last();"
because later in the code I do a check, like, if the foundMessage was the last one, then "do something else" (in this case, go to another channel and repeat the same forEach loop)
replying to this
goto 
by the way your variable names make my eyes hurt
Very long
what method do you recommend me to use then?
for of
Replace foreach with for...of
same lmao I know I should shorten them a lot
At least they’re descriptive
exactly
And not just like x or y
Because there're like 4 kind of different variables with similar names
so for the code not to mix any of them, I describe them very well
and alright, thanks a lot!
I wonder how long a module can be if you have issues mixing vars
actually funnily enough
i just test foreach iterated a 50k element array
it was 4ms faster than for of
i guess it depends on the use case
for of is also slower than most others
yeah
a lot of people think its just syntactical sugar for "for i"
i think a lot more happens in the background
I was always told for of is faster than foreach
Maybe just because it has to get the elements size?
probably
checks slow it down most likely
for of uses iterators
depends on the object for how it implements its iterator
so different objects can have different for of performance
Tim the walking lexicon 
lmao
Ah
Thought it was just the last one oops
Now I got this a lot of times when trying to run the command lol
(node:24) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'removeAll' of undefined
let wwwGamesChannelFetchedMessages = await wwwGamesChannel.messages.fetch({limit: 100})
let wwwGamesChannelLastMessage = wwwGamesChannelFetchedMessages.last();
for (const messageFound of wwwGamesChannelFetchedMessages) {
setTimeout(async function(){
messageFound.reactions.removeAll()
}, 500);
}```
Does it mean that the message didn't contain any reaction?
maybe you came across a system message and those dont have the reaction object? idk i dont djs anymore#
nah, all the messages in those channels have been sent by non-bot users nor by the Discord system
by the way that settimeout is useless since they'll all run pretty much at the same time anyways
I just don't wanna be rate limited
I read somewhere that 500 is a good time to not be rate limited
djs handles that automatically
what you are doing is setting all of those removal requests to happen in 500ms
they dont queue
they run at the same time
a
Thought they were being queued tbh lol
And ok will do
if you want to queue them you need to await settimeout
for loops will wait for async operations to finish inside it before continuing
Set the limit to 50, still getting
(node:25) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'removeAll' of undefined
man i was thinking something like 5 lmao
But like, a lot of times
Ah bruh lmao but in those channels there're like 25 messages as minimum
were just testing
got it, will try
alright
nah, even with 5 I still got the same error
will try this as well to see what exactly is messageFound
that feeling when you dont even know
You're iterating through a collection, they're mapped by keys and values, you must destruct the second element: const messageFound -> const [, messageFound]
trust me, that happens to me most of the times~
I see, thanks for the heads up, will see what I can do
const [id, values] of collection
Somehow prefer that style
How can i add timer on mongo like mute with time i know how to use mongo but this thing i don't know how can i make it or give me an idea how it will be
Just store times in which something is supposed to happen and then on start, query that and create timeouts
It’s always a good idea to store the time in the database and in the cache.
If your bot restarts you can load the timestamps back into your cache but nothing can be lost.
But keeping that stuff in the cache will reduce the amount of calls you need to do to the database.
(node:25) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'values' of undefined
let wwwGamesChannelFetchedMessages = await wwwGamesChannel.messages.fetch({limit: 100})
let wwwGamesChannelLastMessage = wwwGamesChannelFetchedMessages.last();
for (const messageFound of wwwGamesChannelFetchedMessages.collection.values()) {
await setTimeout(async function(){
messageFound.reactions.removeAll()
});
}```

as wwwGamesChannelFetchedMessages is a collection and Tim suggested it that way, I tried it out
The property .collection doesn’t exist
I could just try wwwGamesChannelFetchedMessages.values() though
yeah that's what I'm realizing lol
Tim said for(const something of <collection>.values())
Not .collection as property
But collection.values()
Collections represents the data type, a collection
Like if I would say array.includes()
Array is an array not .array as property
yeah now that I think of it, it totally makes sense
alright
omg it almost worked from beginning to end but I have no idea why it stopped at the last one
Any idea? The code repeats, so there shouldn't be any bug
No errors in the console either
here's the code involved```js
let brAvatarsChannelFetchedMessages = await brAvatarsChannel.messages.fetch({limit: 100})
let brAvatarsChannelLastMessage = brAvatarsChannelFetchedMessages.last();
for (const messageFound of brAvatarsChannelFetchedMessages.values()) {
await setTimeout(async function(){
messageFound.reactions.removeAll()
if (messageFound === brAvatarsChannelLastMessage) {
confirmationEmbed.fields[1] = {name: **${brCreationsCategory.name} Category**, value: <#${brGamesChannel.id}> - Cleaned! \n<#${brModelsChannel.id}> - Cleaned! \n<#${brAvatarsChannel.id}> - Cleaned!}
confirmationEmbed.fields[2] = {name: **${videosCategory.name} Category**, value: <#${videosChannel.id}> - Cleaning. . .}
m.edit(confirmationEmbed);
let videosChannelFetchedMessages = await videosChannel.messages.fetch({limit: 100})
let videosChannelLastMessage = videosChannelFetchedMessages.last();
for (const messageFound of videosChannelFetchedMessages.values()) {
await setTimeout(async function(){
messageFound.reactions.removeAll()
if (messageFound === videosChannelLastMessage) {
confirmationEmbed.fields[2] = {name: `**${videosCategory.name} Category**`, value: `<#${videosChannel.id}> - Cleaned!`}
m.edit(confirmationEmbed);
const successfullyExecutedActionEmbed = new Discord.MessageEmbed()
.setTitle(`**Reactions Deletion Successfully Completed**`)
.setDescription(`All the reactions from every single message in the channels from the **${liveCreationsCategory.name}**, **${brCreationsCategory.name}** and **${videosCategory.name}** categories have been successfully removed.`)
.setColor("GREEN")
.setFooter(`Reactions deletion hosted by: ${message.author.tag} (${message.author.id})`, message.author.displayAvatarURL())
.setTimestamp()
message.channel.send(successfullyExecutedActionEmbed);```
I'm totally aware it's very hard to read but I swear it looks way more clean in the code maker window I write my code in lmao
It might do so but I’m on mobile atm 
So on ready event should i set timeout with time from data bath if it's there ?
It’s the right time to send a request to the database and fetch your timestamps for the clients who are muted
If the timestamps are > than the current time, you add them to your cache (for example a map) and work with it
At the moment you mute somebody or remove a mute you need to update the cache and the database of course
Okay thx
Bruh, here's a tip
Your variable names are WAY too descriptive
Go easy on names, use comments if you must
pretty messy on desktop too
Yeah we figured that out via DM already
I hate Discord’s code blocks especially on mobile
thanks for the feedback
Btw my bot is still not passing from "Cleaning. . ." the last channel
I already tested everything
It's not rate limit
So the error is in the code but I don't know exactly where
Are you really fetching every single message?
That sounds like api abuse unless it takes like 1 day to complete
Yeah but the limit is 100 and those channels have less than 100 messages for sure
Also I already tested it and it's not something about rate limit/API abuse
I literally tried skipping a whole category and it's still stopping working when it reaches "cleaning #community-videos"
No error?
No error
Are you suppressing any?
I'm not - Better check the sourceb.in link I've shared with you in DMs
do you mean .catch()?
root@ip-125-249:/home/ubuntu/real# npm i discord.js
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/distubejs/prism-media.git
npm ERR! git@github.com: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-09-10T15_41_32_696Z-debug.log



