easterobot 1.1.1__tar.gz → 1.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. {easterobot-1.1.1 → easterobot-1.1.2}/.dockerignore +4 -1
  2. {easterobot-1.1.1 → easterobot-1.1.2}/.github/workflows/tests.yml +13 -0
  3. {easterobot-1.1.1 → easterobot-1.1.2}/Dockerfile +10 -5
  4. {easterobot-1.1.1 → easterobot-1.1.2}/PKG-INFO +6 -1
  5. {easterobot-1.1.1 → easterobot-1.1.2}/README.rst +5 -0
  6. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/commands/disable.py +2 -1
  7. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/commands/edit.py +2 -1
  8. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/commands/enable.py +2 -1
  9. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/commands/game.py +5 -3
  10. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/commands/help.py +4 -1
  11. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/commands/reset.py +2 -1
  12. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/commands/search.py +4 -1
  13. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/config.py +1 -1
  14. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/games/rock_paper_scissor.py +1 -1
  15. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/games/tic_tac_toe.py +2 -2
  16. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/config.example.yml +2 -2
  17. easterobot-1.1.2/entrypoint.sh +6 -0
  18. {easterobot-1.1.1 → easterobot-1.1.2}/pyproject.toml +1 -1
  19. {easterobot-1.1.1 → easterobot-1.1.2}/uv.lock +1 -1
  20. easterobot-1.1.1/entrypoint.sh +0 -6
  21. {easterobot-1.1.1 → easterobot-1.1.2}/.editorconfig +0 -0
  22. {easterobot-1.1.1 → easterobot-1.1.2}/.github/actions/setup-project/action.yml +0 -0
  23. {easterobot-1.1.1 → easterobot-1.1.2}/.github/workflows/docs.yml +0 -0
  24. {easterobot-1.1.1 → easterobot-1.1.2}/.github/workflows/lint.yml +0 -0
  25. {easterobot-1.1.1 → easterobot-1.1.2}/.github/workflows/publish.yml +0 -0
  26. {easterobot-1.1.1 → easterobot-1.1.2}/.gitignore +0 -0
  27. {easterobot-1.1.1 → easterobot-1.1.2}/.pre-commit-config.yaml +0 -0
  28. {easterobot-1.1.1 → easterobot-1.1.2}/.vscode/extensions.json +0 -0
  29. {easterobot-1.1.1 → easterobot-1.1.2}/.vscode/ltex.dictionary.en-US.txt +0 -0
  30. {easterobot-1.1.1 → easterobot-1.1.2}/.vscode/ltex.hiddenFalsePositives.en-US.txt +0 -0
  31. {easterobot-1.1.1 → easterobot-1.1.2}/.vscode/settings.json +0 -0
  32. {easterobot-1.1.1 → easterobot-1.1.2}/LICENSE +0 -0
  33. {easterobot-1.1.1 → easterobot-1.1.2}/conftest.py +0 -0
  34. {easterobot-1.1.1 → easterobot-1.1.2}/docker-compose.yml +0 -0
  35. {easterobot-1.1.1 → easterobot-1.1.2}/docs/conf.py +0 -0
  36. {easterobot-1.1.1 → easterobot-1.1.2}/docs/index.rst +0 -0
  37. {easterobot-1.1.1 → easterobot-1.1.2}/docs/references.rst +0 -0
  38. {easterobot-1.1.1 → easterobot-1.1.2}/docs/resources/favicon.png +0 -0
  39. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/__init__.py +0 -0
  40. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/__main__.py +0 -0
  41. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/alembic/env.py +0 -0
  42. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/alembic/script.py.mako +0 -0
  43. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/alembic/versions/2f0d4305e320_init_database.py +0 -0
  44. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/alembic/versions/940c3b9c702d_add_lock_on_eggs.py +0 -0
  45. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/bot.py +0 -0
  46. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/cli.py +0 -0
  47. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/commands/__init__.py +0 -0
  48. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/commands/base.py +0 -0
  49. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/commands/basket.py +0 -0
  50. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/commands/top.py +0 -0
  51. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/games/__init__.py +0 -0
  52. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/games/connect.py +0 -0
  53. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/games/game.py +0 -0
  54. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/hunts/__init__.py +0 -0
  55. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/hunts/hunt.py +0 -0
  56. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/hunts/rank.py +0 -0
  57. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/info.py +0 -0
  58. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/logger.py +0 -0
  59. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/models.py +0 -0
  60. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/py.typed +0 -0
  61. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/alembic.ini +0 -0
  62. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/credits.txt +0 -0
  63. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_01.png +0 -0
  64. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_02.png +0 -0
  65. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_03.png +0 -0
  66. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_04.png +0 -0
  67. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_05.png +0 -0
  68. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_06.png +0 -0
  69. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_07.png +0 -0
  70. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_08.png +0 -0
  71. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_09.png +0 -0
  72. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_10.png +0 -0
  73. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_11.png +0 -0
  74. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_12.png +0 -0
  75. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_13.png +0 -0
  76. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_14.png +0 -0
  77. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_15.png +0 -0
  78. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_16.png +0 -0
  79. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_17.png +0 -0
  80. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_18.png +0 -0
  81. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_19.png +0 -0
  82. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/eggs/egg_20.png +0 -0
  83. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/icons/arrow.png +0 -0
  84. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/icons/end.png +0 -0
  85. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/icons/versus.png +0 -0
  86. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/emotes/icons/wait.png +0 -0
  87. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/logging.conf +0 -0
  88. {easterobot-1.1.1 → easterobot-1.1.2}/easterobot/resources/logo.png +0 -0
  89. {easterobot-1.1.1 → easterobot-1.1.2}/tests/__init__.py +0 -0
  90. {easterobot-1.1.1 → easterobot-1.1.2}/tests/test_cli.py +0 -0
  91. {easterobot-1.1.1 → easterobot-1.1.2}/tests/test_config.py +0 -0
  92. {easterobot-1.1.1 → easterobot-1.1.2}/tools/chatgpt.txt +0 -0
  93. {easterobot-1.1.1 → easterobot-1.1.2}/tools/cropping.py +0 -0
