Skip to content

nodebb chat roll dice game

Solved Customisation
29 2 13.5k 1
  • wrote on last edited by DownPW
    #1

    hi @phenomlab

    for respond at your question here :

    https://community.nodebb.org/topic/16560/modify-nodebb-plugin-ws-dice?_=1657798694273

    When I talk about chat, I’m talking about nodebb’s internal messaging or even better in the globalchat plugin.

    Actually I use global chat so all my users all chat together in nodebb

    I would like the /roll with result to work in it

  • hi @phenomlab

    for respond at your question here :

    https://community.nodebb.org/topic/16560/modify-nodebb-plugin-ws-dice?_=1657798694273

    When I talk about chat, I’m talking about nodebb’s internal messaging or even better in the globalchat plugin.

    Actually I use global chat so all my users all chat together in nodebb

    I would like the /roll with result to work in it

    wrote on last edited by
    #2

    @DownPW ok. I’ll install the global chat plugin in DEV and write some code around that. What sort of timeline are we looking at ?

    Plus, can you let me know if you just want a “roll dice” button at the top of the chat for everyone to use ? What should happen with the result ?

  • @DownPW ok. I’ll install the global chat plugin in DEV and write some code around that. What sort of timeline are we looking at ?

    Plus, can you let me know if you just want a “roll dice” button at the top of the chat for everyone to use ? What should happen with the result ?

    wrote on last edited by DownPW
    #3

    @phenomlab

    no schedule/timeline !!
    I’m not in a hurry 🙂

    the purpose would be exactly the same as the quoted plugin

    The user writes the command to throw the dice with the numbers he wants as he sees fit, not necessarily needing a button or else all the game possibilities should be stipulated in it:

    /roll 1d4
    /roll 4d6
    /roll 30d2
    etc ....
    

    And the result is given back to him in the chat too like this for example:

    /rollBot: User to roll 4d6. Result is 4, 3, 6, 1
    
  • @phenomlab

    no schedule/timeline !!
    I’m not in a hurry 🙂

    the purpose would be exactly the same as the quoted plugin

    The user writes the command to throw the dice with the numbers he wants as he sees fit, not necessarily needing a button or else all the game possibilities should be stipulated in it:

    /roll 1d4
    /roll 4d6
    /roll 30d2
    etc ....
    

    And the result is given back to him in the chat too like this for example:

    /rollBot: User to roll 4d6. Result is 4, 3, 6, 1
    
    wrote on last edited by
    #4

    @DownPW thanks. I guess I’ll need to see how the existing plugin works first then replicate that.

  • wrote on last edited by DownPW
    #5

    @phenomlab

    maybe another plugin for help you: https://github.com/NodeBB/nodebb-plugin-dice

    The interrest : He have an admin panel with creation of a bot for responce…

    And maybe using filter:messaging.save and Messaging.addSystemMessage instead of topic events

  • @phenomlab

    maybe another plugin for help you: https://github.com/NodeBB/nodebb-plugin-dice

    The interrest : He have an admin panel with creation of a bot for responce…

    And maybe using filter:messaging.save and Messaging.addSystemMessage instead of topic events

    wrote on last edited by
    #6

    @DownPW Thanks. Will review

  • wrote on last edited by
    #7

    No problem @phenomlab

    I have open an issue on the first plugin official github and that works now on chat/global chat and topic !

    He use action:messaging.save if i’m not mistaken 🙂

    But if you want to check in on JS, why not ? 🙂
    It’s maybe better than a plugin 😉

  • No problem @phenomlab

    I have open an issue on the first plugin official github and that works now on chat/global chat and topic !

    He use action:messaging.save if i’m not mistaken 🙂

    But if you want to check in on JS, why not ? 🙂
    It’s maybe better than a plugin 😉

    wrote on last edited by
    #8

    @DownPW sounds like the plugin author is responsive and open to requests etc. I think taking this route is going to be quicker, but happy to review of you think otherwise.

  • wrote on last edited by
    #9

    Nope no problem mark @phenomlab 🙂

    I have another request that should take less time for you.

    I open it in another thread.

  • DownPW DownPW has marked this topic as solved on
  • @DownPW sounds like the plugin author is responsive and open to requests etc. I think taking this route is going to be quicker, but happy to review of you think otherwise.

    wrote on last edited by
    #10

    @phenomlab said in nodebb chat roll dice game:

    @DownPW sounds like the plugin author is responsive and open to requests etc. I think taking this route is going to be quicker, but happy to review of you think otherwise.

  • wrote on last edited by
    #11

    hi @phenomlab

    Have you got an idea for improve that bug ? :

    9822ed8e-14ed-48b3-b7f8-ea113d94b573-image.png

    Hello @oplik0

    It’s appear when the result of a roll appear on 2 lines in the timeline (Example: lot of dice roll)

    Example here with no bugs on 1 line :
    869657eb-40d5-4d8b-8dc4-28d5f12fe40b-image.png

    thanks for your futur replies 😉

  • hi @phenomlab

    Have you got an idea for improve that bug ? :

    9822ed8e-14ed-48b3-b7f8-ea113d94b573-image.png

    Hello @oplik0

    It’s appear when the result of a roll appear on 2 lines in the timeline (Example: lot of dice roll)

    Example here with no bugs on 1 line :
    869657eb-40d5-4d8b-8dc4-28d5f12fe40b-image.png

    thanks for your futur replies 😉

    wrote on last edited by
    #12

    @DownPW is there a url where I can see this ?

  • wrote on last edited by
    #13

    @phenomlab

    You can test on my VM test as usual
    MP

  • wrote on last edited by
    #14

    @phenomlab

    I have test some CSS code but it’s difficult for me.

    I just manage to remove the span time but it also removes it for other system events appearing on the timeline.

    span.timeago.timeline-text {
        display: none;
    }
    

    c4a0ce7b-0aeb-4f22-9c20-f7a533e71b21-image.png

    I can’t figure out why the username and timestamp display correctly on one line and not on 2. It’s almost the same thing finally 😲

  • @phenomlab

    I have test some CSS code but it’s difficult for me.

    I just manage to remove the span time but it also removes it for other system events appearing on the timeline.

    span.timeago.timeline-text {
        display: none;
    }
    

    c4a0ce7b-0aeb-4f22-9c20-f7a533e71b21-image.png

    I can’t figure out why the username and timestamp display correctly on one line and not on 2. It’s almost the same thing finally 😲

    wrote on last edited by
    #15

    @DownPW This isn’t going to be a simple fix you can resolve with CSS. The issue here is how the plugin injects new code into an existing HTML structure, but doesn’t provide any means of identifying elements by ID rather than using a shared class name. Based on this, “best effort” is all that can be offered without directly changing any code.

    For example

    .dice-event-text {
        display: inline-block;
        align-items: center;
        flex-wrap: wrap;
        max-width: 800px;
        width: 800px;
    }
    

    This yields

    248f43d6-23c7-4e78-a9cd-329665161393-image.png

    Not perfect of course, but certainly better than what you have.

  • wrote on last edited by DownPW
    #16

    indeed it is better but it also modifies the result on 1 line…

    As you say, we can’t do much until the plugin is modified 😞

  • indeed it is better but it also modifies the result on 1 line…

    As you say, we can’t do much until the plugin is modified 😞

    wrote on last edited by
    #17

    @DownPW Yes, it’s not very elegant sadly, and there is an impact to other elements. You could write a jQuery function that only modifies the CSS when there are more than x of the same element in that div… 🙂

  • wrote on last edited by DownPW
    #18

    Why not @phenomlab but like you know, i’m not a good JS develloper 😉 lol
    I have not the skills for that 😞

  • wrote on last edited by DownPW
    #19

    @phenomlab do you think it is difficult to do?

    EDIT: https://community.nodebb.org/post/88897

  • @phenomlab do you think it is difficult to do?

    EDIT: https://community.nodebb.org/post/88897

    wrote on last edited by
    #20

    @DownPW said in nodebb chat roll dice game:

    do you think it is difficult to do?

    No, but judging by this

    https://github.com/NodeBB/NodeBB/pull/10837/commits/e7404fd7c3d401e6adb6246c23e5567cda136dec

    It might be best to wait - or if you can’t, you could easily patch that file, or overwrite it (public/src/modules/helpers.common.js)


