PokeNavBot / issue-tracker

Bug reports / feature tracking repository for PokeNav
https://pokenavbot.com
20 stars 4 forks source link

Tagging / Notification Support #90

Closed dandesousa closed 5 years ago

fortepc commented 6 years ago

Idea:

Step 1) User 1: $subscribe registeel Step 2) PokeNav adds Registeel to a list of pokemon that User1 wants notified of. Step 3) User 2: $raid registeel Step 4) PokeNav uses some method to notify User 1 of that raid being reported.

Step 2 Options)

A - Keep the subscribed pokemon as a profile feature. Having the ability to have cross server notification support. This would be better if users are able to exclude specific servers from pokemon subscriptions B - Keep the subscribed pokemon as a server role. Making it server specific(like meowth)

Step 4 Options) A - DM the user with a link to join that raid channel. B - Tag the user, either directly or with a role

ghost commented 6 years ago

To maximize customization options, allow servers to assign server-specific roles/subscriptions to specific gyms and raid bosses.

For example, the ability to assign a sponsored gym with a role such as "EX HUNTER" and every time a raid is called out for that gym, the assigned role is also included and notified.

On the flip side of that with raid bosses, allowing servers to assign @Legendary, @Regirock, @Marowak, @Shiny to individual bosses so that these roles will be notified when the raid is called out.

dandesousa commented 5 years ago

@fortepc @cupkait

Here we go, the most flexible solution I can think up this morning:

Proposal

Challenges

Discord is not designed for the flexibility that many people want for pokemon notifications. It can't scale to notify you of all Pokemon, no matter how much people want it to. Allowing subscribing to Pokemon willy nilly will flood discord servers with roles that aren't ever notified. And often the way things should be tagged is not necessarily obvious or enumerable (ex gym, park everyone plays at, poke draft bosses, legendaries, special sub-group etc).

Role tagging will become more important when in app screenshot reports become common and the app may not have access to all roles for manual tagging by a user.

Goal

Allow PokeNav to tag specific roles when certain events occur, which should save manual effort. This aims to allow admins to configure tags when a boss raid is announced or updated; or a raid occurs at a certain gym. It will solve the following example cases:

Implementation & Examples

Admin Commands $create-role name-of-role (convenience so you don't need another bot to use the feature) $enable-gym-role ex-downtown-role "Clock Tower" $enable-boss-role pokedraft-raid-boss Claydol $enable-boss-role legendary Mewtwo $enable-boss-role mewtwo Mewtwo

User Commands $join-role ex-downtown-role (convenience -- allows joining any role assigned as a boss or gym role) $leave-role ex-downtown-role (convenience -- allows leaving any role assigned as a boss or gym role) $show-roles (will show a settings like embed with the boss and gym roles listed -- available to all)

Restrictions / Limits

Questions / Future Work

I will likely take the first simplest implementation to start but possible improvements include:

fortepc commented 5 years ago

After catching up and thinking about this more and more, I think that inside of discord raid boss notification support should stay simple, and saving the more advanced / flexible notification support be in the Companion App where it can function without the issues that discord imposes on trying to do on notifications.

Inside of discord I see this feature in two modes. An anarchy mode, and a managed mode. With a potential 3rd option depending on feasibility.

$set pokemon-roles anarchy $set pokemon-roles managed $set pokemon-roles active-bosses

anarchy mode functions exactly like Meowth does currently. When a users uses $subscribe Snorlax, PokeNavBot checks if the @Snorlax role already exists, if it does exist it adds that user to it, if it doesn't exist pokenav creates that role and then adds the user to it. Smaller servers with less tech savvy admins would benefit most from this mode. They wouldn't be concerned by the role limit, as most small servers don't bother with anything other than team roles, and maybe admin/staff roles. And as PokeNav is now, with only doing raid bosses, people wouldn't need to be subscribing to a long list of pokemon. It would require basically no set up for the admins and offers the fastest and easiest way to get this feature started in a server.

image

managed mode would mean be what you've described above, and when #106 gets figured out it could be a simple $set sub-role exraid-gym @exraidgym. I think setting roles for regions is unnecessary though. Just add the ability to have multiple active raids channels for different regions that are 1<->1 linked to a reporting channel for that region, like I originally suggested in #40 which would allow users to set that specific regional active raids channel to notify on every message instead of just mentions.

(insert link to flowchart describing managed mode, but I'm too tired to make it right now, maybe later...)

active-bosses mode would be a slight modification of anarchy mode, where any user can use $subscribe Snorlax but instead it would only create a new role if the species the user tries to subscribe to is on a poke-nav server whitelist of currently active raid bosses. And when a pokemon species gets removed from that whitelist, the role in the servers using this mode would automatically get removed. This would leave an intentional gap, so that if an admin manually created a pokemon role, people can subscribe to it even if it's not on the server's whitelist.

image

Anarchy mode existing would necessitate the need for some sort of purge command, to facilitate cleaning up of unused roles $purge-subscription-roles command would check for any raid notification roles that have no users subscribed to them and delete them. and $purge-subscription-roles -a would purge all subscription roles, even those that have users, and if an admin wanted to delete a specific pokemon role they'd just do it in their normal role management and pokenav would recognize that the role for that species no longer exists and stop trying to tag it.

dandesousa commented 5 years ago

First, I think the active raid bosses thing is out of scope since bosses are regional and thats not what I'm trying to spend my time on with this feature necessarily. Unless it uses the "has it ever been a raid boss" feature used for counter lookups, the auto-create role from active boss probably wouldn't be implemented now.

Second, While I know you really like Meowth's mode of auto-creating roles by users, I think that its dangerous, as it essentially grants anyone with send messages the ability any where pokenav exists to create as many roles as they want on a server, regardless of utility. While you can somewhat do this now with raids those are temporary and immediately obvious to everyone whats going on. Creation of roles has a tendency to silently sneak up and when its a problem (run out of roles) requires immediate attention since it break half the features in PokeNav. Then the admin tags me in #support asking why PokeNav suddenly stopped working when they haven't touch the configuration (this relatively common just with standard permissions).

In either case the above is purely additive, we can break it off into another feature and add it later as a setting / option when theres admin interest.

As a simplifying step, I also don't see a need to treat boss roles as any different than gym roles in terms of command structure. If users don't subscribe to pokemon or gyms and instead subscribe to the roles on the server they want, admins gain much more flexibility in running servers how they want.

$subscribe legendary $subscribe snorlax

Where the role is one that is pre-made (whitelisted) by admins.

Admins can change the roles and people don't need to subscribe, (make a legendary tag, and admins add / switch over the tag to the newest legendary t5 boss when it rotates). PokeNav can still provide tools in the future to make reconfiguring the server easier (like if we allow the active raid bosses thing or swap to the next legendaries). The interface to users should remain the same. They lookup what notifications are enabled on the server, if they want they request new roles from admins and admins are the only ones that allow server configuration to change, since they are the only ones who can fix it.

fortepc commented 5 years ago

1) The point of spending your time keeping up with raid bosses is fair, I wish we could hook into other system like this page https://www.pokebattler.com/raids where they are already maintaining what current possible raid bosses are. PokeBattler seems to be pretty API friendly. Maybe since they already actively keep up with what active raid bosses are they have an API or would be willing to add one?

fortepc commented 5 years ago

2) And that makes sense too, but I am just thinking of the smaller communities. The ones that are less tech savy. And seeing that it does work for Meowth servers. They've not had any need to delete that feature from their bot. It's fairly self regulating. I know that PokeNav does rely on roles a lot more than Meowth does, so it stands to fail a lot more drastically if it goes wrong. But An anarchy mode for subscriptions stands to benefit those smaller servers who are less tech savvy who wouldn't bother with the admin work needed to keep and maintain a set of roles for subscriptions.

dandesousa commented 5 years ago

I think a follow up issue to track the current bosses from pokebattler or another source would be good.

I do have one more change to this before I start the implementation if @fortepc / @cupkait can give me a thumbs up if they agree I'll proceed to work on it right away:

Theres one other case that this doesn't solve is when you wanna tag based on combination of things.

For example, If you want a role for tier 5's in a specific neighborhood or at a specific gym. Two separate problems. I propose an area rule in addition to gyms and the ability to combine a gym with a boss / tier. To future proof, align it with the trade syntax:

EX Raid Role $enable-raid-role ex-eligible-raid "gym: Ex Gym Name"

All tier 5 eggs and bosses $enable-raid-role t5-raid "tier: 5"

All mewtwo $enable-raid-role mewtwo-raid "boss: mewtwo"

All tier 5's within 5 KM of a GPS coordinate $enable-raid-role township-raid "tier: 5" "area: 40.22, -75.01, 5"

tier and boss would be mutually exclusive, as would area and gym. Each rule is evaluated separately (you can make multiple rules for a role) and all conditions of a rule must be true to add the tag.

There would probably also be limits on the number of rules that are allowed to be evaluated (I need to do some investigation).

To sum up, I see 4-5 new commands:

subscribe <role-name>. # subscribe to any role that is a raid role in the server enable-raid-role <role-name> <rules>. # this gives you an id you can check disable-raid-role <an id> # removes the rule show-subscriptions # display everything in English language create-role role-name # convenience to make a new role that is mentionable

Will only tag the role once, when the raid is created -- we can add follow up tags later if needed