Renamed kernel plugin and moved gnu/linux trigger there
This commit is contained in:
parent
84d0a30a52
commit
83e3876b06
@ -14,7 +14,7 @@
|
||||
"nxy.plugins.admin",
|
||||
"nxy.plugins.bitcoin",
|
||||
"nxy.plugins.ctcp",
|
||||
"nxy.plugins.kernel",
|
||||
"nxy.plugins.linux",
|
||||
"nxy.plugins.mcmaniac",
|
||||
"nxy.plugins.quotes",
|
||||
"nxy.plugins.seen",
|
||||
|
@ -1,15 +1,32 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import random
|
||||
|
||||
import irc3
|
||||
import feedparser
|
||||
|
||||
from docopt import Dict as DocOptDict
|
||||
from irc3.plugins.command import command
|
||||
from irc3.utils import IrcString
|
||||
|
||||
from . import Plugin
|
||||
|
||||
GNU_LINUX = """I'd Just Like To Interject For A Moment. What you're referring
|
||||
to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it,
|
||||
GNU plus Linux. Linux is not an operating system unto itself, but rather
|
||||
another free component of a fully functioning GNU system made useful by the
|
||||
GNU corelibs, shell utilities and vital system components comprising a full
|
||||
OS as defined by POSIX."""
|
||||
|
||||
|
||||
class Kernel(Plugin):
|
||||
URL = 'https://www.kernel.org/feeds/kdist.xml'
|
||||
|
||||
@irc3.event(r'(?i)^:\S+ PRIVMSG (?P<channel>\S+) :'
|
||||
r'.*(?<!gnu[/+])linux(?! kernel).*')
|
||||
def linux(self, channel: str):
|
||||
if random.randint(0, 3) is 0:
|
||||
self.bot.privmsg(channel, GNU_LINUX)
|
||||
|
||||
@command
|
||||
def kernel(self, mask: IrcString, channel: IrcString, args: DocOptDict):
|
||||
"""Get Linux kernel releases.
|
@ -11,24 +11,11 @@ from . import Plugin
|
||||
RAINBOW = (5, 3, 7, 8, 9, 3, 10, 12, 2, 6, 13)
|
||||
RAINBOW_LEN = len(RAINBOW)
|
||||
|
||||
GNU_LINUX = """I'd Just Like To Interject For A Moment. What you're referring
|
||||
to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it,
|
||||
GNU plus Linux. Linux is not an operating system unto itself, but rather
|
||||
another free component of a fully functioning GNU system made useful by the
|
||||
GNU corelibs, shell utilities and vital system components comprising a full
|
||||
OS as defined by POSIX."""
|
||||
|
||||
|
||||
@irc3.plugin
|
||||
class Useless(Plugin):
|
||||
requires = ['irc3.plugins.command']
|
||||
|
||||
@irc3.event(r'(?i)^:\S+ PRIVMSG (?P<channel>\S+) :'
|
||||
r'.*(?<!gnu[/+])linux(?! kernel).*')
|
||||
def linux(self, channel: str):
|
||||
if random.randint(0, 4) is 0:
|
||||
self.bot.privmsg(channel, GNU_LINUX)
|
||||
|
||||
@irc3.event(r'(?i)^:\S+ PRIVMSG (?P<channel>\S+) :(?P<msg>huehuehue)$')
|
||||
def huehuehue(self, channel: str, msg: str):
|
||||
self.bot.privmsg(channel, msg)
|
||||
|
Loading…
Reference in New Issue
Block a user