From b01f1182f2968800d80eb9ba5295a1e76e05aef5 Mon Sep 17 00:00:00 2001 From: Ryan <49689423+FriedCheese2006@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:32:29 -0500 Subject: [PATCH 1/4] Create discord_setup.md Create a section on how to setup the Discord integrations. --- getting-started/discord_setup.md | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 getting-started/discord_setup.md diff --git a/getting-started/discord_setup.md b/getting-started/discord_setup.md new file mode 100644 index 0000000..4d382a0 --- /dev/null +++ b/getting-started/discord_setup.md @@ -0,0 +1,47 @@ +# Discord Setup + +## Discord Bot +### Create Bot +
    +
  1. Go to https://discord.com/developers/applications
  2. +
  3. Click on "New Application" in the upper-right
  4. +
  5. Give it a name of your choosing and select the tickbox for the ToS
  6. +
  7. Click "Create"
  8. +
  9. Select "Bot" in the list on the left
  10. +
  11. In the section labeled "Privileged Gateway Intents", enable the option for "MESSAGE CONTENT INTENT"
    This will allow the bot to read messages in the Discord server.
  12. +
  13. Scroll back to the top and under "Token", click on "Reset Token". Copy the token value.
  14. +
+ +### Setup Bot +
    +
  1. In WindowsGSM, go to the Discord tab
  2. +
  3. Click "Edit" next to "Discord Bot Token", paste in the copied token, and click "Save"
  4. +
  5. CLick on the "Invite" button near the top
    This will take you to Discord.
  6. +
  7. Select the correct server from the list and click continue
  8. +
  9. Review and authorize the requested permissions.
  10. +
+ +### Setup Admin Accounts +You will need to explicitly provide which Discord users will be permitted to use the bot commands. Each admin user will need to perform these steps. + +#### Get User ID from Discord +
    +
  1. In Discord, go to "Settings"
  2. +
  3. In the "App Settings" section, select the "Advaned" option
  4. +
  5. Enable "Developer Mode" and exit the settings menu
  6. +
  7. Select your profile icon in the bottom-left corner and click "Copy User ID
  8. +
  9. Provide this to the WindowsGSM admin
  10. +
