brainiac-discord 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed2e8f74f05207e45944b37b43094298419d007ed897dac9987f97d86a03152b
4
- data.tar.gz: 9ac14bdbb6e5481d7b36a8734f8b4beb66eb7b8299caa1459e47c6389f186101
3
+ metadata.gz: 753751521918bfaf9dbbd4481272289b5e56109c8a6607a4f9bee5bb6d4158fe
4
+ data.tar.gz: 143f91e2f62daec56217695b50c6d11f7b22b8d02996600ff2bc04059dacfd92
5
5
  SHA512:
6
- metadata.gz: c74ff0656c3790f82604c8162c826758b5ca57ea0eecb71adc5e7fcf7d78ee6eccebb110dffada6a6ba4e74456c75c98fdcee88679cbd2716a52d73f53231cf6
7
- data.tar.gz: 9c5ffd03b96f76668d2cbfcfb54bebd93af6ca2501f7d952d635a9db75f2cd712d3e40274e23dee877fc835ac0a305264eb27b5383411e4b35288477a236e038
6
+ metadata.gz: 199e2440232277e9068b31a59bd407dc5b6e3c736e313da1eed4b4ad64f0ebb5b6f7fce1edc7f3e928560534b7167ae64d945683432c792d83c99e6dbdabc9d2
7
+ data.tar.gz: 7625990b00a2b3e1629d11a7eed4ae5947e662cd28d1514dd65bcc1ad689eedf7e9c42020c7e6a884ee35594a2aa229207d144302e51f4ff4d8a6300665eaf84
data/README.md CHANGED
@@ -14,7 +14,7 @@ Each agent gets its own Discord bot. Users @mention @Galen or @GLaDOS directly
14
14
  - **Emoji feedback** — non-reserved emoji reactions are logged as feedback to the agent's persona
15
15
  - **Thread isolation** — conversations get their own threads with worktree persistence
16
16
  - **Forum support** — cron jobs can post to forum channels
17
- - **GIF support** — agents can search and embed GIFs via GIPHY API
17
+ - **GIF support** — agents can search and embed GIFs via Klipy API (formerly GIPHY)
18
18
  - **Draft delivery** — file-based response delivery survives server restarts
19
19
 
20
20
  ## Installation
@@ -92,7 +92,8 @@ Stored in `~/.brainiac/discord.json`:
92
92
  },
93
93
  "authorized_role_ids": [],
94
94
  "authorized_user_ids": [],
95
- "giphy_api_key": "your-giphy-api-key"
95
+ "giphy_api_key": null,
96
+ "klipy_api_key": "your-klipy-api-key"
96
97
  }
97
98
  ```
98
99
 
@@ -192,18 +192,21 @@ module Brainiac
192
192
  # --- GIF Search ---
193
193
 
194
194
  def search_gif(query)
195
- api_key = Config.giphy_api_key
195
+ api_key = Config.klipy_api_key
196
196
  return [] unless api_key
197
197
 
198
- uri = URI("https://api.giphy.com/v1/gifs/search")
199
- uri.query = URI.encode_www_form(api_key: api_key, q: query, limit: 5, rating: "pg-13")
198
+ uri = URI("https://api.klipy.com/v2/search")
199
+ uri.query = URI.encode_www_form(key: api_key, q: query, limit: 5, contentfilter: "medium")
200
200
  http = Net::HTTP.new(uri.host, uri.port)
201
201
  http.use_ssl = true
202
202
  response = http.get(uri)
203
203
  return [] unless response.code.to_i == 200
204
204
 
205
205
  data = JSON.parse(response.body)
206
- (data["data"] || []).map { |g| { "url" => g.dig("images", "original", "url") || g["url"] } }
206
+ (data["results"] || []).filter_map do |r|
207
+ url = r.dig("media_formats", "gif", "url") || r.dig("media_formats", "mediumgif", "url") || r["url"]
208
+ { "url" => url } if url
209
+ end
207
210
  rescue StandardError => e
208
211
  LOG.warn "[Discord] GIF search error: #{e.message}" if defined?(LOG)
209
212
  []
@@ -53,8 +53,8 @@ module Brainiac
53
53
  @config["dashboard_token"]
54
54
  end
55
55
 
56
- def giphy_api_key
57
- @config["giphy_api_key"]
56
+ def klipy_api_key
57
+ @config["klipy_api_key"] || @config["giphy_api_key"]
58
58
  end
59
59
 
60
60
  def channel_mappings
@@ -3,7 +3,7 @@
3
3
  module Brainiac
4
4
  module Plugins
5
5
  module Discord
6
- VERSION = "0.0.9"
6
+ VERSION = "0.0.10"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brainiac-discord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis