Compare commits
2
Commits
7adb8dc386
...
18e67e6137
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18e67e6137 | ||
|
|
5681efe1e0 |
No files matched your search
@@ -8,7 +8,7 @@ source of truth: a file removed means its emoji is deleted.
|
|||||||
## Install
|
## Install
|
||||||
|
|
||||||
```
|
```
|
||||||
dpy_appemojis @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_appemojis.git@v1.0.0
|
dpy_appemojis @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_appemojis.git@v1.1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "dpy_appemojis"
|
name = "dpy_appemojis"
|
||||||
version = "1.1.0"
|
version = "1.1.1"
|
||||||
description = "Mirror a project folder onto the bot's application emojis for discord.py — folder is the source of truth. Config-free, injectable, installable."
|
description = "Mirror a project folder onto the bot's application emojis for discord.py — folder is the source of truth. Config-free, injectable, installable."
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|||||||
@@ -172,22 +172,13 @@ class DPYAppEmojis:
|
|||||||
|
|
||||||
for name in to_create:
|
for name in to_create:
|
||||||
image = await asyncio.to_thread(_read_file, desired[name])
|
image = await asyncio.to_thread(_read_file, desired[name])
|
||||||
try:
|
|
||||||
emoji = await self._client.create_application_emoji(name=name, image=image)
|
emoji = await self._client.create_application_emoji(name=name, image=image)
|
||||||
except discord.HTTPException:
|
|
||||||
# raise XOR log: this re-raises, so the exception carries the failure to the
|
|
||||||
# caller (who decides fatal-vs-routine) - no error log here would double-report.
|
|
||||||
raise
|
|
||||||
current[name] = emoji
|
current[name] = emoji
|
||||||
result.created.append(name)
|
result.created.append(name)
|
||||||
|
|
||||||
for name, emoji in list(existing.items()):
|
for name, emoji in list(existing.items()):
|
||||||
if name not in desired:
|
if name not in desired:
|
||||||
try:
|
|
||||||
await emoji.delete()
|
await emoji.delete()
|
||||||
except discord.HTTPException:
|
|
||||||
# raise XOR log: re-raises, so the exception is the signal - no log here.
|
|
||||||
raise
|
|
||||||
current.pop(name, None)
|
current.pop(name, None)
|
||||||
result.deleted.append(name)
|
result.deleted.append(name)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user