+ +#### Add Admin User to WindowsGSM +
    +
  1. Go to the Discord tab in WindowsGSM
  2. +
  3. Click "ADD ADMIN ID" in the upper-right
  4. +
  5. Paste in the ID provided from above
    By default, the admin will have permissions to manage all servers. If they should only have permissions for specific servers, continue to the next step. Otherwise, stop here.
  6. +
  7. Click "EDIT SERVER ID" in the upper-right
  8. +
  9. Provide a list of server IDs they should be able to manage using the provided sample format![image](https://github.com/WindowsGSM/Documentation/assets/49689423/2960d96f-72fc-4f69-bbf8-399fd2b421c2) +
  10. +
+ +## Discord Webhooks +These are used to provide notifications for server status changes. Webhooks are setup per server in WindowsGSM. This allows for setting up a webhook per channel in Discord per server From 0233bd53f2c524cabe5e032d5ffad82595496b6f Mon Sep 17 00:00:00 2001 From: Ryan <49689423+FriedCheese2006@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:34:26 -0500 Subject: [PATCH 2/4] Update discord_setup.md --- getting-started/discord_setup.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/getting-started/discord_setup.md b/getting-started/discord_setup.md index 4d382a0..70a7ea8 100644 --- a/getting-started/discord_setup.md +++ b/getting-started/discord_setup.md @@ -21,10 +21,10 @@
  • Review and authorize the requested permissions.
  • -### Setup Admin Accounts +## Setup Admin Accounts You will need to explicitly provide which Discord users will be permitted to use the bot commands. Each admin user will need to perform these steps. -#### Get User ID from Discord +### Get User ID from Discord
    1. In Discord, go to "Settings"
    2. In the "App Settings" section, select the "Advaned" option
    3. @@ -33,7 +33,7 @@ You will need to explicitly provide which Discord users will be permitted to use
    4. Provide this to the WindowsGSM admin
    -#### Add Admin User to WindowsGSM +### Add Admin User to WindowsGSM
    1. Go to the Discord tab in WindowsGSM
    2. Click "ADD ADMIN ID" in the upper-right
    3. From eff11a4266395be97bcb67ac137ba6111fb060b5 Mon Sep 17 00:00:00 2001 From: Ryan <49689423+FriedCheese2006@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:06:16 -0500 Subject: [PATCH 3/4] Update discord_setup.md Update to section for getting user ID in Discord. --- getting-started/discord_setup.md | 36 ++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/getting-started/discord_setup.md b/getting-started/discord_setup.md index 70a7ea8..d0c7cd7 100644 --- a/getting-started/discord_setup.md +++ b/getting-started/discord_setup.md @@ -26,11 +26,8 @@ You will need to explicitly provide which Discord users will be permitted to use ### Get User ID from Discord
        -
      1. In Discord, go to "Settings"
      2. -
      3. In the "App Settings" section, select the "Advaned" option
      4. -
      5. Enable "Developer Mode" and exit the settings menu
      6. -
      7. Select your profile icon in the bottom-left corner and click "Copy User ID
      8. -
      9. Provide this to the WindowsGSM admin
      10. +
      11. In Discord, find the user to be added as an admin. This can be done from a post or the members list in a server
      12. +
      13. Right-click on the user and select "Copy User ID"
      ### Add Admin User to WindowsGSM @@ -44,4 +41,31 @@ You will need to explicitly provide which Discord users will be permitted to use
    ## Discord Webhooks -These are used to provide notifications for server status changes. Webhooks are setup per server in WindowsGSM. This allows for setting up a webhook per channel in Discord per server +These are used to provide notifications for server status changes. Webhooks are setup per server in WindowsGSM. This allows for setting up a webhook per channel in Discord per server in WindowsGSM. This allows for granularity so that notifications for a particular game server are only posted in the relevant Discord channel. All game servers can be setup with a single webhook to have all notifications posted to a single channel in Discord. + +### Generate Webhook URL +
      +
    1. In Discord, go to the channel where you'd like the alerts to be sent for the game server
    2. +
    3. Right-click the channel name and select "Edit Channel"
    4. +
    5. Select "Integrations from the left-hand menu
    6. +
    7. Click on "Create Webhook"
      If you already have a webhook setup, click on "View Webhooks" and then select "New Webhook" instead
      The webhook name will autogenerate
    8. +
    9. Select the newly created webhook
    10. +
    11. Click on "Copy Webhook URL"
      You can optionally rename the webhook as well, but this is not required.
    12. +
    + +### Setup Webhook in WindowsGSM +
      +
    1. Select the game server from the list in WindowsGSM that you want to setup the webhook for
    2. +
    3. In the settings pane (bottom left-hand), click on "Edit" next to "Discord Alert"
    4. +
    5. Paste in the webhook URL copied from above and click save
    6. +
    7. Turn on the toggle next to "Discord Alert"
    8. +
    9. Click on "Test Alert" and you should see a message pop into the Discord channel
    10. +
    + +From here, you can configure some of the alert behaviors. + +#### Set Message +This is a preconfigured, static message that will always been shown when the alert fires. This can be set to mention a user for push notifications/alerts from Discord. To do so, get the user's ID from the section above "Get User ID from Discord" and use it in the text field following the example formatting shown.
    The carrots ARE REQUIRED for @ notifications to work + +#### Settings +This allows you to select from a list of events that will trigger an alert through the webhook. From 8bcf3bc649eccdb55221fa90f0e8cd897abc8ede Mon Sep 17 00:00:00 2001 From: Ryan <49689423+FriedCheese2006@users.noreply.github.com> Date: Mon, 5 Feb 2024 12:38:16 -0500 Subject: [PATCH 4/4] Update discord_setup.md Formatting --- getting-started/discord_setup.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/getting-started/discord_setup.md b/getting-started/discord_setup.md index d0c7cd7..dc3fcd1 100644 --- a/getting-started/discord_setup.md +++ b/getting-started/discord_setup.md @@ -16,30 +16,35 @@
    1. In WindowsGSM, go to the Discord tab
    2. Click "Edit" next to "Discord Bot Token", paste in the copied token, and click "Save"
    3. -
    4. CLick on the "Invite" button near the top
      This will take you to Discord.
    5. +
    6. Enable the bot by turning on the toggle under "Enable"
    7. +
    8. Click on the "Invite" button near the top
      This will take you to Discord.
    9. Select the correct server from the list and click continue
    10. Review and authorize the requested permissions.
    +You should see the bot join the server. + ## Setup Admin Accounts You will need to explicitly provide which Discord users will be permitted to use the bot commands. Each admin user will need to perform these steps. ### Get User ID from Discord
    1. In Discord, find the user to be added as an admin. This can be done from a post or the members list in a server
    2. -
    3. Right-click on the user and select "Copy User ID"
    4. +
    5. Right-click on the user and select "Copy User ID"
      ⚠️ The user ID is a string of numbers.
    ### Add Admin User to WindowsGSM
    1. Go to the Discord tab in WindowsGSM
    2. Click "ADD ADMIN ID" in the upper-right
    3. -
    4. Paste in the ID provided from above
      By default, the admin will have permissions to manage all servers. If they should only have permissions for specific servers, continue to the next step. Otherwise, stop here.
    5. +
    6. Paste in the ID provided from above
      ⚠️ The user ID is a string of numbers.
      ⚠️ By default, the admin will have permissions to manage all servers. If they should only have permissions for specific servers, continue to the next step. Otherwise, stop here.
    7. Click "EDIT SERVER ID" in the upper-right
    8. -
    9. Provide a list of server IDs they should be able to manage using the provided sample format![image](https://github.com/WindowsGSM/Documentation/assets/49689423/2960d96f-72fc-4f69-bbf8-399fd2b421c2) -
    10. +
    11. Provide a list of server IDs they should be able to manage using the provided sample format!
    +### Check Setup +From any channel the bot has access to, send a message of "wgsm chec" (without the quotes) and verify that you get a response. If not, double-check + ## Discord Webhooks These are used to provide notifications for server status changes. Webhooks are setup per server in WindowsGSM. This allows for setting up a webhook per channel in Discord per server in WindowsGSM. This allows for granularity so that notifications for a particular game server are only posted in the relevant Discord channel. All game servers can be setup with a single webhook to have all notifications posted to a single channel in Discord. @@ -65,7 +70,7 @@ These are used to provide notifications for server status changes. Webhooks are From here, you can configure some of the alert behaviors. #### Set Message -This is a preconfigured, static message that will always been shown when the alert fires. This can be set to mention a user for push notifications/alerts from Discord. To do so, get the user's ID from the section above "Get User ID from Discord" and use it in the text field following the example formatting shown.
    The carrots ARE REQUIRED for @ notifications to work +This is a preconfigured, static message that will always been shown when the alert fires. This can be set to mention a user for push notifications/alerts from Discord. To do so, get the user's ID from the section above "Get User ID from Discord" and use it in the text field following the example formatting shown.
    ⚠️ The carrots ARE REQUIRED for @ notifications to work #### Settings This allows you to select from a list of events that will trigger an alert through the webhook.