GithubHelp home page GithubHelp logo

uno's Introduction

UNO

The time you spent looking at this readme could have been spent being productive.
Readmes kill. Play UNO instead. UNO saves lives.

Table of Contents

  1. Description
  2. Configurable Rules
  3. Selfhosting
  4. Disclaimer

Description

This is an UNO bot designed for the Discord chat platform. The intent of this bot is to provide a fun and fulfilling UNO experience with your friends!

Commands

UNO HELP - Shows this message!
UNO SUPPORT - Gets a link to my support guild!
UNO JOIN - Joins (or creates) a game in the current channel!
UNO QUIT - Quits the game! Party pooper.
UNO START - Starts the game! Can only be used by the player who joined first.
UNO TABLE - Shows everyone at the table.
UNO PLAY <colour> <value> - Plays a card! Colours and values are interchangeable.
UNO PICKUP - Picks up a card!
UNO CALLOUT - Calls a player out for only having one card left!
UNO HAND - Checks your hand!
UNO RULES - Checks or sets the game rules!
UNO! - Let everyone know that you only have one card left!

You can execute up to two commands in a single message by separating them with &&!

The player will get their cards in a PM by the bot itself but to the command needs to be executed in the room where the players are playing (not privately).

Configurable Rules

One of the features of UNO is configurable rules, to make sure your games are as customizable as possible! You can view these using the uno rules command.

To set, the creator of the game has to run the command: uno rules <key> <value>.

Current rules:

Decks

Key: DECKS Type: integer Default: 1

This is the number of decks to use in the game.

Initial Cards

Key: INITIAL_CARDS Type: integer Default: 7

This is how many cards to pick up at the beginning of the game.

Draws Skip

Key: DRAW_SKIP Type: boolean Default: true

This is whether pickup cards (+2, +4) should also skip the next person's turn.

Must Play

Key: MUST_PLAY Type: boolean Default: false

This is whether a player has to play a card if they're able to, instead of drawing.

Callouts

Key: CALLOUTS Type: boolean Default: true

This is whether other players are able to call someone out for having only one card but not saying uno!

Callout Penalty

Key: CALLOUT_PENALTY Type: integer Default: 2

This is how many cards a player has to pick up with someone successfully calls them out.

False Callout Penalty

Key: FALSE_CALLOUT_PENALTY Type: integer Default: 2

This is how many cards a player has to pick up if they try to call someone out, but everyone has more then one card.

Automatically Play After Draw

Key: DRAW_AUTOPLAY Type: boolean Default: false

Automatically plays a card after drawing, if possible. If a wild card is drawn, will give a prompt for color.

Selfhosting

You may selfhost (AKA run your own instance of) this bot under the following circumstances:

  • Your instance (referred to as a "clone") must be private.
    • As such, your clone must not be listed on any sort of public bot listing.
  • You understand that no support will be provided to aid you in self-hosting.
  • You agree to not submit any issues, features, or pull requests related to bugs exclusively related to self-hosting.

Configuration

config.json (config.example.json), the oauth part is not mandatory (it is used for the web interface) but if you don't needed you need to leave the settings with default values.

config/config.json (config/config.example.json), support various database with this example will use SQLite.

Dependencies

After running npm install it is required to migrate the new database (after put the configuration files) and run npm run sequelize db:migrate. Now, you can run the bot with node index.js.

Disclaimer

This bot is not associated with UNO or Mattel in any ways.

uno's People

Contributors

mte90 avatar ratismal avatar rykanrar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

uno's Issues

msg.channel.createMessage is not a function

I am getting this, I think that happens after writing by PM to the bot. The bot writes in the discord server channel with no issues but doesn't read the answer of the player.

 00  12/20 19:49:25   error    
 TypeError: msg.channel.createMessage is not a function
    at executeCommand (/opt/UNO/src/Shard/index.js:215:39)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async executeQueue (/opt/UNO/src/Shard/index.js:194:17)
    at async Client.<anonymous> (/opt/UNO/src/Shard/index.js:231:5)
 00  12/20 19:49:27   error    
 TypeError: msg.channel.createMessage is not a function
    at executeCommand (/opt/UNO/src/Shard/index.js:215:39)
    at async executeQueue (/opt/UNO/src/Shard/index.js:194:17)
    at async Client.<anonymous> (/opt/UNO/src/Shard/index.js:231:5)

sortHand() doesn't work as expected.

Checklist

  • I have checked previous issues for duplicates
  • This issue is not related to selfhosting
  • This issue is a feature request (leave unchecked for bug report)

Expected Behavior

When the bot sends the hand, the hand should be sorted.

Current Behavior

Hand isn't sorted, doesn't change at all.

Possible Solution

The compare function provided here should return the difference in the value of the two cards rather than just a boolean. Can't test if that fixes it myself because of #11 (which is probably referring to a config.json example with all the fields listed but not filled).

