Skip to content

Commit

Permalink
Add specs for PrivacyPolicyCommand; bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
Charibdys committed Jul 4, 2024
1 parent 932b8f4 commit bbcbcad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions spec/handlers/command_handlers/privacy_command_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module PrivateParlorXT
messages[0].data.should(eq(expected))

# Privacy Policy sent to cooldowned user

cooldowned_user = Tourmaline::User.new(50000, false, "cooldown")

message = Tourmaline::Message.new(
Expand All @@ -85,9 +85,9 @@ module PrivateParlorXT
messages.size.should(eq(1))

messages[0].data.should(eq(expected))

# Privacy Policy sent to blacklisted user

blacklisted_user = Tourmaline::User.new(70000, false, "BLACKLISTED")

message = Tourmaline::Message.new(
Expand All @@ -104,9 +104,9 @@ module PrivateParlorXT
messages.size.should(eq(1))

messages[0].data.should(eq(expected))

# Privacy Policy sent to left user

left_user = Tourmaline::User.new(40000, false, "esimerkki")

message = Tourmaline::Message.new(
Expand All @@ -123,9 +123,9 @@ module PrivateParlorXT
messages.size.should(eq(1))

messages[0].data.should(eq(expected))

# Privacy Policy sent to user not in chat

not_in_chat_user = Tourmaline::User.new(12345, false, "newbie")

message = Tourmaline::Message.new(
Expand All @@ -145,4 +145,4 @@ module PrivateParlorXT
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ require "tourmaline"
module PrivateParlorXT
@[RespondsTo(command: "privacy", config: "enable_privacy_policy")]
# A command used to view the privacy policy of the bot
#
#
# This command is required for all Telegram bots according to https://t.me/BotNews/96
#
#
# All bots require a privacy policy that is easily accessible
# This command is usuable by any user of the bot, regardless of if he is blacklisted, left, or neither
#
#
# The Privacy Policy is defined in the locale files; if you modify the program in how it handles data, the Privacy Policy may need to be updated
#
#
# Contact information is defined by the `blacklist_contact` configured value
class PrivacyPolicyCommand < CommandHandler
# Returns a message containing this bot's Privacy Policy
Expand All @@ -37,4 +37,4 @@ module PrivateParlorXT
)
end
end
end
end

0 comments on commit bbcbcad

Please sign in to comment.