Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default connector and default room #48

Closed
jacobtomlinson opened this issue Sep 2, 2016 · 1 comment
Closed

Default connector and default room #48

jacobtomlinson opened this issue Sep 2, 2016 · 1 comment

Comments

@jacobtomlinson
Copy link
Member

jacobtomlinson commented Sep 2, 2016

When writing a skill which originates from something other than a message (e.g cron #26) the response may need to know which room to post into.

Most chat clients have a default room, like #general in Slack. This could be available as a property in the connector so that skills can easily access it.

e.g

@non_message_decorator()
def myskill(opsdroid):
    for connector in opsdroid.connectors:
        message = Message("Message text", connector.default_room, None, connector)
        connector.respond(message)

It should also be possible to override the default room in the connector config.

connectors:
  slack:
    default-room: "#random"
@jacobtomlinson
Copy link
Member Author

jacobtomlinson commented Nov 17, 2016

It would also be good to have a default connector. This could either be the first specified or the one tagged with default: true (or the first one tagged in case of error).

e.g

connectors:
  slack:
  shell:
  campfire:
    default: True

This could be accessed like:

@non_message_decorator()
def myskill(opsdroid):
    connector = opsdroid.default_connector
    message = Message("Message text", connector.default_room, None, connector)
    connector.respond(message)

@jacobtomlinson jacobtomlinson changed the title Connector default room Default connector and default room Nov 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant