#development
1 messages · Page 1582 of 1
maps are generally easier to understand when you first start out
as you don't have to write everything yourself
where can I find the docs for map caching?
There are micro optimizations you can make to make raw Object K,V access times faster than Maps.
Any JS Collection tutorial Instellate
Collections are a discord.js feature
What the fuck?
Other libs may provide their own Map extensions
Lol
Discord.py has inbuilt features for it
The Map object holds key-value
pairs and remembers the original insertion order of the keys.
I code in JS
I am reading that rn
Ohhh
Performs better in scenarios involving frequent additions and removals of key-value pairs
Which cooldowns are, definitely
Me python! My frontend sucks
Objects: Not optimized for frequent additions and removals of key-value pairs
=> Collection (Map) better for cooldowns
And no, Collections are not a discord.js specific feature
It is
why is it not
Ah, not specific yes
Other libs have their own collections too
they all extend map
Triggers me everytime when people think Nodejs bot = discord.js
usually the way to do it is to create a symlink, that way if one is updated, the other is automatically updated as well, since its linked to the same file
google how to create symlinks in linux
In this context we're obviously talking about discord.js, stop acting like a smart-ass
Also, this is maps
this is objects
100k iterations
How are we obviously talking about discord.js?
Just because that is the only discord JS wrapper you know doesn't mean everyone is automatically talking about discord.js
The Map object holds key-value
pairs and remembers the original insertion order of the keys.
Making a test meant for objects and using it for a map is obviously going to perform worse
how do i learn typescript
Assuming you already know JS, https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html
https://www.typescriptlang.org/docs/handbook/ by reading, a lot
Find TypeScript starter projects: from Angular to React or Node.js and CLIs.
aight thanks 😄
yeah i do know js i just wanna move on TS everyone says it is better
Gotta go back to work, talking to a brickwall anyway
collections are not js
How is the test meant for using objects... both have the same general use-cases. The only pro with maps is that it also keeps track of the size and also the order. In the case for cooldowns, the order and the size of the map is not important
Maps are js
I'm not sure if this guy is trolling or just full of himself
speaking of collector, i had to make my own collectors for reactions and messages
fun™️
again
👋
Collection !== Map
Yes we are not noobs
Collection extends Map
Still doesn't mean that collections are a discord.js specific feature
And still fact that maps perform better for frequent changes
And that's what the test showed.... 100K insert operations, objects 4ms, maps 10ms

Only insert?
yes Collection extends Map, but that doesnt mean you can call Maps Collections, unless you specifically use Collections from discord.js or install them as a separate module. furthermore, Collections implement many features from Arrays that Maps dont have, if you use those features, you are not getting Map performance
It's like throwing rocks at a tank
Other libs also implement collections, Eris for instance
and Collection !== Map
Basically all
yes, its not discord.js but it is something you have to install separately
Collection is not built in
Map is
Nobody ever said collections are maps
hey, could anyone tell me how i would fix my code so that the program.namelmao changes every 1 second (cuz now it sends the same string every time).```
private static Random random = new Random((int)DateTime.Now.Ticks);
private string RandomString(int size)
{
StringBuilder builder = new StringBuilder();
char ch;
for (int i = 0; i < size; i++)
{
ch = Convert.ToChar(Convert.ToInt32(Math.Floor(26 * random.NextDouble() + 65)));
builder.Append(ch);
}
return builder.ToString();
}
// get 1st random string
string Rand1 = RandomString(4);
// get 2nd random string
string Rand2 = RandomString(4);
// creat full rand string
string docNum = Rand1 + "-" + Rand2;
Program.namelmao = docNum
}```'c# btw
We are literally just telling this guy that maps perform better for cooldowns
Because every lib has collections and we are talking about discord bot cooldowns
not every lib has collections lmao
Tested performance of deletion (delete obj[x] vs obj.delete(x)) And they are the same
But they all differ if we're talking about performance
well he was going on and on about not being collections not being about discord.js, implying they exist in non-discord libraries
No?
Yeah he said "Google JS Collections tutorial"
I said collections are not d.js specific
anyone here knowing c#?\
Yes, because he is making a discord bot
With a JS lib
And all js libs I know of have collections
@pale vessel
again, that implies "JS LIBS"
aka, non-discord libs
Wow im so incredibly sick of this conversation
Googling "JS Collections tutorial" does not yield any tutorials which explain how discord.js Collections work
you started it lmao
you started it
wdym
oh lmao
ah yes
well now when people say "collections" i won't think of maps anymore then
Mongo.db Collections are also a thing
how about we all think of Pokemon collectible cards when people say collection? thats a neutral stance 
I can literally call any data structure a Collection of something
1 month later, still no reply on my intents application 
@dusky sundial if its indeed been a WHOLE month, ask in discord.gg/discord-developers
it shouldnt have taken that long
well now it does take more than a month
discord is full of request they have said
just check on your tickets
I mean it says there has been some activity on it, but no replies and still has the "open" status so idk what's going on
if you didnt receive an email regarding it, ask in that server
I'll try that, thank you
I wonder what exactly wanted to tell here

