Git Product home page Git Product logo

birbinator-dev's Introduction

Readme

Adjust .env and ./config.js

Use npm run deploy to register slash commands via discord api and make them accessible for the user.

Use npm run dev for development.

Use npm run notion to configure and test the notion API.


Commands:

Commands are registered/loaded by reading the files in the commands-folder. Simply remove unnecessery/unwanted commands from the folder or add your own.

Commands consist of a property 'data' and a method 'execute'

  • 'data' contains necessary information like 'name' and 'description' and additional properties to define options, subcommands etc.
  • 'execute' is called from the clients event emitter via onInteractionCreate in 'bot.js'

WCCC

guide.js

shows a message embed with wccc guidelines

past.js

sends a link to the past topics on notion

time.js

Shows the time left to suggest a topic, to vote or until the stream starts

settings.js (moderator only)

handles '/wccc settings' slashcommand to configurate settings of the voting.

topics.js (moderator only)

starts the topic suggestion time.
collect incoming messages until a configurated amount of time has expired or a maximum amount of suggestions has been reached. notify sableraph/wccc moderators via ephemeral message on end.

vote.js (moderator only)

starts the voting time.
send collected topics via dm to command user and await emoji reactions from the user. prompt user when all topics have an individual emoji and send voting message in channel.

stop.js (moderator only)

Stops the topic or voting time manually


Configuration and Settings

This is a good tutorial to create the bot imo. All the required data like the 'bot token', 'discord ids' and the 'notion' data is contained in ./config.js.
Depending on how flexible you want to be, you can add different default values for the 'Topic Suggestion' and 'Voting Time' in ./commands/wccc/controllers/settings


Message content

All messages that are sent to the users are in ./commands/wccc/assets/messages.js.


Permissions

Basic permissions handling is set in ./commands/wccc.js.

It requires an explicit 'wccc moderator role' to call the 'settings', 'topics', 'vote' and 'stop' commands (the Id needs to be set in './config.js). These commands can only be called in the voting channel.

The commands 'guide' and 'past' can be called by everyone but only in the chat channel.

The command 'time'can be called in the voting and chat channel.


Notion

The values of the topics table are set via the ids of each row. To get these ids use npm run notion to log them in the console and copy them to './config.js' as explained here

There's another (commented) code snippet in ./commands/wccc/controllers/notionGetIds.js to test the Notion API.


Todo

send configuration prompts via dm
add a notification role/command
permissions
add a wccc moderator role (in case of emergency)
add a timer/reminder (setTimeout) during topic suggestion time
add /time stream, wccc command
Doublecheck/correct message content - Discord Formatters
Notion API (partially - update token, ids, etc.)
find errors/bugs
use rollup/webpack

birbinator-dev's People

Contributors

error-four-o-four avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.