main.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:discord_bot 作者: Der-Eddy 项目源码 文件源码
def on_message(message):
    if message.author.bot or message.author.id in loadconfig.__blacklist__:
        return
    if isinstance(message.channel, discord.DMChannel):
        await message.author.send(':x: Sorry, but I don\'t accept commands through direct messages! Please use the `#bots` channel of your corresponding server!')
        return
    if bot.dev and not await bot.is_owner(message.author):
        return
    if bot.user.mentioned_in(message) and message.mention_everyone is False:
        if 'help' in message.content.lower():
            await message.channel.send('Eine volle Liste aller Commands gibts hier: https://github.com/Der-Eddy/discord_bot#commands-list')
        else:
            await message.add_reaction('??') # :eyes:
    if 'loli' in message.clean_content.lower():
        await message.add_reaction('??') # :lollipop:
    if 'instagram.com' in message.clean_content.lower():
        await message.add_reaction('??') # :poop:
    if len(message.attachments) > 0:
        try:
            await message.channel.send(await _fileCheck(message))
        except:
            pass
    await bot.process_commands(message)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号