Does someone know why I can not connect my Yt account with my discord?
why not
hey umm
im trying out oauth
and i keep getting invalid grant
error
const code = req.query.code;
console.log({ code })
const payload = {
client_id: process.env.DISCORD_CLIENT_ID,
client_secret: process.env.DISCORD_CLIENT_SECRET,
grant_type: "authorization_code",
code,
scope: ["email", "guilds", "identity"],
redirect_uri: "http://localhost:5010/discord"
}
const accessToken = await axios.post("https://discord.com/api/oauth2/token", payload, {
headers: {
"content-type": "application/x-www-form-urlencoded"
}
});
in nodejs..
the syntax on the doc is python, i dont think there's much change to it tho
i tried with camel case as well
clientId
same error
maybe i should remove the form urlencoded?
http://localhost:5010/discord?
It needs to be a valid URL and you must have it set in developer portal
localhost?
yep
Alright this is quite a complicated issue to explain.
I have this bot wich I made a "custom" db handler for wich basically translates db.get() to an sql query and returns the value this allows me to ensure data so I have less data saved. Now I'm accessing the database from a different bot as I need to get some data from there, I am able to access the sqlite file but when I query a SELECT * FROM MoneyMoves the data returned is [] even though there is alot of data in there anyone knows why?
they show localhost even in their docs and tuts
i tried removing the header no luck
Does axios automatically encode the object you send to query params
Because it needs to be in the form of a string, not JSON
So it doesn't...
huh
for post request the data will obviously go in the body xd
req.body
that ?client_id= is a get request
okay, lemme change the url
the body needs to be in the "x-www-form-urlencoded" format, that's why you provide "content-type": "application/x-www-form-urlencoded"
you are still sending the body, but you aren't sending json
no, you pass the query params to the body
why is axios so confusing
im confused
this is why i use node-fetch
body: `client_id=${yourId}&...`
node-fetch is life
preach
blasphemy, axios is life!
Why don't lazy fetch doe
how can axios be confusing??
opps, sorry did not see your ping that time and thanks 😊
hi, guys, anyone know how get user language? Python
that's impossible unless you ask them and then save it
let's be honest here
Asking them is the best way
Btw I got a way to reduce the load on bot reviewers
Just use a spam filter for the bot description
they most likely won't know how to use auth
@shrewd sparrow no
Because it can falsely check
And it takes us about 10 seconds to detect spam ourselves
Ok thx
Erm.
Anyways
10 seconds is time wasted
And when you multiply that by a ton of bots
It’s not cash money
And you can’t falsely check the ‘aaaaaaaaaaaaaa’s and ‘eeeeeeeeeeeeeee’s can it
The word length is also a factor
Just make the spam check more loose
even if it gets filtered out
and the end user resubmits
it does not mean that the description isn't going to be garbage and unhelpful
Selam Türkler birlikte bir bot kodlamak isteyen varsa seve seve işbirliği yaparım bot örneklerimi görmek isterseniz DM. :)
english only in this channel
is dis a rule?
yes
show me pls

