|
|
@ -20,16 +20,16 @@ class Extension: |
|
|
|
self.track_guild_id = core.main_server_id |
|
|
|
|
|
|
|
self.webhook_reaction_translate = { |
|
|
|
"😘":('ban', {"profile":"", "reason":"", "minutes":0, "requester":""}), |
|
|
|
"🔨":('ban', {"profile":"", "reason":"", "minutes":30, "requester":""}), |
|
|
|
"⚒️":('ban', {"profile":"", "reason":"", "minutes":120, "requester":""}), |
|
|
|
"😘":('ban', {"profile":"", "reason":"", "minutes":0, "discord_user":None}), |
|
|
|
"🔨":('ban', {"profile":"", "reason":"", "minutes":30, "discord_user":None}), |
|
|
|
"⚒️":('ban', {"profile":"", "reason":"", "minutes":120, "discord_user":None}), |
|
|
|
"📨":(self.no_reason, {"requester":""}), |
|
|
|
"🦵":("kick", {"profile":""}), |
|
|
|
"🦵":("kick", {"profile":"", "discord_user":None}), |
|
|
|
"🔇":("mute", {"profile":""}), |
|
|
|
"😇":("unban", {"profile":""}), |
|
|
|
"hueglot:713139400028061767":("kick", {"profile":"", "requester_profile":""}), |
|
|
|
"🔍":("profile", {"profile":""}), |
|
|
|
"🔎":("unban", {"profile":"", "requester_profile":""}) |
|
|
|
"😇":("unban", {"profile":"", "discord_user":None}), |
|
|
|
"<:hueglot:713139400028061767>":("kick", {"profile":"", "requester_profile":"", "discord_user":None}), |
|
|
|
"🔍":("profile", {"profile":"", "discord_user":None}), |
|
|
|
"🔎":("unban", {"profile":"", "requester_profile":"", "discord_user":None}) |
|
|
|
} |
|
|
|
|
|
|
|
@core.listen() |
|
|
@ -50,8 +50,6 @@ class Extension: |
|
|
|
message: discord.Message = await channel.fetch_message(payload.message_id) |
|
|
|
user: discord.User = await self.core.fetch_user(payload.user_id) |
|
|
|
|
|
|
|
print(payload.emoji, message.webhook_id, self.core.user.id == payload.user_id, message.guild.get_member(user.id).get_role(self.track_role_id)) |
|
|
|
|
|
|
|
if message.webhook_id != self.track_webhook_id: |
|
|
|
return |
|
|
|
|
|
|
@ -61,10 +59,14 @@ class Extension: |
|
|
|
if not message.guild.get_member(user.id).get_role(self.track_role_id): |
|
|
|
return |
|
|
|
|
|
|
|
print(payload.emoji, message.webhook_id, self.core.user.id == payload.user_id, message.guild.get_member(user.id).get_role(self.track_role_id)) |
|
|
|
|
|
|
|
if str(payload.emoji) in self.webhook_reaction_translate.keys(): |
|
|
|
executor, kwargs = self.webhook_reaction_translate[str(payload.emoji)] |
|
|
|
if "requester" in kwargs: |
|
|
|
kwargs["requester"] = user.id |
|
|
|
if "discord_user" in kwargs: |
|
|
|
kwargs["discord_user"] = user |
|
|
|
if "reason" in kwargs and not user.id in self.no_reason: |
|
|
|
def check(msg: discord.Message): |
|
|
|
return msg.author == user and msg.channel == message.channel |
|
|
@ -82,7 +84,7 @@ class Extension: |
|
|
|
print("Cannot delete request reason message, error: " +err) |
|
|
|
|
|
|
|
#не ну это пиздец |
|
|
|
if msg.content.split(" ") > 0 and msg.content.lower().split(" ")[0] == "отмена": |
|
|
|
if len(msg.content.split(" ")) > 0 and msg.content.lower().split(" ")[0] == "отмена": |
|
|
|
return await message.channel.send(content=f"{user.mention}!\nДействие {payload.emoji} отменено по твоей воле", delete_after=60) |
|
|
|
else: |
|
|
|
kwargs["reason"] = msg.content |
|
|
@ -93,6 +95,7 @@ class Extension: |
|
|
|
kwargs["profile"] = message.embeds[0].url |
|
|
|
if "requester_profile" in kwargs: |
|
|
|
kwargs["profile"] = message.embeds[0].author.url |
|
|
|
del kwargs["requester_profile"] |
|
|
|
|
|
|
|
try: |
|
|
|
if type(executor) == str: |
|
|
|