Skip to content

scottadkin/Discord-UT2004-Server-Query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discord-UT2004-Server-Query

A discord bot that communicates with Unreal Tournament 2004 servers and displays their responses.

image

Requirements

  • Node.js Version 22.12.0 or later.

Bot commands

adminCommands

  • .addserver alias ip:port Add a server to the database with the specified alias ip and port, if port is not specified 7777 is used.
  • .deleteserver serverID Deletes the specified server matching the IP:PORT of the ID.
  • .editserver serverID type value Edits the specified server's type with the new value, valid types are IP, Port, Alias, Country.
  • .roles Displays all user roles that can use admin commands.
  • .allowrole Name Allows users with said role to use admin commands.
  • .removerole Name Disables users with said role from using admin commands.
  • .allowchannel Allows the bot to be used in the current channel.
  • .removechannel Disables the bot to be used in the current channel.
  • .channels Displays all channels that are enabled for bot usage.
  • .setauto Sets the channel as the auto query channel where the latest messages are updated in intervals.
  • .disableauto Disables the auto query channel updates.

Normal Commands

  • .help Displays this command.
  • .servers Displays all the servers added to the database.
  • .active Displays all the servers added to the database that has at least 1 player in it.
  • .qID Queries the specified server ip:port matching that server ID in the database.
  • .q ip:port Queries a UT2004 server with the specified ip:port, if port is not provided 7777 is used.
  • .ipID Displays the name and ip:port of the server added to the database.

Installing

  • Extract the contents of the archive into a directory.
  • Open command prompt in the same directory.
  • Run the command npm install to install the required dependencies.
  • Now run the command node install to create the database tables.
  • Rename exampleConfig.js to config.js, alternatively you can make a copy of the file and name it config.js
  • Now open the config file /config.js.
  • Add your Discord bot token, if this is not done correctly the bot can't join your server. https://discordpy.readthedocs.io/en/latest/discord.html
  • The bot requires Privileged Gateway Intents: Message Content Intent.
  • If you want to use the auto query channel feature the bot will also need the Manage Channels permission to set the current channel topic(it will still work without it, you will get an error message).
  • Make sure adminRole is a role in your discord server that you have access to, otherwise admin commands needed to setup the bot will be unavailable to you.
  • The config file is also where you can set the command prefix, by default it's dot(.)

Running the bot

  • Open command prompt in the directory you installed the files.
  • Run the command node app

First time use

When the bot has joined the server only people with the role "adminRole" can use the bot, to change this:

  • .allowchannel This will enable any user to use non admin commands in the current channel.
  • .allowrole <role name> This will enable users with the specified role to use admin commands.
  • .setauto Sets the current channel to be the auto query channel, it is recommended the auto query channel is a new channel where users can't post as the bot will delete previous messages when this command is used in a text channel.

Auto Query Information

  • Every time the command is used the bot will post fresh messages for each server added to the database, after each query interval the bot will edit the previous message with the latest response from the respected server.
  • If a new server is added after this command is used it will post any new servers in the auto query channel.
  • If a server is deleted from the database list the bot will remove it's respected message from the auto query channel.

Screenshots

image image image image

About

A discord bot that communicates with Unreal Tournament 2004 servers and displays their responses.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors