Giter Club home page Giter Club logo

reputation-bot's Introduction

wakatime

Motivation

This bot was created for the DevCord Discord Server.
We needed a way to identify valuable users in our community. Most bots do these by chat activity.
Sadly a high chat activity doesn't mean that a user is valuable for the community.
That is where the reputation bot comes in place.

How does it work

The reputation bot will scan messages for thank phrases, which you can define.
When a thank phrase is found the bot will try to find the receiver of the message. This is done by several checks.

You can find more about the bot on our website.

Self-hosting

Take a look at our hosting page.

Invite and more Information

For an invitation link and more information take a look at the website.

reputation-bot's People

Contributors

amejonah1200 avatar dependabot[bot] avatar dlsf avatar drschlaubi avatar emmaboecker avatar goldmensch avatar jak0busus avatar kxmpxtxnt avatar nycodeghg avatar rainbowdashlabs avatar renovate[bot] avatar sirywell avatar skyslycer avatar taucher2003 avatar yannicklamprecht 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

Watchers

 avatar  avatar  avatar  avatar

reputation-bot's Issues

Exception in channel set command

Unknown interaction.
at de.chojo.repbot.commands.Channel.set(Channel.java:248)

[12:32:46][ERR][  ReputationBot] Unhandled exception occured: net.dv8tion.jda.api.exceptions.ErrorResponseException: 10062: Unknown interaction
at net.dv8tion.jda.api.exceptions.ErrorResponseException.create(ErrorResponseException.java:185)
at net.dv8tion.jda.api.requests.Request.onFailure(Request.java:117)
at net.dv8tion.jda.internal.requests.RestActionImpl.handleResponse(RestActionImpl.java:270)
at net.dv8tion.jda.internal.requests.restaction.interactions.InteractionCallbackActionImpl.handleResponse(InteractionCallbackActionImpl.java:85)
at net.dv8tion.jda.api.requests.Request.handleResponse(Request.java:259)
at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:238)
at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:142)
at net.dv8tion.jda.internal.requests.Requester.execute(Requester.java:125)
at net.dv8tion.jda.internal.requests.ratelimit.BotRateLimiter$Bucket.run(BotRateLimiter.java:478)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: net.dv8tion.jda.api.exceptions.ContextException
at net.dv8tion.jda.api.exceptions.ContextException.here(ContextException.java:54)
at net.dv8tion.jda.api.requests.Request.<init>(Request.java:71)
at net.dv8tion.jda.internal.requests.RestActionImpl.queue(RestActionImpl.java:197)
at net.dv8tion.jda.internal.requests.restaction.interactions.InteractionCallbackActionImpl.queue(InteractionCallbackActionImpl.java:113)
at net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:573)
at net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:539)
at de.chojo.repbot.commands.Channel.set(Channel.java:248)
at de.chojo.repbot.commands.Channel.onSlashCommand(Channel.java:86)
at de.chojo.jdautil.command.dispatching.CommandHub.onSlashCommand(CommandHub.java:120)
at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:463)
at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88)
at net.dv8tion.jda.internal.hooks.EventManagerProxy.lambda$handle$0(EventManagerProxy.java:68)
... 3 more```

Max Reputation per message

Currently the max reputation per message is hardcoded to three.
This counts for messages and embeds as well.

This should be configurable via the reputation settings.

  • Add max_message_reputation to thank settings
  • Update get_thank_settings() database function
  • Implement in vote listene
  • Implement in message analyzer

Make fancy reputation list mobile friendly again

The ranking list currently breaks thanks to discords mobile formatting. Embed fields can't be inlined on mobile devices.
image
Implement the tablist without fields
Maybe something like

`<Rank>` | `<Rep>` ➜ <User>

For formatting reasons, rank and rep should have the same spacing and use code formatting to force mono font.
This will force a table like format without losing the ability to mention the user.

Reaction on thank messages

Currently when a thank message gets a rep reaction the donator will get the reputation instead of the receiver.

Add EMBED thanktype

Add an embed thank type to mark reputation given by embed.

The current implementation breaks the embed when reaction reputation is disabled, because embed reputation is marked as reaction. These reputations will be declined by the reputation service.

Ephemeral for other users on rep promt

Related to the changes in #52

If another user clicks on the button, currently nothing happens.
That should send an ephemeral message for the user, so he knows, that he is ignored on the buttons

Emoji debug

In order to be more transparent and give more feedback to users the bot should have an option to enable some kind of debug mode.

This mode will only affect messages in reputation channel of course

Each emoji means something.
👀 ➜ Found a thankword
💤 ➜ Receiver was on cooldown
🔍 ➜No receiver was found
❓ ➜ Receiver has no recent messages in this channel.
🕛 ➜ The referenced message is too old

Allow multiple reactions for reputation

Currently one emote is set as a reputation emote.
This emote is given when a message triggers a reputation for a user. This behavior in general should stay unchanged.
This emoji will become the "main emote" of the bot.

Additionally to the main emote the user should be able to add additional emotes, which will also trigger reputation, but wont be used by the bot to react.

  • Create a table to store all additional reputation emotes of a guild.
  • outsource the main reaction setting to its own command called reactions
  • Allow the user define and reset the main emote
  • Allow the user to add and remove additional emotes.
  • Implement as slash command
  • Implement as text command

Display order of the names

When the bot asks who you want to give reputation to, the names are displayed in a very strange order for mobile.

current order:
1️⃣ 2️⃣
3️⃣ 4️⃣
5️⃣ 6️⃣

better order:
1️⃣ 4️⃣
2️⃣ 5️⃣
3️⃣ 6️⃣

So it would also be in the right order on mobile:
current order:
1️⃣
3️⃣
5️⃣
2️⃣
4️⃣
6️⃣

better order:
1️⃣
2️⃣
3️⃣
4️⃣
5️⃣
6️⃣

Fancy presence

The bot should have some fancy presents with some nice statics.
Probably wait for some nice statistics first.

Possible statistics:

  • Total Guilds (retrieved from db guild_settings)
  • Watched Channel (retrieved from db active_channel)
  • Total given reputation (retrieved from db reputation_log)
    • rep of week
    • total
    • weekly average of last 4 weeks
  • Total analyzed messages (Retrieved from db statistics (tbd))

Add badges in rep profile for top 3

The first x users in a guild ranking should get a special badge in the reputation profile

  • Create a new Config section called "profileImages"
  • This section should contain an enabled boolean and an array of strings which will be urls
  • Insert the badges as author profile picture if a image is present for this rank in the configuration

Cleanup localization

We have some keys which should be split into multiple keys.
Some keys contain formatting and other bad stuff which should not be part of the localization.

Split keys into multiple keys.

Problematic keys

  • command.info.links
  • command.repSettings.sub.emojidebug.explain
  • command.repSettings.embed.descr

Allow to set the channel list as black and whitelist

Allow to use the channel list as a black or whitelist.
Currently it is only used as whitelist

  • Add channel list type to guild settings
  • Add slash command to define the list type
  • Add text command to define the list type
  • Adjust list command locale to take the list type into account
  • Add buttons to channel dialog in setup command

Adjust user context with latest messages

Sometime a User wants to give a reputation to another user after sometime.
This is mostly not possible because of the max message age.

The user should define a fixed amount of last messages which authors will be added to the context regardless of time. but still after the first message of the thanking user.

This will allow users to thank someone after some time when no other conversation took place in the channel in the meantime.

Allow all channel to be added at once

Allow all as channel name.
This can not be done in the addchannel command and will therefore require another subcommand to support this as a slash command.

  • Add slash command for addAllChannel
  • Add text command for addAllChannel
  • Add Button to add all channel to the setup command.

Manage abuse protection

Currently all abuse protection mechanisms are always enabled.

It should be possible to disable and enable every single mechanism via an own command.

Improve Fuzzy match

Fuzzy match and mentions should only work for users which wrote a message in the max message age duration in the current channel and after the donator has started writing.
This also applies for mentions. The analyzer should take a pool of possible users.

Also A thank without a valid user will be given to the other author if only one author was active in the max message age time.

Rewrite Botlist

Rewrite botlist integration.

  • Add vote webhooks with cjda
  • Add a small thank message for voting
  • Add botlist links to info commands
  • Reorganize botlists configuration section

Guild dashboard

Provide a dashboard similar to the developer stats dashboard

This dashboard should contain:
Top 3 Reputation users
Total guild reputation
Week guild reputation
Today guild reputation
Top reputation channel

Strip messages

The MessageAnalyzer should strip trailing punctuation characters. This is required to make thankword work even when suffixed with such a mark.

When matching the thankword regex a regex like \y<thankword>\y is build to enforce word boundaries.
These word boundaries are getting violated by punctuation marks like in the following example.

Following examples arent working, but should work:
<thankword>!
<thankword>.
<thankword>, ...

Think which characters which may proceed these words. Characters like question marks should and could invalidate a thank word.

New Logo and Branding

The Bot really needs a serious Icon.

The star is already good, but a bit too simple. It should be recognizable and unique in some way.
Probably also still neutral. No anime girl I guess.

Maybe something like these icons would be applicable. Of course more special, colorful and less boring
image

The same style and identity should be applied to badges introduced in #13

Allow removing a reputation by removing the reaction

After the user is notified that this reputation counted like implemented in #17 he may want to remove the reputation again.

When a user or moderator removes a reputation reaction this should remove the reputation as well.

  • Implement the GuildMessageReactionRemoveEmoteEvent and GuildMessageReactionRemoveEvent into the ReactionListener.
  • Add the required queries to the ReputationData

Voice reputation

It should be a way to give reputation to people you have helped in a voice channel. One possibility would be to set a channel where you can thank people in voice with e.g.
"prefix voice @name" (/rep voice @chojo)

Create FAQ

Create a FAQ and explain some things

  • Emoji Debugging
  • Why cant I give reputation to user XY
  • What is a context
  • What roles will be given and removed by the bot
  • How can I remove reputation of a user
  • A user has left the guild but still shows up in top command
  • How can I request my data
  • How can I delete my data

Easy setup

Use dialog system to create a setup command which guides the user through the bot setup process.

Prompt user

If no match for a thank message was found prompt the user and let the user decide which user he wants to thank.

Hey you just said thank you. Which users do you want to thank?

Reactions at message with the numbers.

Make a command to remove reputation

On our server we have backfilled reputation, but now there are old/inactive users in the top list and we would like to only have current users on there, so a command that removes/sets the reputation of a given user to a given number would be useful. Thank you!

DSGVO command

The bot should be GDPR and DSGVO compatible.
Currently the user needs to request its data on discord. However this is a lot of manual work on dev side.

Goal is to implement a mechanic which allows user to:

  • Implement request of all data associated with a user.
  • Implement deletion of all data associated with a user.
  • Implement command listener for private messages.

Data request should be done by writing a private message to a user. Implementation could be similar to the internal command listener.

Returned data should remove all data from other users. Data should be supplied as json dump of the requested database object.
Deletion of data should not destroy integrity of the database. Data will not be deleted, but anonymized. This means that user ids are purged and set to 0. No user should lose reputation caused by data deletion of another user.

Self destructable confirmation message

Currently a user does not get a visible or noticeable feedback if he reacts to a message with the reputation emote.
This mostly happens when a user upvotes a reputation, by clicking on the emote given by the bot.

The user should get a short feedback when he adds the reaction to the message.
This should be done in form of a short confirmation message into the channel which will be deleted after some seconds.

Make "reputation" configurable

It should be possible to change the name of reputation by guild.

A guild should be allowed to call it Kudos, Awesomeness or whatever they want.

For example calling it R AP utation on DevCord to honor AP.

Insert the possibility to set the singular and the plural name of the reputation name. These will be Reputation by default and can be a language key to still allow localization.

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.