by 4nimal.yt
stress3’s Arbiter Bot
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
Created: | Last Updated:
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:
- 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:
- Go to the Discord Developer Portal (https://discord.com/developers/applications)
- Create a new application or select an existing one
- Go to the "Bot" section
- Click "Reset Token" to generate a new token
- Copy the token
- In the Lazy Builder, go to the "Environment Secrets" tab
- Add a new secret with the key "BOT_TOKEN" and paste your token as the value
Testing the Bot
To start the bot:
- Click the "Test" button in the Lazy Builder interface
- 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:
- Go to the Discord Developer Portal
- Select your application
- Go to the "OAuth2" section
- In the "Scopes" section, select "bot"
- In the "Bot Permissions" section, select the necessary permissions (Administrator is recommended for full functionality)
- Copy the generated OAuth2 URL
- Open this URL in a new browser tab
- 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
-
Streamlined Communication - Allows administrators to easily broadcast messages through the bot, providing a centralized and authoritative voice.
-
Enhanced Privacy - By deleting original admin messages, it helps maintain confidentiality of admin identities and prevents direct messaging to admins.
-
Improved Moderation - Gives moderators a tool to communicate official messages while removing their personal accounts from view, reducing potential harassment.
-
Consistent Branding - All official communications come from a single bot account, providing a consistent brand/voice for announcements and moderation.
-
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.