Skip to content

Commit 2d2448d

Browse files
authored
Merge pull request #1 from PaulBayfield/main
chore: move from pip to uv
2 parents a2c56e7 + 377b468 commit 2d2448d

File tree

10 files changed

+454
-21
lines changed

10 files changed

+454
-21
lines changed

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
FROM python:3.12.7-alpine3.20
2-
3-
RUN apk add --no-cache git
1+
FROM python:3.12.10-alpine
2+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
43

54
COPY . ./ScalarBot
65

76
WORKDIR /ScalarBot
87

9-
RUN pip install --no-cache-dir -r requirements.txt
8+
RUN uv sync --frozen
109

11-
CMD ["python", "__main__.py"]
10+
CMD ["uv", "run", "__main__.py"]

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@ Scalar Discord's server official Bot
99
# 📖 • Table of contents
1010

1111
- [📄 • Presentation](#--presentation)
12-
- [📃 • Credits](#--credits)
1312
- [📝 • License](#--license)
1413

1514
# 📄 • Presentation
1615

17-
This repository contains the source code of the Scalar Bot, the official bot of the Scalar Discord server.
18-
19-
# 📃 • Credits
20-
21-
- [Paul Bayfield](https://github.com/PaulBayfield)
16+
This repository contains the source code of the Scalar Bot, the official bot of the Scalar Discord server.
17+
The bot is designed to enhance the experience of the Scalar community by providing various features and functionalities.
18+
The Scalar Bot is publicly available, meaning it can be used in Direct Messages, Private Groups, as well as any Discord server.
19+
20+
Made by [Paul Bayfield](https://github.com/PaulBayfield)
2221

2322
# 📝 • License
2423

2524
```
26-
Copyright 2025 Scalar, Paul Bayfield
25+
Copyright 2025 Scalar
2726
2827
Licensed under the Apache License, Version 2.0 (the "License");
2928
you may not use this file except in compliance with the License.

ScalarBot/cogs/Commands.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class Commands(commands.Cog):
88
"""
9-
Commandes du bot.
9+
Bot commands for the Scalar bot.
1010
"""
1111
def __init__(self, client: commands.Bot):
1212
self.client = client
@@ -34,26 +34,32 @@ async def scalar(
3434
icon_url=self.client.user.avatar.url,
3535
)
3636

37-
website = discord.ui.Button(
37+
button_website = discord.ui.Button(
3838
style=discord.ButtonStyle.link,
3939
label="Website",
4040
url="https://scalar.com",
4141
)
42-
docs = discord.ui.Button(
42+
button_docs = discord.ui.Button(
4343
style=discord.ButtonStyle.link,
4444
label="Documentation",
4545
url="https://guides.scalar.com",
4646
)
47-
github = discord.ui.Button(
47+
button_github = discord.ui.Button(
4848
style=discord.ButtonStyle.link,
4949
label="Github",
5050
url="https://github.com/scalar/scalar",
5151
)
52+
button_discord = discord.ui.Button(
53+
style=discord.ButtonStyle.link,
54+
label="Discord",
55+
url=self.client.config.discord_invite,
56+
)
5257

5358
view = discord.ui.View()
54-
view.add_item(website)
55-
view.add_item(docs)
56-
view.add_item(github)
59+
view.add_item(button_website)
60+
view.add_item(button_docs)
61+
view.add_item(button_github)
62+
view.add_item(button_discord)
5763

5864
await interaction.response.send_message(
5965
embed=embed,

ScalarBot/cogs/Events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Events(commands.Cog):
1111
def __init__(self, client: discord.Client):
1212
self.client = client
1313

14-
14+
1515
@commands.Cog.listener()
1616
async def on_message(self, message: discord.Message):
1717
if message.author.bot or message.guild is None or message.author.id == self.client.user.id or message.content == "":

ScalarBot/utils/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ def __init__(self, environ: dict):
1010
self.channel_showcase = int(environ.get("DISCORD_CHANNEL_SHOWCASE", 0))
1111
self.embed_colour = int(environ.get("DISCORD_EMBED_COLOUR", 0), base=16)
1212
self.footer_text = f"© {datetime.now().year} Scalar • scalar.com"
13+
self.discord_invite = environ.get("DISCORD_INVITE", "https://discord.gg/scalar")

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
volumes:
77
- discord.log:/ScalarBot/discord.log
88
environment:
9-
- PYTHONUNBUFFERED=0
9+
- PYTHONUNBUFFERED=1
1010
- TOKEN=${TOKEN}
1111
- DISCORD_INVITE_URL=${DISCORD_INVITE_URL}
1212
- DISCORD_EMBED_COLOUR=${DISCORD_EMBED_COLOUR}

pyproject.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[project]
2+
name = "scalar-bot"
3+
version = "1.0.0"
4+
description = "Our Discord bot for https://discord.gg/scalar"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = [
8+
"aiohttp>=3.11.17",
9+
"discord-py>=2.5.2",
10+
"python-dotenv>=1.1.0",
11+
]

requirements.txt

-112 Bytes
Binary file not shown.

uv.lock

Lines changed: 416 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)