java - 构造函数 JDABuilder(AccountType) 已弃用
问题描述
在 JDA 中,我不断收到错误“构造函数 JDABuilder(AccountType) 已弃用”
package diaduck.Playground;
import net.dv8tion.jda.api.AccountType;
import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.JDABuilder;
public class Main {
public static JDA jda;
public static void main(String[] args) {
jda = new JDABuilder(AccountType.BOT).setToken("**************************").buildAsync();
}
}
解决方案
This constructor has been deprecated for well over a year now. The documentation tells you exactly why and what needs to be done. In fact, this constructor no longer even exists on the latest version of JDA.
The migration guide tells you to use the new factory methods instead. Read more on GitHub
推荐阅读
- python - 当我通过 Python 打印文件时,文件看起来不同
- maven - pluginManagement 干扰了 shade 插件
- geometry - 如何描述两个平面之间的二面角?前视图和侧视图包含的交叉角?
- python-3.x - 使用 if 语句检查用户输入中的字符串总是最终返回相同的输出。如何修复?
- c# - 子对象属性更改触发父母 DependencyPropertyChanged 回调?
- jquery - 当孩子是班级时,如何访问 $(this) 选择器的孩子?
- typescript - 计算机死机后出现与 Jasmine 相关的随机错误
- python - 在保存之前确定 jpeg 和 png 图像的图像大小
- javascript - 通过扩展将 db 搜索的结果写入动态(可能是有角度的)页面
- javascript - 在 JQuery 中克隆/取消克隆