noctal.is
πŸ“Ž 1 file 3,552 chars
πŸ“„
pasted-code-1787672360544.txt
txt 90 lines
β–Ά
Build a **professional, cute and feature-rich Discord bot** themed around **SPY x FAMILY**. The bot should feel like a W.I.S.E. secret-agent assistant with kawaii anime styling. Use pink, cream, red, black, hearts, sparkles and subtle classified-file UI.

Take inspiration from the **functionality and ease of use of Carl-bot**, but create an original bot, branding, commands, responses and interface.

### CORE COMMANDS

Create slash commands including:

`/announce` β€” create styled announcement embeds with title, description, image, footer and optional ping
`/send` β€” send a custom message/embed to a selected channel
`/say` β€” bot repeats text
`/embed` β€” create customizable embeds
`/clear` β€” bulk delete messages with permission checks
`/slowmode` β€” set channel slowmode
`/lock` / `/unlock` β€” lock or unlock channels
`/userinfo` β€” detailed member information
`/serverinfo` β€” server statistics
`/avatar` β€” display avatars
`/role` β€” add/remove roles
`/nick` β€” change nicknames
`/poll` β€” create polls
`/remind` β€” reminders
`/afk` β€” AFK system
`/suggest` β€” suggestions with voting
`/report` β€” member/message reports
`/help` β€” categorized command menu

### MODERATION

Add AutoMod, anti-spam, anti-raid, anti-link, warnings, mute, timeout, kick, ban, unban, warn history, mod logs, joins/leaves, message deletion/edit logs and configurable punishment thresholds.

Commands:
`/ban` `/kick` `/timeout` `/warn` `/warnings` `/mute` `/unmute` `/purge` `/case`

Add configurable staff roles and permission checks.

### SPY x FAMILY FEATURES

`/peanut` β€” Anya randomly reacts with funny peanut-themed responses, images or quotes
`/anya` β€” random Anya reaction
`/mission` β€” generate a random secret mission
`/agent` β€” assign/show an agent profile
`/twilight` β€” random spy response
`/thornprincess` β€” random assassin-themed response
`/bond` β€” random cute prediction
`/eden` β€” random Eden Academy result
`/forger` β€” generate a random Forger-family scenario
`/guess` β€” anime/character guessing game

Create an **Agent XP system** with levels, ranks, achievements and leaderboards. Add daily rewards, missions, streaks, coins and collectible SPY x FAMILY badges.

### FUN

Add games such as trivia, guessing, economy, blackjack, rock-paper-scissors, 8ball, dice, coinflip and random events.

### AUTOMATION

Welcome/goodbye messages, autoroles, reaction/button roles, custom commands, scheduled announcements, reminders, birthday messages, boost notifications and automatic event announcements.

### TICKETS

Create a complete ticket system with buttons:
🎫 Support
πŸ›‘οΈ Moderation Report
🀝 Partnership
πŸ“’ Advertisement
πŸ’‘ Suggestions
πŸ› Bug Report

Include transcripts, staff-only access, close/reopen buttons and logs.

### ROLE & UTILITY SYSTEM

Support self-roles, color roles, notification roles, anime roles and SPY x FAMILY character roles. Include role menus with buttons/select menus.

### COMMAND DESIGN

Use clean embeds, buttons, dropdowns and autocomplete wherever appropriate. Organize `/help` into **Moderation, Utility, Fun, Spy, Economy, Tickets and Admin**.

Every command must have proper permission checks, useful error messages, cooldowns and logging.

### STYLE

Bot name: **γ€Œ W.I.S.E. 」**
Personality: intelligent spy assistant + cute Anya energy.
Use emojis such as πŸŽ€ πŸ•΅οΈ 🌸 πŸ’— πŸ₯œ ✦ ΰ­¨ΰ­§ β™‘ ✧.
Responses should feel like classified mission files while remaining concise and readable.

