Skip to content

Instantly share code, notes, and snippets.

@davidsaccavino
Created August 28, 2018 03:44
Show Gist options
  • Save davidsaccavino/5510d9cd3030aa8a2ba777dd5e0b6b4d to your computer and use it in GitHub Desktop.
Save davidsaccavino/5510d9cd3030aa8a2ba777dd5e0b6b4d to your computer and use it in GitHub Desktop.
import discord, 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(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