#development
1 messages ยท Page 1746 of 1
my favourite language is js
but it's whenever
and there's no real formula for developers to tell
I'd rather have Dart figure out when to make it constant for me
What other languages do you know?
php, html, css, c#, learning solidity
html, css
Current objective: survive
I haven't learned the other three languages though.
I hate html
yeah same
css is ok
never touching it
ive seen some bots monitor their own uptime. Is there an easy way to do that? discord.py btw
worked with flutter for a company and the sensation of not touching html and css gave me joy tbh
Hello world in html:
Hello World
If it's some uptime command, just log when your bot was initialized via on_ready and calculate the distance between the time
ill try that, thanks
I feel like every dev should learn at least one functional programming focused language at some point. Clojure, Haskell, Elixir etc.
definitely
Clojure is a great language ๐
yeah it's nice
just touching the general programming paradigms genuinely benefits you in the long run
Hah yeah. People need to stop making everything a class.
Mutable state scares me now.
All things mutable
ooga booga ```js
let x = 10;
while (true) {
x = x - 1;
if (x == 0) {
break;
}
}
x += 3```
Technically that isn't mutable, because you are creating a new integer on every assignment.
nothing scares me anymore after having to work with bascom then asm for 4 months
Your answers are one Google search away. https://stackoverflow.com/a/29246176/14695788
thanks!
I have no more ideas for my bot, suggestions?
What's your bot about?
about everything, I have no topic
Well YouTube kins thinga
Then look at popular bots and draw inspiration from their commands
if its about everything do you have a function that fetches google searches and relays them in an embed
twas completely random
but economy, moderation, picture cmds, etc
I have a good economy system, moderation with kick and ban
when I try to do Google search Heroku gives me Always errors
oof sorry for ping user
should I give a look on npm website?
Which is the usage of WOKCommands?
WOKCommands?
npm created by the YouTube channel Worn Off Keys
You want to use the YouTube API?
hey dose anyone know how to unlock a hidden channel on discord
fuck man why is releasing libs so hard
every time i release something, i need to release 3-4 additional versions to fix readme mistakes in the following hour or two
reject libs
return to monke
I'm running into an unclosed client server error which then invokes a 429 ratelimiting error. How do I fix these? I don't know what I need to do to fix them.
How would I add text to an already created list?
Like I have my list, and I add it adds something when something happens.
language?
JS/Javascript.
Oh
how does your list look like? where is it stored?
Its like a const list.
example?
Like const list = [ "Value", 'Value2", 'Value3" ] but later adds to the list.
so, an array
you can add items to arrays using .push()
list.push("new value")
just keep in mind that arrays are in-memory
once your bot shuts down or restarts, the array will be reset to its initial value
Anyone ever ran into this issue and found a fix?
What's the exact error? Can you show the rate limit headers?
Well, it's an unclosed client session which then http spams in trying to connect, causing the ratelimiting. :/
close ur sessions
Are you using Discord.py
dms are also a channel
yes, you can also get it by getting a channel's parent
yes, idk how to close it while keeping my bot up 24/7
how do I make an api
lang?
py flask
you just answered urself
What is message thread exactly?
where do I get the free website
temporary channels
not a thing currently
free domain
freenom gives some free domains
technically, freenom
How is it work?
they are only a year iirc
just note that they are """""free"""""
^
domain
there's like 30 visit requirement or sth
excessive quotation marks are intentional
#freenom @drowsy crag
@lyric mountain How do I close client sessions, but allow my bot to run 24/7?
that error is probably not being caused by discord client
?
but some other client u opened and forgot to close
Create New one on close
What do you mean by temporary channels?
And close all ones in opening client
like github issues
or reddit
whatever
channels that are there for limited time
Is it like normal text channels?
yes but temporary
They are sun channels kinda i thibk
I'm confused. Cuz I'm using Replit to run my bot and I only have one instance of the bot open, but not running. So it's running somewhere else????
don't use replit
that's it
not discord client
do you use any api?
there are no truly free domains the same way there are no truly free vps and hosting services
I get it thanks
then what in this world is free?
yeah, I said freenom is """"free"""" because technically you don't own the domain
oxygen?
yes
oxygen aint free
soon enough not even oxygen
you pay a toll to breathe it
bruh
the more you breathe oxygen the more oxidized your cells get
But you can do what you can do with owning domain
kinda
you're heavy limited both because 99.9% websites/services don't trust freenom domains and because the farthest you can go with it is redirecting to another site
using discord.py, sql, js, html, css. ๐คทโโ๏ธ Idk what the culprit could be
you can't even set a dns to it
freenom embeds the site inside a screen-wide frame
just check the html of a freenom-masked domain
Well not really?
be a twitch streamer
and stream what?
halo 3
5 bucks a month is enough
and how much time i spend on streaming?
drama works
lkke
idk about that because i think mininum wage is definitely higher than 5 bucks an hour
ztream yourself sleeping for example
thanks
exdee
anyways domains are not expensive
get some 1-2 hour job like cleaning someones garden for 10 bucks
and yoi hVe enougj for 1 year
fking mobile keyboard
i can feel your pain
My bot just fixed itself and I am no longer getting the issue. Idk what happened, or how it fixed itself, but I'm happy it's working. ๐
How do I make something repeat until a certain condition is met?
a while loop?
Yah? JS btw.
its called a while loop in js too.
Anyways, how do I do one?
while(condition) {
//code here
}
So, when I do my command: x/start 1h(time) test(prize) It shows the (time) Portion of the Command. Now I am now experience with args formations that much lol, which is why im asking.
time: time = args[0];
prize: args.join(" ").slice(22);
args is every arg, so args.join(" ") will join every arg, including time.
youll need to ignore the first arg
Duration is spelt wrong. XD.
Gotcha.
I was typing fast ๐ฉ
I messed it up more . . . . . . . . . . . .
While you can use loops like while, there are higher level loops that may be able to accomplish what you want (e.g. for (initializers; condition; incrementer) {...}).
can you send the code?
let item = args[1]
var time;
var winnerCount;
for (var i = 0; i < args.length; i++) {
item += args[i] + " ";
}
time = args[0];
if (!time) {
return message.channel.send('No Duration was Provided in your message.');
}```
I have it set as that.
Now, I barely use args lolol. So I am learning that on my free-time.
^, There ya are.
dang i thought it was a langauge i could code sorry dont know that ๐ฆ
stop using var
heres why
I used let, its still the same @opal plank
ik, its unrelated to your problem, just letting you know its bad to use var
Ah, okay lmao
also why you setting item = args[1], then after everything you do manipulating it, you reassign it to args[0] ?
nvm
im dumb
its item not time
...
One message removed from a suspended account.
One message removed from a suspended account.
put a print statement and see if it's looping
unless you already did
or just step through
with a debugger
One message removed from a suspended account.
One message removed from a suspended account.
get a debugger, use breakpoints
Node has a pretty nice built-in debugger. You can even use it in production if you really have to hah. kill -SIGUSR1 <pid>
FYI
JSON is faster by quite a bit, but uses more bandwidth compared to a binary format.
How do I allow users to clear over 100 in one clear command?
Repeat bulk delete every 100 messages
api aboose go bbrrr
code:
public static String getBalance(String userId) {
String getBalanceQuery = "SELECT balance FROM master WHERE user_id == 679725208785125398;";
String database = "economy.db";
ResultSet rs = Database.sqlQuery(getBalanceQuery, database);
try {
if (rs.next()) {
String balance = String.valueOf(rs.getInt("balance")); // line 44
rs.close();
return balance;
} else {
rs.close();
addUser(userId);
return "Setting up your account; try again!";
}
} catch (SQLException e) {
e.printStackTrace();
}
return "ERR!";
}
error
java.sql.SQLException: The prepared statement has been finalized
at org.sqlite.core.NativeDB.throwex(NativeDB.java:487)
at org.sqlite.core.NativeDB.column_int(Native Method)
at org.sqlite.jdbc3.JDBC3ResultSet.getInt(JDBC3ResultSet.java:393)
at org.sqlite.jdbc3.JDBC3ResultSet.getInt(JDBC3ResultSet.java:400)
at commands.economy.CommandDatabaseBackend.getBalance(CommandDatabaseBackend.java:44)
at commands.economy.temp.main(temp.java:5)
this is java, workign in sqlite
I got it working
sure
this proves deno libs are better
using the shittiest lib to run the test
also dont trust that so readily
discorddeno was ruthlessly put on fire in dapi a while back
due to how shit some of the code was
nor were some of the comparisons fair at all
what's dapi
did they actually print the source code and burn it
they wanted to put that lib in dapi
i dont wanna get into specifics
but just know that you have ur lib put here if its good enough
my big boy is there at the very end

the lib devs and staff didnt deem deno was good enough of a lib to be put there
they said it multiple times in general
so yeah, dont go blindly looking at graphs made by the owner, 100% biased
and im gonna leave it at that note, dont wanan get into the specifics
not the place for finding devs
Hey , my bot plays music very nicely but when i do like #play lofi 24/7 like the music from YouTube streams of 24/7 it plays 1 second and there is no voice from the bot
I use ffmpeg package
Discord.js
guild.channels.set(channel.id, channel);
Getting error cannot read property of ID user undefined
When ading bot to server other than my Main server adding to anyother server is fine just with 1 server
It has 2fa enabled maybe something idk pls help
you shouldn't set channels manually considering Discord.js manages the caches for you. What exactly are you trying to do?
Okay so its just an rank bot
And it worke fine on all server
Except when i add to main server to fails
can you provide the full error stack
you need 2fa enabled on your account to have your bot working with servers that require 2fa
i only read the 2fa part, lol
alr, so 2fa isn't the issue
can you like copy paste the error in a code block?
i want to see the issue
Yea
Every time a webhook sends a message to a channel, my bot returns the following error:
if(!message.member.hasPermission("MANAGE_CHANNELS")) return;
TypeError: Cannot read property 'hasPermission' of null```
How can I check if using the user is a human or a webhook?
one cheap way would be simply checking if theres a member
add a ? there
conditional chaining ftw
if(message.webhookId) return;
that would add extra lines
try that
could just use conditional chaining
Ahh couldn't copy so ss@earnest phoenix
where did you define channel
we already told you, dont set new channels
try message.channel.id?
let d.js deal with that
no clue what the context is
Okay lemem check what the heck i did
Am confused now there isnt src at all hidden files
use v12
erwin
v11 no longer works
?
mind showing me how you configured the gamesdk sometime?
Yea i modified some code which i forked in v12
its all in c#, do you know c#?
@heady lichen do you have any prior programming experience
vscode is being a bitch
ye, some
A bit
vs isnt working either
lowkey its mostly using node-napi and the snippet from the sdk docs
wouldn't recommed making a bot as your first project
and im starting to lose my braincells which are already at -500
api?
if not
node-api
the fuck is a napi
I have 3 of em running fine@earnest phoenix
its what i use to compile csharp code in js
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
I just fked this one
three bots
small question: why
-botinfo 842274047127846933
That bot wasn't found
-bots
-botinfo 841912784639492096
Sorry
Thnx dude saved my time gonna do some version code fixing its fine
theres a guide on porting it
-botinfo 839540536871878656
839540536871878656
Dragon Bot
7628
Moderation Bot built to manage discord servers.
This bot has all the premium commands. Hackban/forceban [Type of ip ban] is also available.
undefined
1
0
No server count
@hollow silo
ip ban on discord lol
OMG finally got on demand caching working in a client I'm working on.
It will only activate the caches that you use.
y can't I access the abstract properties in the constructor of same abstract class?
Yo everyone, I have a question.
my currency system stores also the guild.id in the schema and the leaderbord Is made by people with the same guildID.
But now that some people tested my bot in my server added it to them server and in the leaderbord they don't figure out. How can I change the guildID when they use .beg?
-bots
This user has no bots
559726241280688130
Watcher
8293
This bot watches over the bots in the top.gg server to make sure everything is following the rules uwu
discord.js
watcher
15
2
15 Servers
@coral trellis

@tulip loom
hmmm
i know hyperlinks in embeds can be inserted this way [Click me](link here) then why is it showing like this?
Field titles don't allow hyperlinks
when i delete a dedicated server, how can i be sure that the provider isnt just putting that dedicated server straight back into the pool again and reinstalling an OS image over it, e.g. what stops the next user of the box doing a basic data recovery on its disk and getting my data?
Only description and field values
never considered that till now
use a script to overwrite every bit on the Drives with 0
if you use Linux, DD or shred can do it
So I was reworking some of my older code and found this and I have now tried coming up with a solution to my problem for some time but have not found anything that could work and is not redundant. ```js
try{
commands.get(CommandName).run(msg, client, Discord, args, commands.array());
}catch(e){
if(notCommandChannel(msg, client, false)) return
client.eventEm.emit('CommandError', msg, CommandName, args, e)
}
Now the problem is not the code itself, it is the try and catch. I want it to catch if an error occurs anywhere within that .run() call as many times when an error occurs the program exits. Instead of having to put redundant try catch blocks in all command functions I would like to know if there is an easier way to do this.
If you mean allowing a user to press on certain reactions that do something in particular. Then yes. However, if that wasn't what you meant by "reaction menu" then I am unsure.
umm..... lemme be more clear
what i'm trying to do is
an embed have 10 fields with values
now when the user reacts on next emoji
the fields and values should get changed
why don't you use exceptions handling in the command itself
where the run() is being used
that is possible
any refs to it?
Well that was sort of what I meant when I said it would make it very redundant and hence also why I wondered if there was any way to put a function it self in a try block and not the call to that function without having to go into that function and add individual try-catch blocks everywhere.
For editing the message:
https://stackoverflow.com/questions/55711572/how-to-edit-a-message-in-discord-py
For getting reaction input:
https://stackoverflow.com/questions/52210855/give-role-when-a-user-add-reaction-discord-py
I would like to have my bot edit a message if it detects a keyword, i'm not sure how to edit the message though.
I've looked through the documentation but can't seem to figure it out. I'm using di...
I don't think there's another way around with functions... 
So i custom write the code
i was looking for some Paginator
https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.wait_for refer to the reaction_add event for waiting for reactions
why you need a while True loop for this I have no idea
How can i invite my bot? I did it on glitch
doesn't matter where you host it. Go over to the discord developers portal > your bot > oauth2
Ok thanks
-botinfo 753597592637800478
no luke, i am your father...
๐
if only you knew the power of the non-glitch side of the force
fair
sorry
F
I did an music bot on glitch but it doesnt play any music it always first connecting and after disconnects
Idk what is the problam
Well thatโs the common behavior of most of the providers I know. The costumer always is responsible for his data and security specially for an unmanaged server. Imagine each time a costumer changes the provider would run system tasks to override each byte on the hard disk. That would increase the time until a system being ready for the next costumer and dramatically reduce the life cycles of the hard drives, especially SSDs/NvME.
That would actually mean higher costs and higher chances of early hardware failing.
i dont think vms even have access to the physical disk
vms are usually given virtual disks
the bytes they read are the bytes given to them by the virtualization, not by the disk hardware
or at least one would think thats how it works, in practice im not sure
Yeah I think so, too but his concerns are about dedicated ones
yeah if you are given full access to a physical disk, then yes
Tim I feel like you're the maintainer of the #development channel at this point ๐
Lol
69.2K messages from you in here
Thatโs what I understand as dedicated server (with unlimited root access)
Think about doing ads for Detritus...
Take Erwin the rich kid as example

yeah this is a physical dedicated server
I'm gonna run Shred on it remotely before I shut it down for the last time
run DBAN on it
I can't boot off my own iso, can I ru dban from inside Linux?
why you cucks talking about me on my back?
you can run something from a recovery image or a linux installation disk
linux install disks have plug an play systems that you can run without installing
Talking in a good manner about you only!
Trust me I would never lie! 
sus, im watching you duck boi
No KVM console you can rent or get for free to install own images?
Thatโs making me nervous...
it has KVM, I dunno if I can use it though it's crummy and old and expects a java plugin ew
hi, in dblpy, autopost doesn't work only for me or this is a lib issue?
Sounds like Hetzner lol
ovh
lol itโs an old LARA KVM console I guess
But they are capable of uploading your own image but due their low speed it takes forever
I did install the OS via KVM consoles, too for Windows machines I couldnโt put in VM containers because I needed bare metal power.
The providers actually offer Windows images but only in combination of they can sell you the license.
And a server key from eBay is cheaper 
One message removed from a suspended account.
/hug
I have consistently removed guilds my bot was in if they are too small or havenโt used the bot for a few weeks just to get rid of the verification process. 
would be easier if you could just link the id to your account regardless of the state of the bot
Hmm yeah as you have to have your phone number being verified already
One message removed from a suspended account.
One message removed from a suspended account.
Thatโs more than enough user data they should have access too tbh
But I guess Iโm forced to verify if I donโt wanna leave active guilds actually using the bot 
a smart person(like me) would simply make sure to make the bot as dynamic as possible and abuse eval to push updates while the bot doesnt get the intents it needs

you've heard of coding in notepad
you've heard of coding on mobile
but i bet you've never heard of coding a discord bot in discord with eval()
It doesnโt need any intents but Iโm still limited to 75 servers
It already is dynamic as I said above removing "itself" from not used or too small guilds
lmao
ure not limited to 75
u limited to 100
75 unless you dont want intents
which idk why you wouldnt
just turn them off in the gateway identify
rather than the portal
They are off and I donโt need them
then whats the matter
Well than 100 ... doesnโt really matter
Nope itโs not thatโs not the issue, I just donโt like sharing personal data to companies like Discord
Itโs already enough what Iโm providing in here 
why
and its still not finished
wdym why
cuz im a NEET, i can stay up for a couple days coding
why you torture yourself
i cant code for more than a couple hours straight, i get tired
i guess im not poor enough
xd
What syntax do you prefer to annotate that a variable is mutable:
let mut varName = value; // For mutable
let varName = value; // For immutable
or
let varName = value; // For mutable
const varName = value; // For immutable
i'll just invest all my money on a shitcoin
Pfff amateur... call dominos to order 10 pizzas, shut all windows and doors, lock your room door and then enjoy a 24h coding experience 
i'll still take breaks, play games, check discord, etc
i has water, the feeling of starvation and 2 loud speakers
i like js's way
i do check discord for 5m and then go back
lmao
but i've never used a language where you have to specify mutability with a second keyword
mostly when its compiling
so im biased
Oh I forgot to mention the empty bottle you will need for things, you know what 
the only empty bottles i have are the vodka ones i chugged

and theres quite a few of them
coding buzzed is a bliss
less thinking and more anger
We know Erwin, we know...
All those rich kids are on alcohol or on drugs.
We see how all the Detritus ads made you rich and changed your character!

Hi there
@green kestrel are interfaces required in sep. files with PSR-4?
i've always done interfaces in OOP for coding practices but not sure if it's honestly needed
anyone knows why writting to a text file in batch writes the previous string instead of the current one?
Lol
you misspelled pain
show code
ight
set /p id="Enter your ID: "
if %id% == "" (
echo Login failed. Your input is blank :/
) else (
echo %id% > config.txt
echo Login saved.
)
when I run the batch file it writes what I inputed the last time
I have no idea why :/
actually thank you for reminding me
is there a way to run input from the vsc debugger window?
readline , but here
use-case: bot is offline, i want to run evals in it, but the process is still running
could do with a browser, but i wanna see how to do it here
and now we ping the person who's most likely to know the answer
@quartz kindle you got a customer
Lol
idk the answer to that, not sure if its possible, if it is, you would have to keep it always on
well i can always use the inspect port
to attach a debugger midprocess would require something from the nside
to attach the debugger
the easiest way i can think of would be to use some socket messaging that evals stuff
or even a web api
vsc already has an attach debug option
but its attaches at the start
not sure if you can randomly attach/detatch it
then use that
well, i can, but the part idk how to work with is the readline
since its a debugger, not a console
the debugger runs actual code
connect it to chrome dev tools i guess
?
That Discord feature is called answering not quoting
when I run the batch file it writes what I inputed the last time
what does that mean?
its called replying 
If you wanna append the text to the file you can't go with >
i feel like you didnt show all the code
It is all the code
you said "the last thing you wrote", your code its only showing one input
the last time I ran it
and wrote in the input
it always writes my last input instead of the one I write
isnt %% an env variable?
should it be %id ?
in batch
One message removed from a suspended account.
no it shouldn't
for a CLI
doesn't matter
One message removed from a suspended account.
pm2, forever, and nodemon, are 3 very excellent modules for managing processes like nodejs apps, without requiring a batch file and especially without needing an open command prompt at all times to run them.
but I want an open cmd
thats the point
the batch file is just a part of the cli
the rest if handled in python
@echo off
SET /p id="Enter your ID: "
if [%id%] == [] (
echo Login failed. Your input is blank :/
) else (
echo %id% > test.txt
echo Login saved.
)
pause
got no issue
thats not what I did bruh
can enter whatever I want the next time
try writing to a file
same result just changed it bc of recording the window
its not the same for me
You mean the batch isn't overwriting the text file?
its not writting the correct data
If so just check if the file exists and remove it
its writting something from the past
wut... that makes no sense
record it, never heard or have seen something like that
works fine for me?
wait
property role.edit js v11
i just ran the code twice, and the file was correctly replaced
pls
Try
@echo off
SET /p "id=Enter your ID: "
if [%id%] == [] (
echo Login failed. Your input is blank :/
) else (
echo %id% > test.txt
echo Login saved.
)
pause
ok
It's an issue with the scope of the var as I read
so i'm trying to figure out why my command line is throwing me an error, and i guess i can't really explain it because i'm new to coding a discord bot
i can send you the error in dms or here if need be
?
send it here
Error: Cannot find module './discordbot.js'
Require stack:
- /home/spaceguy/discord-bot/commands/commands.js
- /home/spaceguy/discord-bot/discordbot.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:941:15)
at Function.Module._load (node:internal/modules/cjs/loader:774:27)
at Module.require (node:internal/modules/cjs/loader:1013:19)
at require (node:internal/modules/cjs/helpers:93:18)
at Object.<anonymous> (/home/spaceguy/discord-bot/commands/commands.js:3:20)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Module.require (node:internal/modules/cjs/loader:1013:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/spaceguy/discord-bot/commands/commands.js',
'/home/spaceguy/discord-bot/discordbot.js'
]
}
do you have a file called discordbot.js?
yep
where are you requiring it from?
if you want to require discordbot.js from inside commands.js you need ../ not ./
You got delayed expansion enabled?
wha
message.channel.editRole({
^
TypeError: message.channel.editRole is not a function
does it still happen with my code example?
I just realized something
when I use it with the rest of the code
that happens

to be honest, cant remember
searched it up earlier, apparently everything has to be separate
what are you trying to do?
there is nothing called editRoles in property of TextChannel
and before yall say anything, I use this for myself
i would not use nodemon for production use tho
true. pm2 is much better. But I like giving unbiased options.
for the bot verification, the bot must be in 100 servers?
75
76 Is a big Number, Actually my bot Is in 4
but tbh having to verify it sucks
no more intents
unless you have a good reason for them
but the numbers of members matter in the verification? I know that I cant create servers for get the verification, but a server with 10 members for example Is counted?
wdym?
bruh
you will have to make a request for intents
just dont rush it
enjoy while you can
Y should I enjoy now?
because you have intents!
try this
ok
what are intents?
Intents are maintaining a stateful application can be difficult when it comes to the amount of data you're expected to process, especially at scale. Gateway Intents are a system to help you lower that computational burden. Some of these gateway intents are defined as "Privileged" due to the sensitive nature of the data they grant, and access can be enabled below.
mine
ye ok
Presence Intents - If your bot tracks presence data, you may need the presence intent to receive presence event data.
Server Member Intents - If your bot tracks server members or downloads the entire member list, you may need the server members intent to receive member events and the member list.
so all this intents are connected to the data that I collect from servers?
@boreal iron it worked! thanks a lot
alright, np
the difference between a verified bot and a bit verified one Is only this intents thing?
no exactly
a website where I can find this or someone that wants to explain?
verified bot tag, unverified cant join more than 100 servers
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
yep
you probably dont need them if you dont even know what they are
Looking Good!
is this a bad thing to do?
finally { return; }
feels a little wrong but im used to doing it so ยฏ_(ใ)_/ยฏ
is that js? or php
php 8.0.3
that's what i'm currently using
i mean yes it states catch there too, but in other OOP langs they don't force you to use either of the two if you use try
oh
they do lol
i thought you had both catch and finally
one of them is required in most langs
people usually do try { something() } catch(e) { /* no-op */ }
What does this mean
well at least PHP 8 allows to drop the exception capture
not that you would always need it
yeah
ye, js also allows an empty catch since node v12
I generally like the changes in 8 tho
just annoying because if i want to do this it's a prereq https://i.imgur.com/iYBA8dg.png
the thing
is
try finally will not catch the error
so isnt the try redundant there?
im not catching any errors
then why the try?
im passing exceptions but their custom exceptions
which handle the logic in different files
i mean
i mean i can add a catch if i want but the other files literally do that for mew
idk the specifics of php in this case
but in js, try finally is basically the same as no try at all
ill just be honest, php sucks ass at times
any error that happens will bubble up
try finally is basically used to run cleanup code after the error, but still throw the error anyway
yeah so thing of php
i think since 7.3 they allowed devs to now build off of the base exception code
we can use this for example
since this is nothing more than an extension of the exception class now
What does this mean
i'm already throwing it to begin with
and the base exception has a built-in catch state
there's no reason for me to write a catch for it at all
oh dude, switch is also outdated... since 8 match is the way to go
i'm aware
just to say
but I'm not sure if that somehow looks more clear than switch
So far the library is written with PHP 7.3 in mind.
I think I spoke with @green kestrel about it but since a good amount of PHP devs are still using 7.3 and haven't moved to 8 yet, there's no reason for me to make the lib 8+ exclusive yet
well putting catch() {}
can somebody help with apache2?
i don't need to catch anything though 
just ask
you never know! 
reeee
<VirtualHost *:80>
ServerName mydomain.com
ProxyPreserveHost On
ProxyPass / https://ip:25568/ retry=0
ProxyPassReverse / https://ip:25568/
</VirtualHost>
<VirtualHost *:443>
ServerName mydomain.com
ProxyPreserveHost On
ProxyPass / https://ip:25568/ retry=0
ProxyPassReverse / https://ip:25568/
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/mydomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem
</VirtualHost>
which line i missing for force https?
since atm if i go to my domain it does not redirect to https
Code boutta throw and you boutta catch these hands
i feel oppresed and threatened
is the proxy required?
If you just wanna force SSL, RewriteRules are your friends
For example:
<VirtualHost *:80>
ServerName www.evilshit.hate
ServerAlias evilshit.hate
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>
idk why i use proxy
I need it since I don't use port 80
doesn't make if your virtualhost listens to port 80 <VirtualHost *:80>
do you have sometime to configure a conf
just left ip/domain empty and port is 25568
ๆฉๆขฐไบบๅฆไฝ็จ๏ผ
If your webserver listens to port 25568 then tell the virtualhost to do as well
httpd.conf Listen 25568
<VirtualHost *:25568>
Make sure to add/edit the firewall rules
will it work firster then rewrite rules?
of course, lol creating internal proxies between 1 machine is ... idk weird and useless
You can even put anything into one virtualhost
For example:
<VirtualHost *:25568 *:443>
ServerName www.evilshit.hate
ServerAlias evilshit.hate
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/mydomain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem
DocumentRoot "${WWWROOT}/evilshit.hate"
...
</VirtualHost>
i don't use file it is a express app
ๅฆไฝๆด๏ผ
oh god for a second there I thought the domain was "evieshit" 
same
I've checked my code but can't figure out which command or line this is coming from. Any way to trace it to a specific line in the code?
(node:7093) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
at RequestHandler.execute (/root/bot/source/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async RequestHandler.push (/root/bot/source/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
(node:7093) 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: 9)
just an example, if so then without document root
you should go and handle errors/rejections
how would it be with ip,sorry i am really unfamiliar with apache2
create a function which handels them and log the line and file where it happens
btw my current bot not require presence intent and server member intent
without verification, can my bot add more than 100 servers?
or should my bot leave a server which has less member when bot reach 100 servers?
@slender thistle wanna see why i hate php?
SHH
<VirtualHost *:25568 *:443>
* will listen to all network interfaces (IP addresses assigned)
no, regardless of intents, to get past 100 server you NEED to verify
<VirtualHost 12.34.56.78:25568 *:443>
will listen to that one only
but the domain is linked to the server ip how would it know the ip?
you go
"oh you need to make the class as abstract" right?
SIKE WRONG
I SWEAR TO GOD
WHY IS PHP SO INCONSISTENT
IM GONNA LOSE IT
because i code php
but why
Then use <VirtualHost *:25568 *:443> ... apache picks the IP automatically
good question
so as long its <= 100 server it still worked
while verification is still in process, my bot will need to leave server with most less member then
be careful or hell will open up for you 
okay thx
I mean I'm not familiar with express but try and and see I guess
edit a role with a command
message.channel doesn't have any property called edit role
basically translating it into simple language, you're trying to edit the role of the channel lol
channels have no roles
they probably want a permission overwrite for a role
channel.updateOverwrite(roleid, {SEND_MESSAGES: false})
discord.js
Don't put event handlers inside of other event handlers or functions, thanks
lel
How to export var from inside the function
You... do'nt
Ahh kinda new to this
What are you even trying to do here
Yt sub count channel
uhhhhh
How to make it global actualy
you... just need to set the status of the bot here
nothing else
I mean it's clear to me you're just mashing codes together with zero clue what you're doing here.
Yes
So please read this message: #development message
yes. you need to learn the language instead of just shoveling code together. please.
I will for now pls help
I did. Your help is : go learn javascript.
Fine
Anyone know why I'm having this error UnhandledPromiseRejectionWarning: TypeError: (intermediate value).setTitle(...).setURL(...).setThumbnail(...).setDescription(...).addFeilds is not a function ?
feilds lmao
now i know why I was about to fail in inlish lit.
How do I define this
if (member.user.bot)
The error says cannot read property of user is null
ok well you don't have a defined member then
what event is this
What do you mean?
I was trying to run a user-info command then go that error for mod-logs
const roles = ['Moderator']
module.exports = (client) => {
const channelId = '842412267894210622'
client.on('message', (message) => {
const { guild, content, member } = message
if (member.user.bot) {
return
}
const hasRole = member.roles.cache.find((role) => {
return roles.includes(role.name)
})
if (hasRole) {
const channel = guild.channels.cache.get(channelId)
if (channel) {
channel.send(`<@${member.id}> said this:
"${content}"`)
}
}
})
}
jesus christ 
is that supposed to be a command?
Don't put an event handler inside another, that doesn't work
or it does but it fucks up real fast

client.on and module.exports

copying every single message into another channel breaks privacy laws
like he/she copied something from everywhere
I mean, maybe, but that's not really that relevant I think
Yeah that's my main concern. don't do that.
don't do this dude
that's how heroku works i assume
I never Saw this before
@quartz kindle 111 more messages here and you have 69420 pog
sad day but worth it
Then we'll get hat new account, Tim2
Tim0.1, Tim0.2a, Tim1.0, Tim6.9, Tim42.0
i could also delete my oldest message here for every new message i send :^)

my old messages are probably super cringe
no
that would be heresy
deleting tims messages in development
thats like
idek something as bad as that
was looking at all my old messages, coming up on my 1 year here ๐
try{
profileData = await profileModel.findOne({ userID: message.author.id});
if(!profileData){
let profile = await profileModel.create({
userID: message.author.id,
serverID: message.guild.id,
coins: 10 ,
bank: 0 ,
tier: 0 ,
nlavoratori: 1 ,
});
profile.save();
} else {
let profile = await profileModel.findOneAndUpdate({
serverID: message.guild.id,
});
}
} catch(err){
console.log(err)
}```
Is possible that this code updates only me?
happy 1 year typing
lol
make new account called Tim2.0
Lol
tims mart
my first ever message here: #development message
can someone help me code my new roblox game?
probably not, no
dang.
There's probably a number of servers you can find with people that are proficient in Lua and Roblox itself
just use server discovery, I'm sure you'll find something!
alright, thanks.
@quartz kindle I need your preference, is js if (!ctx.args[0]) { await ctx.respond('CURRENT_LANGUAGE') return } or js if (!ctx.args[0]) return await ctx.respond('CURRENT_LANGUAGE') better?
@opal plank mr. I would like some help with ts
second
return a promise
i said second
go ahead
ok so ive got an object for language stuffs, some values are strings while some are functions ex. http://img.terano.dev/CYqYxBw2
how would I type a function that takes the name and paramaraters to the function. ex. lang('CMD_BLACKLIST_ADDED', '277183033344524288')
and it be typed
make an enum or an object with keyof
return ctx.respond()
without await
nah eslint be mad if I don't await it
it wont
declare enum MyEnum{
CMD_BLACKLIST_NAME: 'Blacklist'
}
export type (user: keyof MyEnum) => void
so I would need to make an enum duplicating the object I already have?
dafuq
its the opposite
eslint doesnt let you do return await
settings I have ig
redundant await aside, do I return the promise or void?
I dislike the way it looks using the one liner for short files but for files with like 10 checks its stupid to have it be 40 lines
imho
i mean
if you want the function to return void
but you also want to await it
then do await X; return;
I just want to know what you would do for looks tbh
you could also return X.then(r => void 0)
ye I could lmao
i would just return the promise
and maybe use the .then() variant if i really need it to return void
so you prefer how it looks?
alright ive got another question
so say I have code like this ```js
const x = await y()
// I could do this
let x;
try {
x = await y()
} catch (e) {
console.error('Handled some error or something')
return
}
// or this
const x = await y()
.catch(() => null)
if (!x) return console.log('Handled some error or something')``` I find the top part makes more sense but find it stupid to deal with using let like that, how do you handle things like this?


