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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +6 -2
- data/lib/rubyred/commands.rb +2 -1
- data/lib/rubyred/commands/pug.rb +32 -0
- data/lib/rubyred/commands/pug/pug_helper.rb +8 -0
- data/lib/rubyred/events.rb +15 -0
- data/lib/rubyred/events/lulz.rb +20 -0
- data/lib/rubyred/events/lulz/lulz.yaml +11 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f67a5450d3eccad7d442d2b4c29a53e6ebe40626
|
4
|
+
data.tar.gz: c90d9860024f20425b872e76ada855bc3039c5c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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)
|
data/lib/rubyred/commands.rb
CHANGED
@@ -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,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
|
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.
|
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-
|
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
|