BotKit by Fedify
We are designing an API to support manual accept/reject of follow requests in #BotKit. Which of the below two approaches seems better?
Returning true
or false
in the onFollow
event
bot.onFollow = async (session, follower) => {
// Accept follows requests from non-bot accounts:
return follower instanceof Person;
};
Accepting a followRequest
object as the third parameter in the onFollow
event and calling the accept()
or reject()
method
bot.onFollow = async (session, follower, followRequest) => {
// Accept follows requests from non-bot accounts:
if (follower instanceof Person) await followRequest.accept();
else await followRequest.reject();
};
Option | Voters |
---|---|
Returning true or false in the onFollow event | 5 (63%) |
Accepting a followRequest object as the third parameter in the onFollow event | 3 (38%) |