|
|
@ -25,7 +25,11 @@ class Linking(commands.Cog): |
|
|
|
|
|
|
|
@commands.Cog.listener() |
|
|
|
async def on_message(self, message): |
|
|
|
if message.author != self.bot.user and message.guild is None: |
|
|
|
self.guild = self.bot.get_guild(self.guild_id) |
|
|
|
if message.author != self.bot.user and message.guild is None and self.guild.get_member(message.author.id) is not None: |
|
|
|
if "://" in message.content: |
|
|
|
return |
|
|
|
if self.guild in message.author.guilds: |
|
|
|
channel = message.channel |
|
|
|
await channel.send("Processing, please wait...") |
|
|
|
# Potential API key, so tries it out |
|
|
@ -76,8 +80,7 @@ class Linking(commands.Cog): |
|
|
|
file.write(json_dumps) |
|
|
|
file.close() |
|
|
|
|
|
|
|
guild = self.bot.get_guild(self.guild_id) |
|
|
|
member = guild.get_member(message.author.id) |
|
|
|
member = self.guild.get_member(message.author.id) |
|
|
|
if member: |
|
|
|
|
|
|
|
url = "https://panel.birdflop.com/api/client" |
|
|
@ -115,21 +118,21 @@ class Linking(commands.Cog): |
|
|
|
elif server_node == "Elktail - EU": |
|
|
|
user_elktail = True |
|
|
|
if user_client: |
|
|
|
role = discord.utils.get(guild.roles, id=self.client_role_id) |
|
|
|
role = discord.utils.get(self.guild.roles, id=self.client_role_id) |
|
|
|
await member.add_roles(role) |
|
|
|
if user_subuser: |
|
|
|
role = discord.utils.get(guild.roles, id=self.subuser_role_id) |
|
|
|
role = discord.utils.get(self.guild.roles, id=self.subuser_role_id) |
|
|
|
await member.add_roles(role) |
|
|
|
if user_crabwings: |
|
|
|
role = discord.utils.get(guild.roles, id=self.crabwings_role_id) |
|
|
|
role = discord.utils.get(self.guild.roles, id=self.crabwings_role_id) |
|
|
|
await member.add_roles(role) |
|
|
|
if user_duckfeet: |
|
|
|
role = discord.utils.get(guild.roles, id=self.duckfeet_role_id) |
|
|
|
role = discord.utils.get(self.guild.roles, id=self.duckfeet_role_id) |
|
|
|
await member.add_roles(role) |
|
|
|
if user_elktail: |
|
|
|
role = discord.utils.get(guild.roles, id=self.elktail_role_id) |
|
|
|
role = discord.utils.get(self.guild.roles, id=self.elktail_role_id) |
|
|
|
await member.add_roles(role) |
|
|
|
role = discord.utils.get(guild.roles, id=self.verified_role_id) |
|
|
|
role = discord.utils.get(self.guild.roles, id=self.verified_role_id) |
|
|
|
await member.add_roles(role) |
|
|
|
|
|
|
|
await channel.send( |
|
|
|