mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-04-30 06:37:29 +00:00
refactor(example): say_hello 命令添加用户的账号信息.
补充账号信息, 方便查(为了测试). P.S. 其实这个 Commit 应该算作 feat, 但这个是示例扩展, 所以就改成了 refactor.
This commit is contained in:
parent
22a824377a
commit
de83d2c3d3
@ -23,7 +23,12 @@ public class SayHelloExtension implements AbilityExtension {
|
|||||||
.info("Say hello to you.")
|
.info("Say hello to you.")
|
||||||
.privacy(Privacy.PUBLIC)
|
.privacy(Privacy.PUBLIC)
|
||||||
.locality(Locality.ALL)
|
.locality(Locality.ALL)
|
||||||
.action(ctx -> ctx.bot().silent().send("Hello! " + ctx.user().getUserName(), ctx.chatId()))
|
.action(ctx -> {
|
||||||
|
String msg = "Hello! " + ctx.user().getUserName() +
|
||||||
|
" ( " + ctx.user().getId() + " ) [ " + ctx.user().getLanguageCode() + " ]" + "\n" +
|
||||||
|
"Current Chat ID: " + ctx.chatId();
|
||||||
|
ctx.bot().silent().send(msg, ctx.chatId());
|
||||||
|
})
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user