Skip to content

Commit

Permalink
Merge pull request #13 from Private-Parlor/v1.1
Browse files Browse the repository at this point in the history
V1.1.0
  • Loading branch information
Charibdys authored Jan 1, 2024
2 parents 1f840ec + f639475 commit 5da305e
Show file tree
Hide file tree
Showing 124 changed files with 2,835 additions and 1,781 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ Alternatively, you can download the precompiled binaries from [Releases](https:/

1. Rename `config.yaml.copy` to `config.yaml`
2. Edit config file
- The config file should atleast contain the API Token received from botfather and a path to a SQLite database
- The config file should at least contain the API Token received from Botfather and a path to a SQLite database
- Unless the database already exists, Private Parlor XT will create a new SQLite database at the given path
3. Run the `private-parlor-xt` binary

## Development

Development intructions are as follows:
Development instructions are as follows:
- Ensure code conforms to the [Crystal API coding style](https://crystal-lang.org/reference/1.9/conventions/coding_style.html)
- Explicitly define return types and types for variables and parameters
- Document your code
Expand Down
63 changes: 61 additions & 2 deletions config.yaml.copy
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ locale: en-US
## Modify lifespan of a message, in hours
##
## Setting this to 0 will disable message expiration
## NOTE: This will increase RAM usage if database history is not enabled
## This will increase RAM usage if database history is not enabled
##
## WARNING: It is NOT possible to delete messages older than 48 hours
##
## Accepted values: an integer between 0 and 4294967295
## Default: 24
Expand Down Expand Up @@ -126,6 +128,14 @@ locale: en-US
##
#media_spoilers: false

##
## Allow users to attach a reason to their upvote/downvote messages
##
## Accepted values: true, false
## Default: false
##
#karma_reasons: false

##
## Relay forwarded messages as if they were a regular message
##
Expand Down Expand Up @@ -191,6 +201,17 @@ locale: en-US
##
#pseudonymous: false

##
## Replace tripcode with flag or emoji signatures
##
## This will change tripcode headers from the 'name!code' format to
## a series of at most 5 flags/emojis
##
## Accepted values: true, false
## Default: false
##
#flag_signatures: false

##
## MessageEntity toggles
##
Expand All @@ -210,6 +231,7 @@ locale: en-US
## code
## text_link
## custom_emoji
## blockquote
##
## Default: ["bold", "italic", "text_link"]
##
Expand Down Expand Up @@ -558,7 +580,6 @@ relay_contact: false
##
#cooldown_base: 5


##
## Length of time in hours until a warning expires
##
Expand All @@ -575,6 +596,43 @@ relay_contact: false
##
#warn_deduction: 10

# --------------------------------
# Karma Economy
# --------------------------------

##
## Users must spend karma in order to post
##
## If enabled, every message will deduct the amount of karma configured here
## from the user's account. When the user lacks the required amount of karma,
## then their message will not be posted.
##
## This can be used to limit spam or the posting of certain message types
## without outright disabling them.
##
## A cutoff rank can be set with the rank's value, making it so that any user
## of that rank or higher no longer must spend karma.
##
## Accepted values: any 32-bit integer
##
#karma_economy:
# cutoff_rank: 10
# karma_text: 0
# karma_animation: 5
# karma_audio: 2
# karma_document: 2
# karma_video: 10
# karma_video_note: 10
# karma_voice: 2
# karma_photo: 5
# karma_media_group: 10
# karma_poll: 20
# karma_forwarded_message: 10
# karma_sticker: 2
# karma_venue: 10
# karma_location: 10
# karma_contact: 10

# --------------------------------
# Spam Prevention
# --------------------------------
Expand Down Expand Up @@ -642,6 +700,7 @@ spam_handler:
decay_amount: 1000
score_character: 3
score_linebreak: 100
score_text: 3000
score_animation: 3000
score_audio: 3000
score_document: 3000
Expand Down
64 changes: 55 additions & 9 deletions locales/de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,30 @@ replies:
# Available placeholders: toggle
toggle_debug: "*Modus für debuggen*: {toggle}"

gave_upvote: "_Du hast Karma zu dieser Nachricht gegeben\\!_"
# Available placeholders: reason
karma_reason: |-
\ für:
>{reason}
# Available placeholders: karma_reason
gave_upvote: "_Du hast Karma zu dieser Nachricht gegeben{karma_reason}\n_"

got_upvote: "_Du hast Karma bekommen\\! \\(Benutzt den /info Befehl zu dein Karma checken, oder /togglekarma diesen Benachrichtigungen abzuschalten\\)_"
# Available placeholders: karma_reason
got_upvote: |-
_Du hast Karma bekommen{karma_reason}
\(Benutzt den /info Befehl zu dein Karma checken, oder /togglekarma diesen Benachrichtigungen abzuschalten\)_
upvoted_own_message: "_Du kannst deine Nachricht Karma nicht geben\\!_"

already_voted: "_Du hast schon dieser Nachricht Karma gegeben oder entfernt_"

gave_downvote: "_Du hast Karma von dieser Nachricht entfernt\\!_"
# Available placeholders: karma_reason
gave_downvote: "_Du hast Karma von dieser Nachricht entfernt{karma_reason}\n_"

got_downvote: "_Du hast Karma verlieren\\! \\(Benutzt den /info Befehl zu dein Karma checken, oder /togglekarma diesen Benachrichtigungen abzuschalten\\)_"
# Available placeholders: karma_reason
got_downvote: |-
_Du hast Karma verlieren{karma_reason}
\(Benutzt den /info Befehl zu dein Karma checken, oder /togglekarma diesen Benachrichtigungen abzuschalten\)_
downvoted_own_message: "_Du kannst deiner Nachricht Karma nicht entfernen\\!_"

Expand All @@ -105,6 +118,23 @@ replies:
*Karma*: {karma}/{limit}
{loading_bar} \({percentage}%\)
# Available placeholders: level
karma_level_up: |-
_Gut gemacht\!
Du hast ein Niveau erlangt\. Jetzt dein Niveau ist:_
*{level}*
_\(Benutzt den /karma\_info Befehl zu dein Niveau checken, oder /togglekarma diesen Benachrichtigungen abzuschalten\)_
# Available placeholders: level
karma_level_down: |-
_Ach nein\!
Du hast ein Niveau verloren\. Jetzt dein Niveau ist:_
*{level}*
_\(Benutzt den /karma\_info Befehl zu dein Niveau checken, oder /togglekarma diesen Benachrichtigungen abzuschalten\)_
# Available placeholders: amount, type
insufficient_karma: "_Du musst {amount} Karma haben, bevor du kannst eine {type} Nachrict schicken\\._"

already_warned: "_Diese Nachricht war schon gewarnt_"

private_sign: "_Die Weiterleitungen Einstellung deines Kontos muss zu \"Jeder\" gesetzt werden, bevor du eine Nachricht mit deinem Namen unterschreiben kannst\\._"
Expand All @@ -120,15 +150,25 @@ replies:

downvote_spam: "_Du kannst jetzt Karma nicht entfernen, unterlass du Karma zu oft entfernen\\._"

tripcode_format: "Name#Passwort"

flag_sign_format: "🏴🏴🏴🏴🏴"

# Available placeholders: valid_format
invalid_tripcode_format: |-
_Ungültige Format des Tripcode\. Das Format ist:_
`Name\#Passwort`
`{valid_format}`
# Available placeholders: name, tripcode

tripcode_set_format: "*{name}* `{tripcode}`:"

# Available placeholders: name,
flag_sign_set_format: "`{name}`:"

# Available placeholders: set_format
tripcode_set: |-
_Tripcode gesetzt\. Es wird erscheint als:_
*{name}* `{tripcode}`:
{set_format}
# Available placeholders: tripcode
tripcode_info: "*Tripcode*: `{tripcode}`"
Expand Down Expand Up @@ -317,6 +357,12 @@ logs:
# Available placeholders: id, name, msid
unspoiled: "Nutzer {id}, alias {name}, hat ein Spoiler aus der Nachricht [{msid}] entfernt"

# Available placeholders: id, name, oid, reason
upvoted: "Nutzer {id}, alias {name}, hat Nutzer [{oid}] Karma gegeben für: {reason}"

# Available placeholders: id, name, oid, reason
downvoted: "Nutzer {id}, alias {name}, hat Nutzer [{oid}] Karma entfernt für: {reason}"

# Available placeholders: sender_id, sender, receiver_id, receiver, msid
revealed: "Nutzer {sender_id}, alias {sender}, hat sein Nutzername an {receiver_id}, alias {receiver}, privat gezeigt, via die Nachricht [{msid}]"

Expand All @@ -335,6 +381,6 @@ logs:
# Available placeholders: id, name, rank, text
ranked_message: "Nutzer {id}, alias {name}, hat eine {rank} Rangnachricht geschickt: {text}"

# Available placeholders: id
force_leave: "Entfernt Nutzer {id}, weil der Bot blockiert sind"
# Available placeholders: id, name
force_leave: "Entfernt Nutzer {id}, alias {name}, weil der Bot blockiert sind"
---
63 changes: 55 additions & 8 deletions locales/en-GB.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,30 @@ replies:
# Available placeholders: toggle
toggle_debug: "*Debug mode*: {toggle}"

gave_upvote: "_You upvoted this message\\!_"
# Available placeholders: reason
karma_reason: |-
\ for:
>{reason}
# Available placeholders: karma_reason
gave_upvote: "_You upvoted this message{karma_reason}\n_"

got_upvote: "_You've just been upvoted\\! \\(check /info to see your karma or /togglekarma to turn these notifications off\\)_"
# Available placeholders: karma_reason
got_upvote: |-
_You've just been upvoted{karma_reason}
\(check /info to see your karma or /togglekarma to turn these notifications off\)_
upvoted_own_message: "_You can't upvote your own message\\!_"

already_voted: "_You have already upvoted or downvoted this message\\._"

gave_downvote: "_You downvoted this message\\!_"
# Available placeholders: karma_reason
gave_downvote: "_You downvoted this message{karma_reason}\n_"

got_downvote: "_You've just been downvoted\\! \\(check /info to see your karma or /togglekarma to turn these notifications off\\)_"
# Available placeholders: karma_reason
got_downvote: |-
_You've just been downvoted{karma_reason}
\(check /info to see your karma or /togglekarma to turn these notifications off\)_
downvoted_own_message: "_You can't downvote your own message\\!_"

Expand All @@ -105,6 +118,23 @@ replies:
*Karma*: {karma}/{limit}
{loading_bar} \({percentage}%\)
# Available placeholders: level
karma_level_up: |-
_Nice work\!
You have gained a karma level\. Your level is now:_
*{level}*
_\(check /karma\_info to see your level or /togglekarma to turn these notifications off\)_
# Available placeholders: level
karma_level_down: |-
_Whoops\!
You have lost a karma level\. Your level is now:_
*{level}*
_\(check /karma\_info to see your level or /togglekarma to turn these notifications off\)_
# Available placeholders: amount, type
insufficient_karma: "_You must have {amount} karma available before you can send a `{type}` message\\._"

already_warned: "_This message has already been warned\\._"

private_sign: "_Your account's forward privacy must be set to \"Everybody\" to sign with your username\\._"
Expand All @@ -120,14 +150,25 @@ replies:

downvote_spam: "_You can't downvote at this time, avoid downvoting too often\\. Try again later\\._"

tripcode_format: "name#pass"

flag_sign_format: "🏴🏴🏴🏴🏴"

# Available placeholders: valid_format
invalid_tripcode_format: |-
_Invalid tripcode format\. The format is:_
`name\#pass`
`{valid_format}`
# Available placeholders: name, tripcode
tripcode_set_format: "*{name}* `{tripcode}`:"

# Available placeholders: name,
flag_sign_set_format: "`{name}`:"

# Available placeholders: set_format
tripcode_set: |-
_Tripcode set\. It will appear as:_
*{name}* `{tripcode}`:
{set_format}
# Available placeholders: tripcode
tripcode_info: "*Tripcode*: `{tripcode}`"
Expand Down Expand Up @@ -316,6 +357,12 @@ logs:
# Available placeholders: id, name, msid
unspoiled: "User {id}, aka {name}, removed a spoiler from receiver message [{msid}]"

# Available placeholders: id, name, oid, reason
upvoted: "User {id}, aka {name}, upvoted user [{oid}] for: {reason}"

# Available placeholders: id, name, oid, reason
downvoted: "User {id}, aka {name}, downvoted user [{oid}] for: {reason}"

# Available placeholders: sender_id, sender, receiver_id, receiver, msid
revealed: "User {sender_id}, aka {sender}, revealed username to user {receiver_id}, aka {receiver}, via receiver message [{msid}]"

Expand All @@ -334,6 +381,6 @@ logs:
# Available placeholders: id, name, rank, text
ranked_message: "User {id}, aka {name}, sent {rank} message: {text}"

# Available placeholders: id
force_leave: "Force leaving user {id} because bot is blocked."
# Available placeholders: id, name
force_leave: "Force leaving user {id}, aka {name}, because bot is blocked."
---
Loading

0 comments on commit 5da305e

Please sign in to comment.