descartes 0.3.13 → 0.3.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/descartes/modules/lastfm.rb +10 -8
- data/lib/descartes/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cdcd60c7e41d412cc589426bf4a3f8512c7a5ad
|
4
|
+
data.tar.gz: 0ee7fa46d001a6fc57fdfd2abe718e1b4bba45be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49ec8e9ea9ff909eaf419166799e11e2eb5bfdae5b64e60a69072161a6e0ad41c4993b38bbd41250d6bb28d3606296fd9e5209162f8fe78ec6f140778a54f15c
|
7
|
+
data.tar.gz: 07c58817f94e3c9a6635367ebe444844e12ec61169c4f6ef3503a7657ef57be95122ebbcfb38ea61f18680e700209e5f39804182e89a9fca3a52ae56eee2cfc4
|
@@ -35,9 +35,11 @@ class Descartes
|
|
35
35
|
|
36
36
|
match 'lastsong', method: :last_played_song
|
37
37
|
def last_played_song(m)
|
38
|
+
authenticate!
|
39
|
+
|
38
40
|
usernick = m.user.nick
|
39
41
|
lastfmnick = get_lastfm_nicks_archive[usernick]
|
40
|
-
m.reply "Hey #{usernick}, I don't know your Last.fm nick. add it using !lastfmuser add <lastfmnick>" unless lastfmnick
|
42
|
+
m.reply "Hey #{usernick}, I don't know your Last.fm nick. add it using '!lastfmuser add <lastfmnick>'." unless lastfmnick
|
41
43
|
|
42
44
|
user = Rockstar::User.new lastfmnick
|
43
45
|
track = user.recent_tracks.first
|
@@ -46,7 +48,7 @@ class Descartes
|
|
46
48
|
if track.now_playing?
|
47
49
|
m.reply "#{lastfmnick} is listening to #{track.name} by #{track.artist} (#{album}) right now!"
|
48
50
|
else
|
49
|
-
m.reply "
|
51
|
+
m.reply "The last song #{lastfmnick} listened to is #{track.name} by #{track.artist} (#{album})."
|
50
52
|
end
|
51
53
|
end
|
52
54
|
|
@@ -58,18 +60,18 @@ class Descartes
|
|
58
60
|
file = File.join File.dirname(__FILE__), 'reply', 'lastfm_nicks.yml'
|
59
61
|
File.open(file, ?w) { |f| f.write YAML.dump(nicks) }
|
60
62
|
|
61
|
-
m.reply "Ok, added user #{lastfmnick}"
|
63
|
+
m.reply "Ok, added user #{lastfmnick}."
|
62
64
|
end
|
63
65
|
|
64
|
-
match
|
65
|
-
def remove_user(m)
|
66
|
+
match /lastfmuser remove (\w{1,15})/, method: :remove_user
|
67
|
+
def remove_user(m, lastfmnick)
|
66
68
|
nicks = get_lastfm_nicks_archive
|
67
|
-
nicks.delete
|
69
|
+
nicks.delete lastfmnick
|
68
70
|
|
69
71
|
file = File.join File.dirname(__FILE__), 'reply', 'lastfm_nicks.yml'
|
70
72
|
File.open(file, ?w) { |f| f.write YAML.dump(nicks) }
|
71
73
|
|
72
|
-
m.reply "Ok, removed user #{lastfmnick}"
|
74
|
+
m.reply "Ok, removed user #{lastfmnick}."
|
73
75
|
end
|
74
76
|
|
75
77
|
match /lastfmuser show ([^\b]+)/, method: :show_relations
|
@@ -80,7 +82,7 @@ class Descartes
|
|
80
82
|
get_lastfm_nicks_archive.each { |usernick, lastfmnick|
|
81
83
|
if usernick_list.include? usernick
|
82
84
|
found = true
|
83
|
-
m.reply "#{usernick} is known as #{lastfmnick}"
|
85
|
+
m.reply "#{usernick} is known as #{lastfmnick}."
|
84
86
|
end
|
85
87
|
}
|
86
88
|
|
data/lib/descartes/version.rb
CHANGED