lIkE tHiS?
thx bro
i said
anyone want to make a bot with me ?
what do I choose for my bot? witch one is better?
buy a vps
its in progress..
Yeah
I did
it says tehy are reviweing the order
but for now I need to host it somehow...
reviweing
there's no such thing as reviewing an order unless you bought and actual physical server and you're waiting for it to ship lol
it's a simple charge
well... It says they are "checking" it, and are going to get the money off the paypall account after they find some space for me..
i'm guessing it's on google
I think you'll get scammed
ss
its this
but it helps
it doesn't
because the bot description needs to get reviewed anyways to see if it provides useful information or not
automatic spam filter does nothing for bot reviewers
only annoys the end user
well vultur is a well known provider but I've never heard of them doing that kinds of checking
There are some people that puts their bot's code inside the description lmao
we'll never see that
unless we turn into mods or bot reviewers
I kinda want to be a bit reviewer just to see what un declined turkish bots look like
it's amusing how most of low quality bots are turkish
dbots outright started banning turkish bots from their service for this reason lol
saves time tho
The actual question here is: why are there so many turkish bots
...it doesn't
yes
I don't see a problem with turkish people, but most of them don't even try with their bots
if at least they tried things would be so much better
the end user is just going to resubmit the bot with a description that isn't picked up by the spam filter
they could also take an online course and improve their english
but it deters some ppl and the reviewers dont need to log another declined message
cuz let's be honest, not even mine is that bad
is there a way to make this shorter? (apart from using getElementsByClassName or id or by tag name)
I get what you say, but if it was actually a good idea, don't you think they would've done that already?
who knows
for loop and then just include the number in the string
I'm using esprima with typescript and when I import it it's just undefined. Really weird. I see the typings just fine, but:
import Esprima from "esprima";
console.log(Esprima)
logs undefined.
use a loop and increment the number at the end, then store them on an array or something
they make the online/offline random now too
ye, that doesnt work with addEventListener
only adds the listener to the last element
it it's called exprima why are you importing exprima?
what? it does work
I've donde that countless times before
You probably do it wrong then
oh
just try everything and if it doesn't work come're and show your code
I tried importing other npm modules and they worked fine
//pseudo
elements = []
for(i = 0; i < 10; i++)
elements.push(getById(`button-${i}`))
this will store all of your elements @dire obsidian
if your only goal is to add event listeners
you can avoid the array altogether and just call addEventListener in the for loop
a cleaner way to do this is to apply a class on your buttons named something like, i don't know, btn
and then you can do this https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
k
@cinder patio have you tried using the require statement instead of import?
I created a new project without typescript and it works just fine

