Skip to content

pool-party/pull-party-bot

Repository files navigation

Pull party bot

Build Status Kotlin Lang ktlint CodeFactor Grade Donations Pull Party Bot

logo

© 2020 Pool Party Corp. All rights reserved.

Pull Party Telegram Bot helps you pulling people up for a party!

Usage guide

logo

Add @PullPartyBot to the chat to be able to create custom parties and manage them via following commands:

all commands are not case-sensitive to support RUDE mode
usernames are char sequences of letters, digits and underscores of 5-32 length

  • /create partyName user1 user2... - create new party with mentioned users

    Users within the party are not repeating
    Party should consist of at least one user
    You can enter users with or without @ symbol
    @admins is a reserved party and already exists
    Party name should be no longer than 50 characters
    @, !, ,, ,, ?, :, ;, (, ) symbols and trailing - are not allowed in the party name

  • /alias <alias-name party-name> - create an alias for the same party

    Alias is a reference on the same party, not just a copy
    Changing single alias instance applies to the party and seen in the other aliases
    If you want to delete a party with all aliases, delete a single alias and press the suggesting button

  • /change partyName user1 user2... - change an existing party

  • /add partyName user1 user2... - extend party with provided users

  • /remove partyName user1 user2... - delete mentioned users from the given party

    Follow all /create method's rules
    You can't change @admins party

  • /delete partyName1 partyName2... - delete the parties you provided

    Only admins have access to /delete
    @admins is a reserved party and can't be deleted

  • /clear - delete all parties of the chat

    Follows all /delete method's rules

Use these commands to mention members of needed parties, see the information and manage appearance:

  • @partyName - syntax for tagging parties implicitly right inside your messages

    To enable this function you need to grant admins rights to the bot
    You will see the suggesting button in case of misspelling

  • /party partyName1 partyName2... - tag the members of existing parties

    If you mention multiple parties - their members will be gathered in a single message and will have no repeats

  • /list entry1? entry2?... - show the parties of the chat and their members

    Returns all parties on empty input
    Entries are either users or party names:
    - on the given user shows all parties he is part of
    - on the given party shows its members
    List doesn't contain repetitive values
    Suggests deleting least recently used parties

  • /start - start the conversation and see welcoming message

  • /help command? - ask for a usage guide

    Provides general guide on empty input
    Shows command usage guide while argument is given

  • /feedback message - leave a feedback for developers in a free-form

Tools and libraries

Launching

In order to be able to launch the bot server locally you have to compile sources with gradle and set the following environment variables or provide corresponding values in defaults.properties:

  • TELEGRAM_TOKEN - the one you get from BotFather
  • DATABASE_URL
  • LONGPOLL=true for using long polling instead of web hooking (common usage case is local launch and debugging)
  • APP_URL - webhook url
  • DEVELOPER_CHAT_ID for error logs

Database migrations

You can simply apply all the migrations to your database via flyway tool, in particular flyway gradle plugin:

./gradlew -Pflyway.url=<jdbc-url> -Pflyway.user=<username> -Pflyway.password=<password> flywayMigrate

If you have initialized your database before, you can add -Pflyway.baselineOnMigrate=true key to process this case.