@@ -3,7 +3,10 @@
3
3
  !pyproject.toml
4
4
  !LICENSE
5
5
  !/easterobot/*.py
6
- !/easterobot/commands/*.py
6
+ !/easterobot/*/*.py
7
+ !/easterobot/*/*/*.py
8
+ !/easterobot/alembic/script.py.mako
9
+ !/easterobot/py.typed
7
10
  !/easterobot/resources
8
11
  !README.rst
9
12
  !entrypoint.sh
@@ -37,3 +37,16 @@ jobs:
37
37
 
38
38
  - name: Run tests
39
39
  run: uv run poe test
40
+ docker:
41
+ name: Docker build
42
+ runs-on: ubuntu-latest
43
+
44
+ steps:
45
+ - name: Checkout code
46
+ uses: actions/checkout@v4
47
+
48
+ - name: Set up Docker
49
+ uses: docker/setup-buildx-action@v3
50
+
51
+ - name: Build services with Docker Compose
52
+ run: docker compose -f docker-compose.yml build
@@ -2,8 +2,8 @@
2
2
  FROM python:3.12-slim
3
3
 
4
4
  # Metadata for clarity and documentation
5
- LABEL maintainer="your_email@example.com"
6
- LABEL description="Docker image for easterobot using uv for dependency management"
5
+ LABEL maintainer="dashstrom.pro@gmail.com"
6
+ LABEL description="Docker image for easterobot, a discord bot for easter events"
7
7
 
8
8
  # Add the UV binary
9
9
  COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
@@ -17,9 +17,6 @@ RUN mkdir /data
17
17
  # Make it read-only
18
18
  RUN chown easterobot:easterobot /data
19
19
 
20
- # Use non-root user for security
21
- USER easterobot
22
-
23
20
  # Change the working directory to the `src` directory
24
21
  WORKDIR /src
25
22
 
@@ -32,8 +29,16 @@ RUN uv sync --frozen --no-install-project
32
29
  # Copy the project into the image
33
30
  COPY . .
34
31
 
32
+ # Fix permissions
33
+ RUN find /src -type d -exec chmod 755 {} \;
34
+ RUN find /src -type f -exec chmod 644 {} \;
35
+ RUN chmod +x /src/entrypoint.sh
36
+
35
37
  # Sync the project
36
38
  RUN uv sync --frozen
37
39
 
40
+ # Use non-root user for security
41
+ USER easterobot
42
+
38
43
  # Default command (use exec form for signal handling)
