rubydium 0.3.14 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0dac94f3bb681c7c2cca9cbdba246a0a9f36e5f2624c8d7118d9b80f71845201
4
- data.tar.gz: fed91db852852a55bf7330b3f58a37b4cddab676218735fe25af739114b03ebf
3
+ metadata.gz: 2c972a49ad1f25abc06d3586d93fc19d28c3121fd9ffed6a1edfceb6f27950a9
4
+ data.tar.gz: 12abd46194c6ec338e0632714cf5b415c3c7cf0cba47233b4821a10561881ab0
5
5
  SHA512:
6
- metadata.gz: 9100a95fa4a72a1a9651a4dff58b15a0b38f43e2a6345880f4b8514d7079628e1811389946ef46d0bab2c7518486d6040b50fe8fc7b18725e6c60d115b93261e
7
- data.tar.gz: 36b7d2f276b87fa5e1875e3672825320816e8f80653754bb186acd6a677cb0013db84be17dac139dc8afa952a4fdf8eb3c2081fea2cf99f1caf95d781dd9c5a2
6
+ metadata.gz: f63106b16dc179ab4629dbf7803ee48728ec0c27fe1a0643233a30e2ed5865996b31d46dd7a0def84f7d9c165edfb419da182e3d52ce314eb3577a11193dea5b
7
+ data.tar.gz: d090fb221f7ddd893e28c029203ad75f4044b5c0b9c2461e47936d458a7f8d76a32e594687d22707e2688025e3fb6b8f54dc5860efa8b053f4e378b7745f7d4c
@@ -1,11 +1,11 @@
1
1
  module Rubydium
2
2
  module Mixins
3
3
  module OtherActions
4
- def safe_delete(maybe_message)
4
+ def safe_delete(maybe_message, only_bot_or_owner: true)
5
5
  message = definitely_message(maybe_message)
6
6
  from_owner = message&.from&.username == config.owner_username
7
7
  from_bot = message&.from&.id == config.bot_id
8
- return false unless from_bot || from_owner
8
+ return false unless only_bot_or_owner || from_bot || from_owner
9
9
 
10
10
  safe_delete_by_id(message.message_id, from_bot: true)
11
11
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubydium
4
- VERSION = "0.3.14"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubydium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.14
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bulgakke