ShadowNotFake
ShadowNotFake

Reputation: 114

If message contains a server invite link

I want to make an auto-moderation system, so the Bot will warn members who sent a server invite link. How can I do so? Example code:

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

Upvotes: 1

Views: 91

Answers (1)

Ariadne Paradis
Ariadne Paradis

Reputation: 966

From what i've seen, discord server links start with discord.gg. So you could use:

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

Upvotes: 1

Related Questions