【问题标题】:If message contains a server invite link如果消息包含服务器邀请链接
【发布时间】:2021-10-28 11:53:51
【问题描述】:

我想做一个自动审核系统,所以机器人会警告发送服务器邀请链接的成员。我该怎么做? 示例代码:

@client.event
async def on_message(message):
    if message.isInvite():
        print("warn")

【问题讨论】:

  • 如果我的回答对你有帮助,你能接受吗?否则你能描述一下它是怎么做到的吗?

标签: python python-3.x discord discord.py


【解决方案1】:

据我所知,discord 服务器链接以discord.gg 开头。 所以你可以使用:

if 'discord.gg' in message:
    print('warn')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-28
    • 1970-01-01
    • 1970-01-01
    • 2012-10-02
    • 1970-01-01
    相关资源
    最近更新 更多