Giter Club home page Giter Club logo

jprof_by_bot's Introduction

Official Telegram bot of Java Professionals BY community.

What is this bot for?

  • Tracks JEPs popularity

  • Tracks popularity of YouTube videos from Java-related channels

  • Warns users when they mention Kotlin

  • Allows users to pin messages

  • Allows users to create polls with reply buttons (just like @like bot)

  • Converts some currencies to EUR and USD

  • Posts scheduled messages from this repo’s posts branch

  • Expands LeetCode links

  • Regulates our English Rooms & teaches us new English words

So, it just brings some fun and interactivity in our chat.

Contributing

Here are the most important rules if you want to make a contribution:

  • Split the code into modules based on features

  • Stick to the technologies that can fit into AWS free tier

The rest could be found in the contributing guide.

jprof_by_bot's People

Contributors

madhead avatar wtsiamruk avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jprof_by_bot's Issues

Topics support for /pin

Describe the bug
/pin is not working in topic-enabled groups

To Reproduce

Steps to reproduce the behavior:

  1. Send a /pin not replying on any message
  2. Bot doesn't respond

Expected behavior
Bot responds with some help and pins balanse.

Temporary pin for users

Non-admin users sometimes want to pin messages in the chat. Do that for them, when asked (e.g. via command like /pin).

Further improvements: make pins achievable or "paid". Not with real money, ofc.

Save posted links

Related to #7.

The idea is to save all the links posted to be able to later generate a digest of topics discussed.

Bets

Is your feature request related to a problem? Please describe.

Users should be able to bet something on a verifiable outcomes. Like: "I bet 10 coins on Valhalla being released in the upcoming Java release".

Describe the solution you'd like

A workflow with buttons for betting.
A message with buttons for verifying / confirming.

Sell pins and custom statuses

Background

A pin is one of the "currencies" used in chats, see #17.

A custom status is an additional title available for admins, rendered in grey near their usernames:

image

It is possible to make any member an admin with no actual admin rights, only to give him a custom status.

Idea

Sell pins and custom statuses!

Solution

  • Bot Payments API
  • Setting custom titles is possible with setChatAdministratorCustomTitle.
  • Pins are fully controlled by the bot already
  • Predefined custom status, like "Supporter" for 1€
  • Predefined custom status, like "I AM RICH" for 5€.
  • Custom status set by user, for about 2-3€. Make sure they would be not able to set "I AM RICH".
  • Pins, 24 (1 day) for 1€
  • Update the ToC! It's important when working with real money.

Create messages with reaction buttons just like @like bot

A @like bot can be used to send messages with reaction buttons:

image

But it looks kind of spammy, because of that via @like. It would be better if we could do that via our own bot.

➕ Access control, only admins can create messages
➕ Use the existing voting facilities
➕ Not sharing stats with anyone else
➖ Requires some coding, though

Kotlin incident is not triggered for non-text content

An update like this:

{
   "update_id":550799694,
   "message":{
      "message_id":82547,
      "from":{
         "id":42,
         "is_bot":false,
         "first_name":"X",
         "last_name":"Y",
         "username":"Z"
      },
      "chat":{
         "id":-42,
         "title":"JPROF.BY",
         "username":"jprof_by",
         "type":"supergroup"
      },
      "date":1625571795,
      "video":{
         "duration":3,
         "width":464,
         "height":848,
         "file_name":"video.mp4",
         "mime_type":"video/mp4",
         "thumb":{
"file_id":"AAyAE",
            "file_unique_id":"AQUty",
            "file_size":12905,
            "width":175,
            "height":320
         },
         "file_id":"BAgBA",
         "file_unique_id":"AgKUs",
         "file_size":572314
      },
      "caption":"\u0415\u0441\u043b\u0438 \u0447\u0442\u043e \u0438\u0449\u0435\u043c \u043b\u044e\u0434\u0435\u0439 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0443\u0442 \u041a\u043e\u0442\u043b\u0438\u043d \u0435\u0441\u043b\u0438 \u0447\u0442\u043e :D"
   }
}

Because of this where clause, where only the TextContent is processed:

when (val content = message.content) {
is TextContent -> if (!kotlinRegex.containsMatchIn(content.text)) return
else -> return
}

Types of content that should be supported as well:

  • Texted / TextedInput subclasses
  • PollContent.poll (question, answers)
  • DocumentContent.text
  • GameContent.game (title, description, text)
  • InvoiceContent.invoice (title, description)
  • PhotoContent.text
  • VenueContent.venue (title)
  • VideoContent.text

UrbanDictionary explainer for the "English Only" topic.

Is your feature request related to a problem? Please describe.

Expand UD terms in the "English Only" topic. Maybe the feature should support only italic spellings, IDK. Maybe it should have a counter / stats: UD terms used by members by day / week.

JProf Digest

Related to #7 and #18, but kinda different.

Once per week, generate a digest:

  • Posted links
  • Topic discussed
  • Friday's poll results
  • Top messages (by number of replies)
  • ???

Publish articles

I want to have a way to publish article links in the chat on behalf of bot.

Posts should have a text (Markdown with hashtags possible) and could have an image, poll or buttons attached.

Topics digest

Provide a command (like Linux's load average) to get a digest of topics discussed last hour, day or weekend. E.g. a user asks "/discussed 1 hour" and the bot responds with a list of topics discussed last hour: "taxes, java 11, graal"

Post of the day / week / month

The bot could count the reactions (❤️, 👍, 💩, etc) on the posts and build a statistics for a given period of time. Rewards could be given to post authors.

Badges & Achievement & Karma

Achievements: a list of rules and levels. Whenever a user makes or achieves something that validates against the rule (like posts 1K of messages mentioning Kotlin, posts 100+ messages per day, etc) - he makes progress against the next level of the achievement. Achievements could also be "just granted" by users. I.e. achievements with levels and single-level achievements.

Karma is an example of a grantable achievement. When a user replies to another user with an upvote (+, 👍, etc) - that user makes progres against the next level of Karma.

Badges are visual representation of achievements. Any level of any achievement can have a corresponding badge.

Users can view their achievements in the chat.

Ahievements can be group-specific.

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.