async def handle_paypal(self, message, extra): tosearch = str(message.system_content) + \ str([e.to_dict() for e in message.embeds]) if not extra else extra paypal = findpaypal(tosearch) if paypal: if not message.author.permissions_in( message.channel).manage_messages: try: await message.delete() except Exception: pass logch = self.bot.get_config(message.guild).get('log.action') if logch: description = f'**PayPal link sent in** {message.channel.mention}' if paypal in extra: if paypal in str(message.system_content) + str( [e.to_dict() for e in message.embeds]): return description = f'**PayPal link found in external content**' embed = discord.Embed(color=message.author.color, timestamp=message.created_at, description=description) embed.set_author(name=message.author, icon_url=str( message.author.avatar_url_as( static_format='png', size=2048))) embed.add_field( name='Link', value=f'[{paypal}](https://paypal.me/{paypal})', inline=False) embed.set_footer(text=f"Author ID: {message.author.id}") try: await logch.send(embed=embed) except Exception: pass
async def handle_paypal(self, message): paypal = findpaypal(message.system_content) if paypal: if not message.author.permissions_in(message.channel).manage_messages: if 'paypal' in self.bot.configs[message.guild.id].get('mod.linkfilter'): try: await message.delete() except Exception: pass logch = self.bot.configs[message.guild.id].get('log.action') if logch: embed = discord.Embed(color=message.author.color, timestamp=message.created_at, description=f'**PayPal link sent in** {message.channel.mention}') embed.set_author(name=message.author, icon_url=str(message.author.avatar_url_as(static_format='png', size=2048))) embed.add_field(name='Link', value=f'[{paypal}](https://paypal.me/{paypal})', inline=False) embed.set_footer(text=f"Author ID: {message.author.id}") try: await logch.send(embed=embed) except Exception: pass