DiscordBotLinuxMonitor 1.0.1__tar.gz → 1.0.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: DiscordBotLinuxMonitor
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: From discord channels: Get information and warning status of Linux server like service, port, ping, ssl certificate, disk/folder/cpu/ram/swap usage, ip connection, ... (Python and shell library, Linux ONLY)
5
5
  Home-page: https://github.com/QuentinCG/Linux-Monitor-Python-Library
6
6
  Author: Quentin Comte-Gaz
@@ -110,10 +110,10 @@ python3 -m discordbotlinuxmonitor --help
110
110
  # Use "--nodebug" to not show any warning information during command
111
111
 
112
112
  # Start the discord bot Linux monitor (First time)
113
- python3 -m discordbotlinuxmonitor --config_file config-example.json --force_sync_on_startup True --debug
113
+ python3 -m discordbotlinuxmonitor --config_file config-example.json --force_sync_on_startup --debug
114
114
 
115
115
  # Start the discord bot Linux monitor (after first time)
116
- python3 -m discordbotlinuxmonitor --config_file config-example.json --force_sync_on_startup False
116
+ python3 -m discordbotlinuxmonitor --config_file config-example.json
117
117
  ```
118
118
  - Go to discord (restart discord if you were already in it)
119
119
  - You should see welcome messages on channels you configured in the config file and be able to communicate with the bot using command defined in previous section
@@ -128,7 +128,7 @@ DISCORD_BOT_SERVICE_USER="discordbotlinuxmonitor"
128
128
  DISCORD_BOT_SERVICE_GROUP="discordbotlinuxmonitor"
129
129
  DISCORD_BOT_SERVICE_NAME="discord-bot"
130
130
  DISCORD_BOT_SERVICE_FILE="/etc/systemd/system/${DISCORD_BOT_SERVICE_NAME}.service"
131
- DISCORD_BOT_FOLDER="/opt/Discord/"
131
+ DISCORD_BOT_FOLDER="/opt/DiscordBot/"
132
132
 
133
133
  ### Add rights to user launching the library depending on what you want it to do ###
134
134
  # Only if this library should be able to reboot the server on demand:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: DiscordBotLinuxMonitor
3
- Version: 1.0.1
3
+ Version: 1.0.3
4
4
  Summary: From discord channels: Get information and warning status of Linux server like service, port, ping, ssl certificate, disk/folder/cpu/ram/swap usage, ip connection, ... (Python and shell library, Linux ONLY)
5
5
  Home-page: https://github.com/QuentinCG/Linux-Monitor-Python-Library
6
6
  Author: Quentin Comte-Gaz
@@ -110,10 +110,10 @@ python3 -m discordbotlinuxmonitor --help
110
110
  # Use "--nodebug" to not show any warning information during command
111
111
 
112
112
  # Start the discord bot Linux monitor (First time)
113
- python3 -m discordbotlinuxmonitor --config_file config-example.json --force_sync_on_startup True --debug
113
+ python3 -m discordbotlinuxmonitor --config_file config-example.json --force_sync_on_startup --debug
114
114
 
115
115
  # Start the discord bot Linux monitor (after first time)
116
- python3 -m discordbotlinuxmonitor --config_file config-example.json --force_sync_on_startup False
116
+ python3 -m discordbotlinuxmonitor --config_file config-example.json
117
117
  ```
118
118
  - Go to discord (restart discord if you were already in it)
119
119
  - You should see welcome messages on channels you configured in the config file and be able to communicate with the bot using command defined in previous section
@@ -128,7 +128,7 @@ DISCORD_BOT_SERVICE_USER="discordbotlinuxmonitor"
128
128
  DISCORD_BOT_SERVICE_GROUP="discordbotlinuxmonitor"
129
129
  DISCORD_BOT_SERVICE_NAME="discord-bot"
130
130
  DISCORD_BOT_SERVICE_FILE="/etc/systemd/system/${DISCORD_BOT_SERVICE_NAME}.service"
131
- DISCORD_BOT_FOLDER="/opt/Discord/"
131
+ DISCORD_BOT_FOLDER="/opt/DiscordBot/"
132
132
 
133
133
  ### Add rights to user launching the library depending on what you want it to do ###
134
134
  # Only if this library should be able to reboot the server on demand:
@@ -81,10 +81,10 @@ python3 -m discordbotlinuxmonitor --help
81
81
  # Use "--nodebug" to not show any warning information during command
