From ee3338df7a0cb84a72bac4cba0607ed094f0fefa Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Thu, 12 Sep 2024 20:18:57 +0100 Subject: [PATCH] Add comments to the start of modules --- app/modules/ai.py | 5 +++++ app/modules/eco.py | 0 app/modules/fediverse_preview.py | 3 +++ app/modules/latency.py | 5 +++++ app/modules/ts_transcode.py | 9 +++++++++ app/modules/version.py | 3 +++ app/modules/yd_dl.py | 3 +++ 7 files changed, 28 insertions(+) create mode 100644 app/modules/eco.py diff --git a/app/modules/ai.py b/app/modules/ai.py index fbffc92..22ae2d0 100644 --- a/app/modules/ai.py +++ b/app/modules/ai.py @@ -1,3 +1,8 @@ +""" +This module is an old mockup of an AI chatbot system using ollama and a set of servers. + +It is not actively used or maintained anymore. +""" import asyncio import json import logging diff --git a/app/modules/eco.py b/app/modules/eco.py new file mode 100644 index 0000000..e69de29 diff --git a/app/modules/fediverse_preview.py b/app/modules/fediverse_preview.py index 1d31277..878317a 100644 --- a/app/modules/fediverse_preview.py +++ b/app/modules/fediverse_preview.py @@ -1,5 +1,8 @@ """ This module takes fediverse links (e.g.) and provides a preview in a reply. + +By default, this will only work with fedi.transgender.ing, but if you set `[fediverse_preview.urls]` in your config, +you can add more. This module will use the Mastodon protocol, however it is designed to be used with misskey. """ import logging import niobot diff --git a/app/modules/latency.py b/app/modules/latency.py index 0bbbc67..b957189 100644 --- a/app/modules/latency.py +++ b/app/modules/latency.py @@ -1,3 +1,8 @@ +""" +This module simply returns the latency between a message being sent and the bot receiving it. + +It also supports a rudimentary federation latency check, by sending a request to the target homeserver. +""" import urllib.parse import niobot diff --git a/app/modules/ts_transcode.py b/app/modules/ts_transcode.py index 1edfc6c..a889090 100644 --- a/app/modules/ts_transcode.py +++ b/app/modules/ts_transcode.py @@ -1,3 +1,12 @@ +""" +This module actively listens for messages in a specific room from specific users, and checks if they contain +a video which uses an unsupported video codec. If it does, it will be transcoded and re-uploaded to the room. + +This is used because we mirror Truth Social into a matrix room and sometimes the videos are in H265, which a lot of +clients cannot play. + +This can easily be adapted to other rooms and users, or even to other types of media, by changing the USER_IDS list. +""" import logging import shlex import shutil diff --git a/app/modules/version.py b/app/modules/version.py index 587cc31..fb4744c 100644 --- a/app/modules/version.py +++ b/app/modules/version.py @@ -1,3 +1,6 @@ +""" +Displays versions for the bot and its dependencies +""" import niobot import asyncio import tomllib diff --git a/app/modules/yd_dl.py b/app/modules/yd_dl.py index 97cb6bc..8c9b04a 100644 --- a/app/modules/yd_dl.py +++ b/app/modules/yd_dl.py @@ -1,3 +1,6 @@ +""" +What it says on the tin - a command wrapper around yt-dlp. +""" import datetime import functools import math