23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/descartes/modules/crunchyroll.rb', line 23
def today(m)
crunchyroll = Crunchyroll.today
aired = crunchyroll.select { |h| h[:airs] == :aired }.map { |r| r[:title].colorize }.flatten.join(', ')[0..-2]
tomorrow = crunchyroll.select { |h| h[:airs] == :tomorrow }
today = crunchyroll.select { |h| h[:airs] == :today }
m.reply "Gli anime di oggi su #{'Crunchyroll'.colorize}:"
today.each do |series|
m.reply "#{series[:title].colorize} (tra #{series[:left].to_ita.colorize})"
end
m.reply '' if today.any?
if tomorrow.any?
m.reply "Domani trasmetterà (per via del fuso):"
tomorrow.each do |series|
m.reply "#{series[:title].colorize} (tra #{series[:left].to_ita.colorize})"
end
end
m.reply '' if tomorrow.any?
m.reply "Sono stati già trasmessi: #{aired}." unless aired.empty?
end
|