open to external guilds: disable everything

This commit is contained in:
Amazed 2020-12-29 16:54:30 +01:00
parent 206ea6b8c8
commit 3503f9b14d

View File

@ -377,6 +377,8 @@ class WynncraftCog(commands.Cog):
@commands.command() @commands.command()
async def connexions(self, ctx): async def connexions(self, ctx):
if ctx.guild.id != 743539323214889030:
return
def td_format(seconds): def td_format(seconds):
periods = [ periods = [
('an', 60 * 60 * 24 * 365), ('an', 60 * 60 * 24 * 365),
@ -417,6 +419,8 @@ class WynncraftCog(commands.Cog):
@commands.command() @commands.command()
@checks.admin_or_permissions(manage_guild=True) @checks.admin_or_permissions(manage_guild=True)
async def ping_channel(self, ctx, channel: TextChannel): async def ping_channel(self, ctx, channel: TextChannel):
if ctx.guild.id != 743539323214889030:
return
i = channel.id i = channel.id
await self.config.guild(ctx.guild).ping_channel.set(i) await self.config.guild(ctx.guild).ping_channel.set(i)
await self.config.guild(ctx.guild).ping_levels.set(True) await self.config.guild(ctx.guild).ping_levels.set(True)
@ -425,6 +429,8 @@ class WynncraftCog(commands.Cog):
@commands.command() @commands.command()
@checks.admin_or_permissions(manage_guild=True) @checks.admin_or_permissions(manage_guild=True)
async def ping_levels(self, ctx, state): async def ping_levels(self, ctx, state):
if ctx.guild.id != 743539323214889030:
return
if state == "true" or state == "on": if state == "true" or state == "on":
await self.config.ping_levels.set(True) await self.config.ping_levels.set(True)
await ctx.send(":white_check_mark: Activé!") await ctx.send(":white_check_mark: Activé!")
@ -470,6 +476,8 @@ class WynncraftCog(commands.Cog):
@commands.command() @commands.command()
@checks.admin_or_permissions(manage_guild=True) @checks.admin_or_permissions(manage_guild=True)
async def set_guild(self, ctx, guild_name): async def set_guild(self, ctx, guild_name):
if ctx.guild.id != 743539323214889030:
return
if guild_name == "no": if guild_name == "no":
await self.config.guild(ctx.guild).guild_name.set(False) await self.config.guild(ctx.guild).guild_name.set(False)
await ctx.send(":white_check_mark: Check sur les membres de la guilde désactivé") await ctx.send(":white_check_mark: Check sur les membres de la guilde désactivé")
@ -524,6 +532,8 @@ class WynncraftCog(commands.Cog):
async def do_loop(self): async def do_loop(self):
await self._log("Looping guilds") await self._log("Looping guilds")
for guild in self.bot.guilds: for guild in self.bot.guilds:
if guild.id != 743539323214889030:
continue
roles_combat_level = await self.config.guild(guild).role_levels() roles_combat_level = await self.config.guild(guild).role_levels()
roles_classes = await self.config.guild(guild).role_class() roles_classes = await self.config.guild(guild).role_class()
roles_guild = await self.config.guild(guild).role_guild() roles_guild = await self.config.guild(guild).role_guild()