RDMAss - A Python Discord bot creating an interaction with RDM API

Overview

RDMAss

A Python Discord bot creating an interaction with RDM API.

Features

  • Assignment Groups scheduled & instant
  • RDM Status
  • Clear All Quests
  • Reload All Instances

Requirements

  • Must be on Developemnt build of RDM
  • At least Python3.6 (virtualenv optional but welcome)
  • Discord Bot Token (enable presence intent, server members intent, message content intent and slash commands privilages)

Quick Setup

  1. Fetch repo, install packages from requirements.txt and copy config.example.json to config.json
  2. Edit config.json
  3. Start main.py

Detailed Setup

1. Fetch & install

git clone https://github.com/Pupitar/RDMAss.git rdmass && \
cd rdmass && \
pip3 install -r requirements.txt && \
cp config.example.json config.json

2. Edit config file

Additonal options are available in default.json

{
    "bot": {
        "token": "bot_token",                              // Discord Bot Token
        "hide_bot_message": true                           // Hide the bot mesage - true | false
    },
    "instance": {
        "discord": {
            "guild_id": 1234567890,                        // Add the Discord Guild ID for the server the bot will be run on
            "output_channel": 2345678901,                  // A discord channel where output of scheduled jobs will be sent.
            "enabled_roles": [3456789012, 4567890123]      // Discord Role ID's that you authorise to use the commands.
        },
        "rdm": {
            "api_endpoint": "http://127.0.0.1:9000",       // RDM front end Endpoint
            "username": "rdm_root_user",                   // RDM front end user (must have admin permissions)
            "password": "6d9fdb16ed509488eeef6af2f842a744" // Password for the front end user
        }
    },
    "locale": {
        "date_format": "YYYY.MM.DD",                       // Date format
        "time_format": "HH:mm:ss",                         // Time format
        "timezone": "UTC"                                  // Timezone (used for assignement scheduler)
    }
}

3. Starting

Directly

python3 main.py

PM2

Start RDMAss in PM2 with pm2 start main.py --name RDMAss --interpreter python3 from the root folder of RDMAss

