Skip to content

[feat] !donate command for being charitable #84

@matthewbrandt

Description

@matthewbrandt

Problem

Gifting individual items to other players in p4nth3rworld is tedious and slow using !gift {random/playername} {itemname}. It works well for one-off gifting but not for larger quantities of charity, especially during livestreams when many players are actively playing.

Solution

A new !donate command is introduced to allow players to gift more than one item at once. It comes with both options and limitations (to prevent abuse).

Format

!donate {parameter}

  • parameter: a selection of (optional) parameters are available but only one can be used at a time; if no parameters are specified a single item is chosen at random
    • cooked: by specifying the cooked parameter, the user can donate a cooked item; the item is selected at random, if no item meets the criteria the donation fails
    • quantity {integer}: by specifying a quantity, the user can have a specific number of items to donate (> 0); the items are selected at random, if the user has insufficient number of items the donation fails
    • rarity {operator} {integer}: by specifying a rarity, the user can donate a specific rarity of item to donate (<, >, = are supported operators); the item is selected at random, if no item meets the criteria the donation fails

Examples

  • !donate: a single random item from the user's inventory will be donated to a single random user in the current zone
  • !donate cooked: 1 random cooked item from the user's inventory will be donated to a single random user in the current zone
  • !donate quantity 69: 69 random items from the user's inventory will be donated to a single random user in the current zone
  • !donate rarity > 999: 1 random item of rarity 1000 or higher from the user's inventory will be donated to a single random user in the current zone

Error

When donations fail, an appropriate error message should be shown depending on the root cause.

Not enough items in the users' inventory:

@username: insufficient inventory size

No users in the same zone:

@username: there is no one eligible to receive your donation

No cooked item:

@username: no cooked items in inventory

Success

When donations succeed, an generic message should be shown depending on the amount of items and rarity.

Single item:

@username1 donated carrot to @username2 in the beach zone! (rarity: 1)

Multiple items:

@username1 donated 42 items to @username2 in the beach zone! (total rarity: 69420)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions