Giter Site home page Giter Site logo

fishroom's People

Contributors

bigeagle avatar condy0919 avatar dotkrnl avatar felixonmars avatar gumblex avatar hexchain avatar hosiet avatar huiyiqun avatar maskray avatar mys721tx avatar mytbk avatar simonsmh avatar wangqr avatar wengxt avatar xiaq avatar zhsj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fishroom's Issues

Ingore Telegram bot command to other IMs?

Fishroom is a api-based bot on Telegram so it cannot see other bots message. Of cause it cannot forward it. It is necessary to send command messages which IRC and other platform not be able to recognize it?


😂 就是光给 IRC 发个 Telegram bot 命令的消息并没有啥用……

Crash if no gitter room

config.py relevant part:

    'gitter': {
        'token': '',
        'me': '',  # bot username
    },
    'bindings': {
        "channelname": {
            "irc": '#somechannel',
            "telegram": '-12345678',
            "xmpp": ''
        }
    }

Traceback (most recent call last):
  File "/srv/http/fishroom/fishroom/fishroom.py", line 278, in wrapper
    f(*args, **kwargs)
  File "/srv/http/fishroom/fishroom/gitter.py", line 151, in GitterThread
    gt.listen_message_stream()
  File "/srv/http/fishroom/fishroom/gitter.py", line 140, in listen_message_stream
    asyncio.wait(tasks, return_when=asyncio.FIRST_EXCEPTION)
  File "/usr/lib64/python3.5/asyncio/base_events.py", line 337, in run_until_complete
    return future.result()
  File "/usr/lib64/python3.5/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/lib64/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/usr/lib64/python3.5/asyncio/tasks.py", line 332, in wait
    raise ValueError('Set of coroutines/Futures is empty.')
ValueError: Set of coroutines/Futures is empty.

If I add a gitter key to bindings:

    'bindings': {
        "channelname": {
            "irc": '#somechannel',
            "telegram": '-12345678',
            "xmpp": '',
            "gitter": ''
        }
    }

Still crash but this time a different stack trace:

Traceback (most recent call last):
  File "/srv/http/fishroom/fishroom/fishroom.py", line 278, in wrapper
    f(*args, **kwargs)
  File "/srv/http/fishroom/fishroom/gitter.py", line 151, in GitterThread
    gt.listen_message_stream()
  File "/srv/http/fishroom/fishroom/gitter.py", line 144, in listen_message_stream
    raise d.exception()
  File "/usr/lib64/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
  File "/srv/http/fishroom/fishroom/gitter.py", line 66, in fetch
    msg = self.parse_jmsg(room, json.loads(line))
  File "/srv/http/fishroom/fishroom/gitter.py", line 76, in parse_jmsg
    from_user = jmsg['fromUser']['username']
KeyError: 'fromUser'

telegram.py ValueError: I/O operation on closed file.

Traceback (most recent call last):
File "/root/fishroom/fishroom/runner.py", line 37, in wrapper
f(*args, **kwargs)
File "/root/fishroom/fishroom/telegram.py", line 692, in Telegram2FishroomThread
for msg in tg.message_stream(id_blacklist=tele_me):
File "/root/fishroom/fishroom/telegram.py", line 540, in message_stream
telemsg = self.parse_jmsg(jmsg)
File "/root/fishroom/fishroom/telegram.py", line 372, in parse_jmsg
url, err = self.upload_sticker(file_id)
File "/root/fishroom/fishroom/telegram.py", line 284, in upload_sticker
photo = webp2png(sticker)
File "/root/fishroom/fishroom/helpers.py", line 50, in webp2png
im.save(out, "PNG")
File "/usr/local/lib/python3.6/dist-packages/PIL/Image.py", line 1895, in save
self.load()
File "/usr/local/lib/python3.6/dist-packages/PIL/ImageFile.py", line 205, in load
seek(offset)
ValueError: I/O operation on closed file.

Failed start fishroom.web

redis是用apt install redis-server 安装的,config.py中redis的host改成了127.0.0.1,之前的步骤都没有报错

启动fishroom.fishroom的回显是:

root@hostker:~/fishroom# python3 -m fishroom.fishroom
[fishroom.command] [INFO] command `help` registered
[fishroom.command] [INFO] command `pia` registered
[fishroom.command] [INFO] command `mua` registered
[fishroom.command] [INFO] command `imglink` registered
[fishroom.command] [INFO] command `vote` registered
[fishroom.command] [INFO] command `hualao` registered