{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"declaration": true,
"outDir": "./dist",
"rootDir": "./src",
"removeComments": true,
"downlevelIteration": true,
"strict": true,
"noImplicitAny": true,
"alwaysStrict": true,
"moduleResolution": "Node",
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
},
"exclude": [
"./test/",
"./dist/"
]
}
My tsconfig.json
oh okay. So it does compile to commonjs
I fixed it
I had to import it like this import * as Esprima from "esprima"; cause it has no default exports
just use deno and run ts natively
I still think you should try to use require since import/export default was the worst thing to happen for esm/ts
without transpilling it
deno is a meme
lol
deno also transpiles it, it just saves the js files somewhere where you won't see them
oh really?
a guys
Yeah. There is no runtime interpreter for TypeScript afaik since TS is built off JS
I am the leader but idk why I cant invite it
Seems like someone hasn't verified their bot
?
How can I split it to fit 1024 letters length inside the Array?
any expaination
explain. You want each character to be an entry in the array with a max of 1024, or you want each entry to be <= 1024?
1024 seems a bit arbitrary though
he probably wants an array of string, each element with <=1024 characters to fit in one field
aren't embed field max characters 2000
description and footer only
field 1024
mmm. I see
you need to verifiy
@indigo folio wtf
the bot owner needs to verify the bot
i thought that was you
oh xd
@pale vessel can you give advice
use reduce ig
discord.js also has a utility method for splitting strings into chunks
does this even work for arrays
ah there's char
you can join the emojis by space for example and set char to " "
Okay so
im making a simple ban command but the permissions wont work for some reason.
Lol
i will try thanks.
thx
show your code
there is split method in TextChannel.send()
GoogleFued mine?
he wants to use it for embeds
yes
@client.command() async def ban(ctx, member : discord.Member, *, reason=None): if not ctx.author.permissions_in(ctx.channel).ban_members: await ctx.send("uh-oh! Looks like you're missing permission to use that command!") return await member.ban(reason=reason) await ctx.send(f"{member} Has Been **Banned**! For {reason}") print("Someone Just Dropped The Ban Hammer!")
So I made this simple ban command, but it still allows anyone to ban people.
uh oh, python!
Yea
gotta call norizon or shiv 
I'm bad at it too, thats why i have an error. :)
okay I don't know anything about discord.py, but this ctx.author.permissions_in(ctx.channel).ban_members doesn't make much sense because "Ban Members" is not a permission which depends on channels
i also tried
@client.command() @commands.has_permissions(ban_members = True) async def ban(ctx, member : discord.Member, *, reason=None): await member.ban(reason=reason) await ctx.send(f"{member} Has Been **Banned**! For {reason}") print("Someone Just Dropped The Ban Hammer!")
it's fine i think
interesting
same goes for discord.js
ah
so?
wait for someone who has more py knowledge
Mk
(node:7644) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Access
Nice, the mute command now throws this error
and I haven't touched it
that's when it sends Missing Permissions
not when Missing Access
cuz the bot has permissions 100%
me?
*mute
Add the decorator @commands.has_permissions(ban_members=True)
yeah maybe
wdym?
lmao im new to python
Like @client.command()

that's not the problem
but there is one for @commands.has_permissions ??
Well then add what I said to it
Yes
As long as you import it
from discord.ext import commands
i have 'from discord.ext import commands'
Then add this
i have that.
Uh huh
this is the code?
@client.command() @commands.has_permissions(ban_members = True) async def ban(ctx, member : discord.Member, *, reason=None): await member.ban(reason=reason) await ctx.send(f"{member} Has Been **Banned**! For {reason}") print("Someone Just Dropped The Ban Hammer!")
and it doesnt work
:/
wdym
members can still ban higher ups.
just checked as Admin, nothing working
members have ban perms?
no
no idea then 
you mean mods banning admins?
They have that perm then
like a member who just join can run the command and ban someone
i just checked
they dont
oh wait it works
Knew it

