From 555b1fd3ee8c0a55b52516cb6bd62bee63303e6f Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Fri, 13 Dec 2019 21:46:58 -0600 Subject: [PATCH] Added example start script and service file --- geoffrey_bot.service | 17 +++++++++++++++++ geoffrey_bot_start.py | 23 +++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 geoffrey_bot.service create mode 100644 geoffrey_bot_start.py diff --git a/geoffrey_bot.service b/geoffrey_bot.service new file mode 100644 index 0000000..1381919 --- /dev/null +++ b/geoffrey_bot.service @@ -0,0 +1,17 @@ +# Service file for the Geoffrey Discord Bot + +[Unit] +Description=Geoffrey Discord Bot +After=multi-user.target + +[Service] +User=geoffrey +Group=geoffrey +ExecStart=/home/geoffrey/venv/bin/python3 /home/geoffrey/discord_bot/geoffrey_bot_start.py +Type=simple +Restart=always +RestartSec=15 +TimeoutStartSec=15 + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/geoffrey_bot_start.py b/geoffrey_bot_start.py new file mode 100644 index 0000000..7a13bab --- /dev/null +++ b/geoffrey_bot_start.py @@ -0,0 +1,23 @@ +from GeoffreyBot import bot + +# Set discord_token to the token for the Discord bot +discord_token = "" + +# Set geoffrey_api_url to the base api url of the GeoffreyApp +# Example: +# https://test.zerohighdef.com/GeoffreyApp/api/ +geoffrey_api_url = "https://test.zerohighdef.com/GeoffreyApp/api/" + +# Set geoffrey_base_url to the base link of the url +# Example: +# If Geoffrey runs at https://test.zerohighdef.com/GeoffreyApp/home +# geoffrey_app_url would be https://test.zerohighdef.com/ +geoffrey_base_url = "https://test.zerohighdef.com" + +# Set geoffrey_token to the token generated by the GeoffreyApp +geoffrey_token = "" + +if __name__ == '__main__': + print("Starting bot and connecting to {}".format(geoffrey_api_url)) + bot.start_bot(discord_token=discord_token, geoffrey_api_url=geoffrey_api_url, geoffrey_api_token=geoffrey_token, + geoffrey_app_url=geoffrey_base_url)