82
82
 
83
83
  # Start the discord bot Linux monitor (First time)
84
- python3 -m discordbotlinuxmonitor --config_file config-example.json --force_sync_on_startup True --debug
84
+ python3 -m discordbotlinuxmonitor --config_file config-example.json --force_sync_on_startup --debug
85
85
 
86
86
  # Start the discord bot Linux monitor (after first time)
87
- python3 -m discordbotlinuxmonitor --config_file config-example.json --force_sync_on_startup False
87
+ python3 -m discordbotlinuxmonitor --config_file config-example.json
88
88
  ```
89
89
  - Go to discord (restart discord if you were already in it)
90
90
  - You should see welcome messages on channels you configured in the config file and be able to communicate with the bot using command defined in previous section
@@ -99,7 +99,7 @@ DISCORD_BOT_SERVICE_USER="discordbotlinuxmonitor"
99
99
  DISCORD_BOT_SERVICE_GROUP="discordbotlinuxmonitor"
100
100
  DISCORD_BOT_SERVICE_NAME="discord-bot"
101
101
  DISCORD_BOT_SERVICE_FILE="/etc/systemd/system/${DISCORD_BOT_SERVICE_NAME}.service"
102
- DISCORD_BOT_FOLDER="/opt/Discord/"
102
+ DISCORD_BOT_FOLDER="/opt/DiscordBot/"
103
103
 
104
104
  ### Add rights to user launching the library depending on what you want it to do ###
105
105
  # Only if this library should be able to reboot the server on demand:
@@ -11,7 +11,7 @@ def main() -> None:
11
11
 
12
12
  # Define available arguments
13
13
  parser.add_argument('--config_file', type=str, required=True, help='Path to the configuration file (must be a JSON file)')
14
- parser.add_argument('--force_sync_on_startup', type=bool, required=True, help='Force discord command synchronization on startup (do it only the first time, because after, you will have a discord command to do it if really needed)')
14
+ parser.add_argument('--force_sync_on_startup', action='store_true', help='Force discord command synchronization on startup (do it only the first time, because after, you will have a discord command to do it if really needed)')
15
15
 
16
16
  parser.add_argument('--debug', action='store_true', help='Enable debug mode')
17
17
  parser.add_argument('--nodebug', action='store_true', help='Disable all logs')
@@ -35,12 +35,10 @@ def main() -> None:
35
35
  sys.exit(1)
36
36
  config_file: str = args.config_file
37
37
 
38
- # Ensure the force_sync_on_startup is provided
39
- if not args.force_sync_on_startup:
40
- print("Error: --force_sync_on_startup is required")
41
- parser.print_help()
42
- sys.exit(1)
43
- force_sync_on_startup: bool = args.force_sync_on_startup
38
+ # Check if force_sync_on_startup is provided
39
+ force_sync_on_startup: bool = False
40
+ if args.force_sync_on_startup:
41
+ force_sync_on_startup = True
44
42
 
45
43
  # Prepare the Discord bot (will throw an exception if the configuration is invalid)
46
44
  discord_bot_linux_monitor = DiscordBotLinuxMonitor(config_file=config_file, force_sync_on_startup=force_sync_on_startup)
@@ -30,7 +30,7 @@ __email__ = "quentin@comte-gaz.com"
30
30
  __license__ = "MIT License"
31
31
  __copyright__ = "Copyright Quentin Comte-Gaz (2024)"
32
32
  __python_version__ = "3.+"
33
- __version__ = "1.0.1 (2024/09/14)"
33
+ __version__ = "1.0.3 (2024/09/14)"
34
34
  __status__ = "Usable for any Linux project"
35
35
 
36
36
  # pyright: reportMissingTypeStubs=false
@@ -6,7 +6,7 @@ with io.open(file='README.md', mode='r', encoding='utf-8') as readme_file:
6
6
 
7
7
  setup(
8
8
  name="DiscordBotLinuxMonitor",
9
- version="1.0.1",
9
+ version="1.0.3",
10
10
  description="From discord channels: Get information and warning status of Linux server like service, port, ping, ssl certificate, disk/folder/cpu/ram/swap usage, ip connection, ... (Python and shell library, Linux ONLY)",
11
11
  long_description=readme,
12
12
  long_description_content_type="text/markdown",