Skip to content

Commit 6a2cadf

Browse files
committed
Refactor: Remove unused modules and update versioning
Removed `bot_directory.py` and `log_handler.py` as they are no longer required. Updated `Discord-Bot-AutoPublisher.pyproj` to reflect these removals and adjusted the Python environment description. Updated `Dockerfile` to remove references to the `CustomModules` directory and incremented the bot version to `1.7.8`. Refined `support_invite_command` in `main.py` to handle missing support server configurations and improve response formatting. Updated `requirements.txt` with placeholder dependencies for removed modules.
1 parent 3479223 commit 6a2cadf

File tree

6 files changed

+13
-252
lines changed

6 files changed

+13
-252
lines changed

CustomModules/bot_directory.py

Lines changed: 0 additions & 115 deletions
This file was deleted.

CustomModules/log_handler.py

Lines changed: 0 additions & 125 deletions
This file was deleted.

Discord-Bot-AutoPublisher.pyproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,16 @@
2222
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
2323
</PropertyGroup>
2424
<ItemGroup>
25-
<Compile Include="CustomModules\bot_directory.py" />
26-
<Compile Include="CustomModules\log_handler.py" />
2725
<Compile Include="main.py" />
2826
</ItemGroup>
2927
<ItemGroup>
3028
<Content Include="requirements.txt" />
3129
</ItemGroup>
32-
<ItemGroup>
33-
<Folder Include="CustomModules\" />
34-
</ItemGroup>
3530
<ItemGroup>
3631
<Interpreter Include="env\">
3732
<Id>env</Id>
3833
<Version>3.12</Version>
39-
<Description>env (Python 3.12 (64-bit))</Description>
34+
<Description>env (Python 3.12.10)</Description>
4035
<InterpreterPath>Scripts\python.exe</InterpreterPath>
4136
<WindowsInterpreterPath>Scripts\pythonw.exe</WindowsInterpreterPath>
4237
<PathEnvironmentVariable>PYTHONPATH</PathEnvironmentVariable>

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
WORKDIR /app
44

5-
COPY CustomModules ./CustomModules
65
COPY *.py .
76
COPY requirements.txt .
87

@@ -29,6 +28,6 @@ LABEL maintainer="Discord: pika.pika.no.mi (970119359840284743)" \
2928
description="This bot automatically publishes messages in announcement channels on discord." \
3029
release=$BUILD_DATE \
3130
url="https://github.com/Serpensin/DiscordBots-AutoPublisher" \
32-
version="1.7.7"
31+
version="1.7.8"
3332

3433
CMD ["python3", "main.py"]

main.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#Init
2525
discord.VoiceClient.warn_nacl = False
2626
load_dotenv()
27-
BOT_VERSION = '1.7.7'
27+
BOT_VERSION = '1.7.8'
2828
APP_FOLDER_NAME = 'AutoPublisher'
2929
BOT_NAME = 'AutoPublisher'
3030
if not os.path.exists(f'{APP_FOLDER_NAME}//Logs'):
@@ -599,12 +599,18 @@ async def broadcast(message):
599599
@tree.command(name = 'support', description = 'Get invite to our support server.')
600600
@discord.app_commands.checks.cooldown(1, 60, key=lambda i: (i.user.id))
601601
async def support_invite_command(interaction: discord.Interaction):
602-
await interaction.response.defer(ephemeral = True)
602+
await interaction.response.defer(thinking=True)
603603

604+
if not SUPPORT_ID:
605+
await interaction.followup.send('There is no support server setup!', ephemeral=True)
606+
return
607+
if interaction.guild is None:
608+
await interaction.followup.send(await Functions.create_support_invite(interaction), ephemeral=True)
609+
return
604610
if str(interaction.guild.id) != SUPPORT_ID:
605-
await interaction.followup.send(await Functions.create_support_invite(interaction), ephemeral = True)
611+
await interaction.followup.send(await Functions.create_support_invite(interaction), ephemeral=True)
606612
else:
607-
await interaction.followup.send('You are already in our support server!', ephemeral = True)
613+
await interaction.followup.send('You are already in our support server!', ephemeral=True)
608614

609615

610616
#Tell user what permissions are required

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ attrs
66
certifi
77
charset-normalizer
88
colorama
9+
CustomModules[log_handler,bot_directory]
910
discord.py>2.0.0
1011
frozenlist
1112
idna

0 commit comments

Comments
 (0)