style(extension): 为 getBotToken 设置 SuppressWarnings 用于忽略无关的弃用警告.

根据文档说明, 弃用仅针对重写方法, 对方法的使用并无大碍.
This commit is contained in:
LamGC 2023-02-24 15:53:32 +08:00
parent 8b76a9aa9b
commit 2db0b78962
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

View File

@ -24,7 +24,9 @@ public class AbilityBots {
* @return 返回 AbilityBot 的账户 Id.
* @throws IllegalArgumentException AbilityBot botToken 格式错误时抛出该异常.
*/
@SuppressWarnings("deprecation")
public static long getBotAccountId(BaseAbilityBot bot) {
// 根据文档说明, 弃用仅针对重写方法, 使用该方法并无大碍.
String botToken = bot.getBotToken();
Matcher matcher = botTokenPattern.matcher(botToken);
if (!matcher.matches()) {