Don't allow to warn other bots (#3855)

This commit is contained in:
Sean 2020-05-17 16:03:51 +01:00 committed by GitHub
parent fb26ecf577
commit 38a034e59b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -323,6 +323,9 @@ class Warnings(commands.Cog):
if user == ctx.author: if user == ctx.author:
await ctx.send(_("You cannot warn yourself.")) await ctx.send(_("You cannot warn yourself."))
return return
if user.bot:
await ctx.send(_("You cannot warn other bots."))
return
custom_allowed = await self.config.guild(ctx.guild).allow_custom_reasons() custom_allowed = await self.config.guild(ctx.guild).allow_custom_reasons()
guild_settings = self.config.guild(ctx.guild) guild_settings = self.config.guild(ctx.guild)
reason_type = None reason_type = None