#development
1 messages · Page 1400 of 1
For person mention you can use mentions.members.first()?.name == "Lautaroice"
I think you need username and discriminator actually.
yeah probably
isnt it better to use id?
console.log(mentions.members.first()) and see what you need lol
Yeah
what if you change your name?
or you are nicknamed
actually i think it shows under displayName
guess you could say same for role mention
not under name
yeah i wasn't sure about the property name
its to avoid people using multiple mentions
if i do @stoic girder then @opal plank it'll get yours first[
event though @opal plank is there
yeah that's what i meant
It's not in any particular order but you're right
Discord API be like
if (message.mentions.members.first()== "lautaroice"){
console.log(mentions.members.first());
}
¿?
Nope
all mentions/members/users are mapped in id order, though i could be wrong about that
though im 70% sure
You should use message.mentions.has("your id")
and you get your id by right clicking your username -> copy id
assuming dev mode is on
which is turned on in settings -> appearance
damn i love helping people even tho i suck at it
Relatable
@pale vessel In the if?
ye
fun fact - i was so so so close to start making discord bots in php
that would be awful
Not really
you tried?
I did
PHP is not bad
if (message.mentions.has== "Lautaroice#0800"){
console.log(mentions.members.first());
}
aaaaah
That is your tag
Just doing an endless loop and requesting the API over and over again within the limits
Is as responsive as JS
Use message.mentions.has("209841194975494144")
and 102 other jokes you can tell yourself
wtf
What the what
Which doesn’t mean you can’t
And that nums?
That is your ID
that number is your ID, which i explained above how to get it
@pale vessel Where can i see that?
Please read defected's messages, I actually feel bad for him
well i'm glad i learnt js more by making bots
wrong reply:
oops
But my id where you found that?