so how do i make it output a message with this new code
Output what message
should I request the intents at startup?
Oh you want an EH
i just write under it? await ctx.send("Uh-Oh! You are missing permissions to use that command!)
and the quote at the end
probably not at startup
@ban.error
async def ban_error(ctx, error):
if isinstance(error, commands.MissingPermissions):
handle_error()
else:
raise error```
mobile so indentation is fucked
lol
it's the Dev version, only in 2 servers, I guess I don't need them

wait a minute
If you copied it straight youd get an indentation error
Which is a red sqiggly line
you can just unindent and reindent
oh
umm... Im using heroku first time.... And idk how to add my files to it so it could host it..
Where do I type that?
@client.command()
async def ban():
ban()
@ban.error
async def ban_error():
handle_shit()```
in file terminal?
Choose a deployment method and follow the steps
handle_error() is a placeholder function so make your own or move it
deployment like GitHub?
If your bot's source code is in a github repo, yes
alr. Thanks
if x:
Please_learn_python()
else:
Please_learn_python()```
-_-
do you see how it works

Uncaught SyntaxError: Unexpected identifier
i did put it with the if command
in if statement for an else to work Python needs an if clause
What you did is nest an else INTO an if
Thus us a learn python moment but ill spoonfeed
which is not what's supposed to be done
lmao
good one
@ban.error
async def ban_error(ctx, error):
if isinstance(error, commands.MissingPermissions):
handle_error()
else:
raise error ```
poor indents
Don't spoonfeed
There are times when if you don't spoonfeed you'll be helping for hours
@mellow kelp just put a lot of catches, just found it's Bad Gateway
A simple example:
x = 5
if x == 5:
print("x is 5")
else:
print("x is something that's not 5")
kekw
agh, now it's not
my head's a mess rn
how is it missing perms, if it has Admin perms!?!?!?

DiscordAPIError: Missing Permissions
at RequestHandler.execute (C:\Users\ragsf\Desktop\Gumball-and-Penny\node_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (internal/process/task_queues.js:93:5) {
method: 'put',
path: '/guilds/738540548305977366/members/597908134698156035/roles/754433915610988635',
code: 50013,
httpStatus: 403
}
git commands won't work in powershell
they work
VSC?
git just isn't added to path
You need to add it to path
how?
admin perm doesn't bypass role hierarchy
Thoughts from Ryan Hoffman, an experienced team leader, software architect and developer.
IT'S A LOWER MEMBER
i smell copied code from 10 miles away
chill out
bruh
oh dear
I can't, aaaaaaaaaaaaa
`- You can not moderate (kick/ban/nickname) a target that has a higher role than your highest role or is the guild owner
- The ADMINISTRATOR permission does not skip this check
- You can not modify (edit/add/remove) roles that are higher than your highest role
`
@quaint wasp your token is in the github repo
fake.
the guy only has 2 roles, these are under every roles the bot has
then it wasn't reset?
check it again
I dont own github..which I think I need to to make a path to it.
I don't own github either
dont u have to like... have it in ur files?
Red: Bot, Green: the target
You add the path to git
what is target
the guy I am trying to mute, for example
has both roles
are you trying to add No.1 
OK TY
Muted, the role name, was above everything
lol
I got many files... but which one I do?
stooopid me
just a question @summer torrent, to check every role one member has in a server, do I need GUILD_MEMBERS?
uhh
idk
hard question/
i think yes
Where you installed git... aka, where the git executable is
I don't think it's necessary
I never did tho..
isn't it caches when your bot joins
I don't, at least to check that one role called 'Muted'
so basically you can get from them cache
Then install git
yeah, everythings workin without them
wait
wait, shouldn't you already have git if you have a bot repository
I got github desctop
well there you go
you'll need to install git if you wanna use it from powershell, cmd etc
ye
in discord.js how do you get the new and old content of an edited message
messageUpdate event
iki
but if a wanted to put it in an embed
what would i pass in
message.content.updatedContent?
no
That doesn't have sense, there two contents ._.
wdym
I mean you can't put content 2 times
const embed = new MessageEmbed()
.setTitle("Action #2 - Message Edit")
.addField(`Channel`, `<#${message.channel.id}>`)
.addField(`Author`, `<@${message.author.id}>`)
.addField('Edited Content', message.content.)
.setThumbnail(message.author.displayAvatarURL())
.setColor(0xcc5353)
.setTimestamp()
return message.guild.channels.cache.get(modlog.channel).send(embed)
under Edited Content what do i put
and i would like to make a column called original content
???
@summer torrent are you alive?
???

bc
show full code
const { MessageEmbed } = require('discord.js')
const db = require('quick.db')
module.exports = async (client, message) => {
if (message.partial) await message.fetch()
let modlog = db.get(`moderation.${message.guild.id}.modlog`)
if (!modlog) return
if (message.channel.id === modlog.channel) return
let toggle = modlog.toggle
if (!toggle || toggle === false) return
const embed = new MessageEmbed()
.setTitle("Action #2 - Message Edit")
.addField(`Channel`, `<#${message.channel.id}>`)
.addField(`Author`, `<@${message.author.id}>`)
.addField('Edited Content', message.content.edits)
.setThumbnail(message.author.displayAvatarURL())
.setColor(0xcc5353)
.setTimestamp()
return message.guild.channels.cache.get(modlog.channel).send(embed)
}```
how would i do it
it is something like (client, oldMessage, newMessage)
oh
Ya
you don't have to compare true to true
That's unnecessary
bc it's gonna return true and it's going to be the exact same thing
that's just a beginner mistake
wwhat
yep
there you have if (<bool> === false) and if bool is false then it'll be true, it's the same as if (!<bool>)
oh
It's like using if (message.content == "hi" || message.content == "hi")
Both checks the same thing
yeah
I think it's instant and cached
quick.db is a json db
what does it use to write to file?
sqlite
quick.db is not a json db, at least technically speaking
yeah
quick.db?
yes
who me
wat tests
find how much it blocks
what
isn't console.log also blocking?
yes
is process.stdout.write blocking?
kinda
can you help or not
how do i get the edited content of the message
if i edit the message
djs?
fetch the message?
djs
<Client>.on('messageUpdate', old, new) iirc
or listen to messageEdit events
i am
i am
what you got?
const { MessageEmbed } = require('discord.js')
const db = require('quick.db')
module.exports = async (client, message) => {
if (message.partial) await message.fetch()
let modlog = db.get(`moderation.${message.guild.id}.modlog`)
if (!modlog) return
if (message.channel.id === modlog.channel) return
let toggle = modlog.toggle
if (!toggle) return
const embed = new MessageEmbed()
.setTitle("Action #2 - Message Edit")
.addField(`Channel`, `<#${message.channel.id}>`)
.addField(`Author`, `<@${message.author.id}>`)
.addField(`Original Message`, message.content)
.addField('Edited Content', message.content.upda)
.setThumbnail(message.author.displayAvatarURL())
.setColor(0xcc5353)
.setTimestamp()
return message.guild.channels.cache.get(modlog.channel).send(embed)
}```
2 events
yes its blocking, just tested
what
module.exports = async (client, message) => {
oh
but interesting is
you only got 2
what makes console.log slow is newlines
so it would be
you need the new message to compare the old to the new one
of course, you need to adjust your handler too, to send all 3
client, new and old
is there a way to log without blocking?
module.exports = async (client, oldMessage, newMessage) => {
doesnt look like it
it only sends 2 params my dude
you're adding a third yourself
which is client
which isnt even needed
cuz its inside message already
anyone with knowledge in Firebase?
take a good guess what oldMessage and newMessage is
oh
yeah @quartz kindle I tested and the bot didn't do anything
@quartz kindle if you make an async function to log and don't await it, its not blocking it is? or is it blocking but just a bit after
aight, time for booze, brb
and it seems its not fully blocking
poggers bro?
im getting chick-fil-a today
Tim youve had chidk-fil-a?
right
o its pretty good fast food
aight, im back
ty ❤️
ok so
how interesting is it?
oh wait a minute im dumb.
i have that
you mean JS logging?
yes
tysm it works @opal plank
Js logging is non-blocking technically
techincally
no problemo
but at the same time it isnt
its a JS micro task to the event loop
🙂
https://www.youtube.com/watch?v=cCOL7MC4Pl0 is a good video for it
Have you ever had a bug where things were happening in the wrong order, or particular style changes were being ignored? Ever fixed that bug by wrapping a section of code in a setTimeout? Ever found that fix to be unreliable, and played around with the timeout number until it kinda almost always worked?
This talk looks at the browser's event loo...
particularly in this case 28:00 timestamp shows how the behavour of logging works
oh shit i forgot to turn redis on
thats
1 sec
really good
Okay, so I tried making a simple unban command, but it does not unban the user.
Code:
async def unban(ctx, *, member):
banned_users = await ctx.guild.bans()
member_name, member_disc = member.split("#")
for ban_entry in banned_users:
user = ban_entry.user
if(user.name, user.discriminator) == (member_name,member_disc):
await ctx.guild.unban(user)
use ``` not `
sorry
all good
lol
redis
idk why but suddenly my console.log became 10x faster
I require redis to start my bot but don't actually use it anywhere kekw
bit schewpit
lmao how do i make it so it has color functions
im gonna start porting my stuff to redis very soon
innit @misty sigil
how do i make it have the color functions
then removed it all
```py
oh
Have you got any errors
Okay, so I tried making a simple unban command, but it does not unban the user.
Code:
@client.command()
async def unban(ctx, *, member):
banned_users = await ctx.guild.bans()
member_name, member_disc = member.split("#")
for ban_entry in banned_users:
user = ban_entry.user
if(user.name, user.discriminator) == (member_name,member_disc):
await ctx.guild.unban(user)
js for javascript
bruh
literally copy this
gotta return
```py
thing
```
cant have a space or anything after the py
there we go
print('hi')```
and lemme check
i finally got a hub for my working pc
hub?
yeah, usb hubs
ah
1 port turns into like 10
I have like 6 usb 2.0 on my pc
oh wait it works now
i got 4, but now i got 10
pog
this one i got has 7
ig yea
ggez
yea
I have my mouse and keyboard in the mouse and keyboard slot, the mic and bluetooth on the 2 red usb ports, and then my heaphones on my front port
what you confused about?
how local functions work
whats a local function?
👆🏻
its when you export a function and expect it to be ran in the scope it was originally declared in
rather than somewhere else
the issue is that i cant bind it
cuz i want it to get everything on my index
unless i attach them somewhere, i cant bind them
hmm
@quartz kindle hilp
so you want index and original file?
yea if you can
how would i make the command "Banlist"? Showing all the banned users into the chat?
okay thanks
bro
oh lmao
circled the wrong thiing ontop, but its index.ts
variable isnt acessible in that scope
even though its declared in there
though payload, which is passed as a param to the function, doesnt
gimme a min I can't focus while in class
and its not an object, so i cant bind it
this seems like a fun problem
if i were to bind it, it'd attach on globals or process
@opal plank what's EvalCode, and how do I do that?
I see the problem
do what?
hmmm
like, I always restart the Dev bot, cuz I put a console.log() in the middle of the command
but there I see you can do that without restarting anything
whenever i execute the banlist command, it comes up with this.
thats using eval() function
don't u just run a command for the bot to log something you want?
eval is native from node
Code:
@client.command()
async def banlist(ctx):
await ctx.send(f'Here Are The Users Who Have Been Banned! {ctx.guild.bans}')
hmm
so you can simply run eval('what to eval here')
wut
pass it on your message command
what happens if you bind(this)?
gonna do a reserach so
tim tried that sometime last week
can someone help me?
idk py, so not from me
I barely know js
similar
i dont get it, what it happening?
trying to eval stuff from index
thats it
so i get all variables in the index
but i can only access the params passed
I never said anything
i wish i could slap you rn
lol
How do you eval the code
hi
just eval()
depends
plus a ton of other useless shit
but the core is that that function simply appends the arguments onto eval() func
I tried making a banlist but whenever i execute the command this happens.
hold on
Code:
@client.command()
async def banlist(ctx):
await ctx.send(f'Here Are The Users Who Have Been Banned! {ctx.guild.bans}')
Sorry, I don't know python ^-^
Its a list, use len()
ohhh
if you send the thing directly it'll send the reference
So eval doesn't have access to payload and args?
omg im dumb
it won't send the actual data
cuz it's an object
you gotta do some fuckery which I can't help you with rn
it does, it doesnt have access to variable even though its in the same scope (except aparently not)
ooh
the point is to get eval to be executed locally so it has access to my variables in the index.ts
python is kind of a shot at your own feet, most of it's syntax differs so much from other languages, you get confused
bruh
hello
you don't actually get confused
wait where do i put len()?
@mint mist where do we put len()?
the fact that i've been listening to whip a tesla while attempting to code is not helping me focus at all
lmao
oh yg
what does the genshin utils bot do
ey pog 1800 servers
anyway where do i put len() ???
basically everything a genshin user will ever need
and more
click me if you wanna see more :p
if it doesn't give me primogems then I don't need it
click the link in my status
hmmm
the bottom link has everything
you actually like genshin or is it a joke
i do
wait no im thinking of gacha life LMFAO
@opal plank yo
yo


