mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-07-01 12:57:24 +00:00
style(extension): 为 getBotToken 设置 SuppressWarnings 用于忽略无关的弃用警告.
根据文档说明, 弃用仅针对重写方法, 对方法的使用并无大碍.
This commit is contained in:
@ -24,7 +24,9 @@ public class AbilityBots {
|
|||||||
* @return 返回 AbilityBot 的账户 Id.
|
* @return 返回 AbilityBot 的账户 Id.
|
||||||
* @throws IllegalArgumentException 当 AbilityBot 的 botToken 格式错误时抛出该异常.
|
* @throws IllegalArgumentException 当 AbilityBot 的 botToken 格式错误时抛出该异常.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public static long getBotAccountId(BaseAbilityBot bot) {
|
public static long getBotAccountId(BaseAbilityBot bot) {
|
||||||
|
// 根据文档说明, 弃用仅针对重写方法, 使用该方法并无大碍.
|
||||||
String botToken = bot.getBotToken();
|
String botToken = bot.getBotToken();
|
||||||
Matcher matcher = botTokenPattern.matcher(botToken);
|
Matcher matcher = botTokenPattern.matcher(botToken);
|
||||||
if (!matcher.matches()) {
|
if (!matcher.matches()) {
|
||||||
|
Reference in New Issue
Block a user