Compare commits
No commits in common. "4f0f5d50e607c02dbde9e9e3a1e7cf7f1a67d880" and "c90df959d5fc4b2a5ebe2eba21ca1f4d4fd39152" have entirely different histories.
4f0f5d50e6
...
c90df959d5
4 changed files with 7 additions and 18 deletions
1
bare.py
1
bare.py
|
@ -41,7 +41,6 @@ class bot:
|
||||||
onJoinCmds: list[str]
|
onJoinCmds: list[str]
|
||||||
onStrtCmds: list[str]
|
onStrtCmds: list[str]
|
||||||
markov: MarkovBot
|
markov: MarkovBot
|
||||||
autoMethod: str
|
|
||||||
|
|
||||||
def __init__(self, server: str): ...
|
def __init__(self, server: str): ...
|
||||||
|
|
||||||
|
|
5
bot.py
5
bot.py
|
@ -72,11 +72,6 @@ class bot(bare.bot):
|
||||||
if "onStrtCmds" in conf.servers[server]
|
if "onStrtCmds" in conf.servers[server]
|
||||||
else []
|
else []
|
||||||
)
|
)
|
||||||
self.autoMethod = (
|
|
||||||
conf.servers[server]["autoMethod"]
|
|
||||||
if "autoMethod" in conf.servers[server]
|
|
||||||
else "QUOTE"
|
|
||||||
)
|
|
||||||
self.lastfmLink = conf.lastfmLink
|
self.lastfmLink = conf.lastfmLink
|
||||||
with open("mastermessages.txt") as f:
|
with open("mastermessages.txt") as f:
|
||||||
TMFeed = []
|
TMFeed = []
|
||||||
|
|
|
@ -45,7 +45,6 @@ servers: dict[str, dict[str, Any]] = {
|
||||||
"admins": ["h-tl"],
|
"admins": ["h-tl"],
|
||||||
"hosts": ["owner.firepi"],
|
"hosts": ["owner.firepi"],
|
||||||
"threads": ["radio"],
|
"threads": ["radio"],
|
||||||
"autoMethod": "MARKOV",
|
|
||||||
},
|
},
|
||||||
"backupbox": {
|
"backupbox": {
|
||||||
"address": "127.0.0.1",
|
"address": "127.0.0.1",
|
||||||
|
|
10
handlers.py
10
handlers.py
|
@ -138,18 +138,14 @@ def PRIVMSG(bot: bare.bot, msg: str) -> Union[tuple[None, None], tuple[str, str]
|
||||||
)
|
)
|
||||||
elif kind == "ACTION ducks":
|
elif kind == "ACTION ducks":
|
||||||
bot.msg("\x01ACTION gets hit by a duck\x01", chan)
|
bot.msg("\x01ACTION gets hit by a duck\x01", chan)
|
||||||
if chan in bot.channels and bot.channels[chan] >=bot.interval:
|
if chan in bot.channels and bot.channels[chan] >= bot.interval:
|
||||||
sel = ""
|
|
||||||
bot.channels[chan] = 0
|
|
||||||
if bot.autoMethod == "QUOTE":
|
|
||||||
r.seed()
|
r.seed()
|
||||||
|
bot.channels[chan] = 0
|
||||||
with open("mastermessages.txt", "r") as mm:
|
with open("mastermessages.txt", "r") as mm:
|
||||||
sel = conf.decode_escapes(
|
sel = conf.decode_escapes(
|
||||||
r.sample(mm.readlines(), 1)[0].replace("\\n", "").replace("\n", "")
|
r.sample(mm.readlines(), 1)[0].replace("\\n", "").replace("\n", "")
|
||||||
)
|
)
|
||||||
else:
|
bot.msg(f"[QUOTE] {sel}", chan)
|
||||||
sel = bot.markov.generate_from_sentence(message)
|
|
||||||
bot.msg(f"[{bot.autoMethod}] {sel}", chan)
|
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue