public interface Bot
| 限定符和类型 | 方法和说明 |
|---|---|
@NotNull net.mamoe.mirai.contact.Friend |
getAsFriend()
Get the bot itself as a friend
|
@Nullable net.mamoe.mirai.contact.Friend |
getFriend(long id)
Get the friend with special id
|
@NotNull net.mamoe.mirai.contact.Friend |
getFriendOrFail(long id)
Get the friend with special id
|
@NotNull List<net.mamoe.mirai.contact.Friend> |
getFriends()
Get all the friends
|
@Nullable net.mamoe.mirai.contact.Group |
getGroup(long id)
Get the group with special id
|
@NotNull List<net.mamoe.mirai.contact.Group> |
getGroups()
Get all the groups
|
long |
getId()
Get the id of the bot
|
net.mamoe.mirai.Bot |
getNativeBot()
Get the Mirai Bot Instance
|
boolean |
isDefaultBot()
Indicate this is the default bot
|
boolean |
isOnline()
Indicate the bot is online
|
boolean |
login()
Login the bot
|
boolean |
logout()
Logout the bot
|
boolean |
relogin()
Relogin the bot
|
@NotNull net.mamoe.mirai.Bot getNativeBot()
boolean relogin()
boolean login()
boolean logout()
@NotNull @NotNull net.mamoe.mirai.contact.Friend getFriendOrFail(long id)
id - the friend idNullPointerException - throw if the friend with special id does not exist@Nullable @Nullable net.mamoe.mirai.contact.Group getGroup(long id)
id - the group id@Nullable @Nullable net.mamoe.mirai.contact.Friend getFriend(long id)
id - the friend id@NotNull @NotNull List<net.mamoe.mirai.contact.Friend> getFriends()
@NotNull @NotNull List<net.mamoe.mirai.contact.Group> getGroups()
boolean isOnline()
@NotNull @NotNull net.mamoe.mirai.contact.Friend getAsFriend()
long getId()
boolean isDefaultBot()
Copyright © 2022. All rights reserved.