#development
1 messages · Page 37 of 1
Yeah. i have options.getString
It just can't get it to get the choice and send the correct array.
getString has an argument named name, which should be category in your case
it should then get the choice the user provided
aka in your case either gif_cat or gif_dog
Is what I'm getting from the docs at least
and is what I'm seeing within your code already
could you log the content of value?
Thats what I'm picking up and it loads the choices but I don't get how to display the correct choice so if dog is chosen: const dog array else: cat
ohh
You could technically have a main variable named gif or something, having a if condition set the value of gif to the for example cat[Math.floor(Math.random() * cat.length)] you have already present, so
initialize a new variable called gif
through an if condition, check if the variable "value" is "gif_cat"
if yes, set gif to what is currently in image_cat
if no, set the gif to what is currently in image_dog
and then just simply reply the interaction with gif
Thank you! I'll have a look in the morning!
People who have premium subscriptions for their bot: How do you do it? I'm trying to find the best way to automate payments, looking at Chargebee because of its API
going to have a /redeem command
I mean it obviously says GUILD_TEXT isn’t an integer but a string
Either use djs enums as said above or simply pass the integer which represents the type guild text
Which you can find in the API docs
ok so, if the mods put "Final Countdown" to play exactly at 9:58 AM PST, the riff will start the very moment a million bots crash from the lack of intent approval
It will start then, yeah even if not every bot will be disconnected immediately
But I guess since discord knows exactly how many servers are bot is in mostly smaller bots will be disconnected short after each other
And larger ones been handled with care
let timeembed = await target.send({embeds: [embed1]})
timeembed.embeds[0].edit({embeds:[embed2]})```Its telling me that timeembed.embeds[0].edit isnt a function.Why?
Using v13
Because embeds[0] is an embed object, and embed objects don’t have an edit function
I believe you meant to do timeembed.edit()
editing a message will also return a promise, so await it
Just to say
Also your var timeembed actually isn’t an embed but a message object send() returns
You might confuse yourself with that var name
Yeah I would do something like const timeMessage = await ...
Good variable names may seem like a small change but they make a big difference in readability sometimes
@civic scroll angular question you available?
@sharp geyser here
I am trying to setup ngx-socket-io with angular, but when I do so the page content no longer loads
Its just a white space
I even tried commenting out my changes and still nothing
anything appear in the console / build logs?
Forgot Angular even logs shit in the dev tools console
Uncaught ReferenceError: Cannot access 'ChatService' before initialization
at Module.ChatService (chat.module.ts:14:18)
at 818 (chat.module.ts:16:15)
at __webpack_require__ (bootstrap:19:1)
at 1470 (chat.module.ts:14:18)
at __webpack_require__ (bootstrap:19:1)
at 2226 (app.module.ts:19:15)
at __webpack_require__ (bootstrap:19:1)
at 5041 (app-routing.module.ts:8:25)
at __webpack_require__ (bootstrap:19:1)
at 6747 (app.component.html:2:21)
How the fuck do I use services in angular
you import them in class constructors
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ChatComponent } from './chat.component';
import {ChatService} from "./chat.service";
@NgModule({
declarations: [
ChatComponent
],
imports: [
CommonModule,
],
exports: [
ChatComponent
],
providers: [ChatService],
})
export class ChatModule { }
import { Component, OnInit } from '@angular/core';
import {ChatService} from "./chat.service";
@Component({
selector: 'app-chat',
templateUrl: './chat.component.html',
styleUrls: ['./chat.component.scss']
})
export class ChatComponent implements OnInit {
constructor(private chatService: ChatService) { }
sendMessage(msg: string) {
this.chatService.sendMessage(msg)
}
ngOnInit(): void {
}
}```
the component is fine
it's just improper import in to module
hang on lemme check
@sharp geyser can i see the service declaration decorator for ChatService
import { Injectable } from '@angular/core';
import {Socket} from "ngx-socket-io";
import {map} from "rxjs";
import {ChatModule} from "./chat.module";
@Injectable({
providedIn: ChatModule
})
export class ChatService {
constructor(private socket: Socket) {}
sendMessage(msg: string) {
this.socket.emit('message', msg)
}
getMessage() {
return this.socket.fromEvent('message').pipe(map((data: any) => data.msg))
}
}
I think this is where I am going wrong with the providedIn
it doesn't look wrong, at least to me
Interesting
@sharp geyser
try this
"emitDecoratorMetadata": false in tsconfig.json
then restart the dev process
changing providedIn: ChatModule to providedIn: 'root' works ig
idk if this is the most efficient fix
but
interesting
did my change fixes the problrm
one sec
no
same error in dev tools console
Actually I should be sleeping soon rip
1am got school tomorrow
Hey umm anyone use auto code?
everything was working fine until today, the bot suddenly not responding to commands on auto code
and when i type the command i dont see any logs as well
-intents
Why does my bot tell me it needs a "message content intent"?
Starting from <t:1662031440:D>, Discord has made the content within messages a privileged intent you ** are required** to apply for if your bot depends on it. You can read more about that change here.
To avoid our channels being flooded with said questions, we would ask you not to ask questions regarding the intent within this server and ask in discord.gg/discord-developers instead. Thank you.
@earnest phoenix first one btw