然后尝试启动fishroom.web出现错误

root@hostker:~/fishroom# python3 -m fishroom.web
[fishroom.command] [INFO] command `help` registered
Traceback (most recent call last):
  File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/root/fishroom/fishroom/web/__main__.py", line 30, in <module>
    main()
  File "/root/fishroom/fishroom/web/__main__.py", line 24, in main
    application.listen(config['chatlog']['port'],address=config['chatlog'].get('host', '0.0.0.0'))
  File "/usr/local/lib/python3.5/dist-packages/tornado/web.py", line 1944, in listen
    server.listen(port, address)
  File "/usr/local/lib/python3.5/dist-packages/tornado/tcpserver.py", line 142, in listen
    sockets = bind_sockets(port, address=address)
  File "/usr/local/lib/python3.5/dist-packages/tornado/netutil.py", line 156, in bind_sockets
    0, flags)):
  File "/usr/lib/python3.5/socket.py", line 732, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

Send digest to maillist

Maillist is more suitable for searching and history.

How about sending messages of one day as digest to maillist.

Stale page on renavigation

Steps to reproduce:

  1. Join a extremely noisy channel, like tuna, on https://fishroom.tuna.moe/log/tuna/today.
  2. Wait for a while to fill your screen with new messages.
  3. Perform random edits to your address bar, redo them, and navigate to the URL in (1) again. (Do not reload/F5)

Expected:

The message listing should contain new messages received in (2).

Actual:

The browser displays a stale log from (1). F5 fixes the issue.

jquery CDN 爆炸了

% curl -vvv https://cdn.bootcss.com/jquery/2.1.4/jquery.min.js
*   Trying 183.158.35.38...
* TCP_NODELAY set
* Connected to cdn.bootcss.com (183.158.35.38) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=cdn.bootcss.com
*  start date: Sep 11 23:03:00 2017 GMT
*  expire date: Dec 10 23:03:00 2017 GMT
*  subjectAltName: host "cdn.bootcss.com" matched cert's "cdn.bootcss.com"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x55864e39ecf0)
> GET /jquery/2.1.4/jquery.min.js HTTP/2
> Host: cdn.bootcss.com
> User-Agent: curl/7.55.1
> Accept: */*
> 
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 403 
< server: marco/1.8
< date: Sat, 30 Sep 2017 03:25:19 GMT
< content-type: text/html
< content-length: 166
< via: M.ctn-zj-lna3-017
< x-request-id: efb713767ee700467507c23beee11b24
< 
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>marco/1.8</center>
</body>
</html>
* Connection #0 to host cdn.bootcss.com left intact
% date
2017年 09月 30日 星期六 11:26:32 CST

Wechat module crashed after sending messages in web.

Traceback (most recent call last):
File "/root/fishroom/fishroom/runner.py", line 37, in wrapper
f(*args, **kwargs)
File "/root/fishroom/fishroom/wechat.py", line 230, in Fishroom2WechatThread
myid_chn = config[msg.channel].get("me")
KeyError: 'web'
@mytbk

Configurable filters for reply-quote text in IRC

On #archlinux-cn, the results of replying to someone can be highly annoying, if the replied message contains a command, e.g. 'google (varia bot).

It would be great if users can supply functions to filter the thing...

Teleboto Hide Specific Message(s)

建议增加teleboto的一个功能,使用户可以指定某些消息只显示在telegram群里,但不被web版记录。
比如让/mask 你的牙缝里有片菜叶不显示在fishroom里,但是telegram里可以看到。

另外,或许要考虑发图片,@wiki,我有颜色,@ bing 等功能的实现。

tg: image caption not recorded

huiyiqun21 sent an image on tuna@tg, and the caption is not in the log.

hmm

Also, Fwded imgs miss the 'Fwd xxx' indication.

fishroom may need at least python 3.5

README.md says "Ensure your python version is at least 3.4". However, Python 3.4.3 from Ubuntu 14.04 cannot run fishroom.

In fishroom/bus.py, there is an import typing, which is new in version Python 3.5.

https://docs.python.org/3/library/typing.html

Also I have the following error when running the latest git code.

root@redis-512mb-sfo1-01:~/fishroom# python3 -m fishroom.fishroom
Traceback (most recent call last):
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/root/fishroom/fishroom/fishroom.py", line 8, in <module>
    from .base import EmptyBot
  File "/root/fishroom/fishroom/base.py", line 73
    raw=msg, **msg.opt,
                      ^
SyntaxError: invalid syntax

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.