mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-24 03:54:20 +00:00
Remove /markov
This commit is contained in:
parent
9b4764c28b
commit
5ec1b971b0
3 changed files with 0 additions and 44 deletions
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
riotwatcher = "^2.7.1"
|
riotwatcher = "^2.7.1"
|
||||||
royalspells = "^3.2"
|
royalspells = "^3.2"
|
||||||
markovify = "^0.8.0"
|
|
||||||
|
|
||||||
[tool.poetry.dependencies.royalnet]
|
[tool.poetry.dependencies.royalnet]
|
||||||
version = "^5.2.4"
|
version = "^5.2.4"
|
||||||
|
|
|
@ -30,7 +30,6 @@ from .peertube import PeertubeCommand
|
||||||
from .funkwhale import FunkwhaleCommand
|
from .funkwhale import FunkwhaleCommand
|
||||||
from .eval import EvalCommand
|
from .eval import EvalCommand
|
||||||
from .exec import ExecCommand
|
from .exec import ExecCommand
|
||||||
from .markov import MarkovCommand
|
|
||||||
|
|
||||||
# Enter the commands of your Pack here!
|
# Enter the commands of your Pack here!
|
||||||
available_commands = [
|
available_commands = [
|
||||||
|
@ -65,7 +64,6 @@ available_commands = [
|
||||||
EvalCommand,
|
EvalCommand,
|
||||||
ExecCommand,
|
ExecCommand,
|
||||||
FunkwhaleCommand,
|
FunkwhaleCommand,
|
||||||
MarkovCommand
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Don't change this, it should automatically generate __all__
|
# Don't change this, it should automatically generate __all__
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
from typing import *
|
|
||||||
from royalnet.commands import *
|
|
||||||
# import markovify
|
|
||||||
# import os
|
|
||||||
# import re
|
|
||||||
|
|
||||||
|
|
||||||
class MarkovCommand(Command):
|
|
||||||
name: str = "markov"
|
|
||||||
|
|
||||||
description: str = "Genera una frase da una catena di Markov."
|
|
||||||
|
|
||||||
syntax: str = "[modello]"
|
|
||||||
|
|
||||||
# _texts: Dict[str, markovify.NewlineText] = {}
|
|
||||||
|
|
||||||
def __init__(self, interface: CommandInterface):
|
|
||||||
super().__init__(interface)
|
|
||||||
# if interface.name == "telegram":
|
|
||||||
# files: List[str] = tuple(os.walk(self.config["Markov"]["models_directory"]))[0][2]
|
|
||||||
# for file in files:
|
|
||||||
# match = re.match(r"(\S+)\.json$", file)
|
|
||||||
# if match is None:
|
|
||||||
# continue
|
|
||||||
# model_name = match.group(1)
|
|
||||||
# with open(os.path.join(self.config["Markov"]["models_directory"], file)) as f:
|
|
||||||
# self._texts[model_name] = markovify.NewlineText.from_json(f.read())
|
|
||||||
|
|
||||||
async def run(self, args: CommandArgs, data: CommandData) -> None:
|
|
||||||
raise CommandError(f"{self} è disattivato. Riprova tra un po' di giorni!")
|
|
||||||
# if self.interface.name != "telegram":
|
|
||||||
# raise UnsupportedError("[c]markov[/c] funziona solo su Telegram.")
|
|
||||||
# model_name = args.optional(0, self.config["Markov"]["default_model"])
|
|
||||||
# try:
|
|
||||||
# sentence = self._texts[model_name].make_sentence()
|
|
||||||
# except KeyError:
|
|
||||||
# raise InvalidInputError("Il modello richiesto non esiste.")
|
|
||||||
# if sentence is None or sentence == "":
|
|
||||||
# await data.reply(f"💭 Il bot ([c]{model_name}[/c])... non dice niente. Riprova!")
|
|
||||||
# else:
|
|
||||||
# await data.reply(f'💬 Il bot ([c]{model_name}[/c]) dice:\n{sentence}')
|
|
Loading…
Reference in a new issue