help ;-;
yeah i mean isnt it only supposed to be applied to verified bots and the message content can still be received by unverified ones?
Unverified bots can just enable the intent in the developer portal
With the enforcement this should have happened automatically
ah gotcha
thanks
Check the developer portal
And take a look if the privileged message content intent switch is enabled
Hi
yeah it worked thanks a bunch
my Bot Site is
https://top.gg/bot/1007599798267957273
The Reason It's Still Unconfirmed I think is the tail.
A new bot is constantly coming out, which I call a tail, so people are having difficulties.
You have to wait until it’s verified by topgg
It’s in a queue with lots of other bots
So wait patiently until they’ve done their job and test your bot
anyone knows vuepress here? if yes please ping me, have some fuck up to discuss
hey guys
the inclusive or is true when either p or q is true, or both are true right? And the exclusive or (XOR) is only true when either p or q is true, but not both?
XOR requires 1 input to be true (1) and one to be false (0) yes
While OR can have both inputs being true (1)
To output true (1)
Huh? 👀
i guess he's talking about the intents thingy
Ah I see, thanks fake
;;join
The day of reckoning is upon us
Oh God, here they come; it's all gonna about the intents
The command that worked yesterday started giving an error today.
const reqPermMember = client.commands.get(interaction.commandName).command.reqPermMember.replace("Administrator", "Administrator").replace("ManageChannels", "Kanalları Yönet").replace("ManageRoles", "Rolleri Yönet").replace("ManageMessages", "Mesajları Yönet").replace("ManageGuild", "Sunucuyu Yönet").replace("ModerateMembers", "Üyelere Zamanaşımı Uygula").replace("BanMembers", "Üyeleri Yasakla").replace("KickMembers", "Üyeleri At")
I use regPermMember here
Ow,, I made a little mistake.
im scared
I'm dealing with a weird issue, and I'm quite confused. I send an embed with a button via DM, and in the button handler to delete the embed once an option is chosen, I call interaction.message.delete() but it's unable to find the message in the DMchannel: [ChannelNotCached]: Could not find the channel where this message came from in the cache! Ideas on how to fix this?
in the cache
you should always fetch dms
Imgur links stopped embedding, anyone know if that's a bug or intended? Or if it will come back?
Yep fetch the message
u need to use the imgur page url for auto-embedding of videos
hm, wait
no, they indeed broke for some reason
Yeah that was not the case before, any imgur link would embed
And linking to a mp4 like that would still make it say gif
It's a real shame they really need to let everyone embed mp4/webm as "gif" not just a few whitelisted sites
Imagine the terabytes of bandwidth wasted every day on gif
that ain't on discord's side, it's imgur who converts videos to gifv (not gif)
if anything, I'd prefer if discord supported apng/webp instead, since they're the modern sucessors of gif
No, it's on discords side, but maybe I wasn't clear
I meant the video -> gifv conversion
And the embedding
Discord doesn't "whitelist" anyone, it's the sites that pass an OG tag containing embed data
When you link to a imgur or gifycat "gif", discord embeds it in chat as a html video element (that is playing a mp4) that autoplays and says "gif" in the corner
No it's not about OG tags or metadata, it should be, but it's not
That applies to any gif
No it doesn't, a actual gif file just shows a gif file
Don't think so, all gifs I ever saw always had that in discord
Yes actual gif files
What I am talking about is embedding mp4s and making them work like a .gif
gifv isnt a format
Imgur does that for all videos
It is
Which is what imgur, gfycat, etc links do
Yes as you can see there it's not an actual format
That's on their side, not on discord's, discord doesn't convert
It is, it's a server-rendered gif basically
A gifv yes
No just a mp4
What nmakes you say that
U can do it urself
Autoplay + discord detects as gif
It's client side?
It's just a looped video with GIF label
No it's just a Mp4 file
I won't argue, image providers used that since always to provide hd gifs from videos
That still isn't a discord whitelist, anyone can do that
No
Should I use process.exit(0) to restart the bot?
No what?
That's for terminating the process
You can't "restart" a process from within
No, there isn't. Ok I can bet you 100 bucks, but I can't do more than that.
I mean, u can, but u lose the attachment to it
So, what should I use?
If you must, press F12 and see what imgur returns on the response
Some external process to control it
I've already done that
Even the headers?
anyone has experience with node.js native modules on aws lambda?
A mp4
I did it, I do client.destroy() first and then log back into the bot.
That isn't restarting the process
When I say "another process" I mean a truly external process with the sole purpose of controlling the desired process
Like pm2
Did you try replicating the response?
By response I mean headers + body
I even bothered discord staff with this before and they said it's whitelisted
long ago
I'm not sure what you mean, the body would be the file
That's really weird then, the video is usually encoded at the origin
Im not sure what you mean tbh
poggers
Why does my bot tell me it needs a "message content intent"? Why has my bot stopped responding to any chat messages?
Starting from <t:1662031440:D>, Discord has made the content within messages a privileged intent you ** are required** to apply for if your bot depends on it. You can read more about that change here or read more [from the official announcement regarding the changes](#697138785317814292 message)
To avoid our channels being flooded with said questions, we would ask you not to ask questions regarding the intent within this server and ask in discord.gg/discord-developers instead. Thank you.
thankfully ^_^
Yay fffinally
can you show where you create your bot instance
The developer portal
There's going to be soo much of that
Especially in replit
Anyway my offer stands, $100 reward for someone that can show me how to get your videos(meaning mp4/webm) to embed as gif (Meaning autoplay, no video controls) in discord with your own site/host that is not imgur/gfycat etc
Yes because we definitely trust that you will pay us 100 dollars for something you can google in 35 seconds
I'm confident that you can't, thats why im making the offer
thats easy...
Thats a gif
embed as gif
Videos
Yeah see
Not a GIF
Have you considered the fact that discord doesn’t auto play videos for a reason? Why would you ever even want to do that?
It autoplays videos from sites like imgur
Because they’re trusted
That is the whole point I've been talking about
Others in this chat disagree with you
You yourself said it's something you google in 35 seconds
Not going to waste my time on a fictitious reward :p
Which one is it, need to be trusted or easy to do?
I can send you $5 first as a token of good faith
How do I modify my IntelliJ plugin settings?
As an example, I downloaded this but it doesn't show what file I'm editing: https://cdn.hamoodihajjiri.com/DI6zfYFnnk .
I mean I dont know but there's a cog there
how can i run my app forever in my android even after i close it
Android isn't a suitable operating system for that /:
If you dont have any money maybe use replit
its a js application
turned into .apk
Maybe there is a way, but phone OSes are designed to close apps and conserve power and absolutely not run them forever
Is it a bot?
or webserver
you can't, android automatically culls background applications if you near the maximum RAM usage
then how can i run it in background?
its a app
not worth it, you'll constantly fight with android to keep your process alive
and you lose the most vital thing
did you create the app yourself?
yes
imagine literally ignoring all the warnings to focus only on what u want to see
ty for help
how did you create it? using what tools? android studio?
if you used android studio you have to look into how to code background apps on android
if you used some bot maker app that makes the apk for you, then you cant, its a limitation of whatever app you used
Some smartphones probably have a better SLA than some services out there

As much as I do t like replit and dont think people should use it, it seems reliable
Replit is fine for testing simple projects or just hosting them, such as static websites and such, or even the complex ones (but not too complex)
People shouldn't use it for things like Discord bots
i host my lavalink servers on it 
That's even worse
whats the right perms for mute/unmute?
whatever is required to use timeout
oh okay so moderate_members
or if ur still using old-school muting, MANAGE_ROLES
I am, cuz my timeout breaks my stuff lol
the until= thing gives me errors alot for some reason
ur probably setting an invalid duration
i just get " Member.timeout() got some positional-only arguments passed as keyword arguments: 'until'"
then until should be passed as positional, not named
wdym?
function(positional, {named: value})
ur passing the parameter wrongly
cuz im tryna do until=
... the syntax of bash is close to be as horrible as python
for real...
ik that will put it into a bad light, but still
I've found that JS can do what I did with bash before
So maybe you dont have to use bash?
I have to
creating scripts for firewall updates resolving dynamic hostnames
on root level ofc
Well maybe you have to idk
What I do is I exec
So maybe you can have a little thing in bash that does the change and the rest in js
well yeah... besically using any language to execute any shell command and handling the output to send another shell command
it's much more efficient here to directly create a shell script
Alright
Also while on the topic I want to talk about how nice it is to promisify exec
it's not like I do really struggle with bash, but tbh I don't like it and don't create scripts real often using it
I used to try to use ffmpeg frameworks
It was hard to figure out how they wanted you to do thing and advanced options didn't work
Exec is sooo much easier
yeah using exec to execute a shell command using your language of choice might look easier in the first place
Try replicating https://github.com/VoltrexMaster/protonug in a Bash script 
I already feel enough pain Mr voltrex
Not for games but for the https://github.com/GloriousEggroll/proton-ge-custom
It's basically Steam Proton with bleeding edge dependencies for better support
I also used to do text manipulation with sed and grep with bash and that was kinda hard because they all had non-standard regex
But with JS it's standard regex so you can use sites like regextester to learn
yeah I feel that, also using regex to match strings
Working with shell scripting languages such as Bash to do command-line operations and manipulation is just absolute pain
"Why is my bot not working anymore" counter: 0
had to figure out it's some other sort of regex, too
actually, it's 2 Sir
shame on you, you missed that
I'm surprised a lot of them didn't come here, it's hell let loose in the discord.js support server
why is my djs v8 bot not working anymore please help
"Why does discord.js not support extremely old versions of Node.js???????????????"
Man these people

cache=/tmp/auth-hosts-cache
tmp=${cache}.tmp
# resolving hostnames
for hostname in "${hostnames[@]}"; do
iplist=($(dig +short "$hostname" A))
for ipaddr in "${iplist[@]}"; do
echo $ipaddr >> $tmp
done
done
if [ ! -f "$tmp" ]; then
exit 1
fi
if [ "$(cat $tmp)" == "" ]; then
rm $tmp
exit 1
fi
my eyes are getting cancer, I swear
omg guys why is my bot returning null for content 
help why is my bot not working anymore
/j
you have to delete your application and create a new one
known bug
all your servers will surely carray over, don't worry
new dev tos
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
o not live yet
reject bash, return to interpreter
u wanna make my pain even worse? very rude
hey don't diss our buddy python
fuck, I'm smokin too much, too
lol
QUICK QUICK CLICKING DISMISS AND WHEN IT'S LIVE TELL EVERYONE I NEVER GOT A NOTIFICATION
You know, my bot shouldn’t be working at this point, but it still is
let the games begin
I’ve got the opposite problem: why is my bot working
You not connected to the internet
Ez fix
Disconnect the internet
if you haven't read carefully, the connection of all bots won't be closed at the same time
it's a "rollout"
imagine 10000s of disconnects and reconnects at the same time
gateway goes brrr
if i was discord i would just rm -rf / and disappear
well I'm getting closer
#!/bin/bash
hostnames=("..." "...")
cache=/tmp/auth-hosts-cache
tmp=${cache}.tmp
# resolving hostnames
for hostname in "${hostnames[@]}"; do
iplist=($(dig +short "$hostname" A))
for ipaddr in "${iplist[@]}"; do
echo $ipaddr >> $tmp
done
done
if [ ! -f "$tmp" ]; then
exit 1
fi
if [ "$(cat $tmp)" == "" ]; then
rm $tmp
exit 1
fi
# cache
if [[ ! -f "$cache" || "$(cat $cache)" != "$(cat $tmp)" ]]; then
if [ -f "$cache" ]; then
rm $cache
fi
iptables -F auth-hosts
while read ipaddr; do
iptables -A auth-hosts -s "${ipaddr}/32" -p tcp -m tcp --dport 22 -j ACCEPT
iptables -A auth-hosts -s "${ipaddr}/32" -p tcp -m tcp --dport 113 -j ACCEPT
echo $ipaddr >> $cache
done < $tmp
fi
# exit
if [ -f "$tmp" ]; then
rm $tmp
fi
if [ ! -f "$cache" ]; then
exit 1
fi
exit 0
while I dislike bash much it works quite well
and pretty much catch and handles empty results etc.
so... somebody requested it and I think he gets what he wants
OH NO
found the first issue
$ cat /tmp/auth-hosts-cache
ipaddr
ipaddr
ipaddr
ipaddr
ipaddr

forgot to turn ipaddr into a var
bash is the only language where using tab for indent is unreadable
yeah I feel like exactly the same tbh
fine works now pretty well
without uselessly update the firewall rules if the IPs are still the same as my cache holds em
@boreal iron You did that one beautiful!
I know. Very much thanks!
@boreal iron No problem, Sir!
Appreciate your feedback, FakE!
<3
I should probably check if the chain auth rules exist
How does this music dashboard look?
https://cdn.discordapp.com/attachments/485665973643378698/1014984897829543956/unknown.png
Songs in the queue appear below the current track
Responsive design?
643945264868098049
But doesn’t the system still sends messages to me?
I would guess I will still get notifications by the system as long as the account is linked to an application
system deez nuts
I meant responsive layout aka design
Oh yes. Mobile looks fine
Well then regarding the fact you said you’re new to this, it looks quite nice
I mean redesigning it later isn’t an issue as long as functionality is already a thing
err sorta responsive

The Discord interface is already responsive and nice to look at. Mobile literally has no purpose in using the dash
discord system dm spam tf
flagged as scam
It's almost like they've been threatening this happening for a long time!!
I can’t believe bots I don't own are being broken. Gonna write an angry post on twitter to the 5 followers I have

LMAOOO
if people still need more time after the 2 years or so of delay, then there's issues
Wait for it…
People who haven’t noticed yet, in October, will get a delay until 2023
but Discord!1!!!
5 freedom units says they'll essentially tell devs to cope and seethe
I’m soon to blocking discord’s dms
No they annoy me
How do you call two arrays so it chooses one and sends a meme for random?
For people who didn’t get it yet
I used to do .json and used it to have a specific code to choose a random meme from the file, which I suggest using links
Or you can use the Reddit meme api (which I don’t know if it still works)
Thanks, I am going to work on this ^^ but to get the command out for the promised time, I'll create an array called random.
Your question is confusing. Calling two arrays? Arrays are not "Callable" in the literal sense (functions)
Merging two arrays together and get a random item of it?
You can do fetch api though?
Arrays are linked to an api?

this is news to me
I need to reconsider my outlook on js
^^^
[…array1, …array2][some random key]
array1.concat(array2) merges the two arrays together (non mutative)
array1.push(…array2) mutates array1
The issue is you won’t know the length the here
(For my example)
Or is maybe… this in that scope a thing?
[…][this.length-1]
Maybe?
Thanks, I'll have a try.
Ok, I'll do add all gifs to the random for now.
But anyways margin the arrays together can be archived by using the spread operator
Like I mentioned above
Ok! Thanks for the help!
Then simply create a var
To access the length
To do a math random between 0 and the length
Minus 1
do not be afraid to make vars, if it isn't necessary the compiler will remove it anyway
Not sure if this exists in that scope
[…][this.length-1]
Would be neat
Oh ok
ngl my computer science knowledge just clutched up on a calculus quiz I just took
holy shit I feel alive after that
lol
This would be referring to globalThis
what
Spotify has custom integration with discord, I don’t believe so
Like adding a button to a website embed
Not possible since it's custom for Discord and Spotify
oh ok thanks
I'm planning a good new feature for my bot
ohno
🗿 you don't even know what it is yet
I don’t think we need to in order to be afraid
8ball?
it will be "suspicious" behaviour detection type of thing. I have a few ideas for detection types. For example if the account is completely new it can be suspicious, have been in the server but only spam similar messages / don't type any message at all? Either an abondoned or spam account. I'm planning to come up with more stuff later
is this a good idea?
feels very fitting given my bot will be an anti raid bot
inb4 you implement the most inefficient algorithm known to man for your new feature
I don't think so, i've gotten plenty of spammers in my server
part of their spam account detection is things like an account going inactive for a period of time then becoming very active, things like new accounts spamming
its not instant

good idea, will allow moderators to decide whether they're suspicious or not in the very end
Classic “my bot will do the impossible with 0 prior information”
so you're adding an anti-massjoin too?
anti-discord server
nah i don't have that yet
Hi , what could be the cause of getting as an error while trying to implement the topgg webhook 
it will be a good idea, trust me
I'll first try making an example command out of it
then i will integrate to detect automatically
I'lll have options to notify owners / moderators, or ping staff in the bots modlog channel
Hey 🙂
Do you have somme clue for caching stuff ?
To have one cache for all shards
I try express api -> not very convincing
I got some : FetchError: request to http://127.0.0.1:3002/players failed, reason: connect ECONNREFUSED 127.0.0.1:3002
There is other type of communication
?
Like socket ?
then it ain't "anti-raid" creature
ok anti nuke then jeez
remember how you guys hated me for this code
it's not even that bad
The biggest problem is the fucking formatting dude
I kinda see why it would be bad, but it's not that bad if you actually look at it
It is that bad when I look at it
it's easily readable
I was close to hit a tree on my right

Very close
driving and texting bad
Gooood
don't text and drive then
dude what's the stone hedge emoji called on PC
I can't find it
I always stop immediately when I’m texting don’t worry
FakE driving once again, how common

THE PIC HAD ANOTHER REASON
😄
Some Changes
On Sept 1, 2022, we are providing an updated Developer Terms of Service (ToS) and Developer Policy and a one-month review period. These updated terms and policy will go into effect on ...
guys
guys
I can't belive this
maybe I'll finally be able to get the presence intent
I found a great feature to add that will use it
Weeeeeeoooooowwww
I will monitor peoples presence as a part of the "suspicion" detection thing
Bae's code formatting is the nightmare of code formatters ngl
not yet how, but I'm having a few ideas rn
I seriously don't get why some people don't use code formatters, it's just stupid
maybe to listen to their game presence, maybe whether they're on browser/mobile maybe try detecting a self bot that way
I use formatters, I have my own indexer
"indexer"?
indenter*
give a scrambled piece of code I'll show you how it does
it's pretty good
That indentation is rather ridiculous
well I do that myself, the indenter doesn't format it that way mostly
I'm pretty sure you don't have your own indenter, probably just supplied custom indentation options to the code formatter
And why would you indent it that way?
no idea, didn't code like that before, just started doing it out of nowhere and it became a thing
but for me it's readable and I have no issues with it
For you it might be, but while showing it to others it's pretty bad, considering the 0 index indentation for the operator expressions
hey, so I wondering if there is a way in SQL to join one table with multiple tables individual at once
table 1: id, date, reason
table 2: id, moderator, user
table 3: id, moderator, channel, amount
the result could be something like the one below I could imagine, but I have no idea how to achieve this
id, date, reason, moderator, user / none, channel / none, amount / none
ig
You know there’s a reason FakE uses notepad only 
if I have a number, or rather a bunch of numbers, say 4 and all were 27, how do I not make them go over 100?
do I just round it up or?
Yes and it’s called JOIN on a specific column matches one in a different table like an ID
There are different types of JOINS depending on what you wanna do
But yes it’s doable easily
I don't think there is a function to force the number to stay between certain values in JS is there?
if it's over 100 just stay at 100 is it's below 0 just stay at 0?
guys? 😐
ok I'll code it myself, let me know if there is a more efficient way later 
I used Math.min and Math.max for that
but how would I make it so that values that are just not existent in the other tables be none there?
how...exactly will you know if someone is suspicious from presence alone?
yk you can't simply say "I'll use it in the algorithm" and hope for discord to fall for it
A random "undefined" in my console 
I log either true or false after each log made using my function (Exception for questions, identifiable using [?])
for example if someone has a self bot, their broswer presence is bound to be on for 24/7 since that's how bots work. if a bot is connected through a gateway they will have the broswer presence on, furthermore if someone has 2 presences at the same time, they can be using a selfbot and be on their phone and/or desktop so they will have both. I'm aware that it can be a fluke but it's a good way to actually tell if someone is self botting
I know people who are online 24/7 and aren't bots
yk, some people don't turn off the internet at night
yeah that's why i said it can be a fluke, that's why I can also tell if their browser is on 24/7 but the other devices are on periodically
This is #development?
indeed
bruh? it's literally a good feature, not at all an excuse
no code = no help
mb
the presence is irrelevant, you can't really ask for a priv intent without a good reason
keep thinking
bruh I literally told you my reason, a possible self bot detector
ye, not good enough
const log = {
info: (string, success) => {
console.log(`[${success ? colors.green.bold("INFO") : colors.cyan.bold("INFO")}] ${string ?? "Undefined"}`);
},
warn: (string) => {
console.log(`[${colors.yellow.bold("WARN")}] ${string ?? "Undefined"}`);
},
err: (string) => {
console.log(`[${colors.red.bold("ERROR")}] ${string ?? "Undefined"}`);
},
ask: (string) => {
console.log(`[${colors.blue.bold("?")}] ${string ?? "Undefined"}`);
},
};
let config = null;
function checkForConfig() {
if (fs.existsSync(process.cwd() + "\\config.json")) {
try {
config = JSON.parse(fs.readFileSync(process.cwd() + "\\config.json"));
log.info("Config(.json) found", true);
console.log(true)
return true;
} catch (err) {
log.err(err);
console.log(false);
return false;
}
} else {
fs.writeFileSync("config.json", "[]");
log.warn("Config(.json) wasn't found. I've created the file for you, please fill it out.");
console.log(true);
return false;
}
}
let cookie = null;
if (checkForConfig()) {
rl.question(log.ask("Cookie"), function (ckie) {
cookie = ckie;
startClient();
});
}
async function startClient() {
log.info("Starting client");
console.log(false);```
Looks good enough for me
"undefined" comes after rl.question(log.ask("cookie"))
really now 😐
you...could use a logging library yk?
you need to include the stacktrace for errors, else they're useless
You talking about const log = {?
yes
Can come later
you're printing only the error message, not the error stacktrace
Main problem is the undefined in my console
Hey guys
should I ask in the discord api server? They usually answer there kind of questions
Was thinking some dependency
Any idea how can I
think about a better reason, or don't ask for that intent
By evaluating
you don't need it, you want it
well this is what I've done so far
a simple embed and a first factor
gonna make it look better soon
it's impossible to know where that undefined without a stacktrace or context
Depending on the join you’re using all column selected of both or more tables will be shown in the result.
If those are null then they will be shown as null of course
it's like finding a pizza in italy
Please see my msg
I feel like you wanna merge tables together rather than using join to get a combined result of multiple tables
damn
Umm i don't want to start whole client
it's at if (checkForConfig())
shard also has that method
question is how
see the docs on how to properly restart a single shard
the only, ONLY place that undefined could be printed
toes
the error isn't a string, it's an object
and, if it follows the standard convention, it overrides the toString method to show the error message
which might not exist depending on the error
There isn't an error
you do not simply use booleans with percentages
you can't have "slightly true"
it is
It'd start with "[ERROR]"
toes
if it's 0 then it's not suspicious and if it's over 0 it may be, hence the true there
then, as I said, the whole thing doesn't make sense
nowhere else could print undefined
there is a merge feature?
please use a proper logging library, they include essential info on each line
I cannot help u
wait @lyric mountain is it even possible to check how many messages a certain user sent?
only if u track in the database
so there is no way to check how many messages the user has sent without tracking?
like doing something along message.member.messages.count ?
no
you can check the count by doing
so how come a bot can't do that?
also whoa I sent so many messages here
I feel like you wanna merge tables together rather than using join to get a combined result of multiple tables
Yikes… internet dead
Omg
bae, you need to understand there's a slight difference between you doing something and discord doing something
Now it’s sending
they can because it's their own api
Somewhere down here there’s another reply for you
I get it, but it would be a good thing to have for bots imo
Just had no internet to send it
The reason it logs undefined is because you're passing the return value of the ask() method as the first parameter to the rl.question() method, which the return value of the ask() method seems to be undefined since you're not returning anything
how so? that's irrelevant
ok I have an idea on how to do that
...newcomers?
well what about dead accounts or alts that haven't sent anything?
u wanna kick them, right
you're overthinking it and will end up having more false-positives than actual positives
hell no, why would someone do that?
but they're in the server but have never ever sent anything in it
what's the point of them being there
Actually the discord.js server did that, but using the prune functionality
So… to repeat what I said before when I got interrupted
Do you wanna merge together tables or just query multiple tables at once using any identifier
Kicked like thousands of people
they're 100% a dead account, and that could be a thing that I could flag
do you think that would be a good feature then?
No, just use the prune functionality Discord provides, no need for such an additional feature
haven't done much yet
Please use a mono-spaced font
Damn we now busting his balls on the font
Thanks
no I mean, I just want my bot to be able to tell if the account is a dead account, that could be potentially a factor to flag the account as suspicious, I think...?

it's gonna be one hell of backfire
you guys hating over anything >:[
why?
if it's gonna flag it's only gonna flag it to around 25% every factor the bot will detect will add 25% to the final suspicion rate
because you're using stuff that shouldn't be used as metrics
I will do that if it's over 75% then notify the owners
A dead account is irrelevant to flag as suspicious, and there's no need for detecting dead accounts other than kicking them, which is what the prune functionality can exactly do
if you're gonna accuse someone, u need solid evidences
okay, I get it
what else besides messages then? I also wanted to check for similar messages spam
I may still be able to
if the last 10 messages are the same / really similar flag
is that at least good enough?
What even are you marking the users as suspicious for?
I have one table that is a list of events happening with ids
then I have multiple tables describing different types of events with the corresponding id
now I basically want to have a list oriented on the first table, but additionally the rows of the other tables added to them
a lil example:
id | date | user | channel
1 ... u1
2 ... u2
3 ... chan1
4 ... u3
the empty spaces being none or whatever
I will use that in my anti nuke module later, right now I'm making it to be a function as an example
it won't do anything yet, but later I will make it do stuff automatically
basically a test command
pokecord-like farming
check for suspicious links in those 10 messages? :[
He doesn’t seem to understand that detection is not just a few statements but an advanced algorithm being updated constantly which already has as many use cases and edge cases to decide and detect if something matches your conditions or not

okay what else could be the factor then. I'm not looking to write a super extreme complicated algorithm just yet. I'm making an example command of how it could work
Yeah so not merging em together but return multiple table contents as result joined together by their identifier
If you do provide 2 example tables structures I can show you how to use JOIN
Just need a few columns and the ID column all tables share
Somehow readable on mobile pls

ok urgent one
const channel = await modal.guild.channels.create(`appeal-${data.data[0].id}`, {
permissionOverwrites: [
{
id: modal.user.id,
allow: [Permissions.FLAGS.VIEW_CHANNEL, Permissions.FLAGS.SEND_MESSAGES, Permissions.FLAGS.ATTACH_FILES, Permissions.FLAGS.EMBED_LINKS],
}
],
parent: serverConfig.appealsCategory
})```
permissionsOverwrites isn't working
its granting Everyone perms to see the channel
Don’t u need to deny the everyone role to see the channel?
do you actually need to take them from Permissions? I think doing just VIEW_CHANNEL by itself will do the trick
yeah
I had to do that
just add this
{
id: message.guild.roles.everyone,
deny: ['VIEW_CHANNEL', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY']
}
apparently it should fallback on the default category option
I mean if everyone has the permission to view channels by default you will most likely need an overwrite for this role to deny it for this channel
Thinking logically about this
But yeah I’m not really into channel management or permissions
can you check if the account is verified? somehow?
But I do assume I’m right. About that one
I think not being verified by email and/or number could be suspicious
is there a way to check that in discord.js?
Go to the docs, select the user or guild member class and check the existing properties
Instead of letting somebody else do the job for you
In the first place
first time on the docs page always slow

not the first time I'm there >:[
also it's not loading
discord.js issue
What are you wanting to know
Not without oauth
hmm I see
I mean you can
email is a prop you get with the identify scope
I don't want to check email
so without that its hard to tell
I just wanna check if the account is verified
how 0_0
If a guild enforces a specific security level and a guild member is typing you indirectly know he at least matches this security level
Thats a roundabout way
Yeah
Not the most ideal
Not meant you can directly check it
It is definitely a way to check though
But this relies on the guild having any sort of security level
how would that actually work code wise I cannot imagine that
You could do it when they send a message, or when they join the guild
Yes but in his case he speaks about checking an user being verified in a guild or not
But without a guild enforcing some sort of security level you won’t know anyways
Yea but this also still relies on the guild even setting a security level no?
So yeah not much reliable
I see
True
At least for your use case it is
But speaking about security built into discord or a bot and not enforcing the given options you have doesn’t make much sense, too
I need more ways to check the trust though, do you guys have any ideas?
One thing you can do is make a website with oauth and have it as a "verification" thing
they visit, click a button to see if they have an email/phone number linked to account and if so they can interact with the community but again
this is pointless as discord already has this
so far I check the date of the account and the appearance of it, only 2 factors. You guys rejected checking messages so that's off as well
Yeah
this is only if you are adamant on implementing this
yea
also I dont even think you can get the phone number in oauth
so even then it'd be one less way of checking for verified phone numbers
it's fine, it was just an idea, I'm not too keen on implementing that
I do need some other ideas though, those that are actually useful
If there’s an app redirecting me inside discord to a website outside discord to use the OAUTH flow to get verified I’m gonna quickly leave the server again
yea
so what is why I'm not going to do that
Unless its a far better method of verification than discord already has
thats also reliable
how do I turn a string into a bool?
I wanna check a variable
that returns a string
not specifically true or false but values
if the string is null (empty) it should be false, if it's filled with something it should be true
I know how to do that but it would probably be inefficient
I mean technically a string can already be considered a bool as it is a truthy value
even "empty" strings return true
yeah that's why I would check for length, hence it being inefficient
any better ideas?
however if it's empty I think it would return null
if its length is 0 its false if its 1 or more its true
nope
Can you elaborate on what you’re trying to do
no the actual variable will return null if there isn't any string being sent
I know you guys didn't want me to do that but I wanna check for the self bot with my method anyway
I wanna check if the user is active on browser
Wait a sec
What
is "" actually a falsey value?
Yes
I thought even empty strings were truthy
You’re thinking of empty arrays
Yes
When remembering that dude doing sort of a verification app requiring face authentication and your personal ID I can only cry about those giving em access to such a level of private data
I mean
It is a fairly good idea
Just not fit for discord at all
Some servers do require you to show your ID with everything but the DOB and Picture of you blurred
that's only the 18+ servers tho
I would never ever give that information away
Not even then I would give it away tbh
Yea nah
but he had a good idea
just the setting was wrong
If it would of been for some other company like a security company or smth
by all means go for it
Authorizing a payment or fullfilling a contract to indentify you as person, yes but not for any other use case
yea
I wouldn't
should I still check the last 10 messages as well? I can just check if they contain malicious links that's it
forcing a bool conversion is unnecessary in a lot of cases
Ah it’s not a terrible practice so long as you understand the caveats
I’ve used it a few times personally to check string length in a shorthand and cleaner way
lol the way I did it would probably make you guys cry
most likely
Otherwise I would be doing if(string.length === 0) which I’m too lazy for
Also who the fuck knows rxjs
So I just used if(!!string)
I don't get this shit
But it’s definitely not a good idea if you don’t know the type conversions well and you don’t necessarily know if a different type will be present
!!member.presence?.clientStatus?.web
the first !! is obviously to convert it to a boolean
the first ? is because if the user is completely offline clientStatus won't show so it will return undefined
the second ? is because if the user isn't explicidly on web it will return null, not undefined
hence my confusion
but I do get it now
Is this a selfbot..?
no I just check if the user is on the website before doing the actual checking
this is only cause a presence could not exist on a member
especially if its a partial member object
and clientStatus may just not exist on presence at all cause of some other wacky shit
What
still.. I guess that's good enough if the user is cached
for now I'll just let it stay this way
From my understanding of how djs does it, presence is nullable cause it could not exist either cause they don't have one (or whatever) or its a partial member object
Unless we are talking about different things
then ignore me
:)
it won't exist if 1. the user isn't online at all or 2. is connected through a different device I think
or the user isn't cached, if they aren't you can simply fetch them anyway
do you know how to use rxjs?
No
Same
I’ve just been making a stack machine in rust
nice
integrated the suspicion count into the whois command as well
looks like it fits
gonna have to think of a couple ways to automate the detection
I surely hope the suspicion score isn't global 
nope, it's not
sus score
Tf sort of slang is this used to say false instead of no
okay okay gonna change that
Also I feel like this might be another stringified boolean in your database
Am I Right?


it's not as bad since it gets updated automatically
looks great
Voltrex said multiple times it's not that bad
@earnest phoenix get your ass here and explain this

Ok you’re under code arrest until he explains himself
Go into jail now and don’t take the 200 bucks
Touching code again and you will be sentenced
You should rename is suspicious into sus-o-meter

We know, we know
how about having that as an easter egg 😭
so I am majorly fucking up





