|
|
@ -6,14 +6,11 @@ import discord |
|
|
|
class Extension: |
|
|
|
DONATE_VIP_ROLE = 684725881557614689 |
|
|
|
FREE_VIP_ROLE = 1084187245025689630 |
|
|
|
MAIN_GUILD_ID = 0 |
|
|
|
|
|
|
|
TRACK_WEBHOOK = 819627591501479937 |
|
|
|
|
|
|
|
core = None |
|
|
|
def __init__(self, core): |
|
|
|
self.core = core |
|
|
|
self.MAIN_GUILD_ID = core.main_server_id |
|
|
|
|
|
|
|
@core.listen() |
|
|
|
async def on_message(message: discord.Message): |
|
|
@ -48,7 +45,7 @@ class Extension: |
|
|
|
return await response.json() |
|
|
|
|
|
|
|
async def checkRoles(self, role_id): |
|
|
|
current_members = self.core.get_guild(self.MAIN_GUILD_ID).get_role(role_id).members |
|
|
|
current_members = self.core.get_guild(int(self.core.main_server_id)).get_role(role_id).members |
|
|
|
if role_id == self.DONATE_VIP_ROLE: |
|
|
|
active_vips = await self.getVIP_DiscordIDs() |
|
|
|
elif role_id == self.FREE_VIP_ROLE: |
|
|
@ -58,9 +55,9 @@ class Extension: |
|
|
|
return |
|
|
|
|
|
|
|
ids_4_remove_role = [member for member in current_members if not member.id in active_vips] |
|
|
|
ids_4_add_role = [self.core.get_guild(self.MAIN_GUILD_ID).get_member(i) for i in active_vips if not i in [member.id for member in current_members]] |
|
|
|
ids_4_add_role = [self.core.get_guild(self.core.main_server_id).get_member(i) for i in active_vips if not i in [member.id for member in current_members]] |
|
|
|
|
|
|
|
VIP_ROLE = self.core.get_guild(self.MAIN_GUILD_ID).get_role(role_id) |
|
|
|
VIP_ROLE = self.core.get_guild(self.core.main_server_id).get_role(role_id) |
|
|
|
for member in ids_4_remove_role: |
|
|
|
try: |
|
|
|
print(f"Remove role({role_id}) from {member}") |
|
|
|