Giter VIP home page Giter VIP logo

scrambler's Introduction

bot-stats

scrambler

Scrambler is the original Discord bot created for generating scrambles for twisty puzzles.

This bot was made to make getting twisty puzzle scrambles easier and more convenient than ever! If you spend any time on a Discord server talking to your cubing friends, Scrambler is a must-have with dozens of supported puzzles and relays so you can race one another to your heart's content. The first Discord bot of its kind, Scrambler has been trusted by thousands of cubing servers big and small for their community scramble needs (CubeHead, TheCubicle, SpeedCubeShop, and Cubeorithms to name a few).

Adding Scrambler to your server

Scrambler's invite link can be found here: https://discord.com/api/oauth2/authorize?client_id=423530119836073986&permissions=277025409024&scope=bot%20applications.commands

Once you've added Scrambler, run the /3x3 command to get started.

Documentation

All of Scrambler's commands have detailed documentation which can be found at https://scrambler.gitbook.io.

Want to contribute to the project or report a bug?

  • For direct contribution please see CONTRIBUTING.md (~/.github/CONTRIBUTING.md)
  • The Scrambler support server is available here. There are channels marked for for bug reports and suggestions.
  • You may also suggest a command via the issue tracker.

scrambler's People

Contributors

bacon1661 avatar dependabot[bot] avatar ecuber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

scrambler's Issues

Config - Event customization (good first project!)

Goals

This issue pertains to the config command, specifically to the event customization features.

When complete, the s!config command should be able to:

  • Toggle events on and off
  • Set the number of scrambles/solves for a particular event

Specification

File to be edited:src/commands/settings/config.ts

Desired functionality

If competition is currently running

user: s!config event 3x3
scrambler: A competition is currently running, so you can't use this command.
To change your configuration, please end the competition.

Event toggling

user: s!config event 6x6 7x7 5x5 bld
scrambler: You've successfully disabled 6x6, 7x7, and 5x5, and enabled bld!

Solve count customization

user: s!config count fmc 3
scrambler: Successfully updated the scramble count for fmc to 3!

Argument structure

Event toggling

The idea is there should be anywhere from 1 to infinity events that can be toggled in one command. Flip each one from its current state when you mutate the configuration!

  • args[0]: Name of the event. Verify this with the Event type.
  • args[1]: (optional) Name of the second event. Verify it with the Event type too!
  • ...

Solve count customization

  • args[0]: Name of the event. Verify with the Event type.
  • args[1]: A number between 1-5, inclusive. You'll have to validate the input as a number within this range.

Getting started

The great thing about starting with this command is you'll learn a ton about how the scrambler database is structured. Do your best to get a sense of how the features I've implemented so far work-- the gist is we get the current configuration object from the getConfig(msg) function, update it, and set it with msg.guild.settings.set('comp', { newConfig }) based on the arguments the user provides.

Tips

  • There is an Event interface/type that is imported from src/util/comp-util.ts. Use this to validate event names!
  • In the file, I've already added the skeleton of the command (including the arguments). All you should have to edit are the event and count functions, which correspond to their respective subcommands.

Manage command

  • Moderators can delete a user's times for
    • An event
    • Every event

View command

  • Users can view submissions
    • By themselves (default)
    • From an event
    • From a user

Submit command

Should check to make sure the submission is valid for the event (solve count matches, the event is enabled). Don't worry about an existing submission for that user, just overwrite whatever may have been there before.

  • Checks if user is banned
  • Correctly parses inputs
  • Uploads result to db

Command mentions in /scrambles

Use command mentions in /scrambles
So basically replace

1x1
Generate a 1x1 scramble.

2x2
Generate a 2x2 scramble.

with

</1x1:975496438861693020>
Generate a 1x1 scramble

</2x2:975496438861693021>
Generate a 2x2 scramble.

Comp command

  • Start subcommand
    • Send scrambles according to configuration
  • End subcommand
    • Compiles and sends podiums
    • Deletes results from db‼️

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.