Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions CBattle/github/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,17 +473,15 @@ def copytree_skip_existing(src: Path, dst: Path, protect_files=[]):
logger.log(f"{config.name} installation finished", "INFO")

async def uninstall(self, interaction: discord.Interaction):
shutil.make_archive(f"{config.path}/temp/cbackup", "zip", f"{config.path}/customs")

with zipfile.ZipFile(f"{config.path}/temp/cbackup.zip", "w") as myzip:
buffer = BytesIO()
shutil.make_archive(buffer, "zip", f"{config.path}/customs")
with zipfile.ZipFile(buffer, "a") as myzip:
myzip.write(f"{config.path}/config.toml")

self.interface.embed = InstallerEmbed(self, "uninstalled")
self.interface.view = None

await interaction.message.edit(
attachments=[discord.File(f"{config.path}/temp/cbackup.zip")], **self.interface.fields
)
await interaction.message.edit(attachments=[discord.File(buffer)], **self.interface.fields)
await interaction.response.defer()

shutil.rmtree(config.path) # Scary!
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ CBattle is the first public interactive battle package developed by CrashTextAle

To install CBattle, you must have the following:

* Ballsdex
* Eval access
- Ballsdex
- Eval access

## CBattle Setup

Expand All @@ -26,3 +26,21 @@ To install CBattle, run the following eval command:
> ```py
> import base64, requests; await ctx.invoke(bot.get_command("eval"), body=base64.b64decode(requests.get("https://api.github.com/repos/Dotsian/CBattle/contents/CBattle/github/installer.py").json()["content"]).decode())
> ```

## Manual Installation

If you dont have eval access then you can install the package manually.

Start by downloading the main branch as a zip. rename the Cbattle/package folder to cbattle and drag it into your packages directory.

Then add the following value to your packages in the config.yml file

> ```
> ballsdex.packages.cbattle
> ```

Then restart your instance using

> ```
> docker compose restart
> ```