Sfoglia il codice sorgente

v1.0.1 - call discord_typing properly, minor formatting

master
MrDetonia 7 anni fa
parent
commit
288a08ee1d
3 ha cambiato i file con 13 aggiunte e 13 eliminazioni
  1. +8
    -8
      bot.py
  2. +2
    -2
      commands.py
  3. +3
    -3
      common.py

+ 8
- 8
bot.py Vedi File

@@ -43,14 +43,14 @@ client = discord.Client()
@client.event
@asyncio.coroutine
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


+ 2
- 2
commands.py Vedi File

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

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

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

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

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


+ 3
- 3
common.py Vedi File

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


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


# TODO: generate this on the fly and make it look acceptable
@@ -42,8 +42,8 @@ admins = ['116883900688629761']
# log of users' last messages and timestamps
history = {}
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 = {}

Loading…
Annulla
Salva