minya_hotomoe/modules/Follow.py

22 lines
805 B
Python
Raw Permalink Normal View History

2023-09-08 02:49:37 +02:00
from module_interface import ModuleInterface
from mipac.models import Note
2023-10-03 04:01:27 +02:00
2023-09-08 02:49:37 +02:00
class Follow(ModuleInterface):
def __init__(self):
super().__init__()
self.name = "Follow"
self.regex_pattern = r".*팔로우\s*(부탁\s*해|해?\s*(주(\s*십\s*시\s*오|세요)|줘))"
print("[Follow] Auto follow module, Follow V1 loaded.")
async def execute_module(self, ctx: Note):
print(f"[Follow] Got Follow Related Message : {ctx.content}")
2023-10-03 04:01:27 +02:00
2023-09-08 02:49:37 +02:00
usr = await self.manager.bot.user.api.action.get(ctx.author.id)
if usr.is_following:
await ctx.api.action.reply("이미 팔로우 되어있어요..! 저를 잊으셨나요..?")
else:
await usr.api.follow.action.add()
await ctx.api.action.reply("잘 부탁드려요!")