OuTSMoKE
Allows players to connect their discord account with Steam

Supported Games

Discord Auth is a simple plugin allows players to connect their discord account with steam.

Permissions

  • discordauth.auth -- Required for the authenticate command
  • discordauth.deauth -- Required for the deauthenticate command would recommend not giving this permission to the default group

Commands

This plugin provides universal chat and console commands. When using a command in the chat, prefix it with a forward slash: /.

  • auth -- Generates a code which players can send to the bot
  • deauth -- Deauthenticates the player

Configuration

{
  "Settings": {
    "Bot Token": "",
    "Oxide Group": "authenticated",
    "Enable Logging": false,
    "Auth Commands": ["auth", "authenticate"],
    "Deauth Commands": ["deauth", "deauthenticate"],
    "Discord Roles to assign": [
      "Authenticated"
    ],
    "Revoke Oxide Group on Discord Leave": true,
    "Deauthenticate on Discord Leave": false,
    "Chat Prefix": "(Auth)"
  },
  "Authentication Code": {
    "Code Lifetime (minutes)": 60,
    "Code Length": 5,
    "Lowercase": false
  }
}

Localization

{
  "Code Generation": "Here is your code: [#1874CD]{0}[/#]\nJoin our [#EE3B3B]Discord[/#] and PM the code to the Discord Bot",
  "Code Expired": "Your code has [#EE3B3B]Expired![/#]",
  "Authenticated": "Thank you for authenticating your account",
  "Game-Deauthenticated": "Successfully deauthenticated your account",
  "Discord-Deauthenticated": "You have been deauthenticated from {0}",
  "Already Authenticated": "You have already [#1874CD]authenticated[/#] your account, no need to do it again",
  "Not Authenticated": "You aren't authenticated",
  "Group Revoked": "Your '{0}' Group has been revoked! Join the server back to achieve it",
  "Group Granted": "Granted '{0}' Group and the discord roles for joining {1} back",
  "Unable to find code": "Sorry, we couldn't find your code, please try to authenticate again, If you haven't generated a code, please type /auth in-game",
  "No Permission": "You don't have permission to use this command"
}

Developer API

Hooks

private object OnAuthenticate(string steamId, string discordId)
private object OnDeauthenticate(string steamId, string discordId)
// Returning a non-null value overrides default behavior

API Methods

bool API_IsAuthenticated(string Id)
string API_GetSteam(string discordId)
string API_GetDiscord(string steamId)
int API_GetAuthCount()
List<string> API_GetSteamList()
List<string> API_GetDiscordList()

FAQ

Q: Where can I get the bot token and is it require to host the bot?
A: No. It doesn't require the bot hosted, To get the token simply create a bot go to Link

Q: How does it work exactly?
A: Players can generate a code with the authenticate command which they can dm to the bot directly. This will add them to the data and oxide group.

Q: What's the difference between "Deauthenticate on Discord Leave" and "Revoke Oxide Group on Discord Leave"?
A: Deauthenticate will completely remove the player from the data including oxide group while it's not the case with just oxide group

MIT License

Copyright (c) 2021 OuTSMoKE

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.