Giter Club home page Giter Club logo

sebedius-yearzero-discord-bot's Introduction

Hey! Stefouch here!

I'm a former biological researcher and hobbyist programmer who loves playing boardgames and roleplaying games.

I'm writing and developing content for the Year Zero Engine roleplaying games and for Magic: The Gathering.

const hobbies = ['MTG', 'RPG', 'JavaScript'];
const Stefouch = new Human(hobbies);




Stefouch Gaming Lab
Built by a fan, For the fans.


If you value the work I do,
you can help support my projects
for as little as $1 per month!

sebedius-yearzero-discord-bot's People

Contributors

dependabot[bot] avatar gitlocalize-app[bot] avatar iarizex avatar lorddreger avatar mprangenberg avatar mt-gitlocalize avatar slfrnkln avatar stefouch avatar zonrotan 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

Watchers

 avatar  avatar  avatar  avatar

sebedius-yearzero-discord-bot's Issues

Update to Discord.JS v13

Discord.JS has released their new version 13.

https://github.com/discordjs/discord.js/blob/master/CHANGELOG.md#1300-2021-08-06

There are a lot of new features that the bot could use, like Slash commands and Message components.

The main obstacle against this update is the requirement of Node v16, which is not compatible with the Keyv module we use to manage the PostgreSQL database. See #40 .