Or you can copy and paste the following code below into an existing PM2 ecosystem file or start a new one in the root of RDMAss ecosystem.config.js (remember to change the location of cwd: "/home/user/RDMAss/", to your own directory.

module.exports = {
  apps: [
    {
      name: "RDMAss",
      script: "python3 main.py",
      cwd: "/home/user/rdmass/",
      instances: 1,
      autorestart: true,
      max_memory_restart: "1G",
      env_production: {
        NODE_ENV: "production",
      },
    },
  ],
};

systemd

Systemd user service template. Read for details

[Unit]
Description=rdmass
After=network.target

[Service]
ExecStart=python3 main.py
WorkingDirectory=/home/user/rdmass
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog

[Install]
WantedBy=default.target
Comments
  • Auto events

    Auto events

    https://github.com/Pupitar/RDMAss/issues/17 Add support for Auto Events. Needs testing.

    To get started, you have to populate config.json with:

    "auto_event": {
        "enabled": true,
        "quest_instances": ["your_quest_instances_group"],  // list of quest assignment groups to run
        "iv_instances": ["your_iv_instances_group"],  // optional list of iv assignment groups to run. If provided, those will run after provided `execution_time`.
        "execution_time": 240,  // time in minutes you want to run `iv_instances` after starting reQuest (in my case reQuest takes 4h so after 240 minutes script will auto run IV instances back)
        "time_range": [9, 10]  // only include events which start/end between those hours (including)
    }
    

    Optional options: https://github.com/Pupitar/RDMAss/blob/auto_events/default.json#L38-L65

    opened by lenisko 2
  • Detailed messages, minutes picker

    Detailed messages, minutes picker

    FEATURES

    • Add detailed messages for tech and user sides https://github.com/Pupitar/RDMAss/issues/6
    • Use new API arg https://github.com/Pupitar/RDMAss/issues/12
    • Ability to select minutes in scheduled starts.

    BREAKING CHANGES

    • Renamed output_channel to tech_channel in config.
    • ~~All JOBS have to be re-added after a PR is merged.~~ - resvoled

    User channel could be enabled by user_channel key. Messages are configurable in config tree message. Variables action, type, assignments_groups are available for all configurable messages:

    • tech_channel_message_success
    • tech_channel_message_fail
    • user_channel_message_request
    • user_channel_message_start
    enhancement 
    opened by lenisko 0
  • Swap RDM request arg

    Swap RDM request arg

            let instanceName = request.param(name: "instance_name") // MARK: remove this later, use 'instance' instead
            let instance = request.param(name: "instance") ?? instanceName
    
    bug enhancement 
    opened by lenisko 0
  • Detailed messages for tech and user sides

    Detailed messages for tech and user sides

    Add detailed messages for tech and user sides.

    BREAKING CHANGES

    • Renamed output_channel to tech_channel in config.
    • All JOBS have to be re-added after a PR is merged.

    User channel could be enabled by user_channel key. Messages are configurable in config tree message. Variables action, type, assignments_groups are available for all configurable messages:

    • tech_channel_message_success
    • tech_channel_message_fail
    • user_channel_message_request
    • user_channel_message_start

    Solves https://github.com/Pupitar/RDMAss/issues/6

    enhancement 
    opened by lenisko 0
  • want to have multiple user_channel in different Guilds

    want to have multiple user_channel in different Guilds

    I run my scans for 3 communities. Now rdmass allow me to send user_messages to 1 guilds discord users_channel. I would like the bot to be in multiple Guilds and then send the user_messages to multiple channels, spread over those different Guilds.

    opened by fluffymcpuffy 0
  • Add option to display events with

    Add option to display events with "has_quests": false,

    Hello,

    As in tittle, it would be cool to display event with has_quests false so in the future we can review the event if there are any mistakes in report that event got new quests or not.

    opened by BoB3R 0
  • Role Restrictions for Commands (Assignments)

    Role Restrictions for Commands (Assignments)

    If you wanted to allow a certain discord role from a guild to be able to issue commands to rescan. Only allow certain discord roles, the ability to reQuest only specfic assignment groups ?

    Example: If assignment name = xyz, allow role 12345 to issue the command Thus, If assignment name = xyz, role 0987665 can not issue the command

    Or to display only certain assignments based on a role for the user issuing the command, like a role/guild check before response?

    As discussed: For now I use only one restriction based on roles who can fire commands. For the thing you need you might have to create additional layer of security for commands. I would go with advanced_permissions or something where you could specify that role_id is allowed to use specified commands and list only specified assignments from them. For example:

    {
        "instance": {
            "discord": {
                "enabled_roles": [1234, 2345],
                "advanced_permissions": [
                    {"role_id": "2345", "enabled_methods": ["status", ...], "allowed_assignmentgroups": ["quests_one", ...]},
                ]
            }
        }
    }
    
    enhancement 
    opened by unseenmagik 0
  • Differentiate between Assignments

    Differentiate between Assignments

    Differentiate between a quest assignement and a pokemon scan assignment.?

    For example, if you have an assignment to start a pokemon scan and not quests, you are presented with the ReQuest button when its not needed, jut the Start is needed.

    Not sure if we could add a check in there for a name varaible and show buttons based on assignment name?

    enhancement 
    opened by unseenmagik 0
Owner
null
Satoshi is a discord bot template in python using discord.py that allow you to track some live crypto prices with your own discord bot.

Satoshi ~ DiscordCryptoBot Satoshi is a simple python discord bot using discord.py that allow you to track your favorites cryptos prices with your own

Théo 2 Sep 15, 2022
A python discord client interaction emulator for the DC29 badge code channel

dc29-discord-signalbot A python discord client interaction emulator for the DC29 badge code channel Prep Open Developer mode Open the developer mode f

null 8 Aug 23, 2021
A small and fun Discord Bot that is written in Python and discord-interactions (with discord.py)

Articuno (discord-interactions) A small and fun Discord Bot that is written in Python and discord-interactions (with discord.py) Get started If you wa

Blue 8 Dec 26, 2022
It's a Discord bot to control your PC using your Discord Channel or using Reco: Discord PC Remote Controller App.

Reco PC Server Reco PC Server is a cross platform PC Controller Discord Bot which is a modified and improved version of Chimera for Reco-Discord PC Re

Arvinth Krishna 12 Aug 31, 2022
Discord bot script for sending multiple media files to a discord channel according to discord limitations.

Discord Bulk Image Sending Bot Send bulk images to Discord channel. This is a bot script that will allow you to send multiple images to Discord channe

Nikola Arbov 1 Jan 13, 2022
🚀 An asynchronous python API wrapper meant to replace discord.py - Snappy discord api wrapper written with aiohttp & websockets

Pincer An asynchronous python API wrapper meant to replace discord.py ❗ The package is currently within the planning phase ?? Links |Join the discord

Pincer 125 Dec 26, 2022
Discord.py-Bot-Template - Discord Bot Template with Python 3.x

Discord Bot Template with Python 3.x This is a template for creating a custom Di

Keagan Landfried 3 Jul 17, 2022
Discord bot to monitor collection of mods on the Steam Workshop and notify on update to selected discord server via Nextcordbot API.

Steam-Workshop-Monitor Discord bot to monitor collection of mods on the Steam Workshop and notify on update to selected Discord channel via Nextcordbo

null 7 Nov 3, 2022
An Open-Source Discord bot created to provide basic functionality which should be in every discord guild. We use this same bot with additional configurations for our guilds.

A Discord bot completely written to be taken from the source and built according to your own custom needs. This bot supports some core features and is

Tesseract Coding 14 Jan 11, 2022
Discord ToolBox is a discord bot developed by DJD320 created for the purpose of having some convenient tools in the form of a single bot.

Discord ToolBox Discord ToolBox is a discord bot developed by DJD320 created for the purpose of having some convenient tools in the form of a single b

null 3 Aug 7, 2021
Linky bot, A open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

LinkyBot Linky bot, An open-source discord bot that allows you to add links to ur website, youtube url, etc for the people all around discord to see!

AlexyDaCoder 1 Sep 20, 2022
Image-Bot-Discord - This Is a discord bot that shows the specific image you search from Google

Advanced Discord.py Image Bot CREDITS Made by RLX and Mathiscool README by Milrato Installation Guide in .env Adjust the TOKEN python main.py to start

RLX 3 Jan 16, 2022
Example-bot-discord - Example bot discord xD

example-python-bot-discord Clone this repository Grab a token on Discord's devel

Amitminer 1 Mar 14, 2022
YouTube-Discord-Bot - Discord Bot to Search YouTube

YouTube Bot Info YouTube Bot is a discord bot where you can search for anything

Riceblades11 10 Mar 5, 2022
SongLink Discord Bot - Discord bot to share music links easily

SongLink_Discord_Bot Discord bot to share music links easily. Take a link from y

Edgar Lefevre 4 Feb 18, 2022
Kevin L. 3 Jul 14, 2022
VoiceMaster-Discord-Bot - Fork from original Discord bot with max channel limit, staff role and more

VoiceMaster VoiceMaster is a discord bot created to change the way servers work,

null 2 Feb 28, 2022
A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

A discord Server Bot made with Python, This bot helps people feel better by inspiring them with motivational quotes or by responding with a great message, also the users of the server can create custom messages by telling the bot with Commands.

Aran 1 Oct 13, 2021
Aqui está disponível GRATUITAMENTE, um bot de discord feito em python, saiba que, terá que criar seu bot como aplicação, e utilizar seu próprio token, e lembrando, é um bot básico, não se utiliza Cogs nem slash commands nele!

BotDiscordPython Aqui está disponível GRATUITAMENTE, um bot de discord feito em python, saiba que, terá que criar seu bot como aplicação, e utilizar s

Matheus Muguet 4 Feb 5, 2022