Browse Source

v1.0.1 - call discord_typing properly, minor formatting

master
MrDetonia 7 years ago
parent
commit
288a08ee1d
3 changed files with 13 additions and 13 deletions
  1. +8
    -8
      bot.py
  2. +2
    -2
      commands.py
  3. +3
    -3
      common.py

+ 8
- 8
bot.py View File

@@ -43,14 +43,14 @@ client = discord.Client()
@client.event @client.event
@asyncio.coroutine @asyncio.coroutine
def on_ready(): def on_ready():
# info on terminal
print('Connected')
print('User: ' + client.user.name)
print('ID: ' + client.user.id)
# set "Now Playing" to print version
game = discord.Game(name = version)
yield from client.change_presence(game=game)
# info on terminal
print('Connected')
print('User: ' + client.user.name)
print('ID: ' + client.user.id)
# set "Now Playing" to print version
game = discord.Game(name = version)
yield from client.change_presence(game=game)




# called when message received # called when message received


+ 2
- 2
commands.py View File

@@ -104,7 +104,7 @@ def cmd_sayy(client, msg):


@asyncio.coroutine @asyncio.coroutine
def cmd_markov(client, msg): def cmd_markov(client, msg):
discord_typing(client, msg)
yield from discord_typing(client, msg)


tmp = msg.content[8:] tmp = msg.content[8:]
target = "" target = ""
@@ -161,7 +161,7 @@ def cmd_roll(client, msg):
def cmd_qr(client, msg): def cmd_qr(client, msg):
tmp = msg.content[4:] tmp = msg.content[4:]


discord_typing(client, msg)
yield from discord_typing(client, msg)


# generate qr code # generate qr code
qr = subprocess.Popen("qrencode -t png -o -".split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE) qr = subprocess.Popen("qrencode -t png -o -".split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE)


+ 3
- 3
common.py View File

@@ -13,7 +13,7 @@ import json




# bot version # bot version
version = "v1.0.0"
version = "v1.0.1"




# TODO: generate this on the fly and make it look acceptable # TODO: generate this on the fly and make it look acceptable
@@ -42,8 +42,8 @@ admins = ['116883900688629761']
# log of users' last messages and timestamps # log of users' last messages and timestamps
history = {} history = {}
if os.path.isfile('hist.json'): if os.path.isfile('hist.json'):
with open('hist.json', 'r') as fp:
history = json.load(fp)
with open('hist.json', 'r') as fp:
history = json.load(fp)


# quiet modes # quiet modes
quiet = {} quiet = {}

Loading…
Cancel
Save