#development
1 messages · Page 1816 of 1
I wonder if this good enough for / command help, some of the commands have subcommands, and I don't want to clusterfk help command with it, waifupic for example have 25 subcommands
should be fine imo, slash commands are pretty selfexplanatory since you can add information to each parameter
you don't need a help command for slash commands
Well, think of they add it, and slash won't appear immediately, so it kinda backup before they kick it 6min later
at least for me
I've seen some fellow add bot and didn't give permission for sending message though, type in help command then kick bot. That peeps kinda exist
there is no help for these people
oh
that wasnt intended
Anyone here knows python? If so do you know if i do a while True: thing or loop or whatever you want to say. Does it execute multiple at the same time or does it wait until the first has gone by
this was a bad explanation let me know if you need more in depth lol
it waits until the first goes by
Aren't loops blocking
so i can do a time.sleep() inside it to make a "cooldown" type
Is there even such thing as a non-blocking loop
you can sleep a loop yes
async loops would be just that no?
Yeah
There has to be something yielding control to the event loop though
can i still use / as prefix even though it's reserved for slash commands?
Gonna be tough but it's possible
Nah
It's possible, but make sure command names don't overlap
^
i my implementation it's possible to add spaces because I use trim()
Use a dot at best
Use . 😎 👍
Or something that's easy to use both on phones and PCs
/ / / will work
I wouldn't recommend that
why
The space would be removed by Discord
It overlaps with slash commands
Good luck listening to users' complaints about rough inaccessibility
i gave them option to change prefix they will be fine
That's fine I guess but most users CBA changing prefixes especially when the default one is trash
ohh
A dot is just universal at this point
Simple and you could change it
Plus it doesn't force you to fuck around with the prefix to get a command to work
yeah i use dot as well
s!
imagine having a # as a prefix 
is having the mention as a prefix a good thing 
although it does add an extra step for command processing
no like u have this one prefix as customizable and the other prefix is the mention which is permanently there 
i have a method for that 
im just pretending the first part(mention prefix) doesn't exist and check if theres another mention for the bot
let audios = [
"https://cdn.discordapp.com/attachments/681422909050322964/867017104015622174/michou-fier-lol.mp3",
"https://cdn.discordapp.com/attachments/681422909050322964/867027410133319680/Arrete_de_me_faire_chier_bordel_de_merde.mp3",
"https://cdn.discordapp.com/attachments/681422909050322964/867027435534811136/banana.mp3"
];
let audio = audios[Math.floor(Math.random() * audios.length)];
let thisaudio = new Audio(audio);
thisaudio.play();
after this, how to detect if the song is finished and play another song?
if you know the length of the chosen song you can use setTimeout
yes but how to define the ms for all audios? xD
Instead of having only links in the array have an object with a link and the length
or u can do a setInterval and stop it once the query is done 
each song has a different length most likely
oh ye forgot about that
bruh dont 
why?
storing json for data is unreliable 
err...
unless its like permanent
It's fine if it's static data
in this case it's fine
oh 
its just mp3 links oof
json dbs are unreliable, but using them as actual lookup files are fine
whats a static data 
as long as modification through code is kept at a minimum
permanent data
cant u just store it in object its the same thing for json 
object is in-memory
yes
json can be exported
but this way is more organized
tbf both are the same thing inside js
the difference is that one can be edited externally
how can i download my db's data as a json, just wondering
mongodb
oo thx
nop :/
you can require json files
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'bot@3.0.0',
npm WARN EBADENGINE required: { node: '14.x' },
npm WARN EBADENGINE current: { node: 'v16.3.0', npm: '7.15.1' }
npm WARN EBADENGINE }
npm WARN deprecated node-opus@0.3.3: This project is unmaintained. See @discordjs/opus for an alternative.```
how solve this thig
my very first bot used a json file as a db 
exactly two days until the first file corruption lmaoo
any one pls help
lel me when i didnt knew mongodb existed 
i cant know how setup mangodb
yeah same

npm WARN EBADENGINE package: 'bot@3.0.0',
npm WARN EBADENGINE required: { node: '14.x' },
npm WARN EBADENGINE current: { node: 'v16.3.0', npm: '7.15.1' }
npm WARN EBADENGINE }
npm WARN deprecated node-opus@0.3.3: This project is unmaintained. See @discordjs/opus for an alternative.```
can you help here