Steps to Reproduce (for bugs)

  1. Start a game.
  2. Let the bot send you your hand the first time (isn't sorted).
  3. Do 'uno hand' to get the hand a second time (still isn't sorted).

Context

Figuring out what playable cards I have is harder when I have a lot of them and the hand isn't sorted.

Also, I'll just leave it here since I don't think this warrants a separate issue, the bot seems to be having lag spikes as of late. Not sure if this is due to some memory leak or an influx of players at certain times or some other reason. If it's the second reason, then making a separate command to sort hands and not doing it every turn might help. Sorted hands are not that necessary when a player has just a few cards.

Auto-kick Timer Doesn't Work

Checklist

  • I have checked previous issues for duplicates
  • This issue is not related to selfhosting
  • This issue is a feature request (leave unchecked for bug report)

Expected Behavior

The game should be deleted if it doesn't start within a few minutes, and it should kick players that don't take their turn within a certain time (including the host).

Current Behavior

Players can start a game and never end it, or even leave the server, and the channel can never again play Uno.

Steps to Reproduce (for bugs)

  1. Start game
  2. Do nothing

Context

This has been causing problems on the Discord Dungeons server (currently Spookord Dungeons for October). Multiple uno channels have been deleted or locked because of it. I know there's code in the bot to handle this situation, but it never runs.

Can't Kick Unresponsive Player

Sometimes someone has to leave abruptly before they can use uno quit, the game host should have the ability to kick players out of the match.

error starting bot

help me to fix this

PS C:\UNO-master\UNO-master> node index.js
C:\UNO-master\UNO-master\src\Spawner\index.js:11
    this.max = config.shards.max;
                             ^

TypeError: Cannot read property 'max' of undefined
    at new Spawner (C:\UNO-master\UNO-master\src\Spawner\index.js:11:30)
    at new Client (C:\UNO-master\UNO-master\src\index.js:8:20)
    at Object.<anonymous> (C:\UNO-master\UNO-master\src\index.js:15:16)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (C:\UNO-master\UNO-master\index.js:1:1)

Localize the bot

Checklist

  • I have checked previous issues for duplicates
  • This issue is not related to selfhosting
  • This issue is a feature request (leave unchecked for bug report)

Context

We have our instance but we are all italians and we would like to play in Italian.
The bot as it is today has the text string hardcoded so it is not possible to localize without doing a fork. It is possible to provide a localization system? I would happy to localize in italian.

Player quitting with cards

Checklist

  • I have checked previous issues for duplicates
  • This issue is not related to selfhosting
  • This issue is a feature request (leave unchecked for bug report)

Expected Behavior

When you quit with cards in your hand it should return those cards should be returned to the discarded pile

Current Behavior

When quitting with cards they disappear

Possible Solution

When using the quit command move the cards from the player's hand into the discarded pile

Steps to Reproduce (for bugs)

  1. Make a game
  2. Draw cards
  3. Quit
  4. The card counts don't increase

Context

I was seeing how the bot would break in extreme examples

More settings/game modes

A few popular modes are missing.
E.g. you can't specify wether you want user to be able to play two identical cards, count up +2, count up +4, etc.
Also I remember some modes when playing uno on my DSi where playing a 0 or 7 would switch cards of all players or between two players.

No Way to Forcibly End the Game

As it stands, the only two ways to end an UNO game as of right now is to either complete it or have every player still in the game quit.

I have frequently came up to situations where people just would not quit, even if the game was far too long and even if they should definitely be doing something else. Sounds silly, I know, but people in my server are really obsessed with UNO.

There's probably other legitimate reasons to want to force end a game, so I don't think a UNO END or UNO STOP command would be a bad idea.

I'd imagine this could only be run as the host, and honestly, I tried putting in this feature myself, but ran into two problems:

  • I am not a Javascript developer, and so had no idea what I was really doing (well, I sort of did, but you know).
  • Turns out, the host of the game isn't really stored at all, at least from what I understood. I appreciate the clever usages of how players are added to keep track of the host at least until the game has started, but after that, it's impossible to find out who started it. This was probably the biggest hurdle to adding it in myself and making a PR, as I was too afraid to mess around with the Game object (I don't know how I would edit the serializations and deserializations because I honestly don't know what those even mean).

I would really appreciate if this feature was added - it would really help out with the UNO games on my server.

Callout can be abused to draw 2 cards at will

As it currently stands, anyone can spam call out to get extra cards. It can be exploited to gain extra cards when dealt a bad hand.

Perhaps a good start would be to limit call out to only giving card penalties once per any given turn.

bot is offline

Checklist

  • I have checked previous issues for duplicates
  • This issue is not related to selfhosting
  • This issue is a feature request (leave unchecked for bug report)

Expected Behavior

Current Behavior

Possible Solution

Steps to Reproduce (for bugs)

Context

Gameplay in DM

It's a little bit of a pain to constantly switch between DM and server.
You should make it possible to play the game without the need to switch.
How it is solved currently is suboptimal anyways: The bot sends you your hand without telling you which instance of the game (server and channel) this hand belongs to.

Config file

I don't know if this is checked at all, but would it be possible for you to include a template for the config? I am trying to self-host this bot for a private server because the public version cannot currently be added to a server.

Thank you for your time and consideration!

Gameplay via Reactions

Instead of typing the bot should add possible reactions to the message where you are informed that it is your turn. It just saves a lot of time; especially on mobile.
In case that you will solve the DM/Server switching issue you could also only display reactions that are currently possible for the specific user.

+4 challenge idea

There should also be a +4 stacking, as well as the +4 challenge which depends on the card played before the +4 card. If the player who played the +4 card doesnt have any cards of the same color or number as the card before the +4 card, the one who challenges that player will fail the challenge and draw 6 cards. however, if the player who played the +4 card has any cards of the same color or number as card before +4 card, the one who challenges the player will win the challenge and the one who played the +4 card will instead draw 4 cards.

I hope there will be a +4 challenge feature.

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.