Skip to content

LeGeRyChEeSe/LanPlay-DiscordBot

Repository files navigation

LanPlay-DiscordBot

LanPlay-DiscordBot

Visitors Stars Issues

A Discord bot that provides information on LAN Play servers, players, and games played.

Table of Contents

Get API Key

To use the LanPlay package you will need a specific, non-transferable API key that can be retrieved from LanPlay.

Please follow these steps :

  1. Open a Web Browser and go to http://www.lan-play.com

  2. Open a Console Mode (Ctrl + Shift + C or F12 should work, or Google is your friend to find how to access the Console Mode 🫠)

  3. Go to Network tab and refresh the current page

  4. Search a line named getMonitors and click on it

  5. Open the Payload tab

  6. Copy the api_key value and store it in safe location for the Run the Bot step.

Create a Bot Account

  1. Make sure you’re logged on to the Discord website.

  2. Navigate to the Discord Application for developers.

  3. Click on the New Application button.

  4. Give the application a name and click Create.

  5. Navigate to the Bot tab to configure it.

  6. Make sure that Public Bot is ticked if you want others to invite your bot.

    • You should also make sure that Require OAuth2 Code Grant is unchecked.
  7. Copy the token using the Copy button and store it in safe location for the Run the Bot step.

    • This is not the Client Secret at the General Information page.

      It should be worth noting that this token is essentially your bot’s password. You should never share this with someone else. In doing so, someone can log in to your bot and do malicious things, such as leaving servers, ban all members inside a server, or pinging everyone maliciously.

      The possibilities are endless, so do not share this token.

      If you accidentally leaked your token, click the Regenerate button as soon as possible. This revokes your old token and re-generates a new one. Now you need to use the new token to login.

Invite the bot into your server

  1. Navigate to the Discord Application for developers.

  2. Open the App you previously created for the Bot.

  3. Navigate to OAuth2 tab.

  4. Scroll down and in OAuth2 URL Generator -> SCOPES, tick these boxes:

    • bot
    • applications.commands
  5. Scroll down and in BOT PERMISSIONS, tick these boxes:

    • Manage Expressions
    • Create Expressions
    • Send Messages
    • Send Messages in Threads
    • Embed Links
    • Read Message History
  6. Make sure that INTEGRATION TYPE value is Guild Install.

  7. Copy/Paste the GENERATED URL at bottom to a new Browser Tab and add it to your Discord Server.

Run the Bot

docker run -e API_LAN_KEY=<your_lan_api_key> -e TOKEN=<your_discord_token> garohrl/lanplay-discordbot:latest
  • If you want the Discord Bot running in background:
docker run -d -e API_LAN_KEY=<your_lan_api_key> -e TOKEN=<your_discord_token> garohrl/lanplay-discordbot:latest

Replace <your_lan_api_key> with your api_key and replace <your_discord_token> with your token.

Commands Available

Command Input Output Permission
/help None Help Menu Everybody
/lan select a server LanPlay Server Infos Everybody
/add server
e.g. 'tekn0.net:11451'
Status of server addition Admin
/delete server
e.g. 'tekn0.net:11451'
Status of server deletion Admin

Contributing

Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/NewFeature)
  3. Commit your Changes (git commit -m 'Add some NewFeature')
  4. Push to the Branch (git push origin feature/NewFeature)
  5. Open a Pull Request

Thanks to every contributors who have contributed in this project.

License

Distributed under the MIT License. See LICENSE for more information.

Star History

Star History Chart


Author/Maintainer: Garoh | Discord: garohrl

About

A Discord Bot for retrieving data from http://lan-play.com/

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published