39
44
  CMD ["/src/entrypoint.sh"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: easterobot
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Discord bot for Easter.
5
5
  Project-URL: Homepage, https://github.com/Dashstrom/easterobot
6
6
  Project-URL: Repository, https://github.com/Dashstrom/easterobot
@@ -121,6 +121,11 @@ from `PyPI <https://pypi.org/project>`_
121
121
  cd easterobot
122
122
  echo "DISCORD_TOKEN=YOU_MUST_PUT_YOUR_TOKEN_HERE" > .env
123
123
 
124
+ # Can be unsafe
125
+ chmod -R 700 .
126
+ mkdir data
127
+ chmod 777 data
128
+
124
129
  # Run the docker container
125
130
  docker compose up -d
126
131
 
@@ -83,6 +83,11 @@ from `PyPI <https://pypi.org/project>`_
83
83
  cd easterobot
84
84
  echo "DISCORD_TOKEN=YOU_MUST_PUT_YOUR_TOKEN_HERE" > .env
85
85
 
86
+ # Can be unsafe
87
+ chmod -R 700 .
88
+ mkdir data
89
+ chmod 777 data
90
+
86
91
  # Run the docker container
87
92
  docker compose up -d
88
93
 
@@ -9,7 +9,8 @@ from .base import Context, controlled_command, egg_command_group
9
9
 
10
10
 
11
11
  @egg_command_group.command(
12
- name="disable", description="Désactiver la chasse aux œufs dans le salon"
12
+ name="disable",
13
+ description="Désactiver la chasse aux œufs dans le salon"
13
14
  )
14
15
  @controlled_command(cooldown=True, manage_channels=True)
15
16
  async def disable_command(ctx: Context) -> None:
@@ -13,7 +13,8 @@ from .base import Context, controlled_command, egg_command_group
13
13
 
14
14
 
15
15
  @egg_command_group.command(
16
- name="edit", description="Editer le nombre d'œufs d'un membre"
16
+ name="edit",
17
+ description="Editer le nombre d'œufs d'un membre",
17
18
  )
18
19
  @controlled_command(cooldown=True, administrator=True)
19
20
  async def edit_command(
@@ -9,7 +9,8 @@ from .base import Context, controlled_command, egg_command_group
9
9
 
10
10
 
11
11
  @egg_command_group.command(
12
- name="enable", description="Activer la chasse dans le salon"
12
+ name="enable",
13
+ description="Activer la chasse dans le salon"
13
14
  )
14
15
  @controlled_command(
15
16
  cooldown=True,
@@ -148,7 +148,8 @@ async def game_dual( # noqa: C901, D103, PLR0912
148
148
 
149
149
 
150
150
  @egg_command_group.command(
151
- name="connect4", description="Lancer une partie de puissance 4."
151
+ name="connect4",
152
+ description="Lancer une partie de puissance 4"
152
153
  )
153
154
  @controlled_command(cooldown=True, channel_permissions={"send_messages": True})
154
155
  async def connect4_command(
@@ -161,7 +162,8 @@ async def connect4_command(
161
162
 
162
163
 
163
164
  @egg_command_group.command(
164
- name="tictactoe", description="Lancer une partie de morpion."
165
+ name="tictactoe",
166
+ description="Lancer une partie de morpion"
165
167
  )
166
168
  @controlled_command(cooldown=True)
167
169
  async def tictactoe_command(
@@ -175,7 +177,7 @@ async def tictactoe_command(
175
177
 
176
178
  @egg_command_group.command(
177
179
  name="rockpaperscissor",
178
- description="Lancer une partie de pierre papier ciseaux.",
180
+ description="Lancer une partie de pierre papier ciseaux",
179
181
  )
180
182
  @controlled_command(cooldown=True)
181
183
  async def rockpaperscissor_command(
@@ -7,7 +7,10 @@ from easterobot.hunts.hunt import embed
7
7
  from .base import Context, controlled_command, egg_command_group
8
8
 
9
9
 
10
- @egg_command_group.command(name="help", description="Obtenir de l'aide")
10
+ @egg_command_group.command(
11
+ name="help",
12
+ description="Obtenir l'aide des commandes"
13
+ )
11
14
  @controlled_command(cooldown=True)
12
15
  async def help_command(ctx: Context) -> None:
13
16
  """Help command."""
@@ -14,7 +14,8 @@ from .base import Context, Interaction, controlled_command, egg_command_group
14
14
 
15
15
 
16
16
  @egg_command_group.command(
17
- name="reset", description="Réinitialiser la chasse aux œufs"
17
+ name="reset",
18
+ description="Réinitialiser la chasse aux œufs"
18
19
  )
19
20
  @controlled_command(cooldown=True, administrator=True)
20
21
  async def reset_command(ctx: Context) -> None:
@@ -21,7 +21,10 @@ from .base import (
21
21
  logger = logging.getLogger("easterobot")
22
22
 
23
23
 
24
- @egg_command_group.command(name="search", description="Rechercher un œuf")
24
+ @egg_command_group.command(
25
+ name="search",
26
+ description="Rechercher un œuf"
27
+ )
25
28
  @controlled_command(cooldown=True, channel_permissions={"send_messages": True})
26
29
  async def search_command(ctx: Context) -> None:
27
30
  """Search command."""
@@ -30,7 +30,7 @@ V = TypeVar("V")
30
30
  Members = Union[discord.Member, list[discord.Member]]
31
31
 
32
32
  HERE = pathlib.Path(__file__).parent.resolve()
33
- RESOURCES = pathlib.Path(__file__).parent.resolve() / "resources"
33
+ RESOURCES = HERE / "resources"
34
34
  DEFAULT_CONFIG_PATH = pathlib.Path("config.yml")
35
35
  EXAMPLE_CONFIG_PATH = RESOURCES / "config.example.yml"
36
36
 
@@ -166,7 +166,7 @@ class RockPaperScissor(Game):
166
166
  if not self.timeout:
167
167
  await self.set_winner(final_winner)
168
168
  else:
169
- dt = self.start_timer(63)
169
+ dt = self.start_timer(32)
170
170
  embed.description += f"\n\n{info}\n\nFin du tour {dt}"
171
171
  embed.set_author(name=header, icon_url=icon_url)
172
172
  await self.message.edit(embed=embed, view=self.view, content="")
@@ -85,7 +85,7 @@ class TicTacToe(Game):
85
85
  content += footer
86
86
 
87
87
  if not self.terminate:
88
- now = datetime.datetime.now() + datetime.timedelta(seconds=62) # noqa: DTZ005
88
+ now = datetime.datetime.now() + datetime.timedelta(seconds=32) # noqa: DTZ005
89
89
  content += f"\n\nFin du tour {format_dt(now, style='R')}"
90
90
 
91
91
  embed = discord.Embed(description=content, color=self.color(user))
@@ -142,7 +142,7 @@ class TicTacToe(Game):
142
142
  await self.set_winner(None)
143
143
  else:
144
144
  self.turn += 1
145
- self.start_timer(60)
145
+ self.start_timer(30)
146
146
  await self.update()
147
147
 
148
148
  @override
@@ -13,8 +13,8 @@ hunt:
13
13
  timeout: 300.0
14
14
  game: 0.6
15
15
  cooldown:
16
- min: 1200.0
17
- max: 3000.0
16
+ min: 600.0
17
+ max: 1800.0
18
18
  weights:
19
19
  base: 0.3
20
20
  egg: 0.4
@@ -0,0 +1,6 @@
1
+ #!/bin/sh
2
+ if [ ! -f /data/config.yml ]
3
+ then
4
+ uv run --frozen easterobot generate /data || exit 1
5
+ fi
6
+ uv run --frozen easterobot run --config /data/config.yml --env
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "easterobot"
3
- version = "1.1.1"
3
+ version = "1.1.2"
4
4
  description = "Discord bot for Easter."
5
5
  authors = [
6
6
  { name = "Dashstrom", email = "dashstrom.pro@gmail.com" }
@@ -541,7 +541,7 @@ wheels = [
541
541
 
542
542
  [[package]]
543
543
  name = "easterobot"
544
- version = "1.1.1"
544
+ version = "1.1.2"
545
545
  source = { editable = "." }
546
546
  dependencies = [
547
547
  { name = "aiosqlite" },
@@ -1,6 +0,0 @@
1
- #!/bin/sh
2
- if [ ! -f /data/config.yml ]
3
- then
4
- uv run easterobot generate /data
5
- fi
6
- uv run easterobot run --config /data/config.yml --env
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes