如何使用Better Discord获取用户令牌

huangapple go评论142阅读模式
英文:

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");

huangapple
  • 本文由 发表于 2023年6月22日 10:54:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/76528324.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定