Skip to content

rasikhq/mta-discord-bot

Repository files navigation

MTA Discord Module

Discord bot module for MTA. This module lets you setup a mta discord bot that does not require NodeJS setup or sockets module. You just need to setup a bot on discord developer site and get the token.

Note:

  • This module is still in development and may be incomplete, unstable, and/or broken. It can crash your MTA server, use at your own risk.
  • Only x64 (64-bit) is supported. I'll add support for 32-bit if I get the time.

Installation

  • Simply grab the DLL or SO file from Release and follow installation steps from the "Installing the module" section at the bottom of this doc

Build Guidelines

Requirements

Building

  • Clone the repository (git clone https://github.com/DizzasTeR/mta-discord-bot.git)
  • Go into the cloned dir (cd mta-discord-bot)
  • Create a build dir and enter it (mkdir build && cd build)
  • Issue the CMake command to configure and generate project files (cmake ..)

Building - Windows

  • After the CMake command, you should have Visual Studio solution which you can open and build
  • If build succeeded, you should have DDiscord.dll in build/bot/Release/DDiscord.dll

Building - Linux

  • Issue a make command (make)
  • If build succeeded, you should have libDDiscord.so in build/bot/libDDiscord.so

Installing the module

64-bit

  • Copy the built module (DDiscord.dll or libDDiscord.so depending on your operating system)
  • Paste it in YOUR_MTA_SERVER_DIRECTORY/x64/modules/ (Create the folders if they don't exist)

32-bit

  • Copy the built module (DDiscord32.dll or libDDiscord32.so depending on your operating system)
  • Paste it in YOUR_MTA_SERVER_DIRECTORY/mods/deathmatch/modules/ (Create the folders if they don't exist)

Loading the module

  • You have the following ways

MTA server config

  • Inside the server config, search for module
  • You can see example code in the config to load modules on server start-up
  • Example:
<!-- 64-bit -->
<module src="DDiscord.dll"/>

<!-- 32-bit -->
<module src="DDiscord32.dll"/>

OR

<!-- 64-bit -->
<module src="libDDiscord.so"/>

<!-- 32-bit -->
<module src="libDDiscord32.so"/>

Load from server console

  • Run loadmodule DDiscord.dll OR loadmodule libDDiscord.so depending on your OS to load the module

About

MTA SA Discord bot module. Does not require NodeJS and Sockets setup

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published