dominikh changed the topic of #cinch to: The IRC Framework | Latest version: Cinch 2.3.1 | You're being logged at https://irclog.whitequark.org/cinch/
<croberts> yeah
<croberts> then i guess i know the answer
keyno has quit [Ping timeout: 264 seconds]
keyno has joined #cinch
IggyBot has joined #cinch
IggyBot is now known as StockBot
Azure has quit [Quit: Oops.]
Azure has joined #cinch
<StockBot> hey cinch ppl... I am have some questions... when I want to create my own plugin do i create another .rb file for it? If my main cinch irc bot is main.rb and inside it i call 'require' cinch-homemadeplugin how do i get that to work?
<leftylink> StockBot: you may read https://apidock.com/ruby/Kernel/require or any resource of your choice for how require works
<leftylink> StockBot: it is your choice whether to create another .rb file. see how https://github.com/cinchrb/cinch/blob/master/examples/plugins/hello.rb does not have a separate rb file.
<StockBot> ah so i can create a class (hello.rb style), but then it makes my main .rb file larger.
<StockBot> Thanks
<StockBot> If i wanted to do something like !addcontact NAME PHONE EMAIL is there anything like this that I could pull from as an example?
<kspencer> literally, include Cinch::Plugin and then 'match /addcontact (\S) (\S) (\S)/, :method => :methodNameForAddContact'
<kspencer> StockBot: ^
<kspencer> which means have your class, something like I guess 'class ContactsPlugin'
<StockBot> Ok so then if i had !contactemail it could match for an email and give me their name and phone, something like that?
<StockBot> thanks
<kspencer> you'd have to make a way of retrieving them, say with yaml or json files
<kspencer> at the lowest level
<StockBot> so store it in a yaml file, similar to something like the quotes.rb
<kspencer> yeah says 'contacts:<enter+2spaces>contactID:<enter+4spaces>name: VALUE<enter+6spaces>... and so on'
<kspencer> s/says/say/
<kspencer> each contact id getting 2 spaces before it to keep it in the same level of the 'tree'
<kspencer> keeping basic yaml indentation syntax for the rest of course
Wsewolod has joined #cinch