Git Product home page Git Product logo

shiritori_bot's Introduction

Shiritori_bot

Shiritori (しりとり) is a Japanese word game in which the players are required to say a word which begins with the final kana of the previous word. This is my take on the Shiritori bot but in English.

Rules

Players must submit a word in the chat which begins with the final letter of the previous word. Players can not repeat each other's words and also can not repeat their own words. A word violates said rules or has no meaning is considered an invalid word.

If a player submit 3 invalid words through out the game, they will be kicked. If a player is out of time, they wil be kicked.

Usage

Setup

pip install -r requirements.txt

Navigate to the directory where you clone this project. Create a .env file in the following format.

DISCORD_TOKEN={your_bot_token}
DISCORD_GUILD={your_server}

This is the environment variable(s) that the bot accesses the BOT_TOKEN and GUILD from.

Game Settings

In class Players, you can change the invalid_left variable, which determined the maximum errors a player can make.

class Players:
    """a class to represent players"""
    name = ""
    score = 0
    invalid_left = 3
    time_left = 0
    timer_state = 0
    timer = threading.Timer
    start_time = 0

Also, you can change the timer here:

async def create(ctx, game_type: str):
    """create a game by selecting the game mode"""
    global DEFAULT_TIME
    if game_type == "bullet":
        DEFAULT_TIME = 60
    elif game_type == "blitz":
        DEFAULT_TIME = 180
    elif game_type == "casual":
        DEFAULT_TIME = 1800

You can customize DEFAULT_TIME however you like. I'm using chess-style timer countdown.

Commands

For more information see our help menu

Contribution

Pull requests are accepted! Please open an issue if you find any bugs, or have any idea for a feature. Feedbacks are welcomed

License

GNU Affero General Public License 3.0

shiritori_bot's People

Contributors

schwidola0607 avatar souhhcong avatar t41y0u avatar huynd2001 avatar

Watchers

James Cloos 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.