minya_hotomoe/modules/Friend.py
2023-09-15 11:48:59 +09:00

34 lines
1 KiB
Python

from module_interface import ModuleInterface
from mipac.models import Note
class Friend(ModuleInterface):
def __init__(self):
super().__init__()
self.name = "Friend"
self.regex_pattern = ".*TestAreWeFriend"
self.funcs["dec_like"] = self._dec_like
self.funcs["inc_like"] = self._inc_like
self.funcs["get_like"] = self._get_like
self.funcs["is_friend_async"] = self._is_friend_async
print("[Friend] Friend DB system, Friend V1 loaded.")
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
def _inc_like(self, userid: str):
pass
def _get_like(self, userid: str):
pass
async def _is_friend_async(self, userid: str):
target = await self.manager.bot.user.api.action.get(userid)
return target.is_followed and target.is_following
def module_ready(self):
print("[Friend] Module Ready.")