#Just did a test with something, pnpm run
1 messages · Page 1 of 1 (latest)
Alright I've got some message errors in the console, not sure I understand them though
findByProps didn't find anything. it's better to use DevCompanion to test functions such as findByProps right inside vscode, without having to build the app
I know, that's what I did but the error message is too cryptic
It just said Find bad: Failed to find: Found more than one result! Make this filter more specific
But the problem is that I don't know what it gets so I don't know what I could filter more
So I tried to build, to print the different results and see which ones I wanted to keep
I'm still learning so i'm tinkering, thanks for the help
you need to specify more props in your function, example below
to find the right module you can use sources tab in developer menu and ctrl + shift + f to search for props across all modules
tbh i'm propably doing it the wrong way but...
I had this part of a script that ran in the console : const api = Object.values(wpRequire.c).find(x => x?.exports?.tn?.get).exports.tn;
And i'm trying to recreate this api variable using const api = findByProps("get", "post", "put", "patch", "delete"); which doesn't work
thanks, I will look at this
are you trying to get object that you can use to make requests to discord api?
you can use RestAPI object from webpack/common
Yes
I'm trying to translate this script into a plugin. I wouldn't be able to code it myself but I understand how it works so I'm just going line by line
by the way, to get the store objects, you can use findStore function or sometimes you can just import it from webpack/common or other sources (one of userplugins i made imports a store from another plugin, lol)
thank youuu
How can I find this ifno apart from asking people ? are there documentation somewhere ?
the only documentation i found is just about creating like the base of a plugin, sadly
if you have some feature you want to make in mind, you can look for plugins that do something similar and see how it's implemented there
that's how i learn at least
that's the only one i found too ðŸ˜