feat: add friend check module
This commit is contained in:
parent
ad537d7d1f
commit
869f460197
1 changed files with 10 additions and 8 deletions
|
@ -5,28 +5,30 @@ class Friend(ModuleInterface):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.name = "Friend"
|
self.name = "Friend"
|
||||||
self.regex_pattern = None
|
self.regex_pattern = ".*TestAreWeFriend"
|
||||||
|
|
||||||
self.funcs["dec_like"] = self._dec_like
|
self.funcs["dec_like"] = self._dec_like
|
||||||
self.funcs["inc_like"] = self._inc_like
|
self.funcs["inc_like"] = self._inc_like
|
||||||
self.funcs["get_like"] = self._get_like
|
self.funcs["get_like"] = self._get_like
|
||||||
|
self.funcs["is_friend_async"] = self._is_friend
|
||||||
|
|
||||||
print("[Friend] Friend DB system, Friend V1 loaded.")
|
print("[Friend] Friend DB system, Friend V1 loaded.")
|
||||||
|
|
||||||
async def execute_module(self, ctx: Note):
|
async def execute_module(self, ctx: Note):
|
||||||
|
await ctx.api.action.reply("1" if await self._is_friend_async(ctx.author.id) else "0")
|
||||||
|
|
||||||
|
def _dec_like(self, userid: str):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _dec_like(userid: str):
|
def _inc_like(self, userid: str):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _inc_like(userid: str):
|
def _get_like(self, userid: str):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _get_like(userid: str):
|
async def _is_friend_async(self, userid: str):
|
||||||
pass
|
target = await self.manager.bot.user.api.action.get(userid)
|
||||||
|
return target.is_followed and target.is_following
|
||||||
def _is_friend(userid: str):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def module_ready(self):
|
def module_ready(self):
|
||||||
print("[Friend] Module Ready.")
|
print("[Friend] Module Ready.")
|
||||||
|
|
Loading…
Reference in a new issue