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
|
## Requirements
|
||||||
Python 3.6+
|
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
|
## Config
|
||||||
`nickname` - The nickname the bot will use.
|
`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)
|
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():
|
class FulviaWrapper():
|
||||||
"""
|
"""
|
||||||
A wrapper class for Fulvia to provide default destinations for msg
|
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 = requests.get(uri + query)
|
||||||
res.raise_for_status()
|
res.raise_for_status()
|
||||||
answer = res.text
|
answer = res.text
|
||||||
|
answer = answer[:2000]
|
||||||
if answer:
|
if answer:
|
||||||
#bot.msg can potentially lead to 3rd party commands triggering.
|
#bot.msg can potentially lead to 3rd party commands triggering.
|
||||||
bot.msg(answer)
|
bot.msg(answer, length=300)
|
||||||
else:
|
else:
|
||||||
bot.reply('Sorry, no result.')
|
bot.reply('Sorry, no result.')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user