Skip to content

Instantly share code, notes, and snippets.

Created February 21, 2018 21:03
What would you like to do?
Discord bookmark bot
import os
import sys
import discord
import subprocess
# discord client
client = discord.Client()
def process_message(message):
args = message.content.split(" ")
return args
# create a new event
async def on_ready():
print("(Bot Ready)")
# listen for specific messages
async def on_message(message):
if message.content.startswith("/hello"):
await client.send_message(, "BY YOUR COMMAND!")
if message.content.startswith("/add-link"):
args = process_message(message)
blog = args[1]
link = args[2]
result = subprocess.check_output(['/home/chrisg/steemit/', blog, link])
await client.send_message(, "@{} Link added: {}".format(,link))
# run the bot
bot = "xxxxxxxxYOUR KEY HERExxxxxxx"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment