Coder Social home page Coder Social logo

chokyotager / la-cosa-nostra Goto Github PK

View Code? Open in Web Editor NEW
15.0 4.0 7.0 15.42 MB

A Discord implementation of the party game Mafia, with tones of Forum Mafia.

Home Page: https://discord.gg/9ecwAR9

License: Other

JavaScript 100.00%
mafia discord game werewolf bot javascript nodejs good-first-issue discord-mafia discord-werewolves

la-cosa-nostra's Introduction


banner


Discord server Vulnerabilities Dependencies

About

Bringing real-time Mafia to Discord. Forum Mafia has always been an interesting game. La Cosa Nostra is my attempt in bringing the charged zero-sum strategic mafia party game into Discord, all while keeping everything automated and requiring no human intervention. It is coded in JavaScript.

Installation and configuration using NPM

  1. Install the LCN package using npm install la-cosa-nostra.
  2. Create a bot-token and a Discord bot (guide here).
  3. Add your bot to the server using this link: https://discordapp.com/oauth2/authorize?client_id=CLIENT_ID&scope=bot&permissions=8 - swap the CLIENT_ID out for the ID of your bot.
  4. Copy and paste this code below into a script file in a directory (i.e. lcn/run.js):
var lcn = require("la-cosa-nostra");

var config = {
   "bot-token": "<token>",
   "server-id": "<server ID>"
   // Other configuration parameters as you like
};

var lcnbot = new lcn.Bot(config);
lcnbot.start();
  1. Run the script.
  2. For a more detailed guide and information on installation, as well as configurable fields, visit our Wiki.
  3. Join our Discord or ask on the forums if you require assistance in installation.

Features and preview

Game trial

Emote based votes

Role-specific commands

Role-specific commands - a player with a doctor role healing another player

Auto declare

Completely automatic - from actions to transitions to win declarations

Custom game flavours

Custom game flavours and text - individual roles may be customised easily to suit a "theme" without having to change the role's code - the bot also allows for expansion packs which are essentially drag-and-drop setups

Installation and configuration using bot instance (manual)

Clone or download the bot repository and run it remotely on your server. The minimum Node version for this bot is 10.15.0.

I strongly recommend using PM2 (http://pm2.keymetrics.io/) as the process manager to keep this bot running smoothly (hopefully) on your server.

You will also need to create a bot user on Discord and add it to your server. I suggest reading this guide: https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token

Dependencies are listed in package.json. Other packages used by this module should come pre-installed with Node.

Configure the bot through the /configs file. Make sure you insert your bot token and server ID in /configs/configuration.json. The other configuration options should hopefully be pretty self-explanatory.

Launch bot.js from Node once you are ready.

For a more detailed guide on installation, visit our Wiki. For technical support, ask on the forums or add me on Discord.

Expansion packs

Ever since the Foxgloves update, the bot is able to accept expansion packs. These are individual folders which can contain custom roles, attributes, banners, flavours and even entire setups. They can be copied, pasted, rely on dependencies and shared between users easily, and anyone using the bot can load them.

Some of the default expansion packs that come with the bot include (as listed in /expansions):

conspiracy-channels - adds conspiracy channels - a form of group private communication in games

forum-auxiliaries - adds Mafia factional kill and basic one-attack protection

lcn-expansion-1 & lcn-expansion-2 - expansion packs

lcn-modular-base - expansion pack for modular roles

you-die-you-lose - self-explanatory

the-anarchy-of-sol, zodiac-mafia, the-bluerose-hospital & Duvocation - closed setups, designed by myself with a few other hosts

c9++ - the C9++ semi-open game by Fiasco as seen in Mafiascum

primrose-c9++ - an expanded C9++ setup

expanded-primrose-c9++ - a further expanded C9++ setup but for 21 players

knight-errant - an 18 player blind setup that is generated through a knight move.

2d3 - a 9 player beginner setup as seen on Mafiascum.

plaguetools - a utility expansion pack for the plaguebearer

compmeme - memes for your computer needs, sorry Silicon Valley!

meme - old LCN memes

Simply go to /configs/playing.json and add your expansion pack as a list like such to load it:

{
  "playing": {
    "players": "auto",

    "roles": null,

    "expansions": ["c9++"],
    "shuffle": true,
    "flavour": null

  }
}

Note that roles is set to null so the expansion pack can automatically assign roles.

Wiki, Guides, and Developers

For a more detailed guide on installation, how to make your own roles and setups, and the lot, visit our Wiki at https://github.com/Chokyotager/La-Cosa-Nostra/wiki

We also have a forum dedicated to the LCN community. If you are a developer wanting to ask some development questions or to share your expansion packs, or if you just want to advertise your LCN server, go here: https://chocoparrot.com/forum

Credits

Authors: ChocoParrot & Hex4Nova

Alpha testers: Justin (SpikedCoffee), Lia

Beta testers: Ardvark8op, ShapeShifted, Les (Fantome), Lia, Misode, Conjurer, Good Skele, Hex4Nova, Inffy

Special thanks: Error, Fogalog, Inffy, Randium, Sai Kurogetsu, Alisha

Contact

Add me as a friend!

Discord: ChocoParrot#8925

la-cosa-nostra's People

Contributors

chocoparrot avatar chokyotager avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

la-cosa-nostra's Issues

Upgrade to discord.js v12.2.0

Changes in the Discord API and Domain.
The old API will no longer work on November 7th 2020.
So will everything below discord.js v12 no longer work.

https://github.com/discordjs/discord.js/releases/tag/12.2.0

you'll have to change a lot of code, as they introduced Managers.

Example:

client.channels.get("Channel ID");
// is going to be \/ in discord.js v12
client.channels.cache.get("Channel ID");

here's a copy of the announcement from the Discord Developers server:


๐Ÿ“ฃ API Updates ๐Ÿ“ฃ

Discord has finally made the switch to discord.com ๐ŸŽ‰

With this change also means that the API endpoint is moving too! Please start moving your libraries, webhooks, and integrations over to using discord.com in place of discordapp.com.

We currently plan to start requiring the new domain later this year for third party developers on November 7th, 2020. We will be sending out more formal notices (system DMs and account emails) to announce this breaking change in the coming weeks.

Logger

Log actions from players (not chat logs) separately for audit - work in progress since TAOS commit (in systems/game_templates/Logger.js, considering refactor/discard.

[Log actions can be stored in base64 to prevent server administrators from accidentally seeing it unless deliberately]

Autosignups

Autosignups module to be pended - allow for further automation

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.