Skip to content

Instantly share code, notes, and snippets.

@davidsaccavino
Last active September 28, 2018 20:54
Show Gist options
  • Save davidsaccavino/3be51b4155edb1f22a9e9b47b7f7ed18 to your computer and use it in GitHub Desktop.
Save davidsaccavino/3be51b4155edb1f22a9e9b47b7f7ed18 to your computer and use it in GitHub Desktop.
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