git://git.furryclan.net
/
furrycat
/
catbot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
63b5e0e
)
Bot may not be able to get avatar from unknown user.
author
CMDR furrycat
<elite@furrycat.net>
Mon, 26 Sep 2016 15:54:48 +0000
(16:54 +0100)
committer
CMDR furrycat
<elite@furrycat.net>
Mon, 26 Sep 2016 15:54:48 +0000
(16:54 +0100)
bot.py
patch
|
blob
|
history
diff --git
a/bot.py
b/bot.py
index
150edb2
..
f82434e
100755
(executable)
--- a/
bot.py
+++ b/
bot.py
@@
-213,11
+213,15
@@
def do_commands(message, command, raw, non_admin):
url = m.group(1)
m = re.match(r'<@(\d+)>', url)
if m is not None:
+ other = None
id = str(m.group(1))
for member in client.get_all_members():
if member.id == id:
other = member
- if other is not None:
+ if other is None:
+ log.warning("Can't see requested user {}".format(url))
+ url = None
+ else:
url = other.avatar_url
elif len(message.attachments):
url = message.attachments[0]['url']