idk haven't encountered that
how change node 14.x
to node 16
replit doesn't support node v14 
i ask how change 14.x to 16 noob
thats why the repl community is complaining bc djs v13 requires v14 or up
npm WARN EBADENGINE package: 'bot@3.0.0',
npm WARN EBADENGINE required: { node: '14.x' },
npm WARN EBADENGINE current: { node: 'v16.3.0', npm: '7.15.1' }
npm WARN EBADENGINE }
npm WARN deprecated node-opus@0.3.3: This project is unmaintained. See @discordjs/opus for an alternative.```
what im saying u cant upgrade node versions yet in replit
no is show
npm WARN EBADENGINE package: 'bot@3.0.0',
npm WARN EBADENGINE required: { node: '14.x' },
npm WARN EBADENGINE current: { node: 'v16.3.0', npm: '7.15.1' }
npm WARN EBADENGINE }
npm WARN deprecated node-opus@0.3.3: This project is unmaintained. See @discordjs/opus for an alternative.````
in terminal l of vps
I'm not with node.js but with html, and require dosen't exist 😦
and in my script.js idk how to define :/
Replit isn't a vps
what does vps stands for
They don't support the version of node you require. Nothing you can do to fix that
Virtual private server
virtual private server
i only know a vps as like a hosting platform
i ask aws

i try to deploy
but this comes
npm WARN EBADENGINE package: 'KIRA@3.0.0',
npm WARN EBADENGINE required: { node: '14.x' },
npm WARN EBADENGINE current: { node: 'v16.3.0', npm: '7.15.1' }
npm WARN EBADENGINE }
npm WARN deprecated node-opus@0.3.3: This project is unmaintained. See @discordjs/opus for an alternative.```
Not sure what aws supports. They will have documentation to help with that
You'll have to go through that
it support node 16
what problem here
Then you'll have to go through their documentation to know how to use v16
can you tell
how do i import data in html?
like i want to display how many servers my bot is in via
client.guilds.cache.size
how would i display that in html
it's not that easy
tell me the process 
well first off you have to have an HTTP server running from the same process your bot's in. Then you'll have to create an endpoint which returns the guild count, and then in the client make a HTTP request to that endpoint and inject that into the HTML
im gonna use express how do i "inject" that into html?
document.getElementById("IdOfTheElementWhichTheGuildCountWillbeIn").innerHTML = `Guild count: ${guildCount}`
for example
and how do i define guildCount 
client.guilds.cache.size?
you have to make a HTTP request to the endpoint
typically with javascript
aight im dead lost now 
```npm WARN deprecated node-opus@0.3.3: This project is unmaintained. See @discordjs/opus for an alternative.````
what this
its unmaintained, and shouldnt be used
How to make a bot auto leave a server thats not whitelisted
In the guild join event check if it's on the whitelist.
Probably will want to check all guilds on startup too
In python, what protocol should I use to ensure the bot has guidl permissions.
I have a help command set up with reaction roles, however if the bot lacks manage messages command it has to default to a standalone page.
I have this, but fear it may be incorrect.
Well, I know it's incorrect because it doesn't work 
hey, I realized many bots have "About me" in their profile. how to do this?
You should check discord.py docs for permissions systems
Go to your bot's application page and change the app description
I looked and nothing clicked on.
if you need permissions for a channel, take a look at https://discordpy.readthedocs.io/en/stable/api.html?highlight=permissions#discord.abc.GuildChannel.permissions_for
one thing I haven't tried is client.user, it might work
client user is a user object. Users do not have permissions since Users do not have a guild relation. Members are what has guild relations
alright, so how would i retrieve the bot as a member?
pass in self iirc
its async
so self.bot.etc
just self
because its async
alright i will try
So how to fix it?
you dont
So I just have to deal with it? Fun
return the bool value in the callback
@stoic cypress ctx.channel.permissions_for(ctx.guild.me) would return the channel permissions
the point of async code is waiting for a task to finish and then continuing. You do not wait for that async function to complete, therefor, the code in the scope of the top level fn is running synchronously and goes as fast as possible
not perms for guild
perms for a guild channel is what they need
manage messages doesn't appear in a guild permissions collection
Then yeah, ctx.guild.me.permissions_in or ctx.channel.permissions_for
Thanks
manage messages on roles is a blanket permission value which only overrides if a channel's value isn't set. channel overrides take precedence over all role permissions
user perms > channel perms > role perms > everyone perms
Trying to test manage messages in the scope of just a guild and not a channel doesn't make sense

It does if you don't care about channel overwrites
Otherwise yeah, rely on the channel permission instead
Then your value would be incorrect if channel overrides are present which conflict with the role permissions
I got to here, but i'm not sure how to debunk this.
These are the channel permissions for the bot.
debunk
you know what i mean
as in to get a thing from it that says 'yes i have this permission' or 'no i don't'
just check if the flag is enabled
?
or permissions_in
There is a manage message property on that permissions collection you can access which is a boolean for if your client can manage messages in that channel
yea ive confused myself now
I have it in member form, i think im tryna go off of that
i need this with the bot identified yes?
but with manage_messages
What's member set to?
this is a different command
but member would be author in this command
or a mentioned user
And you want to get the bot's perms in current channel, right?
that is correct.
it might be easier to explain what i'm actually trying to do.
idk
ctx.guild.me.permissions_in(ctx.channel).manage_messages
permissions_in on Member instance here returns a Permissions object, where you then can get the manage_messages flag
Guild.me returns Member version of your bot in that guild
yeah i understand, i'll look more into properly understanding it once ive got it sorted
appreciate the help.
I am trying to make a bot "dashboard" and I am searching for "getting bot reference to website" but there arent any results. So how can I get a reference from my bot to my website so I can for example show the member count on the website?
<@&304313580025544704>
-atmods
@signal estuary
Please do not mention (ping) more than one or two moderators for help, unless there is an emergency.
Here are some examples of emergencies:
- Raids / Multiple members mass spamming.
- Severe disruption of Discord's ToS (NSFW content, etc)
- Anything that requires more than 2 moderators to handle.
use a api, send post requests from your Bot to your express server and the website does get requests on the express servers
store message count in database
do you have any links / tutorials where this is explained?
js: client.messagecount = getMessageCount(); client.messagecount++
that's volatile
thanks
the get MessageCount would be fetching it from your Database or stuff you want to do
that's volatile
thats pseudo code @wooden kindle btw
if you don't use a database, restarting the bot will zero the count
Inb4 getMessageCount is not defined @tired panther
@copper cradle check this out
I know...
That's what I said
"Inb4 they come saying getMessageCount is not defined"
That's what I meant to say at least
Does anyone know why when I use a link to my express app (which contains an image) as the thumbnail for an embed it doesn't work?
.setThumbnail(image) -> When I log image it returns: http://localhost:8080/creators?id=creator-1626789169653.jpg
// ExpressHandler.js --> app.get()
res.sendFile(`${creatorId}.jpg`, options, (err) => {
if (err) throw err;
else console.log("Succesfully sent: ", creatorId)
});
If I got to the link myself it shows the image
well, you can't use localhost on a service
localhost doesn't exist nor is accessible anywhere else in the world except for your pc
You can use ngrok for that or another some shit
oh
can someone help me with scripting/making a game
i dont know how to script dm me if u want to
inb4, no one will show up
you want to make a game but dont know how?
thats like wanting to build a car by yourself without any tools
nonono, he wants to build a car but someone else does it for him
it's like "make a game for me as I say and I might let you put your name next to mine"
I guess you were close enough 
so what do I do then? I have a base64 string and need to use it as an image
Even heroku and similars should just work fine
Wait how would I do that with heroku?
But I upload it to heroku?
Yes
Is there something different for webhooks if you'r hosting from your pc? Cuz whenever i try testing my webhook it does not print anything.
what url are u testing?
and I suppose "myip" is the public ip right?
yea
did you try seein if you're reachable?
nope, how would i do that?
hm, try using https://apitester.com
Hosting locally requires to set firewall rules to allow incoming connections as well as port forwarding in your router since incoming connections for non standardized ports being blocked by default.
see if you get some kind of "found" or something status
theres that too
It also requires to actually own a “real” public IPv4 address as these are DSLite tunnels nowadays meaning the ISP will identify you by that public IP address but it’s not accessible from the outside, the ‘net
ah i see
also if you're using windows you're in to a loooooong wrestle with the OS
Hosting from inside your network is not recommended if you’re not sure about the mentioned things
ok, ill look through that, thank you both.
Usually not since the UI of the advanced firewall allows you a simply method to add inbound TCP connections for any application for example for your specified port
you shouldnt even need to do that
At least that’s more costumer friendly than on Unix systems
when you bind a program to a port, windows will show you a pop up for you to allow connections to it
Should != Is 
I’m not even aware if that’s compatible with the architecture of Windows
As apps usually add firewall rules which is the reason they require admin permissions
try running something like a minecraft server
it will show a pop up about it
at least it does for me
But that doesn’t matter anyways in his case as the router will drop incoming connections for the specified port anyways
lmao minecraft
"How to setup public port with minecraft"
yes it wont help with port forwarding, just avoids messing with the advanced firewall shit
Well yeah maybe but that’s something I’m not aware of
I mean the app still needs to broadcast it needs (in this case the port) to the network service anyhow
I wonder if that somehow just adds temporarily firewall rules as long as the app is running
Rules which aren’t listed
imagine if there was ufw for windows
is there a good music downloading solution i want to cut music video's intro i tried spotify downloaders but they are basicly a youtube-dl with a spotify apı resolver mounted into them so they dont work
Well ufw is just an interface using iptables
And tbh even if you can bypass the Windows firewall easily it is actually really consumer friendly
The package handling is working well even for rules you have set manually still blocking too much requests, syn floods, dos attacks etc.
But I prefer iptables, too
Which will be replaced by nftables in the future anyways
tbf the only thing I miss in windows is bash as scripting lang
like bruh, who the hell codes in powershell's whatever lang it uses
really?
powershell is its own language
Related to anything from apps, to network etc.
teach me the sacred paths master
I can't figure out how to read microsoft's docs
language is too cryptc
Oh never said I’m a pro,
Just need to look into the docs over and over again as the console isn’t really helpful printing errors with links to MSN sites
WeeW never tried that or needed to do that
really, whoever wrote their docs need to be fired
You may don’t do such complicated things 
even javadocs are more readable than that
Yes I agree
That’s another reason why I need to read it over and over again
But as Windows nowadays supports the Linux sub system bash should be supported as well
ye, I did install it on my pc
but still feels weird since u cant just use directly from cmd or pshell
Hmm I agree
the intro
Nothing really I wanna deal with since I’m always creating a test VM on my server at home,
More comfortable than working with a sub system
Eww I’m driving - go away with that shit

I wonder if they'll add a native bash support in w11
since they already made it as a sub-system
Not like I would ever use it
More inbuilt restrictions and spy shit you can no longer get rid of
ah true
As Windows is hard coding things nowadays instead of letting the users the ability to disable things in the registry for example
Which updates like H120/21 shown us
Does clickButton get emitted on selecting a MessageMenuOption in MessageMenu or is there something else that I'm missing?
discord-buttons ^
Does anyone know if there's a way to use a base64 string as an embed thumbnail without using heroku or message attachment?
Why base64 specifically?
it's saved like a base64 string in the API I'm using
Well, you do need to host the api somewhere
it's not my api
no
Can't u just access it directly then?
wdym?
I'm getting data from an api which includes a profileIcon key with a base64 string as it's value
Like, is the api a service hosted somewhere?
I suppose
Does it require authentication?
yes
but once I edit the embed the attachment is shown above it
Well, you do need to refetence the attachment somewhere in the embed to not have it show above it
No, all you can do is ^ this ^
Which will make the attachment "move" to the assigned spot
what about
sending the attachment to a temporary channel and then taking the URL from there?
would that work?
yes
is that a good idea tho?
also "temporary" isn't really an option since let you delete the channel/image the link will become invalid
thus removing the image from your embed
just convert it to a link
but not use discord's link for it 
i dont know github

i just have an account that i dont use

are the emojis property for client always cached?
don't tell me...you're coding WITHOUT github????
do you at least use git or other versioning sorftware?
Whats github?
github is powerful if you use it properly
Even if you don't use it properly. Using it once every few weeks for 15 seconds can save you so much time
(full disclaimer you dont have to use github, other system exist e.g. bitbucket, gitlab etc...)
On Javascript, MongoDB, when I add a new field to the main data file, how can I have it add the new field to all existing data?
with yer favourite buddy iteration
async def taskGenerator(task):
autoActions = AUTOACTIONS()
print("Waiting until ready")
await client.wait_until_ready()
print("Finished")```
the `await client.wait_until_ready()` is taking too long and `Finished` is never printed
how do i fix this?
Well he’s not alone…
Never did the last 14 years.
Oldschool rockz
You're crazy
all my homies use sftp to pull changes :)
Nah I prefer to copy all my code onto a stone tablet and pass it around the village.
very basic of you
What’s the advantage of doing so?
Just because the code is supposed to be save?
(regarding to a disk crash)
lmao
Hello any one say how setup in active vc leave on MUSIC bot
Because you can return to any previous commit, and access it from everywhere
Also it allows collaboration and CI/CD pipelining
Hmm that’s only required if you dunno what you do I guess. 
Notepad++ has a “endless” redo feature as well
But yeah I know what u mean
I guess I will move forward in my next life
I wish I can be that perfect without making any mistake
This man uses notepad++?
I use native Notepad 
Emacs user
It’s not like anything works perfectly at the first time but years of experience are helpful. 👍
-botinfo 866832123494006804
That bot wasn't found
Well yes but actually no
With commits you don't need to go back step by step
You can grab any state of a file from any time before now
Basically revert any change independently of steps
I don’t code mistakes, just happy little accidents


