Skip to content

BChevillon/boaki-actu-discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Boaki Actu discord bot

A Node.js project for managing a Discord bot with features like anecdote publishing, announcements, notable date messages, and more. Built using discord.js.

This bot was created for the Boaki Actu community, bringing together several hundred players around an old video game.

Features

  • Publish predefined anecdotes or choose one at random.
  • Send announcements to specified channels with optional interactive buttons.
  • Automatically post notable events for the current day.
  • Role-based notifications and interactive button management.
  • Scheduled tasks for anecdotes and notable dates.
  • Automatically refresh the bot’s status based on configured activities.
  • Update existing bot messages.
  • Fetch and publish the latest verified speedruns with interactive components.

Installation

Clone the repository and install dependencies:

git clone https://github.com/BChevillon/boaki-actu-discord-bot.git
cd boaki-actu-discord-bot
npm install

Configuration

  1. Setup the config.json file in the project directory:
    {
         "token": "YOUR_DISCORD_BOT_TOKEN",
         "clientId": "YOUR_DISCORD_CLIENT_ID",
         "guildId": "YOUR_DISCORD_GUILD_ID",
         "adminRolesId": ["ROLE_ID_FOR_ADMIN_1", "ROLE_ID_FOR_ADMIN_2"],
         "anecdoteRoleId": "ROLE_ID_FOR_ANECDOTES",
         "speedrunChannelId": "CHANNEL_ID_FOR_SPEEDRUNS",
         "activities": [
             { "name": "ACTIVITY_NAME_1", "type": "ACTIVITY_TYPE_1" },
             { "name": "ACTIVITY_NAME_2", "type": "ACTIVITY_TYPE_2" }
         ],
         "speedrunGames": [
           {
               "name": "GAME_NAME",
               "id": "SRC_GAME_ID",
               "thumbnails": {
                   "level_id": "https://example.com/thumbnail.png",
                   "default": "https://example.com/default_thumbnail.png"
               }
           }
         ]
     }
  2. Add JSON data files for anecdotes and notable dates:
    • data/anecdotes.json
    • data/notabledate.json

Usage

Run the bot

Start the bot using:

node index.js

Available Commands

/anecdote

  • Description: Publishes an anecdote.
  • Parameters:
    • canal: The target channel.
    • id (optional): The ID of a specific anecdote.
  • Example:
    /anecdote canal:#general id:3
    

/annonce

  • Description: Sends an announcement to a target channel.
  • Parameters:
    • canal_message: Source channel of the announcement.
    • message_id: ID of the message to announce.
    • canal_envoi: Target channel.
    • everyone (optional): Mention @everyone.
    • notifications (optional): Add a notifications button.
  • Example:
    /annonce canal_message:#announcements message_id:123456789 canal_envoi:#general everyone:true
    

/modifiermessage

  • Description: Modify an existing message sent by the bot by replacing its content with that of another.
  • Parameters:
    • canal_source: Source channel of the message whose content will be copied.
    • source_message_id: ID of the message to copy.
    • canal_modification: Channel of the message to modify.
    • message_id: ID of the message to modify.
  • Example:
    /modifiermessage canal_source:#general source_message_id:123456789 canal_modification:#announcements message_id:987654321
    

/datenotable

  • Description: Publishes a notable event for today.
  • Parameters:
    • canal: The target channel.
  • Example:
    /datenotable canal:#general
    

/ping

  • Description: Checks if the bot is online.
  • Example:
    /ping
    

Custom Schedulers

Anecdote Scheduler

Schedules a weekly anecdote publication.

  • Configurable via startAnecdoteScheduler(client, channelId, roleId).

Notable Date Scheduler

Schedules a daily notable event message.

  • Configurable via startDateScheduler(client, channelId, roleId).

Speedrun Scheduler

Schedules automatic publication of verified speedruns.

  • Configurable via startSpeedrunScheduler(client, channelId, game).

Handling Button Interactions

Interactive buttons for:

  • Notifications: Toggle role for users.
  • Links: Add external references.

Use handleInteraction(interaction, roleId) to manage button interactions.

Examples

Adding Activities to the Bot

Activities for the bot are defined in the config.json file under the activities section. Each activity contains:

  • name: The activity name displayed in the bot’s status.
  • type: The type of activity (Playing, Listening, Watching, or Streaming).

For example:

"activities": [
    { "name": "Exploring Boaki", "type": "Playing" },
    { "name": "Sharing Boaki history", "type": "Streaming" },
    { "name": "Guiding new players", "type": "Listening" },
    { "name": "www.univers-kipulkai.fr", "type": "Watching" }
]

Speedrun Scheduler

The bot automatically fetches and publishes the latest verified speedruns for configured games from config.json.

  • Displays player, category, level, ranking, and time.
  • Interactive buttons allow users to view the run and learn more about speedrunning on the Univers-KiPulKai website.
  • The games to monitor for speedruns are configured in the speedrunGames section of config.json with their IDs and associated level thumbnails.

Example configuration for a speedrun game in config.json:

"speedrunGames": [
    {
        "name": "KiPulKai : la légende des 3 masques",
        "id": "369wxy8d",
        "thumbnails": {
            "dqzj12gd": "https://www.univers-kipulkai.fr/wp-content/uploads/2025/02/speedrun_icon_0.png",
            "d7yv3ked": "https://www.univers-kipulkai.fr/wp-content/uploads/2025/02/speedrun_icon_1.png",
            "default": "https://www.univers-kipulkai.fr/wp-content/uploads/2025/02/speedrun_icon_default.png"
        }
    }
]

Creator

This module was created by Benoit CHEVILLON. If you have any questions, feedback, or bug reports, you can open an issue on GitHub or contact via email at benoit.chevillon6@gmail.com.

License

This project is licensed under the MIT License.


About

Official discord bot of the Boaki Actu community. Offers community news and interactive features.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors