rubyred 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: f070aaf237be9370cf402ee804a84feccd3b9c21
4
- data.tar.gz: 0b2ee87f7cb1e9ae4705d74d9940ec9e00edb9a9
3
+ metadata.gz: f67a5450d3eccad7d442d2b4c29a53e6ebe40626
4
+ data.tar.gz: c90d9860024f20425b872e76ada855bc3039c5c1
5
5
  SHA512:
6
- metadata.gz: 8e35925905a693b1f1c0fc17ab0eece9ead7f68d2fe44ce2276662d034ef96511540555558191c2dc8717c0c463dff670ded3e4d3595292dcf932782cefa6497
7
- data.tar.gz: 6eece359272b33d5772303f2fde73aecc4e01551b3e8bd7abd9248006156efecccac5c38ed86eafd402994c00534ddd14436e5b55016e8b28439d8e5bc9b3f3a
6
+ metadata.gz: 06dd6f8b612d6741e9a41a468bcbc97933275d51719fa4aeff7057deb743cd37ba8fb9dda7d85ffdebac658df100f0cb58fc72d5e9cf8f2c833f29dd5ea71fc9
7
+ data.tar.gz: d92b7e6b46b7a4cc90c46b7464094f7b6de90fc2295d6194880c7086ce6f4a0e9226ad1eb30f002c5e98757f995bcd8d04eec03075243e4de5c5f07d2e6404bb
data/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@ Information on semver can be found [here](http://semver.org)
3
3
  The Changelog file reads "Top to Bottom" in chronological order, newest
4
4
  versions are on top, oldest are towards the end of the file.
5
5
 
6
+ #### Version 0.1.2
7
+ * Updated the ReadMe to contain the correct minimum tested ruby version
8
+ * Updated the Gemfile to ensure that the newest version is always running
9
+ * Added a new command, !pug <num> provides a number of pictures of pugs to the user requesting them.
10
+ * Added a 'lulz' event, which will cause RubyRed to laugh along with you.
11
+
6
12
  #### Version 0.1.1
7
13
  * Added diagnostics command
8
14
  * Fixed an issue with Heroku
data/README.md CHANGED
@@ -2,8 +2,12 @@
2
2
  Ruby Red is a Ruby based Discord Bot using DiscordRB as the API access toolkit
3
3
 
4
4
  #### Requirements
5
- * Ruby ~v2.1
6
- * DiscordRB
5
+ * Ruby ~v2.3
6
+ * DiscordRB ~v2.1.3
7
7
 
8
8
  #### Available Utilities
9
9
  * Ping! (responds with Pong!)
10
+ * Help
11
+ * Drink
12
+ * Diag
13
+ * Pug (Provides pictures of cute pugs)
@@ -9,7 +9,8 @@ module RubyRed
9
9
  @commands = [
10
10
  Diag,
11
11
  Drink,
12
- Ping
12
+ Ping,
13
+ Pug
13
14
  ]
14
15
 
15
16
  def self.include!
@@ -0,0 +1,32 @@
1
+ module RubyRed
2
+ module Commands
3
+ module Pug
4
+ require 'net/http'
5
+ require 'json'
6
+ require_relative 'pug/pug_helper'
7
+ # Provides the user who requests it with pictures of pugs!
8
+ #
9
+ # Examples:
10
+ # !pug 3
11
+ # `RubyRed`: http://link.to.pug/1
12
+ # `RubyRed`: http://link.to.pug/2
13
+ # `RubyRed`: http://link.to.pug/3
14
+
15
+ single_uri = URI('http://pugme.herokuapp.com/random')
16
+ bomb_partial = 'http://pugme.herokuapp.com/bomb?count='
17
+ extend Discordrb::Commands::CommandContainer
18
+ command(:pug, description: 'Provides the user who requests it with a picture of a pug!') do |event|
19
+ res = Net::HTTP.get_response(single_uri)
20
+ hash = JSON.parse(res.body)
21
+ event << hash["pug"]
22
+ end
23
+ command(:pugs, description: 'Provides numerous pugs on demand', min_args: 1,
24
+ usage: 'pugs <num>') do |event, *num|
25
+ bomb_uri=URI("#{bomb_partial}#{num[0]}")
26
+ res = Net::HTTP.get_response(bomb_uri)
27
+ hash = JSON.parse(res.body)
28
+ PugHelper.dehash(hash, event)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,8 @@
1
+ class PugHelper
2
+ def self.dehash(hash, event)
3
+ hash["pugs"].each do |pug|
4
+ event << pug
5
+ end
6
+ return
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ module RubyRed
2
+ module Events
3
+ Dir["#{File.dirname(__FILE__)}/events/*.rb"].each {|file| require file}
4
+
5
+ @events = [
6
+ Lulz
7
+ ]
8
+
9
+ def self.include!
10
+ @events.each do |event|
11
+ RubyRed::BOT.include!(event)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,20 @@
1
+ module RubyRed
2
+ module Events
3
+ module Lulz
4
+ require 'yaml'
5
+
6
+ LULZ_YAML_FILE = 'lib/rubyred/events/lulz/lulz.yaml'
7
+ lulz_data = YAML.load(File.open(LULZ_YAML_FILE))
8
+ lulz_triggers = lulz_data["triggers"]
9
+ lulz_responses = lulz_data["responses"]
10
+ srand Time.now.to_i
11
+
12
+ extend Discordrb::EventContainer
13
+ #TODO: Add more combinations of different things here to respond to
14
+ BOT.message(contains: lulz_triggers) do |event|
15
+ #TODO: Add more possible responses
16
+ event.send_message("#{lulz_responses.sample} #{event.author.username}")
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,11 @@
1
+ triggers:
2
+ - lulz
3
+ - lol
4
+ - lmao
5
+ - LUL
6
+ - LOL
7
+ - LMAO
8
+ responses:
9
+ - LOL
10
+ - LMAO indeed
11
+ - That's not funny
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyred
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Spiceland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-22 00:00:00.000000000 Z
11
+ date: 2016-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: discordrb
@@ -50,7 +50,12 @@ files:
50
50
  - lib/rubyred/commands/drink/drink.yaml
51
51
  - lib/rubyred/commands/drink/drink_helper.rb
52
52
  - lib/rubyred/commands/ping.rb
53
+ - lib/rubyred/commands/pug.rb
54
+ - lib/rubyred/commands/pug/pug_helper.rb
53
55
  - lib/rubyred/console.rb
56
+ - lib/rubyred/events.rb
57
+ - lib/rubyred/events/lulz.rb
58
+ - lib/rubyred/events/lulz/lulz.yaml
54
59
  homepage: http://rubygems.org/gems/rubyred
55
60
  licenses:
56
61
  - MPL-2.0