Make the bot **modular, reliable, scalable and easy to configure from Discord**, with per-server settings and customizable prefixes/settings where supported.
Kodari AI
KodariAug 25 at 3:47 pm 2
WISEBot
γ€Œ W.I.S.E. 」 is a professional, cute SPY x FAMILY-themed Discord bot with kawaii styling. It features comprehensive moderation tools including AutoMod, anti-spam, warnings, and mod logs, plus utility commands for announcements, embeds, polls, reminders, and AFK. Includes Spy-themed fun commands, an Agent XP system with ranks and badges, games, automation features, a full ticket system, and role management. All commands have permission checks, cooldowns, and logging, with per-server configurable settings.
  1. Create the W.I.S.E. bot foundation, configuration, SQLite persistence, shared styling, and startup lifecycle.

  2. Add modular core, moderation/automod, Spy x Family, games/economy, ticket, and automation cogs.

  3. Add setup files and documentation so the bot can run securely from environment variables.

Created the modular γ€Œ W.I.S.E. 」 SPY x FAMILY Discord bot with:

  • Secure .env token configuration and SQLite persistence

  • Core utility commands: announcements, embeds, moderation tools, polls, reminders, AFK, reports, help

  • Moderation: ban, kick, timeout, warn history, mute, cases, anti-spam, anti-link, message logs

  • Spy features: Anya, peanuts, missions, agents, XP, ranks, guesses, Bond, Eden, Forger scenarios

  • Economy: coins, daily rewards, streaks, leaderboards, badges

  • Games: trivia, blackjack, dice, coinflip, rock-paper-scissors, 8-ball, random events

  • Ticket system with department dropdowns, staff permissions, close/reopen controls, and transcripts

  • Automation: welcome/goodbye messages, autoroles, logs, scheduled announcements, boost notifications

  • Setup files: requirements.txt, .env.example, .gitignore, and README.md

Run with:

Shell
pip install -r requirements.txt
cp .env.example .env
python bot.py
Kodari can make mistakes. Review important code before using.
Files
wise
.gitignore
bot.py
README.md
requirements.txt
Code
16 1,027
bot.py
import logging
import os

import discord
from discord import app_commands
from discord.ext import commands
from dotenv import load_dotenv

from wise.config import Settings
from wise.database import Database

load_dotenv()
logging.basicConfig(level=logging.INFO, format="%(asctime)s | %(levelname)s | %(name)s | %(message)s")
log = logging.getLogger("wise")


class WiseBot(commands.Bot):
    def __init__(self, settings: Settings):
        intents = discord.Intents.all()
        super().__init__(command_prefix="!", intents=intents, help_command=None)
        self.settings = settings
        self.db = Database(settings.database)

    async def setup_hook(self):
        await self.db.initialize()
        extensions = (
            "wise.cogs.core",
            "wise.cogs.moderation",
            "wise.cogs.spy",
            "wise.cogs.fun",
            "wise.cogs.economy",
            "wise.cogs.tickets",
            "wise.cogs.automation",
        )
        for extension in extensions:
            await self.load_extension(extension)
        if self.settings.guild_id:
            guild = discord.Object(id=self.settings.guild_id)
            self.tree.copy_global_to(guild=guild)
            await self.tree.sync(guild=guild)
            log.info("Synced commands to guild %s", self.settings.guild_id)
        else:
            await self.tree.sync()
            log.info("Synced global commands")

    async def on_ready(self):
        log.info("γ€Œ W.I.S.E. 」 online as %s", self.user)

    async def on_app_command_error(self, interaction: discord.Interaction, error: app_commands.AppCommandError):
        if isinstance(error, app_commands.CommandOnCooldown):
            message = f"✦ This mission is on cooldown. Try again in `{error.retry_after:.1f}s`."
        elif isinstance(error, app_commands.MissingPermissions):
            message = "πŸ•΅οΈ Your clearance level is insufficient for that mission."
        elif isinstance(error, app_commands.CheckFailure):
            message = "πŸ•΅οΈ This command can only be used in a server."
        else:
            log.exception("Unhandled slash command error", exc_info=error)
            message = "πŸ’— W.I.S.E. encountered an operational hiccup. Please try again."
        if interaction.response.is_done():
            await interaction.followup.send(message, ephemeral=True)
        else:
            await interaction.response.send_message(message, ephemeral=True)

    async def close(self):
        await self.db.close()
        await super().close()


def main():
    token = os.getenv("DISCORD_TOKEN")
    if not token:
        raise RuntimeError("DISCORD_TOKEN is missing from .env")
    bot = WiseBot(Settings.from_environment())
    bot.run(token, log_handler=None)


if __name__ == "__main__":
    main()