Modified connection-specific callback wrapper in Bot to be more flexible in how it determines the active connection