Compare commits
3 Commits
aee180767d
...
180cb159a7
Author | SHA1 | Date | |
---|---|---|---|
180cb159a7 | |||
03eea368c3 | |||
bee166f985 |
|
@ -4,7 +4,7 @@ It's like Sopel, except rewritten from scratch using Twisted as a base and over
|
|||
|
||||
## Requirements
|
||||
Python 3.6+
|
||||
Python packages: `twisted, python-dateutil, requests, bs4, wolfram, pyenchant, emoji, Pillow, xml2dict, ipython, numpy, numpngw`
|
||||
Python packages: `twisted python-dateutil requests bs4 wolframalpha pyenchant emoji Pillow xml2dict ipython numpy numpngw`
|
||||
|
||||
## Config
|
||||
`nickname` - The nickname the bot will use.
|
||||
|
|
7
bot.py
7
bot.py
|
@ -616,6 +616,13 @@ class Fulvia(irc.IRCClient):
|
|||
self.whoisIdle(nick, idle, signon)
|
||||
|
||||
|
||||
def lineReceived(self, line):
|
||||
"""Overridden to fix broken unicode issues."""
|
||||
if bytes != str and isinstance(line, bytes):
|
||||
line = line.decode('utf-8', errors='surrogateescape')
|
||||
super().lineReceived(line)
|
||||
|
||||
|
||||
class FulviaWrapper():
|
||||
"""
|
||||
A wrapper class for Fulvia to provide default destinations for msg
|
||||
|
|
|
@ -41,8 +41,9 @@ def py(bot, trigger):
|
|||
res = requests.get(uri + query)
|
||||
res.raise_for_status()
|
||||
answer = res.text
|
||||
answer = answer[:2000]
|
||||
if answer:
|
||||
#bot.msg can potentially lead to 3rd party commands triggering.
|
||||
bot.msg(answer)
|
||||
bot.msg(answer, length=300)
|
||||
else:
|
||||
bot.reply('Sorry, no result.')
|
||||
|
|
Loading…
Reference in New Issue
Block a user