Skip to content

Commit c80d1c3

Browse files
committed
prod/morpheushelper: add patches
1 parent b64f8f1 commit c80d1c3

3 files changed

Lines changed: 56 additions & 2 deletions

File tree

hosts/prod/morpheushelper/default.nix

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{ config, pkgs, ... }:
2+
23
let
34
ports = {
45
mariadb = 3306;
56
redis = 63791;
67
};
8+
79
baseEnv = {
810
LOG_LEVEL = "INFO";
911
PYCORD_LOG_LEVEL = "ERROR";
@@ -35,19 +37,45 @@ let
3537

3638
VOICE_CHANNEL_NAMES = "elements";
3739
};
40+
41+
src = pkgs.applyPatches {
42+
src = pkgs.fetchFromGitHub {
43+
owner = "PyDrocsid";
44+
repo = "MorpheusHelper";
45+
rev = "41152ab680c539c7ef38559ffe9ac8e153120183";
46+
hash = "sha256-k2/6Ba5Q4XvKiqCErlfYLrAW23qsz8wEBi0/8+UxyWs=";
47+
fetchSubmodules = true;
48+
};
49+
50+
patches = [
51+
./disable-documentation-links.patch
52+
./privileged-intents.patch
53+
];
54+
};
55+
3856
in
57+
3958
{
4059
virtualisation.oci-containers.containers = {
4160
morpheushelper = {
42-
image = "localhost/morpheushelper";
61+
image = "ghcr.io/pydrocsid/morpheushelper:v3.5.3";
62+
imageFile = pkgs.dockerTools.pullImage {
63+
imageName = "ghcr.io/pydrocsid/morpheushelper";
64+
imageDigest = "sha256:0644787b006d52dc3fd7d1789d5d159fd89eacc2393d006f0a379dc295eabeca";
65+
hash = "sha256-aCL+Qob4K3/npl/ogWjwQ6CDO/Pm2zJvOVysvQyyamQ=";
66+
};
4367
pull = "never";
4468
extraOptions = [
4569
"--rm=false"
4670
"--restart=always"
4771
"--network=host"
4872
"--no-healthcheck"
4973
];
50-
volumes = [ "${./config.yml}:/app/config.yml:ro" ];
74+
volumes = [
75+
"${./config.yml}:/app/config.yml:ro"
76+
"${src}/bot:/app/bot:ro"
77+
"${src}/library/PyDrocsid:/usr/local/lib/python3.10/site-packages/PyDrocsid:ro"
78+
];
5179
environmentFiles = [ config.sops.templates."morpheushelper/env".path ];
5280
environment = baseEnv // {
5381
DB_DATABASE = "morpheushelper";
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/library/PyDrocsid/cog.py b/library/PyDrocsid/cog.py
2+
index 0a55b3b..41f8c66 100644
3+
--- a/library/PyDrocsid/cog.py
4+
+++ b/library/PyDrocsid/cog.py
5+
@@ -257,6 +257,7 @@ def load_cogs(bot: Bot, *cogs: Cog) -> None:
6+
7+
8+
def get_documentation(cog: Cog | Type[Cog]) -> str | None:
9+
+ return None
10+
if isinstance(cog, Cog):
11+
cog = type(cog)
12+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/bot/bot.py b/bot/bot.py
2+
index dfab4fe..ccda46d 100644
3+
--- a/bot/bot.py
4+
+++ b/bot/bot.py
5+
@@ -64,7 +64,10 @@ async def fetch_prefix(_, msg: Message) -> Iterable[str]:
6+
return prefix
7+
8+
9+
-bot = Bot(command_prefix=fetch_prefix, case_insensitive=True, intents=(Intents.all()))
10+
+intents = Intents.default()
11+
+intents.members = True
12+
+intents.message_content = True
13+
+bot = Bot(command_prefix=fetch_prefix, case_insensitive=True, intents=intents)
14+
bot.remove_command("help")

0 commit comments

Comments
 (0)