From 57bd0c94b2b30b4585d9ff079bab36409f28608e Mon Sep 17 00:00:00 2001 From: Zac Herd Date: Fri, 1 Apr 2016 09:52:38 +0100 Subject: [PATCH] Added .say command, minor changes, v0.7.0 --- bot.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 795d87c..15a8d1f 100644 --- a/bot.py +++ b/bot.py @@ -12,7 +12,6 @@ import os import time import datetime import json -from collections import namedtuple # file in this directory called "secret.py" should contain these variables from secret import email,pwd @@ -24,7 +23,7 @@ from secret import email,pwd name = "Maki" # bot version -version = "v0.6.2" +version = "v0.7.0" # text shown by .help command helptext = """I am a bot written in Python by MrDetonia @@ -35,8 +34,9 @@ My commands are: .bots - prints basic info .source - show a link to my source .whoami - displays your user info -.welcome - set your welcome message +.welcome - set your own welcome message .seen - prints when user was last seen +.say - say something ```""" # IDs of admin users @@ -65,7 +65,7 @@ if os.path.isfile('welcomes.json'): with open('welcomes.json', 'r') as fp: welcomes = json.load(fp) -# this instance of a Discord client +# this instance of the Discord client client = discord.Client() @@ -167,6 +167,10 @@ def on_message(message): # user not logged yield from client.send_message(message.channel, 'user not seen yet') + elif message.content.startswith('.say'): + # echo message + yield from client.send_message(message.channel, message.content[5:]) + # Ben meme trackers elif '/ck/' in message.content and message.author.name == "Ben.H": bentrack['ck'] += 1