Added information about fast DB accessors

This commit is contained in:
Abbas Abou Daya 2017-11-05 11:31:46 -05:00
parent b53d252fb4
commit 066ad7f675

View File

@ -77,7 +77,15 @@ Do note that:
With abilities, you can specify the context of the feature. If you only want the command to be available for groups, then you can set `.locality(GROUP)`. If it is a very sensitive command that only admins should have access to, then set `.privacy(ADMIN)`. With abilities, you can specify the context of the feature. If you only want the command to be available for groups, then you can set `.locality(GROUP)`. If it is a very sensitive command that only admins should have access to, then set `.privacy(ADMIN)`.
This allows for abilities with protection guarantees on who can use it and where it can be used. This allows for abilities with protection guarantees on who can use it and where it can be used.
The following is a snippet of how this would look like with the plain basic API. All abilities have access to the following important methods.
* `users()` - Returns a map of ID -> User
* `userIds()` - Returns a map of Username -> ID
* `blacklist()` - Returns a set of IDs of banned users
* `admins()` - Returns a set of IDs of bot administrators
`users()` and `userIds()` accumulate data of all the users who have contacted your bot. Even when a user changes some information (like his or her nickname), the bot will be able to detect the change and update its DB accordingly.
The following is a snippet of how this ability would look like with the plain basic API.
```java ```java
@Override @Override
public void onUpdateReceived(Update update) { public void onUpdateReceived(Update update) {