async def on_message(message): """ Checks if the user is blacklisted, if not, process the message for commands as usual. """ if roxbot.blacklisted(message.author): return return await bot.process_commands(message)
async def on_member_update(self, member_b, member_a): """Twitch Shilling Part""" twitch = roxbot.guild_settings.get(member_b.guild).twitch if roxbot.blacklisted(member_b) or not twitch["enabled"]: return if member_a.activitiy: if member_a.activity.type == ActivityType.streaming and member_b.activity.type != ActivityType.streaming: if not twitch["whitelist"]["enabled"] or member_a.id in twitch["whitelist"]["list"]: channel = self.bot.get_channel(twitch["channel"]) return await channel.send(":video_game:** {} is live!** :video_game:\n{}\n{}".format( member_a.name, member_a.game.name, member_a.game.url))
async def on_message(self, message): if isinstance(message.channel, discord.DMChannel): return settings = roxbot.guild_settings.get(message.guild) msg = message.content.lower() channel = message.channel if roxbot.blacklisted(message.author) or type(message.channel) != discord.TextChannel: return if message.author == self.bot.user: return if msg.startswith(self.bot.command_prefix): if msg.split(self.bot.command_prefix)[1] in settings.custom_commands["1"]: return await channel.send(settings.custom_commands["1"][msg.split(self.bot.command_prefix)[1]]) else: for command in settings.custom_commands["0"]: if msg == command: return await channel.send(settings.custom_commands["0"][command])