stress3’s Arbiter Bot

Test this app for free
21
from models import SyncedRole

from models import SyncedChannel

from abilities import upload_file_to_storage
import requests
from abilities import url_for_uploaded_file
from models import Fight
from sqlalchemy import select
from sqlalchemy.orm import Session
from models import TournamentStage
from models import Participant
from abilities import llm
import os
import discord
from discord import app_commands, PermissionOverwrite
from abilities import apply_sqlite_migrations
import asyncio
from flask import Flask, render_template, request, flash, redirect, url_for, Response, send_from_directory
from models import Base, engine
import time

app = Flask(__name__)
app.secret_key = os.urandom(24)  # For flash messages
Get full code

Created: | Last Updated:

Discord bot that echoes messages from administrators and deletes the original messages.

Here is a draft article for the Arbiter Bot template:

Introduction to the Arbiter Bot Template

This template creates a Discord bot called "The Arbiter" that manages a tournament-style game called The Culling Games. The bot handles participant registration, fight tracking, and tournament progression. It also provides commands for administrators to manage the game.

Getting Started

To begin using this template:

  1. Click "Start with this Template" in the Lazy Builder interface.

Setting Up Environment Variables

This template requires setting up one environment variable:

  • BOT_TOKEN: Your Discord bot token

To set this up:

  1. Go to the Discord Developer Portal (https://discord.com/developers/applications)
  2. Create a new application or select an existing one
  3. Go to the "Bot" section
  4. Click "Reset Token" to generate a new token
  5. Copy the token
  6. In the Lazy Builder, go to the "Environment Secrets" tab
  7. Add a new secret with the key "BOT_TOKEN" and paste your token as the value

Testing the Bot

To start the bot:

  1. Click the "Test" button in the Lazy Builder interface
  2. The bot will start up and connect to Discord

Using the Bot

Once the bot is running, you can use the following commands in your Discord server:

  • /ttm [message]: Send a message as the bot (Admin only)
  • /remove [participant_name]: Remove a participant from the tournament (Admin only)
  • /unlink [participant_name]: Unlink a participant's Discord account (Admin only)
  • /link [discord_user] [participant_name]: Link a Discord user to a participant (Admin only)
  • /remove_participant [participant_name]: Remove a participant from the tournament (Admin only)
  • /list_participants: List all participants in the tournament
  • /copy_on [user_id]: Start copying a user's messages (Admin only)
  • /copy_off: Stop copying user's messages (Admin only)
  • /lock_channels: Lock all channels (Admin only)
  • /unlock_channels: Unlock all channels (Admin only)
  • /hide_culling: Hide all channels except Culling Games category (Admin only)
  • /continue_hiding: Continue hiding channels from where it left off (Admin only)
  • /setup_roles: Setup grade and tool roles with colors and permissions (Admin only)
  • /show_all: Show all channels (Admin only)
  • /sync_channels: Sync all channel permissions (Admin only)
  • /sync_roles: Sync all member roles (Admin only)
  • /restore: Restore all roles and channels to their synced state (Admin only)
  • /update_roles: Update roles for all linked participants (Admin only)

The bot also responds to mentions and can provide information about the tournament, participants, and fights.

Integrating the Bot

To add the bot to your Discord server:

  1. Go to the Discord Developer Portal
  2. Select your application
  3. Go to the "OAuth2" section
  4. In the "Scopes" section, select "bot"
  5. In the "Bot Permissions" section, select the necessary permissions (Administrator is recommended for full functionality)
  6. Copy the generated OAuth2 URL
  7. Open this URL in a new browser tab
  8. Select the server you want to add the bot to and authorize it

Once added, the bot will be able to respond to commands and manage The Culling Games in your server.



Here are 5 key business benefits for this Discord bot template:

Template Benefits

  1. Streamlined Communication - Allows administrators to easily broadcast messages through the bot, providing a centralized and authoritative voice.

  2. Enhanced Privacy - By deleting original admin messages, it helps maintain confidentiality of admin identities and prevents direct messaging to admins.

  3. Improved Moderation - Gives moderators a tool to communicate official messages while removing their personal accounts from view, reducing potential harassment.

  4. Consistent Branding - All official communications come from a single bot account, providing a consistent brand/voice for announcements and moderation.

  5. Audit Trail - The bot's actions of echoing messages creates a clear audit log of official communications separate from regular chat, aiding in record-keeping and accountability.

Technologies

Flask Templates from Lazy AI – Boost Web App Development with Bootstrap, HTML, and Free Python Flask Flask Templates from Lazy AI – Boost Web App Development with Bootstrap, HTML, and Free Python Flask
Discord Automation & Bots Discord Automation & Bots
Optimize SQL Workflows with Lazy AI: Automate Queries, Reports, Database Management and More Optimize SQL Workflows with Lazy AI: Automate Queries, Reports, Database Management and More

Similar templates

We found some blogs you might like...