英文:
How to get user token using better discord
问题
我正在改进我的BetterDiscord插件。我的插件将更新用户在其个人资料中的“关于我”内容。要更新“关于我”内容,我需要向Discord API 发送请求,但为了发送此请求,我需要一个用户令牌。问题:如何在我的BetterDiscord插件中获取用户令牌?
我尝试了很多方法,但未找到任何信息。如果您提供解决方案或可以找到它的来源,我将非常感激。
英文:
I am making my plugin betterdiscord. My plugin will update the user's "about me" content in their profile. To update the "about me" content, I need to make a request to the discord API, but to make this request, I need a user token. Q: How do I get a user token in my betterdiscord plugin?
I tried a lot but couldn't find anything, if you give a solution or sources where it can be found, then I will be very grateful
答案1
得分: 1
直接使用您的令牌是冒险您的帐户的一种好方法。还有其他方法可以以编程方式更新关于我的信息,而不涉及获取令牌。
例如,您可以直接获取 dispatch 函数并使用它来更新个人简介:
const dispatch = BdApi.Webpack.getByStrings("USER_SETTINGS_ACCOUNT_SET_PENDING_BIO", {searchExports: true});
dispatch("新简介");
英文:
Using your token directly is a good way to risk your account. There are other ways to programmatically update the about me that does not involve grabbing the token.
For example you can grab the dispatch function directly and use it to update the bio:
const dispatch = BdApi.Webpack.getByStrings("USER_SETTINGS_ACCOUNT_SET_PENDING_BIO", {searchExports: true});
dispatch("New bio");
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论