From 9e69c5ee5b5ca55ffdc5fcbe162bb405e800987a Mon Sep 17 00:00:00 2001 From: SBen-IV Date: Thu, 23 Nov 2023 23:11:45 -0300 Subject: [PATCH] feat: agrego comando /ayuda y nuevo comando WIP --- .gitignore | 1 + src/controllers/jjjameson.py | 11 +++++++++++ src/main.py | 2 ++ src/view/interno.py | 1 + 4 files changed, 15 insertions(+) create mode 100644 src/view/interno.py diff --git a/.gitignore b/.gitignore index c0a12a9..4a2c4d4 100644 --- a/.gitignore +++ b/.gitignore @@ -160,5 +160,6 @@ cython_debug/ .idea/ *.json +*.yaml .devcontainer \ No newline at end of file diff --git a/src/controllers/jjjameson.py b/src/controllers/jjjameson.py index a2a9849..35f7935 100644 --- a/src/controllers/jjjameson.py +++ b/src/controllers/jjjameson.py @@ -47,6 +47,9 @@ def conseguir_noticias(self, update: Update, context: CallbackContext): self.logger.warn("Cantidad de noticias no es número {arg}".format(arg=context.args[0])) raise CantidadNoticiasNoEsNumeroException(arg=context.args[0]) + def convertir_noticia(self, update: Update, context: CallbackContext): + update.effective_chat.send_message("Trabajando en esta feature...") + def __activar_noticias_automaticas(self, job_queue, chat): self.job = job_queue.run_repeating(self.conseguir_noticias_automatico, INTERVALO_MENSAJES_AUTOMATICOS, context=chat) @@ -85,3 +88,11 @@ def conseguir_noticias_automatico(self, context: CallbackContext): def estado(self, update: Update, _: CallbackContext): update.effective_chat.send_message("Noticias automáticas: {noticias_automaticas}".format(noticias_automaticas=self.noticias_automaticas)) + + def ayuda(self, update: Update, context: CallbackContext): + update.effective_chat.send_message("/noticias - trae las últimas noticias\n" + + "/convertir_noticia - convierte la noticia\n" + + "/empezar - \n" + + "/terminar - \n" + + "/estado - \n" + + "/ayuda - imprime este mensaje\n") diff --git a/src/main.py b/src/main.py index b311eb3..e7f1816 100644 --- a/src/main.py +++ b/src/main.py @@ -25,8 +25,10 @@ def main(): filtro = Filters.chat(chat_id=int(os.getenv('ID_GRUPO_NOTICIAS'))) updater.dispatcher.add_handler(CommandHandler('noticias', jameson.conseguir_noticias, filtro)) + updater.dispatcher.add_handler(CommandHandler('convertir_noticia', jameson.convertir_noticia, filtro)) updater.dispatcher.add_handler(CommandHandler('empezar', jameson.activar_noticias_automaticas, filtro)) updater.dispatcher.add_handler(CommandHandler('terminar', jameson.desactivar_noticias_automaticas, filtro)) + updater.dispatcher.add_handler(CommandHandler('ayuda', jameson.ayuda, filtro)) updater.dispatcher.add_handler(CommandHandler('estado', jameson.estado, filtro)) updater.dispatcher.add_error_handler(error_handler) diff --git a/src/view/interno.py b/src/view/interno.py new file mode 100644 index 0000000..7ba6391 --- /dev/null +++ b/src/view/interno.py @@ -0,0 +1 @@ +# Cindy Moon \ No newline at end of file