Skip to content

tworst46/twadminmenu_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tworst-bot

Discord bot for tw-adminmenu — manage your FiveM server straight from Discord. It connects to your Tworst Cloud panel and lets your staff moderate players, run server actions, manage teams and whitelists, and get event/ticket notifications, all with slash commands in 12 languages.

Features

  • Player moderation — ban, kick, warn, jail, freeze, strip weapons.
  • Player actions — heal, revive, kill, slap, explode, give item/money, set job/model, wipe.
  • Server — live status, online players, announcements.
  • Info — player lookup, ban list, vehicle lookup.
  • Teams & whitelist — list/inspect teams, add/remove members, manage the whitelist and its mode.
  • Event announcements — auto-post to a channel (and DM staff) when an in-game event is scheduled.
  • Role / staff sync (optional) — mirror roles and staff between Discord and the game.
  • 12 languages — English, Türkçe, Deutsch, Français, Español, Português, Русский, Polski, Nederlands, Italiano, Română, العربية. Switch any time with /language.

Requirements

  • Node.js 20 or newer
  • A Discord application + bot token (Developer Portal)
  • A Tworst Cloud server with a bot secret (panel → Server Settings)

Setup

  1. Install dependencies

    npm install
  2. Configure

    Copy .env.example to .env and fill in your values:

    cp .env.example .env

    At minimum you need DISCORD_BOT_TOKEN, DISCORD_BOT_CLIENT_ID, BOT_SECRET, BOT_TENANT_ID, and BOT_SERVER_ID. Every option is documented in .env.example.

  3. Register the slash commands (run once, and again whenever commands change)

    npm run deploy-commands
  4. Start the bot

    npm start

    During development you can use npm run dev for auto-reload.

Commands

Group Commands
Server /status · /players · /announce
Moderation /ban · /unban · /kick · /warn · /jail · /unjail · /freeze · /unfreeze · /stripweapons
Actions /heal · /revive · /kill · /slap · /explode · /giveitem · /givemoney · /setjob · /setmodel · /wipe
Info /player · /banlist · /vehicle · /spawnvehicle
Teams /teamlist · /teaminfo · /teamadd · /teamremove
Whitelist /whitelist · /whitelistadd · /whitelistremove · /whitelistmode
Events /events · /event · /event-channel
System /language

Slash commands are registered per Discord guild, so they appear instantly.

Role & Staff Sync (optional)

Off by default. Set BOT_ROLE_SYNC=1 (and BOT_GUILD_ID) to enable two-way role mirroring between Discord and the game, plus the /sync, /teamsync, /setrole, and /unstaff commands. Leave it at 0 if you don't want Discord to control in-game staff or roles.

Languages

The bot ships with 12 fully translated languages. Set the default with BOT_LOCALE in .env, or change it live with /language set. New translations live in src/i18n/locales/<code>.ts and are picked up automatically.

Project layout

src/
  index.ts            Entry point (connect, then start Discord)
  config.ts           Environment configuration
  bridge/             WebSocket client to the Tworst Cloud agent
  commands/           Slash commands, grouped by area
  features/           Event + ticket announcements
  sync/               Role and team sync
  i18n/               Translations (locales/) and the t() helper
  discord/            Client, interaction routing, command deploy

License

Released under the MIT License — free to use, modify, and self-host.

About

Discord bot for tw-adminmenu — manage your FiveM server from Discord (12 languages)

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages