Class: Cinch::Plugins::Notes
- Inherits:
-
Object
- Object
- Cinch::Plugins::Notes
- Includes:
- Cinch::Plugin
- Defined in:
- lib/cinch/plugins/notes.rb,
lib/cinch/plugins/notes/note.rb,
lib/cinch/plugins/notes/version.rb
Overview
Versioning Info
Defined Under Namespace
Classes: Note
Constant Summary collapse
- VERSION =
'1.0.4'
Instance Method Summary collapse
-
#initialize(*args) ⇒ Notes
constructor
A new instance of Notes.
- #make_note(m, user, message) ⇒ Object
- #send_notes(m) ⇒ Object
Constructor Details
Instance Method Details
#make_note(m, user, message) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/cinch/plugins/notes.rb', line 21 def make_note(m, user, ) note = Note.new(m.user.nick, user, ) @storage.data[user.downcase] ||= [] @storage.data[user.downcase] << note @storage.synced_save(@bot) m.reply 'ok, I will let them know!' end |
#send_notes(m) ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/cinch/plugins/notes.rb', line 29 def send_notes(m) nick = m.user.nick.downcase return unless @storage.data.key?(nick) @storage.data[nick].each do |note| next if note.sent m.user.send("#{note.from} asked me to tell you '#{note.}'") note.mark_sent end @storage.synced_save(@bot) end |