Did this solution help you?
Did you find the suggested solution useful? Support 💗 Sudonix with a coffee ☕
If your organisation needs deeper expertise around infrastructure, security, or technology leadership, learn more about Phenomlab Ltd. Many of the deeper technical guides behind Sudonix are published there.

Related Topics
  • Threaded chat support for NodeBB

    Let's Build It threaded chat code
    35
    1
    19 Votes
    35 Posts
    16k Views
    phenomlab
    @DownPW said in Threaded chat support for NodeBB: Better like this : add shadow and border-left on self answer Of course - you style to your own requirements and taste I’ll commit that CSS we discussed yesterday also
  • Issues with Imgur images in Fancybox chat module

    Bugs fancybox chat
    12
    1
    2 Votes
    12 Posts
    4k Views
    phenomlab
    @DownPW looks good to me.
  • NodeBB v3 Chat Very Slow

    Moved Performance nodebb v3 nodebb chat
    47
    11 Votes
    47 Posts
    21k Views
    phenomlab
    @DownPW Seems fine.
  • 19 Votes
    21 Posts
    12k Views
    phenomlab
    @crazycells this perhaps? [image: terminator_endoskeleton_1020.webp]
  • Forum Icons NodeBB

    Solved Customisation icons forum nodebb
    13
    0 Votes
    13 Posts
    5k Views
    phenomlab
    @cagatay That matches what I see [image: 4f0f858d-9812-42b1-9f61-ffb13d31dccd-image.png]
  • chat list navbar

    Solved Customisation css navbar chat menu
    30
    2
    3 Votes
    30 Posts
    13k Views
    DownPW
    No no it’s ok @phenomlab I just comment the 2 lines mentionned aboves
  • Social icon (Nodebb)

    Solved Customisation nodebb social
    7
    0 Votes
    7 Posts
    3k Views
    JAC
    @phenomlab said in Social icon (Nodebb): @jac I just tested my theory around using the OG image, and according to the Twitter card validator, it works fine [image: 73e805e1-997b-41bf-9259-51c5052ca8fc-image.png] fixed
  • NodeBB Design help

    Solved Customisation
    8
    3
    2 Votes
    8 Posts
    4k Views
    phenomlab
    @riekmedia I’ve applied some new CSS to your site. Can you reload the page and try again ? For the record, this is what I added #footer { background: #2d343e; border-top: 4px solid #2d343e; font-size: 0.9em; margin-top: 70px; padding: 80px 0 0; position: relative; clear: both; bottom: 0; left: 0; right: 0; z-index: 1000; margin-left: -15px; margin-right: -338px; } The /categories page seems a bit messed up, so looking at that currently EDIT - issued some override CSS in the CATEGORIES widget <!--- CSS fix for overspill on /categories page - DO NOT DELETE --> <style> #footer { margin-right: -45px; } </style> That should resolve the /categories issue.