Last active
September 28, 2018 20:54
-
-
Save davidsaccavino/3be51b4155edb1f22a9e9b47b7f7ed18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
import re | |
client = discord.Client() | |
TOKEN = 'your-token' | |
url = 'https://us17.campaign-archive.com/?u=b0c288d012c3990e6593e76e1&id=79473da32d&e=eb0d880e49' | |
resumeRegex = re.compile( | |
r'learn\.joma\.io|joma\'?s (?:resume|cv)', re.IGNORECASE) | |
@client.event | |
async def on_message(message): | |
if message.author == client.user: | |
return | |
resumeResult = resumeRegex.match(message.content) | |
if(message.channel.name == 'counting-channel'): | |
for elt in message.content: | |
if(not elt.isdigit()): | |
await client.delete_message(message) | |
break | |
if(resumeResult): | |
msg = '''Hello {0.author.mention}, | |
here\'s the link to Joma\'s CV! {1}'''.format( | |
message, url) | |
await client.send_message(message.channel, msg) | |
@client.event | |
async def on_ready(): | |
print('Running') | |
client.run(TOKEN) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment