OperationCode / operationcode_bot

Slack bot for responding to Slack events and handling interactive messages. (not currently in use)
MIT License
8 stars 37 forks source link

Update readme usage #88

Closed hpjaj closed 6 years ago

hpjaj commented 6 years ago

Description of changes

When reading through the README and the codebase, it was unclear how our custom "adding a new event" hook would work.

After tracing through the code, it appears that you cannot just create a Slack "equally named" method anywhere. That method would, in fact, have to live in the the operationcode_bot.rb file in order for the hook to work.

This update makes that more transparent for future contributors.

I also noticed that classes in the event directory are classes within classes. This is not a typical way to namespace.

Traditionally, when a class is in a folder for namespacing, you either nest the class in a module, or use this namespacing :: syntax.

I refactored the two classes to use the :: syntax.

hpjaj commented 6 years ago

@hollomancer @jjhampton - the diff may appear that there were a lot of changes made, but the diff is misleading, because the change required both event/ classes to be outdented.

The only change to the message and team_join classes was namespacing. Meaning this:

class Event::Message < Event

instead of this:

class Event
  class Message < Event
  ...