Code Monkey home page Code Monkey logo

discord-item-catalogue's Introduction

๐Ÿ‘‹ Hi, Iโ€™m @Ty-R

discord-item-catalogue's People

Contributors

ty-r avatar tyroberts avatar

Watchers

 avatar

discord-item-catalogue's Issues

A way of creating listings outside of Discord

This may never happen but it's something I'd at least like to look into because it'd be fun. While this bot is not specific to any game, it was created with Minecraft in mind. This server I play on is running Bukkit (or Paper, idk), and I imagine custom shops, or commands are possible.

Usually a user would add items to their shop, and, if they want to, proceed to manually add those items to the catalogue in Discord. This is a mildly inconvenient activity.

I wonder if we could create a plugin that somehow connects to the catalogue, and would allow adding/modifying these listings from in-game?

Enable safe removal of multiple listings

Removal of listings is limited to one at a time. The reason for this is to avoid users unknowingly removing multiple listings; an action that cannot be undone.

Whatever method used to achieve this must be clear so that it becomes highly unlikely to be doable by accident. It's impossible to add a confirmation, but I'd rather not have to.

It could be a flag with a wildcard:

!cat remove -f book*

for example would forcefully remove any listing starting with book.

Discord messages are capped at 2000 characters

I wasn't aware of this when creating the bot, but Discord messages have a fairly small character limit. This is quite a big problem for a bot that returns messages of variable length with seemingly no cap.

This became obvious quite quickly when the catalogue started building up, and a user who queried for everything got nothing in return because the message was too big.

The workaround for now is to segment the message returned by the action most likely to exceed the character limit - search, and send the segments separately. This does the job, and looks OK in the client, but it's a potentially spammy solution. For example if search results were divided by 10, then 10 messages would be sent.

Divide listing into multiple tables

Currently listings is one table with fields: seller, item, price, location. This works well for having listings and only listings but is quite limiting otherwise.

If I wanted to have better "ownership" of a listing I'd have to add another field to this table, like user ID.

If I wanted something like a refined location, then I'd have to add another field to this table, like location co-ords.

Three tables here instead of one would make things a bit easier:

  • users - has many listings, has many shops
  • listings - belongs to users, has one shop
  • shops - belongs to listings, belongs to users

users would have fields like: nameand ID, and ID would be what owns the listing, but we can add other fields here, like admin, in-game name, etc.

listings would continue to have item and price, but would allow for more things like timed discounts, or quantity.

shop would have fields like location, but would allow for more refined values, like which town that shop is in, it's opening hours, etc.

Bulk add

Listings can only be added one at a time which can be tedious if you have a large inventory to add. You'd have to run !cat add item:price @location for each item.

The only bit of the command that is likely to vary is item:price so I wonder if there's a way of putting many things in the middle of that command, or a similar one to better indicate the intention, for example:

!cat list
item1:price1
item2:price2
item3:price3
item4:price4
@location

Add an alternative seller

Currently all fields can be edited except the seller:

[seller] is selling [listing] for [price] at [location]

The reason for this is because the seller is the owner, and only the owner can modify their listings. If the seller was renamed then they would fail future checks that are made when editing that listing because it thinks they're no longer the owner.

I think seller should remain as is, and the default behaviour to also remain as is, but add an additional field which would act as the alternate seller.

This would have a couple of immediate benefits:

  1. Alias sellers - shortened usernames, or in-game usernames that don't match Discord
  2. Store names - shorter listings: [store] is selling [listing] for [price]

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.