#development
1 messages · Page 1676 of 1
Well then 401 means missing permissions
The Authorization header must be a Bot token (belonging to the same application used for authorization), and the bot must be a member of the guild with CREATE_INSTANT_INVITE permission.
Checked that?
yes
Checked that as well?
If using Gateway Intents, the GUILD_MEMBERS intent will be required to receive this event.
const casea = await punishments.findOne({ CaseID: args[0] });```
how come this returns null
i did +viewcase 1
thats a valid case
how can I fix thiss
const casea = await punishments.findOne({ "Punishments.CaseID": args[0] });
isn't args[0] a string?
they're using mongoose so i think their way should work as long as case id is a number
sorry, args[0]
hm
not case id
how about postgres
uh I don't think mongoose magically checks subdocuments
where is dank meme?
oh wtf
Try to replace the oath url by a generated one in your dev portal of discord (of your application)
With: scope = bot & permissions = insta invite
yeah do it like xet or { Punishments: { CaseID: args[0] } }
i didn't see the picture
what... no
it stillreturns null
still returns*
const casea = await punishments.findOne({ "Punishments.CaseID": args[0] }); ```
mongoose cares about types so you have to cast to a number
or just mongodb in general, not mongoose
look it up
so like, Number(args[0])
bump, someone other than the other guy help 🙂
idk cuz if args[0] is a string then it probs wouldnt owrk
yeah
ayy works
but now to display the info
case.map wont work

