dispander.rb 0.4.0 → 0.4.2

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: a45dba58a6aa5d443c2291232d5f52c9bab44354323add4c9be14e9cb0668658
4
- data.tar.gz: 4153063d6540ecb03dcfeb957c2dc4a154e16c638068b850be70911d4833745f
3
+ metadata.gz: 3c458f8fd4e1bb7cf7a16abe9472662cf5a898eea94758b8f0ad2a925a2d2f50
4
+ data.tar.gz: b3f6d59f99ab4286bb6e69972d552588b6d786251451fcc9982a5150c2c81ca3
5
5
  SHA512:
6
- metadata.gz: 47a0b093ce682e5a0a724a4713ad1b50a3ead9e2a095ec1ebe2b085119bc8316d58db7639bb5c95c7a3ea8e4f725b96fa59708a4d2d1db83cadc8a6988d9a1a0
7
- data.tar.gz: be3b922fb5749554e9e581bf6319cce398131b7870cafb3e0a5060868eb19119894d936d595b3b4524e14b1b100ce2e0917846e1e7dd95a7fb725b9328d8cc00
6
+ metadata.gz: 2a6c97d1457cdc23931e2c4831c11526796b124cc911c3a14fd7c11b1da55db7102722a53086a76c2947780cb92e77aad456c0296c9d78b1940646dd6c0d049e
7
+ data.tar.gz: bab35466c02227b52c026601904fefffa513841591792ec1797fbe998dde8401f730fbe01eed3981b95e3ff8e690687997d4f804f90c4c787bf4c21ec66c6939
data/README.en.md CHANGED
@@ -74,6 +74,19 @@ Set emoji to `Dispander#delete_emoji`, or specify it in `Client#load_extension`.
74
74
  client.load_extension(Dispander::Core, delete_emoji: Discorb::UnicodeEmoji["x"])
75
75
  ```
76
76
 
77
+ ## Change the condition to expand
78
+
79
+ Override `Dispander#should_expand?`.
80
+
81
+ ```ruby
82
+ dispander = Dispander::Core.new(client)
83
+
84
+ def dispander.should_expand?(base_message, ids)
85
+ ENV["ALLOWED_GUILDS"].split(",").include?(ids[0])
86
+ end
87
+
88
+ client.load_extension(dispander)
89
+ ```
77
90
 
78
91
  ## License
79
92
 
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # dispander.rb
2
2
 
3
- discorbで出来たBotにメッセージ展開の機能を追加するExtension。
3
+ discorb で出来た Bot にメッセージ展開の機能を追加する Extension。
4
4
  ![画像](https://user-images.githubusercontent.com/59691627/131650571-ec50bf35-c971-4aeb-9a58-8fbf9b3e759b.png)
5
5
 
6
- [DiscordBotPortalJP/dispander](https://github.com/DiscordBotPortalJP/dispander) のRuby版。
6
+ [DiscordBotPortalJP/dispander](https://github.com/DiscordBotPortalJP/dispander) の Ruby 版。
7
7
 
8
8
  ## インストール
9
9
 
10
- Gemfileに以下を追記し...
10
+ Gemfile に以下を追記し...
11
11
 
12
12
  ```ruby
13
13
  gem 'dispander'
@@ -23,7 +23,7 @@ gem 'dispander'
23
23
 
24
24
  ## 使い方
25
25
 
26
- ### Extensionとして読み込む
26
+ ### Extension として読み込む
27
27
 
28
28
  ```ruby
29
29
  require "discorb"
@@ -73,6 +73,19 @@ client.run ENV["DISCORD_BOT_TOKEN"]
73
73
  client.load_extension(Dispander::Core, delete_emoji: Discorb::UnicodeEmoji["x"])
74
74
  ```
75
75
 
76
+ ### 展開条件を変更する
77
+
78
+ `Dispander#should_expand?`をオーバーライドしてください。
79
+
80
+ ```ruby
81
+ dispander = Dispander::Core.new(client)
82
+
83
+ def dispander.should_expand?(base_message, ids)
84
+ ENV["ALLOWED_GUILDS"].split(",").include?(ids[0])
85
+ end
86
+
87
+ client.load_extension(dispander)
88
+ ```
76
89
 
77
90
  ## ライセンス
78
91
 
data/dispander.gemspec CHANGED
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
 
30
30
  # Uncomment to register a new dependency of your gem
31
- spec.add_dependency "discorb", "~> 0.16"
31
+ spec.add_dependency "discorb", "~> 0.19"
32
32
 
33
33
  # For more information and examples about making a new gem, checkout our
34
34
  # guide at: https://bundler.io/guides/creating_gem.html
@@ -122,7 +122,7 @@ module Dispander
122
122
  return unless author_id == event.user_id || operator_id == event.user_id
123
123
 
124
124
  sent_message_ids.split(",").each do |sent_message_id|
125
- event.channel.delete_message!(sent_message_id).wait
125
+ event.channel.delete_message(sent_message_id).wait
126
126
  end
127
127
  end
128
128
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dispander
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dispander.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sevenc-nanashi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-05-20 00:00:00.000000000 Z
11
+ date: 2022-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: discorb
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.16'
19
+ version: '0.19'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.16'
26
+ version: '0.19'
27
27
  description:
28
28
  email:
29
29
  - sevenc-nanashi@sevenbot.jp
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  requirements: []
70
- rubygems_version: 3.2.32
70
+ rubygems_version: 3.3.17
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: discorbのBotにメッセージ展開の機能を追加するExtension。