Seekfried / greedybot-d2irc

A pickupbot for managing Xonotic pickup games, that also syncs messages between Discord and IRC.
MIT License
2 stars 2 forks source link

greedybot-d2irc

A pickupbot for managing Xonotic pickup games

Features:

Installation and usage

Note: greedybot-d2irc requires Python >= 3.9, as it depends on numpy 2.0.0 and discord.py.

Download the code from this repository and configure setting.yaml (see Configuration)

Install python dependencies

pip install -r requirements.txt

And run the bot:

python startbot.py

NOTE: In the first startup, it will create the pickup.db database file with the necessary tables. For that, it will also read the gametypes.json file to populate the database with the predefined gametypes.

Configuration

First you need to create a Discord bot user, which you can do by following the instructions here.

The token is needed for the settings.yaml file.

To get the server and channel ID of your discord, just go to your discord server and write down the IDs found in the URL. (Example below)

server-channel

Settings.yaml

bot:
  # Issue warning to renew pickup to player after x seconds
  pugtimewarning: 2400 
  # Delete player from pickup after x seconds
  pugtimeout: 3600

database:
  # Name of created SQLite file
  filename: "pickups.db"

# You can comment out/delete the following chattypes you dont need
irc:
  # IRC-Server address
  server: ""
  # IRC-Server port
  port: ""
  # IRC-Server auth password
  password: ""
  # IRC-Channelname
  channel: ""
  # IRC-Nickname for the bot
  nickname: ""
  # IRC-User that can close the bot with the !quit command
  botowner: ""
  # IRC quit message
  quitmsg: "Cya!"
  # Show messages if irc user left/joined the channel
  presence-update: false

discord:
  # Discord bot's token
  token: ""
  # Discord-User that can close the bot with the !quit command
  botowner: ""
  # Discord server ID
  server: ""
  # Discord channel ID
  channel: ""
  # Discord rolename to enable Admin/Moderator commands for users
  modrole: ""
  # Show messages if discord user goes offline/online
  presence-update: false

matrix:
  # Matrix server url
  server: ""
  # Matrix room ID
  room: ""
  # Matrix bot name
  botname: ""
  # Matrix bot password
  password: ""

You can create your own settings.yaml file based on the template settings_template.yaml.

There are three other different setting files:

Commands

Player commands

Admin/Moderator commands

For discord-users with the role specific to settings.yaml (modrole) or IRC-users with OP