Make sure you right click the profile picture, not the message since that would be the message ID
You should told him it doesn’t exist on mobile versions of Discord
i always do the name
He might be there
do people make bots on phones
Lol he sent a screenshot on web
@stoic girder Yes, a friend named Voltrex Master did that
woww
Not only he did
i made a bot on phone once
Met a few people here hosting on their mobile phones
i used repl
Don’t wanna comment this but yeah why not
if that works its actually kinda smart
imagine paying for hosting
same
Backed it up somewhere, gimme a sec
how to fix this ? python language
yikes, a language that i don't know
@stoic girder just an endless loop fetching the guild messages every 500 ms within the ratelimit adding ?after as GET argument to catch the latest messages only
Works like a charm
You won’t note a difference to a bot made in JS but as I said PHP is not supposed to act as live environment
that spaces in functions trigger me
what about discord php library?
there's one thats frequently updated
Nah I don’t like to use libs, doing my shit alone doesn’t require to update all the shit always
Some smaller libs, sure, but if this was an actual "big" bot, it would be a mess I assume.
Which is why I'm regretting SQLite and rewriting my whole god damn bot right now.
but you have to update it when discord releases new changes / changes something / etc.
So you would typically make your own lib to reduce caching or modify an existing library
Barely only ... the API had no major changes in how to use it
I wouldn't reinvent the wheel but modifying could be useful.
All depends on the specific environment and use case.
Yeah
Aye the mentioned example wasn’t supposed to run on lots of servers of course
yeah
Maybe not now, but in the future, there could be. Most bots use libraries because someone else (a community in fact) has already put in the hard work to make it easier / more elegant to use. But there is value out of making your own. It's like the difference between making your own HTTP client vs. using a library to do it for you
How can i make a bot that tracks my servers votes?
Yea
i have no idea let me check the docs for you 
@desert hazel Ok so in your server edit page you can set up a webhook URL. Your bot should have a HTTP server at that URL that will parse incoming POST requests.
I'm not sure do any of the DBL API packages have that feature, don't use them myself.
Yeah the libs contain tons of functions and method you don’t need to create your own. That’s correct but how djs for example communicates to the Discord API - sending POST, GET, PATCH whatever requests won’t change in the future. Using these libs is the easiest solution for the most use cases. But not if you wanna code it your own style and you’re able to it. Especially if you wanna put all the content in you really need.
Changing the API version to v8 didn’t change the way to communication works with the endpoint which didn’t require any change of my code.
It's not just about classes, functions, utilities, etc. It's also about conforming to Discord's API & rules. For example, I don't see you handling rate limits in the screenshot you shared. Maybe you are and I'm just blind, but I wont nitpick on someone's choices.
He did say it's for a small bot...
Even if using a OOP style is not the most efficient style but it actually requires just a few changes if I ever need to change some of my ... what you would prototype functions
lol the screenshot is small look into a specific code snipped to the framework around
Working on an application bot... Questions can be added & removed by server admin.
Once someone applies, should I store question ID & answer or question text & answer?
ID would use less space but would create problems if a question is removed.
Any other cons of storing question text directly?
so how would i get the users name that voted, sent to this? and then it will update my bot
Before entering the loop there’re way more requests getting the guilds, the channels etc. and receives any message on any channel after the last sent message (cached)
or ID
@desert hazel dump the POST request data and see what it contains, i guess there is user_id var or something
ok so i make the the /webhook/url in my bot?
Where is your bot hosted, and which language are you using?
Do you know how to setup a webserver?
(node:3893) UnhandledPromiseRejectionWarning: Error: EMFILE: too many open files, open './storage.json'``` anyone might know why im getting this error? i'm using javascript
okay lemme try that, can i ping you if needed?
Sure
except you need the server to actually be hosted somewhere
make sure it’s accessible to the public
Aye
Quick question what does async def mean in py?
idek what port the request is coming in on
not a clue
Ok coool
@safe creek look up asynchronous programming
Mmmk
i don't understand it too much
but
it works
await doSomething(); // wait for doSomething to finish
proceedWithCode();
}```
dump the whole request, does it work at all?
nope, if i go ip:5000/test it prints passed
you did press "test webhook"?
i took the port from the docs
hmm
5000 is on the docs
wait
wait
maybe it cant get through the firewall on my wifi
Not on port 5000
That’s why he told you to use the default webserver port
but dbl dont post on 80
DBL posts to whatever you set in the webhook URL field
Yeah your router doesn’t forward port 80 to your device anyway
You need to forward ports if u wanna use it at your device and open the port in the firewall after
TCP
is there any alternative to "break" in Array.forEach
or i need to go with a regular for loop
stop it at the one you need with if?
yeah
cant you stop it at with a if(found === request)?
i have if(cancel) break
idfk if i am forwarding it correctly
i guess i can put all the code in if(!cancel
What do mean by breaking the array?
might as well just go with regular loop
stopping the loop at a certain point
break works in any loop
either i havent forwarded correctly, or its not working
questions.forEach(question => { if(cancel) break; });
SyntaxError: Illegal break statement
i'll just use for(q in questions)
just hate that it returns key, not the element itself, so you need let question = questions[q];
lmao
bot is hosted on your pc as well?
Bro i think im only allowing port 5000 to my pc 
Most routers are not able to resolve your own IP, just open the URL on your mobile device not using your LAN

And don’t forget the firewall as mentioned
Most cheap ISP routers are trash, actually have no real option to configure DNS rebind sec etc.
Bruh im using a 4g router lmaooo
get 5G 
And also seen lots of routers don’t even supporting port forwarding even if you can set it up in the UI
Bro my 4g router is faster than my wired connection
same LOL
lol thought my country is a mess already but a wireless router phew
same here ngl
i got unlimited data so i just hotspot my 4g most of the time
how many commands can i jam into one discord.py file?

lol do you live in the jungle lmao
as many as you like
oh nice
our "unlimited" used to be 1TB of data a month and then you get throttled to really low speeds
now they dropped it to 200gb
wait what
where you from
literally
same
here
croatia
(sry for non english)
#1
Well cash is all they need
yep
i wouldn't complain if they did it to new users
but they lowered the limits to everyone without notifying
bruh this shit buggin me
let AnswerSchema = new mongoose.Schema({
question: { type: String },
answer: { type: String }
});
module.exports = mongoose.model('Application', new mongoose.Schema({
user: { type: String },
guild: { type: String },
answers: [ AnswerSchema ],
status: { type: Number, default: 0 },
date: { type: Date, default: Date.now }
}));
...
let applicationSchema = bot.data.getQuestionSchema();
let application = new applicationSchema({ user: msg.author.id, guild: msg.guild.id });
...
application.answers.create({ question: question.content, answer: answer });
Cannot read property answers of undefined.
Some obvious error
Or my code sucks
or both
ahh
im dumb as fuck
getQuestionSchema instead of applicationSchema
don't copy-paste kids
Thought it’s working
sry
LOL
Oof time is running... wanted to sleep for a few hours already damn
heh, could've probably finished a lot more commands instead of chatting here for past hour or two
but nice to talk to you folks



4 of em lmao

thats a big brain move
lol









yours is bigger 😢
Sad pepe
This development



hehe boi
be kind

Kii haal bhai


ok calm levi boi
application.answers.create({ data: moreData });
console.log(application.answers); -> empty array
is this expected? do i need to fetch the "row" again to get answers?
mongoose btw

Dont post flashy emotes, thanks.
it will surely work if i get the row again, but more code, more memory and stuff
anyways
Rules are rules for a reason 
bruh
good night
Gn


also keep this channel on topic?
I just said not to post flashy emotes.
@oak cliff thats not flashy tf
yes
you don't know what you just started with mentioning json
json can lead to corruption issues down the line
do it once and get it right
k
he deleted his messages
whats the event for when you join a guild?
what lib
the event for a bot leaving a guild is guildDelete
just replace guildCreate with guildDelete
you're welcome
also - how can you find a channel called message-log and create a webhook there?
srry
im not that good with discord api
ik
full docs on how to do stuff there
i read
best is to read through it
learning how to read through docs and rely more on yourself is a very important skill
but how do you find a specific channel name?
.find
.find(channel => channel.name === 'name')
mmmm
14. Bots with commands allowing a user to DM another user must either state the author or that it was anonymous; in addition to having a block or opt-out feature.
Does this mean I can't make a feature that DM's a person when gets banned/kicked/warned????? Or did I read this wrong?
Ok Good Thought so
Make sure you have an option to disable it
Ok
client.on('guildMemberAdd', (member) => {})
should this listener be triggered when someone new joins the discord guild?
it doesn't seem to be working anymore
remember to enable the member intent
is that a new requirement?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
your event requires the GUILD_MEMBER_ADD intent, as listed on this page
GUILD_MEMBERS (1 << 1)
- GUILD_MEMBER_ADD
- GUILD_MEMBER_UPDATE
- GUILD_MEMBER_REMOVE
is there a config somewhere that i can add that to?
inside your Bot application, you need to enable this toggle https://cdn.hopefuls.de/MuSK
Include the intent in your client options too
yeah, both is better
ClientOptions#ws#intents
thanks, trying that out now
how do i change the color of vote and invite buttons
#support for topics relating to https://top.gg
#development is only (bot) development
Use the <style> tag
cant find it
Inspect element
yeahj cant find it
Don’t you “smh” me when you’re not more clear about questions just asking “how can i change this button” isn’t clear enough. Thank you, Have a good day.
It's a class
If you cant offer help please refrain from speaking to me
thank you flaz
Okok, Let me get this straight. You reply back to me after I replied to you ENGAGING us into a thing called a “conversation” which means, you cant say anything about it. Thanks
Oh no! Anyway let's just move on
@agile lance dont attack people who are trying to help you
Follow rule one, thank you.
They were right, we allow any development topics in this channel, including html and css for the site.
Im a little new to html. Would i just do
div.titleandvote div.content {
to select a class
Yes but there's no .content under .titleandvote from what I'm seeing
Do we need any special permission to use animated Emoji for bots ?
nope
remember that you have to get the emoji mention and your bot has to be inside that server
\:vibe:
doing something like that would give you !vibe
:earth:
when I use this it just returns
:earth:
use the mention tag of that emoji then
huh ?
I can't even write it
<:earth : 779014611835813898>
the emoji mention tag
I am using that
client.on("message", (message) => {
let msg = message.content.trim();
if (msg == "emoji" || msg == "emojis"){
const emojiList = message.guild.emojis.cache;
emojiList.forEach( (a) => {
message.channel.send(`<:${a.name}:${a.id}>`);
});
//console.log(emojiList);
}
});
client.login(process.env.BOT_TOKEN);
I am using this to get a list of emoji
add a to indicate it being animated
where ?
<:a:name:id>
Tha @rustic nova 😊 😊 😊

how do i change the color of the buttons (vote invite) and the tags
so thats how you do animated emojis thanks!
css inside your long description
yeah but i dont know the css
I'm wondering if anyone has a link to either a quick.db or discord.js document that explains a little bit about a ignore channel code.
Basically I made a link deleting feature and I want to be able to have a specific channel where links can be sent and the link code will ignore this channel
Anyone know how this would be done or have a link to the document that explains this a little bit?
tried everything
Just make a button tag in the css file
<style>
div.titleandvote{
transform: 0.5s!important;
text-align: center!important;
font-family: "courier", monospace!important;
animation: fadeInAnimation ease 2.5s!important;
animation-iteration-count: 1!important;
animation-fill-mode: forwards!important;
background: #9900cc !important;
color: #fdca00!important;
}
</style>
And do button: { BackgroundColor: "color" }
yeah that's not how the css on the site works
I need to refresh on how css looks but that should be the code
oh wait
remove the div.
and try that
also, the css selector for both the buttons is .btn-orange
for all the buttons that is
why div. and not just div?
oh yeah, only div lmao
😛 baka
Ik its ;lazy but what should the code be like im very inexperienced
hint: to only change the invite and vote buttons (without the stars, shard server etc), just use the selector .titleandvote .btn-orange
CSS isn't that picky with rules. It's mostly the selectors that are the pain you have to deal with
just do what you did before, with the div.titleandvote
just renaming them to .titleandvote .btn-orange
without the div though
also, most fucking annoying thing on the css are these fucking triangles on the tags https://cdn.hopefuls.de/ToZF
<style>
prefix.btn-orange {
background: #9900cc !important;
color: #fdca00!important;
}
</style>
```?
getting these changed is pain
Very
<style>
.titleandvote .bnt-orange {
background: #9900cc !important;
color: #fdca00!important;
}
</style>
That
didnt work
<style>
.titleandvote .btn-orange {
background: #9900cc !important;
color: #fdca00!important;
}
</style>
<style>
.titleandvote .btn-orange {
background: #9900 cc ! important;
color: #fdca 00! important;
}
</style>
no
<style>
.titleandvote .btn-orange {
background: #9900cc !important;
color: #fdca00 !important;
}
</style>
i highly suggest getting more css experience first before continuing to modify your bot page with design
::after
{
display: none;
}

Still isnt working
where exactly are you putting that on your bot page?
changing the background and the colors on the bottons
No
https://cdn.hopefuls.de/jz2r.gif it works perfectly fine for me
get more experience in css first please
because that is crucial when designing your page
Yeah
i will
thank you for the help
Wait i got it
sorry to bug again but whats the selector for the tags and website- github links
bot-btnss
im blind then lol
websitelink for the website
support for the support button
github for github
not telling the one from report though, because that's a button you should not modify
Alright thank you
so just
<style>
.websitelink .btn-orange {
background: #9900cc !important;
color: #fdca00 !important;
}
</style>
that's your old one
if you want to add more, just append(add) them below the closing bracket
like
.websitelink .btn-orange {
stuffhere: hehe;
}
.yourotherthings {
color: rainbow
}
for example
ahh
ty
<style>
.websitelink .btn-orange {
background: #9900cc !important;
color: #fdca00 !important;
}
.support {
color: #fdca00
}
.github {
color: #fdca00
}
</style>
not exactly
oh wait
it's not .support .github etc
no wait wiat
jeez that's confusing
Yeah
Got it
<style>
.websitelink .btn-orange {
background: #9900cc !important;
color: #fdca00 !important;
}
#support {
color: #fdca00
}
#github {
color: #fdca00
}
#btns {
color: #fdca00
</style>
Id asume that for the tags
i can't help you the whole time, try to learn a bit about css
Ok
should i link tailwind and use that
html
yeah i code html
Hacking into the mainframe l
l
If you can make me 1 bot for free dm me
Wrong place
message.mentions.users.first() || message.guild.members.cache.get(args[0]) || message.author;
how do i make the message.guild.members.cache.get(args[0]) give a User object? because just adding .user to the end doesnt work
how do i make it so client.users.cahce... only works for members in the sevrer
hi
does anyone know how you define a channel as an arg in py
discord.Channel or discord.ChannelType doesnt work
@vale garden mostly there are JavaScript or Typescript devs here so maybe checkout python docs
ask away
@unborn ridge just ask it
hmm
if(err) console.log(err);
let jsfiles = files.filter(f=> f.split(".").pop() === "js");
if(jsfiles.length <= 0) {
console.log(`NO COMMANDS FOUND !`);
}
console.log(`LOADING ${jsfiles.length} COMMANDS !`);
jsfiles.forEach((f,i)=>{
let sss = require(`./commands/${f}`);
console.log(`${i+1}: ${f} Has Been Loaded !`);
bot.commands.set(sss.help.name,sss)
})
})```
i want to make subfolders
will they also wor
work
yeah
Use glob
do i need to add something in index.js
Its like fs but only for finding file and stuff
use glob command in index and it will also include the folders
not command sorry code
?
wait a min
i am unable to understand

cause if i dont make subfolder its messed up in between 109 commands
// options is optional
glob("**/*.js", options, function (er, files) {
// files is an array of filenames.
// If the `nonull` option is set, and nothing
// was found, then files is ["**/*.js"]
// er is an error object or null.
})```
?
i have to type foldername in "**/*.js"
@earnest phoenix
why does my bot repeat the message twice
you might have 2 instances of the bot running
is it djs?
aah
pls if u can help
im not proficient in that 😅
it would be grat
sorry 

@spark dawn glob is a better solution
but how to do that
i dont know anything abou glob
@earnest phoenix cam u show a example
pls
The npm page have the example lol
I know that, but many of the new people dont know the correct usage of glob
I can't figure out on_dbl_vote. Can anyone help me?
@commands.Cog.listener() async def on_dbl_vote(self, data): print('User with id {} has voted for the bot!'.format(data.user))
oops, wrong channel.
I need a new way to host, local hosting currently isn't an option
I've tried heroku, glitch, and repl.it, but they don't have what I need which is 24/7 uptime and ability to save data in a database, any option with both is perfect
a vps
Are there any free ones?
nope
Dang
Did you do repl.it by itself? If you combine it with flask and uptimerobot, it has ||almost|| 100% uptime.
good and reliable hosting comes with a cost unfortunately
I have more than 3 bots on repl.it, all with close to 100% uptime. What dependency do you need?
I need better-sqlite3
Is it on github because I can't find it on the package menu?
I don't know if it's on GitHub, I install my dependencies with npm
const { COLOR } = require("../../config.json");
module.exports = {
name: "test",
description: "Drop The Song From Queue",
async execute(client, message, args) {
if (message.member.voice.channel) {
const connection = await message.member.voice.channel.join();
// when in the voice channel
// Create a dispatcher
const dispatcher = connection.play('./audio.mp3');
dispatcher.on('start', () => {
console.log('audio.mp3 is now playing!');
});
dispatcher.on('finish', () => {
console.log('audio.mp3 has finished playing!');
});
// Always remember to handle errors
dispatcher.on('error', console.error);
}}
}
its not playing anything
why
i am trying from a long time pls
i am adding it in music bot music works
The thing for js? Sorry, I don't know about that.
Yes that lol, and thanks anyway
can i get help
What errors do you get?
Oh you're trying to play music from a file and not youtube or something else like that
I haven't really tried playing music from local files
Does it say that audio.mp3 has started playing @unborn ridge
let suffix = ["", "k", "m", "b", "t", "q"];
if(args[1].toLowerCase().endsWith() == suffix){
let power = 0;
for(i = 1; i < suffix.length; i++){
if (args[1].toLowerCase().endsWith() == suffix[i]){
power = i*3;
break;
}
}
quantity = parseInt(args[1]) * Math.pow(10,power);
}```
Does anyone know why if my args[1] is 100k, why this code give me 100 instead of 100000 for quantity
Error: Could not find player config at exports.getBasicInfo (/home/ubuntu/secret/node_modules/ytdl-core-discord/node_modules/ytdl-core/lib/info.js:59:13) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Object.exports.<computed> [as getBasicInfo] (/home/ubuntu/secret/node_modules/ytdl-core-discord/node_modules/ytdl-core/lib/info.js:296:18) at async exports.getFullInfo (/home/ubuntu/secret/node_modules/ytdl-core-discord/node_modules/ytdl-core/lib/info.js:187:14) at async Object.exports.<computed> [as getFullInfo] (/home/ubuntu/secret/node_modules/ytdl-core-discord/node_modules/ytdl-core/lib/info.js:296:18) (node:15767) UnhandledPromiseRejectionWarning: Error [VOICE_PLAY_INTERFACE_BAD_TYPE]: Unknown stream type at VoiceConnection.play (/home/ubuntu/secret/node_modules/discord.js/src/client/voice/util/PlayInterface.js:84:11) at play (/home/ubuntu/secret/MusicSystem.js:40:8) at processTicksAndRejections (internal/process/task_queues.js:93:5) (node:15767) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
anyone able to help?
to change the color of the tags would i do
<style>
.serversshards {
background: #9900cc !important;
color: #fdca00 !important;
}
</style>
Learn css then
Learn 👏 css 👏 then
Cunts
you could use a css lib
Aight
Use developer tools in your browser to see which CSS rules overwrite yours
or if yours is even applied
@broken matrix don't be rude, we're trying to help
I'm just going to ignore that
Let me check
Just because we have to follow the rules of spoonfeeding here #rules-and-info 
Doesn't mean you have to call us cunts
Ok
One small example of just playing with dev tools in your browser and actually using them
var channel = bot.guilds.cache.first().channels.cache.get('776834241405255719');
channel.setName(`Membrii: ${member.guild.memberCount}`);
these two lines of code are in my guildMemberAdd and guildMemberRemove events but the channel's name doesn't update
I've also checked if the events work, and they do
yup
i got it thank you
any clues?
@wheat jolt just pass in the member.guild and get from channels.cache
@earnest phoenix are these Exam questions?
assignment
I already tried that
😐
from the listener?
Yup, not helping then, we ain't your nerds making your homework
no bud, from my bootloader
aa I just joined CS like last week
ofc from my event
nah im not helping you if you're gonna be a dick
¯_(ツ)_/¯
oh boy oh boy oh boy
you people can't google simple stuff, can you
Creating a tuple is literally done as ("MY FIRST ELEMENT OF A TUPLE",)
IDK the what to search
Then why did you get assigned for that if you have zero clue?
the whole class gets so I must do
she told me to search google
but meh IDK what to search
in the first place
@rustic nova pls help me
don't even know python anyways
😐
aws 1 year free tho
I'm looking for something completely free because I don't have a way to pay for it lol
umm
So, how to fix node-gyp erroring in docker?
you can host your bot then make a patreon page and if your bot is very good then..
you know the rest
lmao
If I had a local hosting option I wouldn't have to worry about this lol
yeah
Any ideas why this function is not showing the correct number of users?
Users are not cached.
ah ok 🙂
- it's property
hey girl
I Noticed That Your Able To Get Your Bot Added To The Server, But I Can Not Figure Out How Is There A Form You Have To Fill Out Or Something?
You can't, anymore.
trying to nginx certbot but always getting this error
Failed authorization procedure. www.ale-bot.xyz (http-01): urn:ietf:params:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from https://www.ale-bot.xyz
/.well-known/acme-challenge/8HNiAYFdttz-ZADkOAVoCvJRijCf3eOYjJvGt4iOuiw [2606:4700:3031::ac43:d337]: "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endi
f]-->\n<!--[if IE 7]> <html class=\"no-js "```
Please Stop Using Pascal Case With Spaces
SoICanUsePascalCaseWithoutSpacesIJustCantUseItWithSpacesRight
XD
enjine x
@unique monolith No You Are Capitalizing The First Letter Of Each Word
Its A Habit
Just type like normal human.
server {
listen 145.239.115.76:443 ssl http2;
listen [::]:443 ssl http2;
server_name www.ale-bot.xyz;
# SSL
ssl_certificate /etc/letsencrypt/live/ale-bot.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ale-bot.xyz/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/ale-bot.xyz/chain.pem;
# security
include nginxconfig.io/security.conf;
# reverse proxy
location / {
proxy_pass http://145.239.115.76:8080;
include nginxconfig.io/proxy.conf;
}
# additional config
include nginxconfig.io/general.conf;
}
# non-www, subdomains redirect
server {
listen 145.239.115.76:443 ssl http2;
listen [::]:443 ssl http2;
server_name .ale-bot.xyz;
# SSL
ssl_certificate /etc/letsencrypt/live/ale-bot.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ale-bot.xyz/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/ale-bot.xyz/chain.pem;
return 301 https://www.ale-bot.xyz$request_uri;
}
# HTTP redirect
server {
listen 145.239.115.76:80;
listen [::]:80;
server_name .ale-bot.xyz;
include nginxconfig.io/letsencrypt.conf;
location / {
return 301 https://www.ale-bot.xyz$request_uri;
}
}```
oh so you're an average indian
which?
nah thats in a different file
idk if i need to change my A's
nope
dont need to
they're in the nginx.conf file
that I include
nah
its worked before
i dont know why its not working now but that's not the issue
Attempting to renew cert (ale-bot.xyz) from /etc/letsencrypt/renewal/ale-bot.xyz.conf produced an unexpected error: Failed authorization procedure. ale-bot.xyz (http-01): urn:ietf:params:acme:
error:unauthorized :: The client lacks sufficient authorization :: Invalid response from https://ale-bot.xyz/.well-known/acme-challenge/MgUzPukdqFpIZJU2o7JtV5CeF_Ihp5cq_NNgery60ds [2606:4700:3
037::6812:3f36]: "<!DOCTYPE html>\n<!--[if lt IE 7]> <html class=\"no-js ie6 oldie\" lang=\"en-US\"> <![endif]-->\n<!--[if IE 7]> <html class=\"no-js ". Skipping.```
alrighty
same error
hey @boreal iron i tried doing what you told me yesterday. I am running against some issues
if (message.content.startsWith(prefix + "raids")) {
{
let params1 = message.content.trim().split(/ +/g);
let params2 = message.content.trim().split(/ +/g);
```
and
```js
let raids = data.raids.filter(raid => getName(raid.pokemon_id).toLowerCase() === params1[0].toLowerCase() && raid.level >= (params2[0] ? params2[0] : 5))``` the code is somehow doing nothing. Is there something wrong with these 2 snippets that i implemented in my code?
why are you indexing them
@eternal osprey bruh params1 is an array
.split is there
oh
i wasnt reading above
lol
i am dice
he copy pasted the same code for params1 and params2
wtf is that kind of logic
yeah im reading it
lol
Or did you try to just set message.content to smth so params2 is different even with the same code
also none of types there are numbers
everything is a string
I think they forgot to get a number from the array
@earnest phoenix same
ig this should fix it:
let params1 = /* the code you already have */[0];
let params2 = /* the code you already have */[1];
ohhhh i knowwww
or just
i need to comment ssl stuff
keep one
i am very smart
okay i understand.
also don't forget to parseInt params2
you also need to check the result of parseInt to make sure it doesn't return NaN or some retarded shit
what would parseint do?
take a guess
yeah i can do that by logging
dont forget to do parseInt else if you do array[params2] you'll pass a string and js will return the property of the array object named as the valye of params2
Takes a string and returns a number from it
okay thanks!
No no no no no no
Hi
@eternal osprey Your bot name
what?
so i basically have to do: (raid => getName(raid.pokemon_id).toLowerCase() === params1[0].toLowerCase() && raid.level >= (params2[1] ? params2[1] : 5))
as we just defined params2[1]
@eternal osprey https://tryitands.ee
yeah well
i am trying it
but it does nothing if itype !raids 6 egg for example
does not even log anything
I'm very confused; i try to visit my domain https://ale-bot.xyz and i automatically get redirected to the www buuuuuuuuut ive set nginx to not do this
i am so confused :(
it is
whats the error
turtle do you know how to help el me
@earnest phoenix is that the full err stack?

pwease?
gg
sometimes you need to get from cache or fetch shit
smh
i need to fix this issue man
the www subdomain redirect
its set as an A record
and yet it doesnt redirect to my server
Depending on the TTL it can up to 48h until a DNS update is pushed
feck
Laughs in cloudflare instant dns updates
My DNS pushes updates immediately too but as I said it needs to setup to do so
Why spoonfeed
which liner is better ? ```# locally
npm install eslint
globally
npm install --global eslint```
@earnest phoenix eslint i local if its on time use
Globally if ir is mulri rime use
i use a vps so which one for me ? @earnest phoenix
..
Share vps with antone?
what ?
Just install globally
ok
but how can i unistall globally ?
@earnest phoenix ^
npm uninstall -g
npm uninstall --global eslint like that ?
oh
hey uys
@earnest phoenix nginx
y it workn't
client.on('message', async message => {
if (message.content.startsWith(prefix + "raids")) {
{
let params1 = message.content.trim().split(/ +/g)[0];
let params2 = parseInt(message.content.trim().split(/ +/g))[1];``` and
```js
let raids = data.raids.filter(raid => getName(raid.pokemon_id).toLowerCase() === params1[0].toLowerCase() && raid.level >= (params2[1] ? params2[1] : 5))``` when i type !raids 6 Absol for example, it literally does nothing.
alrighty
nginx is like glitch or repl ?
user www-data;
pid /run/nginx.pid;
worker_processes auto;
worker_rlimit_nofile 65535;
events {
multi_accept on;
worker_connections 65535;
}
http {
charset utf-8;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
server_tokens off;
types_hash_max_size 2048;
client_max_body_size 16M;
# MIME
include mime.types;
default_type application/octet-stream;
# Logging
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log warn;
# SSL
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
# Diffie-Hellman parameter for DHE ciphersuites
ssl_dhparam /etc/nginx/dhparam.pem;
# Mozilla Intermediate configuration
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
# OCSP Stapling
ssl_stapling on;
ssl_stapling_verify on;
resolver 1.1.1.1 1.0.0.1 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=60s;
resolver_timeout 2s;
# Load configs
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
nginx.conf
@earnest phoenix it is used for hosting ?
@earnest phoenix its a command line program that you run inside a linux server











for example
for example
!