Either the author finally updates his module (I'm starting to doubt it), or we'll have to revamp the database system. Which is a very big task.

Integrate FBL dice

  • Find Forbidden Lands (FBL) dice images.
  • Write the roll command.
  • Create a server to host the emojis.
  • Upload all emojis.
  • Copy/paste all emojis codes into the config file.
  • Playtest & bugfixes.

Integrate ALIEN dice

  • Find ALIEN dice images.
  • Upload all emojis.
  • Copy/paste all emojis codes into the config file.
  • Write the roll command.
  • Add the panic effects to a JSON database.
  • Write the panic command.
  • Implement the panic command into the roll command.
  • Adapt the supply roll.
  • Playtest & bugfixes.

[ALIEN] Panic roll not occurring after pushed rolls

Normal Behavior

With the !rolla command, a Panic Roll must occur if one or more stress dice show a "1".
Accordingly, the Bot runs a Panic Roll for the player.

Bug

This is not working if a "1" appears after the roll is pushed.


TODO list

  • Find the issue and fix it.
  • Update the Bot with the fix.

Bot is reset once per day

Every 24h, the bot is rebooted by the hosting server. It causes the bot to be unresponsive for 10 to 30 seconds.

I apologize if it happens in the middle of your game. It can break immersion, or be frustrating if it happens while typing a long command.

Vaesen critical injuries

I am currently working to add the Vaesen critical injuries.

New commands:

  • !critvaesen | !critv

New files:

  • crits-vaesen-damage.en.csv
  • crits-vaesen-mental.en.csv

Altered methods:

  • Anything related with the !crit command.

Custom prefixes are only saved for 24h

Due to a bad choice of a new database system with this bot, the guild-customized properties are only saved for 24h.

I've chose SQLite, but the bot's host (Heroku) doesn't support this very well.
Instead, I must change for another database system: Postgres.

  • Identify the bug.
  • Read the Heroku help for Postgres.
  • Write a new database script.
  • Test all database connections.
  • Correct all commands with this new script.
  • Playtest and bugfixes.

Vaesen Dice faces blank or 6, no others (minor)

the images for the vaesen dice do not show the numbers on non-6 faces. My players tend to shade narrative failure based upon the height on the various failure results. This is minor because the summary box does show the numbers.
image

Commands Hang/Fail

Hey there! I've noticed that many commands will hang and fail out.

Is this a server resources issue?

Too much information on pushed rolls

Describe the Bug

When pushing a roll in systems with fail-rolls you can see additional text that is only relevant for t2k.

Severity

  • Low (formatting issues, things that don't impact operation)

Context

any pushed roll for i.e. fbl, myz

To Reproduce

  1. !rf 10b
  2. then push so at least one fail comes up.

Expected Behavior

Remove bold lines

Screenshots

image

TypeError: Cannot read property 'stop' of null

Describe the Bug

The following error might have caused a crash of the bot :

TypeError: Cannot read property 'stop' of null
Code: undefined
Path: undefined
Stack: TypeError: Cannot read property 'stop' of null
    at PageMenu.stop (/app/utils/PageMenu.js:134:21)
    at MessageCollector.<anonymous> (/app/Sebedius.js:613:41)
    at MessageCollector.emit (events.js:326:22)
    at MessageCollector.stop (/app/node_modules/discord.js/src/structures/interfaces/Collector.js:188:10)
    at MessageCollector.checkEnd (/app/node_modules/discord.js/src/structures/interfaces/Collector.js:213:22)
    at MessageCollector.handleCollect (/app/node_modules/discord.js/src/structures/interfaces/Collector.js:107:10)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

Severity

  • Critical (bot crash, extremely major functional impact)

Context

It happened after a ReactionMenuError: Missing MANAGE_MESSAGES permission! error, with the command !attack.

To Reproduce

Unknown yet.

Expected Behavior

  • No error should be logged as Missing MANAGE_MESSAGES permission error should send a message to the user instead, like in the roll command.
  • No crash should occur.

Botinfo error

Heroku Log:

2020-12-10T10:21:51.807879+00:00 app[worker.1]: Botinfo Error TypeError: Cannot read property 'cache' of undefined
2020-12-10T10:21:51.807897+00:00 app[worker.1]:     at botInfo (/app/commands/admin.js:204:34)
2020-12-10T10:21:51.807898+00:00 app[worker.1]:     at runMicrotasks (<anonymous>)
2020-12-10T10:21:51.807898+00:00 app[worker.1]:     at processTicksAndRejections (internal/process/task_queues.js:97:5)
2020-12-10T10:21:51.807899+00:00 app[worker.1]:     at async Object.run (/app/commands/admin.js:41:41)
2020-12-10T10:21:51.807899+00:00 app[worker.1]:     at async Sebedius.<anonymous> (/app/bot.js:143:3)

Confusing argument p for the init command

Describe the Bug

I noticed, that !init is the only command where -p isn't a shortcut for -private but for -place/-init instead. This could be highly confusing for a user.
Additionally "p" without the dash can be used as a shortcut for the subcommand "previous". This adds to the confusion.

Severity

  • Medium (minor functional impact)

Expected Behavior

I would at least expect -p to be a shortcut for -private, as in any other command that supports this argument.
Unfortunately this would be a break in the command and we would need a different shortcut for the -place argument.

What do you think @Stefouch ?

Alien !crit x

Describe the Bug

When using !crit x for AlienRPG, two dice are rolled instead of one, the most common results are Rise Again and Torn Apart (1 and 6 on the table respectively), with the only other result being Wounded.

Severity

  • High (a broken feature, major functional impact)

Context

!crit x !crit xeno

To Reproduce

It seems that it happens no matter what - no step process required just type !crit x with the bot active

Expected behavior

should be a single D6 roll, not 2, with an equal chance of rolling one of the 6 options on the Critical table for a Xenomorph

Screenshots

Additional Context

Allow rolls for multiple artifact dice (FBL)

Multiple artifact dice could be rolled in some situation in Forbidden Lands.
Fix that.

Todo list:

  • Upgrade (rework) the Roll command.
  • Add support for multiple artifact dice.
  • Test the changes.

Reaction-menu doesn't reset in private message in attack

Describe the Bug

When using the -private parameter for attacks the reaction menu doesn't reset the counters to 1.

Severity

  • Low (formatting issues, things that don't impact operation)

Context

Any !attack with the -private parameter.

To Reproduce

Steps to reproduce the behavior:

  1. Start an attack with !attack myz anmesiac -private
  2. Click on the sword reaction to roll an attack.
  3. The attack is rolled and the reaction stays at 2.
  4. If you click it again, it's returned to 1 (as usual discord behavior).
  5. On next click it goes to 2 again and rolls another attack.

Expected Behavior

The reaction should be reset like it is in a normal text channel.

Screenshots

image

Vaesen Crit Table

The vaesen crit table is missing from the database. Is it simply missing or is there another reason(copyright, etc...)?

I don't mind adding it to the database myself if it is simply missing. As long as you can tell me where to add it.

Support for Coriolis

Hi, any chance to support the Coriolis dice mechanic too?
Changes in comparison to MYZ dices are: You only need one pool of dices (since there is no different behaviour in base/skill/gear dices) and also every rolled "1" can be pushed.

Regards and thanks for all your great work,
Tobias

@mention doesn't appear to work

Describe the Bug

Saw this happen in two places:

  1. In DMs with the bot
  2. On a new server

Basically doing @Sebedius doesn't appear to trigger any responses, while using the default prefix does.

Severity

  • Medium (minor functional impact)

Prevents easy configuration without running into conflict with other bots.

Context

To Reproduce

  1. @Sebedius ping

Expected Behavior

The readme suggests that the @mention should work, so I'm suspecting this is either a bug or deprecated functionality.

Screenshots

image

image

[REQUEST] Allowing spaces between dice types

I've seen a number of people testing the bot who put a space between the dice types for normal rolls. It might make things smoother to allow a space between dice types. You might need to change the syntax for descriptions which come after, or you could use If statements to check if the text after the space is another dice input.

Discord privileged Intents not granted

Discord's GUILD_MEMBERS & GUILD_PRESENCES privileged Intents are not granted. They aren't mandatory for the bot to work, but are useful for admin tasks.

Todo:

  • Temporary fix: disable these privileged intents
  • Get the bot verified by Discord
  • Contact Discord support
  • Solve the issue
  • Re-enable these privileged intents and the admin commands

Some used emoji are no longer valid

When using the vaesen environment, a "!roll 3d6" gets error emoji placeholders for the dice faces.
This is the result:
image
This is after clicking the placeholder:
image

Custom prefix is not long-term saved

Defining a custom prefix will only work for a predetermined period of time.
The JSON database model could be buggy in the future, due to multiple write/read cycles occurring at the same time.

Will use another database system: Keyv

TODO list:

  • Read documentation for Keyv.
  • Rewrite database module with Keyv.
  • Playtest & bugfixes.

Small database errors

Investigate the following and fix them:

  • Issue 1
  • Issue 2
  • Issue 3
  • Issue 4
  • Issue 5
:one:
Error: TypeError: Cannot read property 'delete' of undefined
Code: undefined https://discord.com/developers/docs/topics/opcodes-and-status-codes
Path: undefined
Stack: TypeError: Cannot read property 'delete' of undefined
    at Sebedius.kdbCleanGuild (/app/Sebedius.js:220:16)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Sebedius.<anonymous> (/app/bot.js:192:25)

:two:
Error: TypeError: Cannot read property 'hasPermission' of null
Code: undefined https://discord.com/developers/docs/topics/opcodes-and-status-codes
Path: undefined
Stack: TypeError: Cannot read property 'hasPermission' of null
    at Object.run (/app/commands/setconf.js:19:16)
    at Object.run (/app/commands/prefix.js:13:50)
    at Sebedius.<anonymous> (/app/bot.js:143:17)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

:three:
Error: SyntaxError: Unexpected token ''
Code: undefined https://discord.com/developers/docs/topics/opcodes-and-status-codes
Path: undefined
Stack: SyntaxError: Unexpected token ''
    at YZRoll.sum (/app/yearzero/YZRoll.js:362:15)
    at YZRoll.toString (/app/yearzero/YZRoll.js:522:23)
    at Object.run (/app/commands/roll.js:289:20)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Sebedius.<anonymous> (/app/bot.js:143:3)

:four:
Error: TypeError: Cannot read property 'delete' of undefined
Code: undefined https://discord.com/developers/docs/topics/opcodes-and-status-codes
Path: undefined
Stack: TypeError: Cannot read property 'delete' of undefined
    at Sebedius.kdbCleanGuild (/app/Sebedius.js:209:16)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Sebedius.<anonymous> (/app/bot.js:192:25)

:five:
Error: TypeError: Cannot read property 'delete' of undefined
Code: undefined https://discord.com/developers/docs/topics/opcodes-and-status-codes
Path: undefined
Stack: TypeError: Cannot read property 'delete' of undefined
    at Sebedius.kdbCleanGuild (/app/Sebedius.js:209:16)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Sebedius.<anonymous> (/app/bot.js:192:25)

Add command for Drawing initiative cards

Initiative cards use a deck of ten cards labelled from 1 to 10. They're used in several Fria Ligan games.

Todo list:

  • Find a concept
  • Write the module
  • Write the command
  • Playtest & bugfixes

Roll: 0 die

Describe the Bug

Rolling 0 of a certain die type is converted to 1.

Severity

  • Low (formatting issues, things that don't impact operation)

Context

!roll command

To Reproduce

!roll 0b
!roll 0b0g0s
!roll 6d0s

Expected Behavior

A 0 die should not be rolled.

Extra dice append to bot response

Describe the Bug

When dice command is give, extra dice is appended to result.

Severity

  • Low (formatting issues, things that don't impact operation)

Context

!roll 10d

on a server with the default system set to Coriolis

To Reproduce

Steps to reproduce the behavior:
In channel type in command and extra dice appears.

Expected Behavior

Extra dice does not appear.

Screenshots

image

Additional Context

[Megathread] Twilight 2000 4E Support

⚠️ DISCLAIMER
The bot support for rolls on this game is entirely based on partially revealed pre-alpha rules over the Internet.
The dice mechanic is still subject to change.

Twilight 2000 will be supported by Sebedius. At the moment, the !rolltwilight (or !rw) command is functional.

Todo List

ROLL

  • Create 17 new dice emojis for T2K.
  • Rewrite the whole Roll engine of Sebedius.
  • Create a !rolltwilight roll command.
    • Make it recognize single letters for dice ranks. E.g. b, c, etc..
    • Make it recognize letter-digit couples for dice ranks. E.g. d8, d10, etc..
    • Make it recognize Ammo dice rolls and count the total muns. E.g. 2a or 2d.
    • Make it support difficulty modifiers.
  • Wait for the official Alpha release of the rules.
    • Correct mechanic errors
    • Create a !crittwilight crit command.
      • Might need a rewrite of the Crit engine of Sebedius since called shot are planned in the rules.
      • Create a crit table for vehicles.
  • Wait for the official Beta release of the rules.
    • Update the dice emojis with better graphics.
    • Fix possible last mechanic changes.
    • Fix possible last crit changes.

CRITICS

  • Encode the critics
  • Create a command for them
    • Hit Location Die
      • Dice emoji icons.
      • Make it compatible

JOURNEY

- [ ] Encode the T2K Mishaps tables.
- [ ] Adapt the current FBL !journey command for T2K.

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.