me when I make the happy little accident of deleting a file with 500 lines

Made a backup of my backup a few years ago, didn’t verify it, format the disk of the original backup, overwritten it with new data, noticed a few weeks later the backup was corrupted
That was horrible
At least I’ve learned something by doing some mistakes
gn
?
I need help someone killing me and I need someone to kick someone in the game
I think you got the wrong server mate
Meet me at the gas station when you get on okay
And someone is a lying about being a staff
@scenic kelp job time
You can please send a unit on the game
Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Discord" button on the bot's page of the bot you need support for, not the "Join Discord" button at the top of our website. If there isn't a button that says Support Server, the server invite is invalid or you were banned from the bot's support server, then we can't help you. Sorry :(
this is not bully hunters
Meet me at the gas station in the past and left the game and I need tell you what I’m wearing okay
Uh what
Name is for use need to kick is knownJuju19
I am at the gas station waiting
Okay this guy is just trolling
I am on a bike
Meet me in the gas station
I am joining the game
Meet me in the gas station when you get on okay when you get on
seems they didnt get the message lol
Yes I need someone to come down and help the kick
I got killed
I got killed
☠️☠️😢
I’m leaving at two hours
Small children on discord 👍
I am trying to find out how many requests I made to my api.
I have made an axios call to the URL and have received HTML code as my data.
https://gist.github.com/EliteHaxy/1237fc0307004137b6f72d9f3deea6cb
That is the data I received. I want to display the number "990" (line 115) in a discord message. is that possible?
Ping me if you know. c:
async def function():
async with client.db.execute(f"""SELECT * FROM active_blacklist""") as cursor:
listOfAllItems = await cursor.fetchone()
try:
active_blacklist = eval(listOfAllItems[0])
except Exception as e:
print("ERROR-----")
print(e)
print(listOfAllItems)
print("ERROR ENDED------")
else:
print(active_blacklist)``` is there a way to check whether the table is none or not without getting errors?
does the sql query return a nosql table?
if so, you could do a very simple statement like this
if listOfAllItmes not in [None, []]:
pass
no the table is created optionally so it might not exist, thus the error
i don't use sql
so can't relate
first time trying ts typechecking be like
All pointing to type of... doesnt have method...
So something to do with some setting I guess
While that method is exist and code working
everything is any
esp when you have all of your commans and events in different diles
files*
Anything I can look into instead of doing @ts-ignore? I dont think ts-ignore is a good solutions, since error mean something I need to look into
why not typescript
Well, care to explain to me like im 5 converting js to ts?
i'm not good at explaining
How dare you insult detritus!
its shit 
https://medium.com/passpill-project/files-with-mjs-extension-for-javascript-modules-ced195d7c84a might be something to do with this
mjs, js extension file
const { MessageEmbed } = require('discord.js');
const db = require('old-wio.db');
const ms = require('ms');
module.exports = {
name: 'timer',
aliases: ['countDown'],
description: 'start a timer',
category: 'General',
execute: async (client, message, args) => {
let Times = args[0];
let time = ms(Times);
db.set(message.author.id, Date.now());
let i;
let timePassed;
let timeLeft;
i = setInterval(async () => {
let t = await db.fetch(message.author.id);
timePassed = Date.now() - t;
timeLeft = time - timePassed;
}, 5000);
console.log(timeLeft);
let int;
let embed = new MessageEmbed()
.setTitle('⏲️ Timer Started!')
.setDescription(`>>> Time Left: ${ms(timeLeft)}`)
.setColor('RANDOM')
.setFooter(message.author.username, message.author.displayAvatarURL());
let m = await message.Reply(embed).then(msg => {
timeLeft = time - timePassed;
int = setInterval(async () => {
await msg.edit({ embed });
}, 5000);
});
setTimeout(async () => {
clearInterval(int);
clearInterval(i);
m.edit({
embed: {
title: '⏲️ Timer Stopped!',
color: 'RANDOM'
}
});
await db.delete(message.author.id);
}, timeLeft);
}
};
Why timeLeft is undefined
If it’s not defined that’s probably why
Somewhere along the lines you’re making it undefined
But I defined it
hm... does anyone know to do cooldowns?
i tried using Bucket but it seems the command is still executed...
Well you could check against a time stamp against the current timestamp and not execute the rest of the code if the time has not passed
but is there a single command that can do this?
Wdym
like uh
You’d probably have to do it in every command unless you make a handler of sorts
@cooldown(1, 10, BucketType.user) doesnt not cancel the command being called
Is this a python thing
Then I’m afraid I can’t really help with the code itself
hmm since this is a collab im actually not sure 🤦♂️
ill just do what i did for my previous bot which is what u suggested
I can only provide the concept
let m = await message.Reply(embed).then(msg => {
int = setInterval(async() => {
console.log(msg);
await msg.edit("hlo");
}, 5000);
});```
error : cannot read property edit of undefined
Well its inline reply function
Yes but Reply doesn’t exist
Its sending the message but not editing it
But reply does
I don’t see how it sends anything or has the js Lang changed that much that methods aren’t case sensitive
no i doint think he initialized msg in the code...
maybe he meant m idk 🤷♂️
He very clearly did
But I’m raising a question as to why they are awaiting and then .then inside a variable
Just await and then use the variable to edit
.then with await just returns a promise iirc
Your code is inefficient to begin with but I can’t begin to understand what’s going on since the code looks incorrect to me anyways
Show your code
I'm making a timer command 😂
Yes but you are setting something in a variable but then using .then
Makes no sense to me
Either set it in a variable and use the variable or just use .then but anyway I don’t know what the issue is to me that code looks like it shouldn’t work to begin with
@cooldown(1, 10, BucketType.user)
@commands.command(
name="trivia",
description="Answer a trivia question using reactions! Provide a number from 1 to 3 specifying the difficulty of the trivia question you want.",
usage="trivia <difficulty>",
)
async def trivia(self, ctx, difficulty=100000000000):```
P.S. could set difficulty's default value to None
Interestimg though
And how are you using it
ah that was my friends code lmao
the command
uh you want me to show the code below?
How you use the command
hmm
In Discord
uh yeah quick update
apparently my friend kind of got it working lol
but do you know how to make it send an error message instead of just not executing the command @slender thistle
on_command_error event
it will be raised for cooldowns too. Check for CommandOnCooldown or whatever it is
async def on_command_error(self, ctx, error, bypass=False):
if isinstance(error, commands.CommandNotFound):
pass
elif isinstance(error, commands.NotOwner):
#stuff that i wont show
elif isinstance(error, commands.MissingPermissions):
#stuff that i wont show
elif isinstance(error, commands.CommandOnCooldown):
embed = discord.Embed(
title="Command on Cooldown",
description=f"This command is on cooldown. Try again in {error.retry_after:,.1f} seconds.",
colour=self.client.primary_colour,
)
embed.set_author(
name=ctx.author.display_name, icon_url=ctx.author.avatar_url
)
await ctx.send(embed=embed)
elif isinstance(error, commands.BadArgument):
#more stuff i wont show
but apparently the commandoncooldown isnt being sent :
The cooldown only applies to usage of the command
hmm so what should be corrected
It's raised when someone uses a command that's on cooldown
yes but nothing is sent
Did you add it as an event to your bot object
hmm lemme see
um im not completely sure what you mean 😶
but we have ```python
class Client(commands.Bot):
def init(self, **kwargs):
super().init(**kwargs)
self.help_command = None
self.start_time = datetime.datetime.utcnow()
@property
def uptime(self):
return datetime.datetime.utcnow() - self.start_time
@property
def config(self):
return config
@property
def primary_colour(self):
return self.config.primary_colour
@property
def error_colour(self):
return self.config.error_colour
@property
def icon_url(self):
return self.config.icon_url```
Hey
I have time in ms : 300000
How can I convert that to min or sec
Like
TimeLeft : 2m 30sec
Where's your on_command_error
I'm not sure what you want to do here
Raid this class
mods
@ripe prairie
as well as ex...
-b @pine grove
Banned babluop#2534 (@pine grove)
this too
is there a better way to get a channel id when someone tagged it in a reply, other than to use regex to take out the <# > at the sides?
like for example:
bot asks for channel
user tags channel
bot wants the id of the tagged channel
message.mentions.channels
i assume you use node.js
yes!
uhhh
My ping is litilery 2613
When my bot is in 56 servers..
And 75k users but I think that doesnt matter really..
Is there a way to decrease it without sharding?
good vps ...
Could anyone please help me develop my bot?
Uhh... I suggest learning JavaScript or Python, depending on what you like more, and then if you do discord.js read https://discordjs.guide
@quaint wasp how long did the bot take to reply to the ping command?
ok so i have a website, the website uses discord's oauth2 to login and store data by the user's id, i want my website to remember if users have previously logged in or not so i store the user's object data (their discord account user object data) in the local storage. But the thing with local storage is that users can also store/clear/modify the data in it, so the user can just store a different user's object data in local storage and my website wouldn't notice that the user wasn't the same user in local storage,
basically my question is how do i prevent the user from pretending to be other users
@amber thistle
two options:
-
encrypt the data before storing it
now unless someone gets hold of someone's computer they can't pretend to be them -
store their ip (discord uses this)
if the user logs in from somewhere else they have to verify through email
hm
Does anyone know for making a dashboard and buying ur domain.Like is it paid?
like for example mee6's dashboard
oo i never thought of encrypting it thanks
i love how this dude unnecessarily pinged a random guy with hm
can you help me with levels?
idk
do you know how to do them?
Ye ig
Why not store stuff in your backend
that's what the second option does
You can just store the user object tied to a session
That user object would also store a switch that indicates whether a user has logged in previously
User's cookies/local storage could be a good place to store the actual session ID
like 30 seconds
its full code is just about 0.25 G.
const profileModel = require('../structures/profileSchema');
let user = msg.mentions.users.first();
let data = await profileModel.findOne({ userID: user.id });
let amount = args[1];
let xp = data.xp;
let newxp = xp - amount;
const response = await profileModel.findOneAndUpdate({
userID: user.xp,
}, {
xp: newxp,
}
);
if(response) return msg.channel.send(`Succesfully decreased \`${user.tag}'s\` xp from ${xp}xp to ${data.xp}xp.`);
if(!response) return msg.channel.send(`Failed to decrease their xp.`);``` why this code doesn't decrease their xp?
hey! Is there any npm package or method with the use to scrape lots of site links based on a certain keyword? So the keyword france would give me lots of articles about france?
your query searches the userID field with the XP value of the user, im pretty sure it should be { userID: user.id, }
oh wait lol i tabnine did the wrong thing, thanks

is it possible to do a while loop for awaitmessages? so something like this:
msg.channel.send(`Do you want to add one more names? Reply with "yes" or "no".`)
msg.channel.awaitMessages(m => m.author.id == author, {max: 1}).then(collected => {
reply = collected.first().content.toLowerCase()
while (reply != no) {
msg.channel.send(`Do you want to add one more names? Reply with "yes" or "no".`)
msg.channel.awaitMessages(m => m.author.id == author, {max:1}).then(collected => {
reply = collected.first().content.toLowerCase()
})
}
})
(React.js) I'm posting to the backend on some pages that don't need authorization. How can I make this safe? So it should not be posted to the same url by someone else.
You can use collector
oh wait hold up, you might have a point. i'll go try it out 🤔
does anyone know if there is a rate limit for fetching invites from servers also
huh
I misunderstood your question
does anyone maybe know how i can get random sites on google based on a certain keyword
Like with the use of a npm packge or not. Doesn't really matter to me
You can use SerpAPI
Hi
I'm trying to create some group commands
i'm using d.py
the problem is when calling the sub-command the parent cmd is being invoked
Isn't that paid tho
why does this code https://srcb.in/K8ljOD6A2k
give this error
It's displayAvatarURL()
look at my code
Show your code
What is this a member
how I learn coding or from where
msg.author.displayAvatarURL()
.titleandvote > a:first-child > .votebutton{
background: #80d8fc;
color: #2d3436;
animation: animateHeart 1.2s infinite;
}
.titleandvote > a:nth-child(2) > .votebutton{
background: #80d8fc;
color: #2d3436;
}
.serversshards .votebutton:nth-child(1) {
background: #80d8fc;
color: #2d3436;
}
.serversshards .votebutton:nth-child(2) {
background: transparent;
color: #80d8fc;
}
.code {
background: #A6662D;
color: #F9CA9E;
}
.botpagebutton {
background: #A6662D;
color: #F9CA9E;
} ```
why doesn't that work ? (its on top.gg btw)
let member = msg.author;
member.displayAvatarURL works the same right?
No
why not?
displayAvatarURL
this
Right now I’m hosting on repl.it hacker plan! And my bot turns offline and online every 14 ish hours. Does anyone recommend and hosting that will stay online 24/7
can someone help me why this code returns this error
you don't need user after first()
ok thx
- add it as the unique _id or 2) add it as an attional field to a document and then insert it, you should find it quickly in the driver docs of the programming language of your choice
How would I go ahead and find the specific version if this is listed in the package.json as dependency:
"eris": "github:abalabahaha/eris#fce520513053eb1f4466130d8075126cf21024fc"
Yeah and how would I find that on github?
Isn't that the commit hash
ah commit hash, ok
Alright so it would be this then:
https://github.com/abalabahaha/eris/commit/fce520513053eb1f4466130d8075126cf21024fc
Ty
may I ask, why are you using a commit instead of npm version?
Dont ask me ¯_(ツ)_/¯
I'm trying to revert this commit:
https://github.com/SideProjectGuys/invite-manager-bot/commit/9ea3c89206ad7835bc8c9e9561df3dffc96f0039
But simply re-adding it into the code throws TypeScript errors
Type '(content: MessageContent, file?: MessageFile) => Promise<Message<TextableChannel>>' is not assignable to type '(content: MessageContent, file?: MessageFile | MessageFile[]) => Promise<Message<TextChannel>>'.
Type 'Promise<Message<TextableChannel>>' is not assignable to type 'Promise<Message<TextChannel>>'.
Type 'Message<TextableChannel>' is not assignable to type 'Message<TextChannel>'.
Type 'TextableChannel' is not assignable to type 'TextChannel'.
Type 'Textable & PrivateChannel' is missing the following properties from type 'TextChannel': lastPinTimestamp, rateLimitPerUser, topic, createInvite, and 19 more.
9 public createMessage(content: MessageContent, file?: MessageFile): Promise<Message> {
~~~~~~~~~~~~~
So I'm trying to figure out what's going on since I have no clue about TypeScript
Do I have to read that from the bottom?
looks like FakeChannel extends TextChannel
and createMessage is having a type mismatch in both
that's what I understood
Looks right to me tho (left InviteManager, right eris)
idk then, will need a ts dude to help with that
im just starting out in web developing so im confused on how do u know if the user previosly logged in if they like cleared their local storage
it would be different if each web browser had their own unique id tho
like if they cleared the only thing ur backend can identify if they have logged in or not, ur backend cant tell if they have logged in or not
you can get the ip
i mean yea but i dont wanna
or some other unique identifiable stuff
Ok it seems that I can build it.
Old:public createMessage(content: MessageContent, file?: MessageFile): Promise<Message> {
"New": public createMessage(content: MessageContent, file?: MessageFile): Promise<Message<TextChannel>> {
if you don't want to store the ip, just make a hash out of it and store that
I just slapped some <TextChannel> after the Message ¯_(ツ)_/¯
the problem isnt about storing the ip or not, its more about the user's trust
like if u know a small, website that grabs ur ip, u would not wanna use that
errr...pretty sure almost all sites get the ip
u would?
also, the ip is public anyway
If I dont trust a website with my IP I use a VPN
but arent those websites like famous
not necessarily
well i wouldnt use a unfamous website that grabs my ip
so i was looking for something else
then i stumbled upon local storage
local storage is client-side
If a user clears their browser data they should not be logged in at the next visit
yes @lyric mountain
and local storage can be edited
That's actually something I expect to happen with every site
yes and thats why i asked that question
ok so i have a website, the website uses discord's oauth2 to login and store data by the user's id, i want my website to remember if users have previously logged in or not so i store the user's object data (their discord account user object data) in the local storage. But the thing with local storage is that users can also store/clear/modify the data in it, so the user can just store a different user's object data in local storage and my website wouldn't notice that the user wasn't the same user in local storage,
basically my question is how do i prevent the user from pretending to be other users
use the user id
yes but
ah I see, you want to prevent the user modifying the local storage
yes
well you want to prevent logging in as another user, by modifying storage
i was thinking of doing a encryption with their id
in my site, I generate a unique hash for each user that login to it
you need to keep a database and generate access tokens
user logs in, generate token, store token in database and then give it to the user either in cookies or in localstorage
thats essentially what discord does
too many cookies
but how would u know if the user logged in or not if the only thing that identifies their browser is cleared?
they have to login again
Use PHP and PHP-Sessions :]
when the use login just retrieve his id's token and return to them
is there a event for when local storage gets cleaed
no
well i would wanna remove the token in the db when they clear local storage
no no no
tokens must be permanent
not necessarily
eh
they can have an expiration date
and every relogin refreshes it
so they automatically expire if you dont use them for like 30 days
well i don wanna make a timeout for each user so im planning on making it permanant
you can also make a unique token per session
so each browser has a unique session
thats what things like gmail and yahoo does
like a id?
you can list active sessions, and deauthorize specific sessions
what I do is:
user login -> does token exist? -> yes -> return token to client
| /\
L no -> generate new token
hm this is more confusing than i thought it would be
well, that because I use the token for more stuff other than the site
so I need to be able to deactivate a token to prevent access/usage
all of these session methods work on the basis that the user's device is not gonna be stolen and/or tampered with, because there is virtually no way to prevent a stolen token and/or cookie from impersonating someone, so most companies dont bother
ok so im gonna explain what i understand so far
user goes onto my site -> retrieve token from local storage:
token exists in local storage -> user can go onto my site
token does not exist -> tells user to login -> store token -> user can go onto my site
that's what I do
its a bit more
except the token shouldn't be stored in the local storage for too long
I use session storage instead
but would that basically mean they have to relogin
- token exists -> use token to connect -> check in database if token is valid -> accept session
that way user gets logged out when he closes the browser
everytime they close the tab
not the tab, the browser
oh
session storage persist as long as there's at least one tab open
like google login
well the user still can modifiy
well, yes
most companies dont use session storage tho
but hashes/tokens are unguessable
but lets say they logged in, token gets stored, the user is a tech savy and he clears the token in the local storage, thus resulting having to relogin, but i would wanna delete that token that he cleared in the database
the moment he refreshes the page you'd check if the token exists
you dont
yes but how would i know which token was the user's previous token in the db
id
if the token is permanent, it will stay in the database until the user removes it
i have a yahoo account for example, if i go into my account security sessions, i can see a list of active sessions, their browser/device info, and the time they were last used. some of those are from browsers that are long gone, last used 6+ months ago
i can then remove them from there
im sure im misunderstanding something here because the user doesnt have access to my database
you give them access to a list of active sessions
im just explaining an example as seen in a real company, in this case yahoo
you have a page in your account settings that shows you all your sessions
when you use sessions in php for example
they generate a session token and store it in cookies
There's also companies that handles login account creation stuff for you.
If your looking for an unfancy quick way to do it.
that token expires once the session ends, and you have to login again
well im using discord oauth2
Plenty of companies allow that
so basically
- user goes to website
- user logs in
- store user id in database and generate a token
- give the token to the user, store in cookies or local storage
when the user returns:
- check if token exists, if it does try check if its valid
- if it is, do nothing
- if its not, login again
everything you can do with js you can do in devtools, so pretty much nothing client-side is safe
everything can be modified, you dont need to care about that
figures
but now you have a token, not a user id
so you cant simply put another user id there and login as them
lmao the current method im using is storing the user id in local storage and thats basically it
yeah
so do the exact same thing, but with a token instead of an id
or even a hash
hm but i would like to clear the invalid tokens in my db
a tokenized hash 
most hashes today are secure enough to prevent reversing
store id-token pairs
oh yea and i need something to check my userinput
well theres a lot to worry about but ill just work on front end for now lol
you can do this for example
user logs in, get their id, for example "232768273927385"
store the id in the database
hash the id with some constant, like a fixed number or string
and store the hash in localstorage
so i unhash it when i need to use the id?
you cant unhash something
oh
thats why hashes are used for passwords
but how would u know if the id is correct?
you hash the id in the database the same way you hashed it before, and check if the result is equal
you will need to store something extra for indexing tho
no
hashing is one way encryption
there is no turning back
thats why its secure
oh so u wouldnt know the original text
exactly
oo
thats how servers store passwords
for example user logs in with password 12345678
server hashes that
and checks if that hash exists in the database
so the database never has the actual password
even if the database is stolen, the thief cant see peoples passwords
oo
the same password hashed the same way will always result in the same hash
but the hash cannot be reversed to obtain the password
store login timestamp on the local storage
when you enter the site again, check if it has expired already
do they even store something? they always ask me to login again, so i think they are not even storing anything other than the oauth2 access token that expires in a couple hours
they do
apparently they do
I don't actually know, but you can go 7 days without logging in again
but the thing is when i clear the local storage top.gg does not tell me to login again
I think that's the max?
I guess so, that's the time oAuth2 token stays valid
and when i refresh the local storage gets stored again
because they have ur ip probably
im looking at the stored stuff after logging in and see nothing relevant
just session ids in cookies
nothing in local storage, nothing in session storage
web dev is confusing
they just use a session cookie
dont you need to be logged in to vote?
you do
then you dont need ip, just do one vote per account
if you change network you can vote again? in the same account?
probably no
then they dont need ip
multi accounts
you cant vote with multiple accounts on the same bot using the same network
do they have protection against that?
https://top.gg/privacy
Could be useful here
^_^
damn wtf is that font color
lmao
Device Info is a web browser security testing, privacy testing, and troubleshooting tool.
all the shit you can easily get from a user simply by them accessing your website
Honestly, was super confused when it said I have 4 webcams, but my phone has 4 cameras.
your phone has 4 cameras?
Wtf compass directions
most phones these days have multiple cameras
ah, that, I thought it was 4 back cameras
tbf I don't even know what a 4th back camera would be
ultra zoom?
2 normals for 3d filming
Some have extra for secondary processing of the other cameras
ah true
at that point you have a handheld kinect
It's really spooky to me that motion sensing and compass is available to every site I visit.
Not something I was aware of
imagine a phone with 10 back cameras
porn sites can know if youre janking

next level pr0n VR
👀
why this code https://srcb.in/HzUYH211tA
doesnt reset their xp after leveling up? no error just doesnt reset
do you receive the messages?
yes
and it adds their level but doesnt reset their xp to 0
oh, thx
but now i broke it
that's not how json works
idk how mongo works, but json structure is ALWAYS key-value pairs
you cant have keyless values
Anyone know how to calculate Avarage words per paragraphs in python?
okayy let me try
still didnt work
doesnt reset xp



