This repository has been archived on 2023-04-13. You can view files and clone it, but cannot push or open issues or pull requests.
CloudBot/disabled_stuff/kernel.py

16 lines
446 B
Python
Raw Permalink Normal View History

2013-08-22 15:41:28 +02:00
import re
2014-02-14 04:36:57 +01:00
from util import hook, http
2013-09-04 12:30:04 +02:00
2013-08-22 15:41:28 +02:00
@hook.command(autohelp=False)
def kernel(inp, reply=None):
contents = http.get("https://www.kernel.org/finger_banner")
contents = re.sub(r'The latest(\s*)', '', contents)
contents = re.sub(r'version of the Linux kernel is:(\s*)', '- ', contents)
lines = contents.split("\n")
message = "Linux kernel versions: "
message += ", ".join(line for line in lines[:-1])
reply(message)