case.UserID
hmm
yep
findOne returns the entire document, not the subdocument you filtered by
its casea.UserID
huh
it only returned the case ID 1
ah wait nvm
i only had one case ID in
oof
so how would i return subdoc
confusion,
if i am using the case ID to find it
then why is it returning case ID's that don't match args[0]
that finds a doc that includes the case id provided inside its punishments
the whole doc
filter the array
yeah since it's guaranteed to include the case id
{
Punishments: [
{
PunishType: 'Warn',
Date: 'Mar 29, 2021, 4:28:23 PM',
Moderator: '526424692366639125',
CaseID: 1,
Reason: 'ahaha'
},
{
PunishType: 'Warn',
Date: 'Mar 29, 2021, 4:48:49 PM',
Moderator: '526424692366639125',
CaseID: 2,
Reason: 'NO'
},
{
PunishType: 'Warn',
Date: 'Mar 29, 2021, 4:48:51 PM',
Moderator: '526424692366639125',
CaseID: 3,
Reason: 'BYE'
}
],```
so do i just filter casea
yeah
yeah just use array.find()
a matching case id with the arg
const casea = await punishments.findOne({ "Punishments.CaseID": Number(args[0]) });
so just this but punishments.find
casea.Punishments.find()?
casea is the doc that includes the punishments and one of them matches the provided case id
you get me?
let br = casea.Punishments.find(Number(args[0]))```
you need to provide a function
you can also use a mix of $unwind and $match
if you only want to return the filtered subdocument
what function would i use to match the number
function checkCase(Number(args[0]))
hmm
uhh I think it's something like
db.$aggregate([{
"$unwind": "Punishments"
}, {
"$match": {
"Punishments.CaseID": Number(args[0])
}
}, {
"$project": { "Punishments": 1 }
}])
Hi
mongodb is overly complicated for doing nested querying
so that would return
just the info associated with case ID 1?
also whats the 1 here for
"$project": { "Punishments": 1 }
you'd get a Punishments key with just the subdocument that matches the given filter
Can you please give me an webcahin batchfile coz i got errors
1 means to include the given key and exclude everything else
i want to make a discord bot send a message someone sent earlier but add something to it.
with discord.js
db.$aggregate is not a function
is db defined as mongoose or the schema
well i tried both, still doesnt work
oh it's without the dollar sign I think
this won't work if you're on mongodb atlas btw
they don't allow you to use real mongodb features on the free tier lol
array.find with the same predicate
yes, convert that to js
that's not how you pass a callback into find
you have to change it a bit
aha ok cool this is how you do it
db.aggregate([
{ "$unwind": "Punishments" },
{ "$match": { "Punishments.CaseID": Number(args[0]) } },
{ "$replaceRoot": { newRoot: "Punishments" }
}])
pretty shitty
it's still not going to work for you because you're using a free tier lol
oooooof
aggregates are super powerful, if you're gonna use mongodb it doesn't make sense to not use them so mongodb atlas is pretty pointless
you're forced to duplicate the search logic instead
for the find, what would i need to do
at OpusScript.decode (C:\Users\Outdated Cosplay\Desktop\LittlePSA\node_modules\opusscript\index.js:82:15)
at Decoder._decode (C:\Users\Outdated Cosplay\Desktop\LittlePSA\node_modules\prism-media\src\opus\Opus.js:64:25)
at Decoder._transform (C:\Users\Outdated Cosplay\Desktop\LittlePSA\node_modules\prism-media\src\opus\Opus.js:189:20)```
This error just started happening out of no where
it used to work like 10 minutes ago
and yesterday too
it's just regular find, go look up examples
why would you ask me when you have a javascript interpreter in front of you
hmm true
cus xetera is big brain?
big bren
Hey i have a bot and I want to make it so it can do math but I dont know how to get it to. How would i do that?
What does a database do for discord bots?
if anyone knows the pg client on npm, I'm trying to use prepared statements and select a column where it's LIKE a value and I'm not sure how to use both the wildcards and prepared index identifiers. I tried LIKE $1% and that gave a syntax error. Any help is appreciated
Tim
can u help
throw new Error("Decode error: " + OpusError["" + len]);
^
Error: Decode error: Invalid packet
at OpusScript.decode (C:\Users\Outdated Cosplay\Desktop\LittlePSA\node_modules\opusscript\index.js:82:15)
at Decoder._decode (C:\Users\Outdated Cosplay\Desktop\LittlePSA\node_modules\prism-media\src\opus\Opus.js:64:25)
at Decoder._transform (C:\Users\Outdated Cosplay\Desktop\LittlePSA\node_modules\prism-media\src\opus\Opus.js:189:20)
at Decoder.Transform._read (_stream_transform.js:191:10)
at Decoder.Transform._write (_stream_transform.js:179:12)
at doWrite (_stream_writable.js:403:12)
at writeOrBuffer (_stream_writable.js:387:5)
at Decoder.Writable.write (_stream_writable.js:318:11)
at Readable.ondata (_stream_readable.js:717:22)
at Readable.emit (events.js:315:20)``` it used to work 10 minutes ago then decided it didnt wanna
@quartz kindle if u cant its ok
let cid = await inc.findOneAndUpdate({}, { $inc: { Inc: 1 } })
data.Punishments.push({
PunishType: 'Warn',
Date: date,
Moderator: message.author.id,
CaseID: cid.Inc,
Reason: reason,
});
data.save();
let swarn = new Discord.MessageEmbed()
.setTitle("Sucess!")
.setColor("GREEN")
.setDescription(`I have sucessfully warned the user! Details below.`)
.addFields(
{name: "User Warned", value: `${toWarn}`, inline: true},
{name: "Case ID", value: `${data.Punishments.CaseID}`, inline: true}
)```
how come case id returns undefined
i tried data.CaseID
nvm
i just did cid.Inc for it
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
at Function.Module._load (node:internal/modules/cjs/loader:769:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []```
that file doesnt exist is what it's saying
how do i delete a message in dpy?
How do i make it look for a different file
you fix the path..
i'm assuming your using VSC or atom?
or a code editor
of some sorts
yes
uh
uh
im not sure
find your bot.js file in windows explorer
and copy the path
oh wait
i think the issue is
that you dont have bot.js in that folder
thats why
let br = casea.Punishments.find(c => c.CaseID === Number(args[0]))```
how would i delete this now
like remove the entry from the db
fixed 👍
I have successfully install phpmyadmin but when i go to localhost/phpmyadmin, is a blank page
how can i do?
let br = casea.Punishments.remove(c => c.CaseID === Number(args[0]))```
i tried this
but it doesnt delete from db
https://sourceb.in/054KyhQ2eX when i node it, the terminal says it's online and it comes online like it should but when i try to test a command, it doesn't work. The terminal doesn't even say smth is wrong like normal. I'm using JavaScript
message.content.slice(prefix.lenght).split(/ +/);
length
i feel so dumb rn, thanks
what db are you using? usually delete/remove methods are based on a key, not a function
.remove(id)
or whatever key you saved it with
how can i fix this?
const channel = member.guild.channels.cache.find(ch => ch.name === "welcome");
(it isnt cached)
mongo
the channel is not cached? you'll have to fetch the whole guild
what does this mean?
install node
gonna be honest, use lavalink for voice
actually
i played with opus
dont do it
lavalink is garbage
its finicky as fuck
ok then
I tried .remove but it doesn’t delete the warning
better use trash lavalink than dealing with connections manually
lavalink is good enough for people who really have no clue what they're doing
indeed, i agree
I have it
but its a lot easier to fuck with than manual connections
its finicky as fuck
raw opus i mean
i did the right one, was i supposed to do the left one?
i got it working within an hour 
yeah well, that's because node™️
i had manage to install opusscript and get it running
after 30 minutes in, i said fuck it and went with lavalink
could've done it no problem with opus
the issue is the errors and de-syncs
its insanely infurating dealing with all of that
https://i.callumdev.pw/c2vxz.png
https://i.callumdev.pw/h4crm.png
Why am I getting this error?
I have the right scopes, bot has CREATE_INSTANT_INVITE/ADMINISTRATOR permissions in the guild, I got the right access token and bot authorization is correct
its still a problem that needs to be fixed
and i didnt wanna deal with it
in all honesty
how do i do this again 😅
COULD =/= SHOULD
guild#fetch()
thought so
would've prob spent around 3 or 4h properly setting it up
How do i make messages embed?
ignore the axios part, its actually node-fetch
you can also call axios.post() instead
switched from axios to node-fetch cause axios created issues somehow
cuz you are trying to json() something that is already json
also how would i make a list without it being screwed up
oop
sorry forgot it had an invite in it
depends which library
wut lol
i mean i know u can do guild.fetch but i dont really know how to get the channel by doing that
if it's not in cache, you have to fetch the guild
let { data } = await axios.post('hhtps://123.com', {data: {/*body here*/}}).catch(() => { data: null });
use something like this instead
not using axios
so i cant get the channel?
said this already
then why u put axios there
once you fetched the guild, you can then query the channels as they're going to be in cache
cause it WAS axios, but axios was being annoyin so switch to node-fetch
just didnt update var name
axios is better than node my dude
discord doesn't expose an endpoint to get just the channels of the guild, you have to fetch the whole guild
i know, but it was being a right nob
it has proper error catching and parses the payload for you
also why you doing a POST to a member?
ah right
uhhhhhhhhhh my small brain is dumb
@opal plank https://i.callumdev.pw/hytr0.png
now getting 401 unauthorized :/
although, if you're using regular djs, all channels should be in cache at all times
i cant enable intents
idk if the acces_token is 1 time use
its a new at
receiving channels, or rather guilds, isn't a privileged intent
using const channel = member.guild.channels.cache.find(ch => ch.name === "welcome"); requires intents tho doesnt it
no it doesn't
wtf why isnt it working now then
@graceful shore you using vsc?
i didnt do anything to the code
visual studio code
no probably should be
no
what are you using then?
notepad XD
i have it lol
is node-fetch is better then request?
still trying to think of what can be causing that tbh
oh turns out i do have visual studio code, i thought i only had the 2017 version installed
well, with node-fetch and stringifying body I got passed 401 error cause it worked, but had another error that made 0 sense cause everything was fine
this entire thing is confusing me lol
updtae it and use that instead
since this is raw api, you could ask in ddevs for more specific onto this
i have it
loool
how do you make the bot respond with embed
there we go
im in it
now read this
ok so i have my code in visual code.... now what lmao
read that
man when i see the JS, im really missing nice template strings
you'll never have questions regarding why is this not working again
cuz you can see your code real-time
ok
this reminds me of the time erwin struggled for ages to get the debugger working on my vscode, then just.. gave up
LOL
i have no errors tho
it doesn need errors to work
well, im patient, but im no buddah 
Erwin’s trying... 

so what am i looking for
you debug your code, if something doesnt work like you thought, debug it there
this is all that is in the console, nothing else
you didnt read the guide at all did you?
you put a breakpoint into stuff you want to debug
ok
ok at erwin giving me wrong axios code now getting 403 error, thats.. progress
wait what/?
me
how???
how do i use breakpoints i cant figure it out
u asking what im using?
already figured it out, node right?
e
The access token is probably invalid and needs refreshed
Or it's as simple as the fact that request bodies need to be a string
I want to know how to make it so you can only buy 1 pc here code ```js
@client.command()
async def bag(ctx):
await open_account(ctx.author)
user = ctx.author
users = await get_bank_data()
try:
bag = users[str(user.id)]["bag"]
except:
bag = []
em = discord.Embed(title = "Bag")
for item in bag:
name = item["item"]
amount = item["amount"]
em.add_field(name = name, value = amount)
await ctx.send(embed = em)
async def buy_this(user,item_name,amount):
item_name = item_name.lower()
name_ = None
for item in mainshop:
name = item["name"].lower()
if name == item_name:
name_ = name
price = item["price"]
break
if name_ == None:
return [False,1]
cost = price*amount
users = await get_bank_data()
bal = await update_bank(user)
if bal[0]<cost:
return [False,2]
try:
index = 0
t = None
for thing in users[str(user.id)]["bag"]:
n = thing["item"]
if n == item_name:
old_amt = thing["amount"]
new_amt = old_amt + amount
users[str(user.id)]["bag"][index]["amount"] = new_amt
t = 1
break
index+=1
if t == None:
obj = {"item":item_name , "amount" : amount}
users[str(user.id)]["bag"].append(obj)
except:
obj = {"item":item_name , "amount" : amount}
users[str(user.id)]["bag"] = [obj]
with open("mainbank.json","w") as f:
json.dump(users,f)
await update_bank(user,cost*-1,"wallet")
return [True, "Worked"]
async def update_bank(user, change = 0, mode = "wallet"):
users = await get_bank_data()
users[str(user.id)][mode] += + change
with open("mainbank.json", "w") as f:
json.dump(users, f)
bal = (users[str(user.id)]["wallet"],users[str(user.id)]["bank"])
return bal
consider using not json
ye I gave up on db
json is not a database
I believe you'd get more mileage out of learning SQL statements and use a database like MariaDB or Postgres.
Ok
i have no idea what im doing
Almost everything, since the documentation is mostly autogenerated, and hard to get support
most i have got is this const channel = (await member.guild.fetch())
no, its already authorized by this point
when i change the page it a tag to the user. what should i do?
can someone help i have no idea what im doing
well, tell me what you need help with, intellisense should tell you most stuff, but if you got a question about detritus im happy to answer, since i've been using it for a while now
The very first step, understanding from where to where on documentation
theres 2 places you should seek to understand it
like if I wanted the same thing as <message>.channel.send
I donno where would I start looking
no
you should, let me show you why
@long crow behold typescript and its intellisense with auto-complete
if you got the plugins for it, should, but ts offers integrated docs out of the gate
if you code on js, you should 100000% move to ts
ts IS javascript
but better
in almost every sense
ok
can send you a link if you want to know more about it
TypeScript has forever altered the lives of JavaScript developers. Learn why TS is so awesome and the basic concepts required to be successful using it https://angularfirebase.com/typescript-the-basics/
Deep Dive https://github.com/basarat/typescript-book
TypeScript Docs https://www.typescriptlang.org/
ok
the intro should tell you a lot of the amazing things ts offers
thx
np
theres quite a few people here using Ts now, i recall a couple months ago where basically me and @cinder patio were the only people who used it
lol
(sorry late to this)
not sure what types of DB you have tried in the past, but one that I find very straight forward for python is SQLite with a library called peewee.
You can download a DB browser like this one (https://sqlitebrowser.org/) and create a DB file, then configure your database however you want (you could just have one column for user ID's that have a PC), then using peewee's tool called pwiz (http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#pwiz), you can run a command that creates a python file with your entire database structured in the form of classes and variables. From there, you can use peewee's querying operators (things like select, from, etc) along with the name of the database model to easily get things in list form.
Sorry if this isn't at all useful, but I figured I would just share this as it's been way easier for me to configure compared to other methods
hmm
guys
i ned help
@client.command()
async def 'name'(ctx):
ctx.send('Text')
what should i type in ctx
Idk
I'm kinda started
I already made a bot
oh
But idk ctx thingy
Any examle
oh hmm
Example*
@opal plank i think i found the problem
client.on('guildMemberAdd', async member => { }); just wont do anything
same with remove
it wont even log "member"
so strange
@graceful shore cuz you arent doing anything with the code
whats inside the brackets?
also
do you have intents enabled?
i am doing stuff inside the code
then, you got intents enabled?
also no, but i tried doing console.log(member); and that did nothing
then you wont get member updates
you NEED intents to use members
right
do u think discord will let me have them just for a welcome function? @opal plank
no i mean if i applied for it because my bot is verified
your bot already verified?
yes
yeah i tried applying for intents before for a /serverstats command and they declined my request so i doubt they will for this
pain of having to apply got intents
yup
Hi (: Regarding to Commando.js framework, Is it possible to make subfolders inside groups folders to store my commands? like
commands
- group1
- subfolder1
- command.ts
- subfolder1
- subfolder2
- command2.ts
Commando does not seem to recognize commands in subfolders
You don't make a bot in repl, you make it in a language, using a library, and just put that code in repl.
what language/library do you want to use?
Then you need to start by choosing, and learning, a programming language.
can ya guideme
That's the first step
oh can ya help
JavaScript is a pretty good starting language, it's relatively easy to pick up
Python is also said to be easy to learn
But either will be weeks/months of learning, so, strap yourself in, it'll take a while.
The first step, what I linked, will take you weeks and months. that's your next step
hmm
As in: take the time to learn a programming language
oh hmm
There is no easy route here. Programming is hard, you have to dedicate yourself to learning something.
I don't
Have you clicked the link I sent?
hmm yup
here it is again: #development message
hmm
bruw
what
It's the "nodejs" repl
hmm
hmm
hmm
code the bot in repls editor, they have docs.
hey guys just wondering what i am doing wrong, my discord bot isnt adding / commands to discord
i dont know why and there is no errors being thrown
here is my sample code for this issue
from discord_slash import SlashCommand, SlashContext
bot = commands.Bot(command_prefix=str(config['SETTINGS']['CommandPrefix']), intents=discord.Intents.all())
slash = SlashCommand(bot, sync_commands=True)
@slash.slash(name="testping")
async def _ping(context):
d = datetime.utcnow() - context.message.created_at
s = str(d.seconds//1000 + d.microseconds//1000)
embed = discord.Embed(title='Ping', color=0xffffff)
embed.add_field(name=':ping_pong:', value=f'{s}ms')
await context.channel.send(embed=embed)
as you can probably tell i have not included all the commands, but this is the only code related to my slash commands
Please Ping me if you can help, as i have not been able to find anything on stack overflow and the Docs are very difficult to understand
what is the name of the bot file @earnest phoenix
That usually happens if the file is empty or you didn't actually save it.
like this
no that's a folder not a file
the file would be index.js or bot.js or main.js or whatever
make sure to save, it CTRL+S
well try @umbral zealots thing and try
node index.js
yeah lol, i did that with 1000 lines of code before and the power went out

6 hours of coding
gone...........
Well, at least you learned a super important lesson!
What lang? @lusty atlas
I'm using JavaScript
so you're using discord.js correct
Yea
hey does anyone have any knowledge on why my bot just randomly went offline with no errors, because my bot just got declined due to it being offline
could be a number of reasons but just "went offline" is a bit too vague to be helpful, I think
It only works if in your package.json have a main like this.
{
"name": "(the name)",
"version": "1.0.0",
"description": "",
"main": "Index.js or file name",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"discord.js": "^12.5.1"
}
}
We've already fixed that issue...
Oh sorry
smh
.-.
Always remember to scroll to the bottom of the channel before you start answering questions, folks! Only you can prevent forest fires answering hour-old messages
Hi (: Regarding to discordjs commando framework, Is it possible to make subfolders inside groups folders to store my commands? like
commands
- group1
- subfolder1
- command.ts
- subfolder1
- subfolder2
- command2.ts
Commando does not seem to recognize commands in subfolders
Show us index.js line 6
Help
I'm using the top.gg API but when someone votes for my bot, the user ID appears but I want the name to appear
how can I do that?
What's your code right now?
let user_vote = req.vote.user;
.setDescription(`El usuario con el ID: `+user_vote+` ha votado por mi!`)
@umbral zealot
Right so presumably discord.js
You can pull the user from client.users.cache.get(user_vote) to get their user object
From there you can get their tag, a mention, etc
And how do I do that?
Use its properties as described in the discord.js docs
This has nothing to do with top.gg
You need to fetch the user info from discord.js
Because top.gg only provides the id, but that can be used to fetch the user.
anyone use lavalink?
i use it with detritus, why?
when you dc a bot manually
it doesn't changestate
so the bot never joins back
for some reason
It is a goodnight here
i dont see any logs
which lib u using?
are you logging voice states?
ok support and general is dead and i need help with an issue is this a good place to get said help ?
from erelajs?
yeah it logs on the lavalink overlay
lemme try
there a lot of state updates,
anyways
the one im looking for is voice state change right?
there's no state log when i dc it manually
yeah
it did log
both for join and dc
but they're both same mmmm. there's no indication of what action is being carried out?
when i manually "disconnect" the bot
then it should pass under voiceServerUpdate iirc
idk what you feeding it, never used erelajs
see the voiceUpdates?
after i dc the bot, all it logs is the search
it even says the player was destroyed. but it never joins the vc again
hmmm im not sure tbh
mindfk, it used to work before
there's no server state update. for both join and dc manually it sends the same voice state update
@opal plank Short browsing, might understand the flow how to read the documentation
like i said, realistically you wouldnt even use the docs
Maybe try out my discord bot version in djs into detritus during this weekend
it would be much better to use typescript and get intellisense directly onto vsc
not familiar yet with TS, so I stick for JS
well, your loss, ts by itself is worth it
you saw the perks of it
not only it completes for you
it also tells you whats wrong or not
I mean, I can't run without learning to walk first
in js you would have to try it and catch the error that way
here you get it before running it
ts IS js
theres no learning curve
you can setup ts to be lax at the beggining
is there an event i can listen to on the client itself? for manual voice dc
dont think so
well
if you're leaving manually
why not do it in the command?
ignore the event
if the bot gets disconnected manually
yeah like from the vc
not command
the command one works fine
when the bot is playing music in a vc, and someone manually disconnects it by right clicking on the bot and "disconnect"
thats when it doesnt rejoin
if there's an event it emits, when this triggers
i could probably do something
i dont get an event when i do the command
the command is pretty much straight forward. typing "bot dc" would be the trigger for me to destroy the player
etc
are you listening to both events?
nop
the voice update events are automatic
voiceserverupdate isnt there
when i disconnected it manually
then add it
on the "raw"?
wdym on the raw?
the "raw" event doesnt have that voiceServerUpdate
if (d.t == "VOICE_STATE_UPDATE") {
console.log(d)
}
client.music.updateVoiceState(d)
});```
this one
i checked the d
it has message typing etc
when i dc manually it throws voice state update
Hi
never the voiceserverupdate
i found my problem, its actually in the queue
when i dc, the queue doesnt get cleared
i need a trigger for it
the "dc" command would be 1 trigger
but when someone does it manualyl there's no trigger
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
its right here
if your lib doesnt have voiceServerUpdate
its shit
well like i said, when it gets disconnected manually, it throws a voice state update, and the lib automatically destroys the player
the problem is with my queue that still exists
and isnt cleared
when its manually disconnected
then i've no clue
both voice state changes have the exact same object
sounds like a lavalink issue
there's no indication if the bot was disconnected
nop, i see the "destroy player" operation
when it dc manually
nvm i figured it out lol
One message removed from a suspended account.
Are reactions rate limited or smth rn
my bot has the thingy that you pass pages with reactions
but after adding/removing the same reaction three times discord keep taking the reaction off or smth idk
i thought i messed something up but same thing is happening with other bots i tested
One message removed from a suspended account.
One message removed from a suspended account.
yes yes i know that but
One message removed from a suspended account.
whats happening rn is kinda weird and i dont think should be happening?
like
Mudae for example, which is a pretty famous bot
I used a paging command
added reaction like just three times
and it stopped working
i thought it was an issue with my bot but after i saw it happening to mudae as well i think theres something wrong with the api idk
I’m trying to separate a command so that only I, the creator, can use it. No one else. Is this a thing I can do? Discord.oh
.py
Yes
lol
?
Your function should return True or False
I will just search the web, but I will keep this in mind
Are you using the commands extension or on_message for commands?
Just create a function that returns true if the id is your id
And pass it at the check decorator
Ok?
With commands.ext you can just @commands.is_owner()
With on_message you can if message.author.id != your_id: return
I mean ye but sometimes you want to allow not only youself but maybe a few selected people
Like Mods or smth
Then that's on server permissions, which is @commands.has_permissions
A group of people... I don't remember if passing owner_ids to commands.Bot reflects on is_owner
They did specify "and no one else" so
I just do
return ctx.message.author.id in (id1, id2, etc)
And pass It in a check decorator
Eh works too
Btw
Could you be as kind to explain to me why that's happening
That problem is Messing with my bot as well
Shhhhh
You're spamming reactions
Não conta pra ninguém
@icy skiff press ctrl + shift + i
@icy skiff do it
I did it
Maybe discord increased the rate-limits
I am
show it
Bad requests and too many requests
i assume its ratelimits
yeah
but i want him to collapse it so i can be sure
what
400
its just happening with bots
i can spam people's messages with reactions
but any bot
it gets rate limited after 2 or 3 reactions
permanently
do you have any client mods?
sorry for my stupidity but i dont know what that is
perfect, then i assume you dont
kek
your acc might have been flagged for reaction spam possibly
i mean, if u have any bots to test it i think u could try it yourself, pretty sure same thing will happen
its not just me
i asked some random friends and same thing
and as i said only happens with bots' messages
i can spam YOUR messages for example
but not bots'
i'd rather not get my acc ratelimited and possibly flagged, thank you

kek
no but like
any bot that has any command that works with reactions
just add/remove the reaction twice or thrice and BOOM
stops working
well, i dont see the issue, thats probably an intended discord feature, they are likely trying to prevent peple from abusing bots
its ratelimits
period

that legit sucks
blame whoever coded the bot if they have 30+ pages you gotta flip through
u cant see past sticker 3
or a page selector
ye but it was working 15 minutes ago 
clearly isnt anymore, so fix it

add a page selector
dont rely on people spam
nobody is going thru 30 pages, sorry to give it to you
10 is already much
ok
lemme give ya a example real quicc
Mudae right, everyone knows mudae
it has that command that u search a character
i dont
Just poking my head in and curious on what you're saying Erwin.
well, idk about bots in general
Pagination when there's 30 pages but you go through them pressing
<-- -->
emojis is fine since it's only two
which is legit what he's doing
I mean, we do it 
bro
Never been ratelimited.
lve seen dozens of bots working like that so its kinda weird it being broken all of a sudden
his client is being ratelimited cuz he's spam clicking like a madman
Oh.
bro
its not that
thats a pretty bad way to run things dude
its getting rate limited after two clicks
Could throw in a custom rate limiter with the system itself. Like only can react ever few seconds.
just cuz they do it, i'll do it too
that definitely shouldnt be intended
Idk we make sure people can't abuse.
well, you DID spend the last 30 minutes spam clicking, i wouldnt be surprised they lowered your ratelimit count to 3 cuz you've been flagged
It do be like that.
Arigato Gozaimasu
same thing is happening with friends
I find it more formal to say in japanese
that dont even use the bots
it IS good
preventing reaction spam for us bot devs
Indeed.
but not LIKE THAT
it IS good
not after TWO GODDAMN CLICKS
just click me
oh
U know what. I'll join you aswell bec Erwin is poggers
Poggers
@slender thistle, @icy skiff got a question for ya
A
yes
ok
so
weird things are happening and my head feels like exploding
so
my bot has a pagination command right
people use reactions to pass pages
if i use such command on server x
the reaction gets rate limited after 2 reactions or smth
if i use same command on server y
works like a charm
ill record a quick video just a sec
is there anyone I can DM and ask if the gif I have is epileptic?
dm a moderator
choosing safe
ok
const client = new Discord.Client({ allowedMentions: { parse: [] } });```
Correct?
For not mentioning everyone, here & roles
Hmm Ok
My guess is your ratelimit was increased for spamming reactions
Guess you'll have to wait
but why does it work on some servers and others dont?
i showed in the video, it works at one server but not on the other
I'm not sure if reaction ratelimits are tied to guilds or channels
but it also doesnt work for some friends of mine?
i dont get it
ill wait for tomorrow and see if its back to normal
Well I have absolutely not a fucking clue 
2
it doesnt make sense tbh





